mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-15 17:44:46 +00:00
Fix Level Maintainer Gui
This commit is contained in:
2 files changed
+12
-10
No files matched your search
@@ -23,6 +23,7 @@ import com.glodblock.github.network.CPacketLevelMaintainer.Action;
|
||||
import com.glodblock.github.util.FCGuiColors;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.client.gui.GuiSub;
|
||||
import appeng.client.gui.slots.VirtualMEPhantomSlot;
|
||||
import appeng.client.gui.widgets.GuiTabButton;
|
||||
@@ -228,8 +229,12 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
this.isEnable = enable;
|
||||
}
|
||||
|
||||
public IAEStack<?> getStack() {
|
||||
return this.container.getTile().getAEStackInventory().getAEStackInSlot(this.getIndex());
|
||||
}
|
||||
|
||||
private void send(Widget widget) {
|
||||
if (cont.inventorySlots.get(widget.componentIndex).getHasStack() && widget.getAmount() != null) {
|
||||
if (this.getStack() != null && widget.getAmount() != null) {
|
||||
FluidCraft.proxy.netHandler.sendToServer(
|
||||
new CPacketLevelMaintainer(widget.action, widget.componentIndex, widget.getAmount()));
|
||||
}
|
||||
@@ -261,7 +266,7 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
FluidCraft.proxy.netHandler.sendToServer(new CPacketLevelMaintainer(Action.Enable, this.getIndex()));
|
||||
didSomething = true;
|
||||
} else if (this.disable == btn) {
|
||||
if (this.container.getInventory().get(this.getIndex()) != null) {
|
||||
if (this.getStack() != null) {
|
||||
this.setEnable(true);
|
||||
FluidCraft.proxy.netHandler
|
||||
.sendToServer(new CPacketLevelMaintainer(Action.Disable, this.getIndex()));
|
||||
@@ -428,10 +433,11 @@ public class GuiLevelMaintainer extends GuiSub {
|
||||
this.amount = (long) ArithHelper.round(result, 0);
|
||||
this.textField.setTextColor(0xFFFFFF);
|
||||
}
|
||||
TileLevelMaintainer.RequestInfo info = cont.getTile().requests[this.componentIndex];
|
||||
if (info != null) {
|
||||
|
||||
IAEStack<?> stack = component[this.componentIndex].getStack();
|
||||
if (stack != null) {
|
||||
Long amount = component[this.componentIndex].getQty().getAmount();
|
||||
info.getAEStack().setStackSize(amount != null ? amount : 0);
|
||||
stack.setStackSize(amount != null ? amount : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -733,11 +733,7 @@ public class TileLevelMaintainer extends AENetworkTile
|
||||
|
||||
@Override
|
||||
public void putAEStackInSlot(int slot, IAEStack<?> aes) {
|
||||
if (aes == null) {
|
||||
updateStack(slot, (IAEStack<?>) null);
|
||||
} else {
|
||||
updateStack(slot, aes);
|
||||
}
|
||||
updateStack(slot, aes);
|
||||
super.putAEStackInSlot(slot, aes);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user