-
Notifications
You must be signed in to change notification settings - Fork 314
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
base: master
Are you sure you want to change the base?
Conversation
@Diamantino-Op Could you run |
Ok, done |
src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputBusME.java
Outdated
Show resolved
Hide resolved
src/main/java/gregtech/common/tileentities/machines/MTEHatchOutputME.java
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
if (((MTEHatchOutputBusME) tHatch).isLocked()) { | ||
return false; | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
…tputBusME.java Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
…tputME.java Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
Co-authored-by: Maya <10861407+serenibyss@users.noreply.github.com>
if (upgradeItemStack != null && upgradeItemStack.getItem() instanceof ItemBasicStorageCell) { | ||
if (this.lockedItems.isEmpty()) { | ||
CellConfig cfg = (CellConfig) ((ItemBasicStorageCell) upgradeItemStack.getItem()) | ||
.getConfigInventory(upgradeItemStack); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
No description provided.