mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-11 07:47:55 +00:00
Merge pull request #100 from asdflj/terminal
terminal does not update view
This commit is contained in:
3 files changed
+40
-44
No files matched your search
+19
-25
@@ -18,8 +18,6 @@ import org.apache.commons.lang3.tuple.MutablePair;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.api.implementations.tiles.IMEChest;
|
||||
import appeng.api.implementations.tiles.IViewCellStorage;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
@@ -28,6 +26,7 @@ import appeng.api.networking.energy.IEnergyGrid;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.storage.IBaseMonitor;
|
||||
import appeng.api.networking.storage.IStorageGrid;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
@@ -42,7 +41,6 @@ import appeng.util.item.AEItemStack;
|
||||
import com.glodblock.github.FluidCraft;
|
||||
import com.glodblock.github.client.gui.container.base.FCContainerMonitor;
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.inventory.item.IFluidPortableCell;
|
||||
import com.glodblock.github.network.CPacketFluidUpdate;
|
||||
import com.glodblock.github.network.SPacketFluidUpdate;
|
||||
import com.glodblock.github.network.SPacketMEInventoryUpdate;
|
||||
@@ -61,27 +59,28 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
super(ip, monitorable, bindInventory);
|
||||
if (Platform.isServer()) {
|
||||
this.serverCM = monitorable.getConfigManager();
|
||||
this.monitor = monitorable.getFluidInventory();
|
||||
if (this.monitor != null) {
|
||||
this.monitor.addListener(this, null);
|
||||
if (monitorable instanceof IFluidPortableCell) {
|
||||
this.setPowerSource((IEnergySource) monitorable);
|
||||
} else if (monitorable instanceof IPortableCell) {
|
||||
this.setPowerSource((IEnergySource) monitorable);
|
||||
} else if (monitorable instanceof IMEChest) {
|
||||
this.setPowerSource((IEnergySource) monitorable);
|
||||
} else if (monitorable instanceof IGridHost) {
|
||||
final IGridNode node = ((IGridHost) monitorable).getGridNode(ForgeDirection.UNKNOWN);
|
||||
if (node != null) {
|
||||
this.networkNode = node;
|
||||
final IGrid g = node.getGrid();
|
||||
if (g != null) {
|
||||
this.setPowerSource(new ChannelPowerSrc(this.networkNode, g.getCache(IEnergyGrid.class)));
|
||||
if (monitorable instanceof IGridHost) {
|
||||
final IGridNode node = ((IGridHost) monitorable).getGridNode(ForgeDirection.UNKNOWN);
|
||||
if (node != null) {
|
||||
this.networkNode = node;
|
||||
final IGrid g = node.getGrid();
|
||||
if (g != null) {
|
||||
this.setPowerSource(new ChannelPowerSrc(this.networkNode, g.getCache(IEnergyGrid.class)));
|
||||
IStorageGrid storageGrid = g.getCache(IStorageGrid.class);
|
||||
this.monitor = storageGrid.getFluidInventory();
|
||||
if (this.monitor == null) {
|
||||
this.setValidContainer(false);
|
||||
} else {
|
||||
this.monitor.addListener(this, null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
this.monitor = monitorable.getFluidInventory();
|
||||
this.monitor.addListener(this, null);
|
||||
this.setPowerSource((IEnergySource) monitorable);
|
||||
}
|
||||
} else {
|
||||
this.monitor = null;
|
||||
@@ -151,11 +150,6 @@ public class ContainerFluidMonitor extends FCContainerMonitor<IAEFluidStack> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isInvalid() {
|
||||
return this.monitor != this.host.getFluidInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void queueInventory(final ICrafting c) {
|
||||
if (Platform.isServer() && c instanceof EntityPlayer && this.monitor != null) {
|
||||
|
||||
@@ -9,8 +9,6 @@ import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.guiobjects.IPortableCell;
|
||||
import appeng.api.implementations.tiles.IMEChest;
|
||||
import appeng.api.implementations.tiles.IViewCellStorage;
|
||||
import appeng.api.networking.IGrid;
|
||||
import appeng.api.networking.IGridHost;
|
||||
@@ -19,6 +17,7 @@ import appeng.api.networking.energy.IEnergyGrid;
|
||||
import appeng.api.networking.energy.IEnergySource;
|
||||
import appeng.api.networking.security.BaseActionSource;
|
||||
import appeng.api.networking.storage.IBaseMonitor;
|
||||
import appeng.api.networking.storage.IStorageGrid;
|
||||
import appeng.api.storage.ITerminalHost;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
@@ -43,26 +42,29 @@ public class ContainerItemMonitor extends FCContainerMonitor<IAEItemStack> {
|
||||
super(ip, monitorable, bindInventory);
|
||||
if (Platform.isServer()) {
|
||||
this.serverCM = monitorable.getConfigManager();
|
||||
this.monitor = monitorable.getItemInventory();
|
||||
if (this.monitor != null) {
|
||||
this.monitor.addListener(this, null);
|
||||
this.setCellInventory(this.monitor);
|
||||
if (monitorable instanceof IPortableCell) {
|
||||
this.setPowerSource((IEnergySource) monitorable);
|
||||
} else if (monitorable instanceof IMEChest) {
|
||||
this.setPowerSource((IEnergySource) monitorable);
|
||||
} else if (monitorable instanceof IGridHost) {
|
||||
final IGridNode node = ((IGridHost) monitorable).getGridNode(ForgeDirection.UNKNOWN);
|
||||
if (node != null) {
|
||||
this.networkNode = node;
|
||||
final IGrid g = node.getGrid();
|
||||
if (g != null) {
|
||||
this.setPowerSource(new ChannelPowerSrc(this.networkNode, g.getCache(IEnergyGrid.class)));
|
||||
if (monitorable instanceof IGridHost) {
|
||||
final IGridNode node = ((IGridHost) monitorable).getGridNode(ForgeDirection.UNKNOWN);
|
||||
if (node != null) {
|
||||
this.networkNode = node;
|
||||
final IGrid g = node.getGrid();
|
||||
if (g != null) {
|
||||
this.setPowerSource(new ChannelPowerSrc(this.networkNode, g.getCache(IEnergyGrid.class)));
|
||||
IStorageGrid storageGrid = g.getCache(IStorageGrid.class);
|
||||
this.monitor = storageGrid.getItemInventory();
|
||||
if (this.monitor == null) {
|
||||
this.setValidContainer(false);
|
||||
} else {
|
||||
this.monitor.addListener(this, null);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
}
|
||||
} else {
|
||||
this.setValidContainer(false);
|
||||
this.monitor = monitorable.getItemInventory();
|
||||
this.monitor.addListener(this, null);
|
||||
this.setCellInventory(this.monitor);
|
||||
this.setPowerSource((IEnergySource) monitorable);
|
||||
}
|
||||
} else {
|
||||
this.monitor = null;
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ public abstract class FCContainerMonitor<T extends IAEStack<T>> extends FCBaseCo
|
||||
protected abstract void processItemList();
|
||||
|
||||
protected boolean isInvalid() {
|
||||
return this.monitor != this.host.getItemInventory();
|
||||
return this.monitor == null;
|
||||
}
|
||||
|
||||
protected void updatePowerStatus() {
|
||||
|
||||
Reference in new issue
Block a user