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.
Should put this value in GregtechDataCodes.
| } else { | ||
| phantomTank.setFluid(null); | ||
| } | ||
| } else if (id == 13) { |
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
Should put this value in GregtechDataCodes.
| return; | ||
| } | ||
| lastPhantomStack = FluidStack.loadFluidStackFromNBT(stackTag); | ||
| } else if (id == 12) { |
There was a problem hiding this comment.
Should put this value in GregtechDataCodes.
No description provided.