Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to filter outputs to ME Output Bus and Hatch #3828

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

Diamantino-Op
Copy link

No description provided.

@FourIsTheNumber FourIsTheNumber added the enhancement Improve an existing mechanic. Please explain the change with a before/after comparison. label Jan 19, 2025
@serenibyss
Copy link
Member

@Diamantino-Op Could you run gradlew spotlessApply on this PR?

@Diamantino-Op
Copy link
Author

Ok, done

@Dream-Master Dream-Master requested a review from a team January 20, 2025 12:50
@serenibyss serenibyss added the 🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta label Jan 20, 2025
src/main/resources/assets/gregtech/lang/en_US.lang Outdated Show resolved Hide resolved
@@ -207,6 +315,9 @@ public void onFacingChange() {
@Override
public boolean onRightclick(IGregTechTileEntity aBaseMetaTileEntity, EntityPlayer aPlayer) {
GTUIInfos.openGTTileEntityUI(aBaseMetaTileEntity, aPlayer);

lastClickedPlayer = aPlayer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this way of caching the player reference for locking, as it could lead to missed calls (especially across server/client) and potentially leaking world reference

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, i should find a better way to get the player, this was the first thing that came to my mind.

Comment on lines +2381 to +2383
if (((MTEHatchOutputBusME) tHatch).isLocked()) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will require voiding mode to be extensively tested, as this function greatly changes void protection calculation

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tested with multi hatch, but did not test what happens when it overflows or try to craft when the hatch is full

if (upgradeItemStack != null && upgradeItemStack.getItem() instanceof ItemBasicStorageCell) {
if (this.lockedItems.isEmpty()) {
CellConfig cfg = (CellConfig) ((ItemBasicStorageCell) upgradeItemStack.getItem())
.getConfigInventory(upgradeItemStack);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've noticed that this method is showing up on my server's profiles more than I'd expect. It's nothing major, but if you have time could you optimize this a bit? I doubt it needs to be called constantly. I'm guessing it's because I have a lot of cells with no partition, causing this code to always run for those busses. I only have a few hundred me output busses in my world, so I imagine late game worlds would be hit quite a bit harder.

https://spark.lucko.me/ID2eUmeIF4
image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll look at what i can do, thx

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok @RecursivePineapple i think i optimized it a bit now, can you check pls?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta enhancement Improve an existing mechanic. Please explain the change with a before/after comparison.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants