-
Notifications
You must be signed in to change notification settings - Fork 182
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
allow quantum tanks to lock their fluids #278
Conversation
43a62e5
to
f380783
Compare
Stealing this PR to improve it a bit and add more features |
Refactor `MetaTileEntityDrum` slightly
Changes since my commits:
|
Changing this to |
@Override | ||
public void handleClientAction(int id, PacketBuffer buf) { | ||
super.handleClientAction(id, buf); | ||
if (id == 12) { |
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.
Should put this value in GregtechDataCodes.
} else { | ||
phantomTank.setFluid(null); | ||
} | ||
} else if (id == 13) { |
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.
Should put this value in GregtechDataCodes.
@Override | ||
public boolean mouseClicked(int mouseX, int mouseY, int button) { | ||
if (isMouseOverElement(mouseX, mouseY)) { | ||
writeClientAction(12, buf -> {}); |
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.
Should put this value in GregtechDataCodes.
FluidStack stack = phantomTank.getFluid(); | ||
if (stack == null && lastPhantomStack != null) { | ||
lastPhantomStack = null; | ||
writeUpdateInfo(10, buf -> {}); |
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.
Should put this value in GregtechDataCodes.
if (!stack.isFluidEqual(lastPhantomStack)) { | ||
lastPhantomStack = stack.copy(); | ||
NBTTagCompound stackTag = stack.writeToNBT(new NBTTagCompound()); | ||
writeUpdateInfo(11, buf -> buf.writeCompoundTag(stackTag)); |
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.
Should put this value in GregtechDataCodes.
writeUpdateInfo(11, buf -> buf.writeCompoundTag(stackTag)); | ||
} else if (stack.amount != 0) { | ||
lastPhantomStack.amount = 0; | ||
writeUpdateInfo(12, buf -> {}); |
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.
Should put this value in GregtechDataCodes.
@Override | ||
public void readUpdateInfo(int id, PacketBuffer buf) { | ||
super.readUpdateInfo(id, buf); | ||
if (id == 10) { |
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.
Should put this value in GregtechDataCodes.
super.readUpdateInfo(id, buf); | ||
if (id == 10) { | ||
lastPhantomStack = null; | ||
} else if (id == 11) { |
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.
Should put this value in GregtechDataCodes.
return; | ||
} | ||
lastPhantomStack = FluidStack.loadFluidStackFromNBT(stackTag); | ||
} else if (id == 12) { |
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.
Should put this value in GregtechDataCodes.
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 also works properly on a server, although definitely put those codes in GregtechDataCodes.
No description provided.