mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-19 19:59:58 +00:00
Oh so slowly getting there.
This commit is contained in:
1 parent
ac0b051126
commit
d5250cacc1
5 files changed
+127
-124
No files matched your search
@@ -24,17 +24,17 @@ public class ExternalConnectionContainer extends Container {
|
||||
private IConduitBundle bundle;
|
||||
private ForgeDirection dir;
|
||||
private IItemConduit itemConduit;
|
||||
|
||||
|
||||
private IItemFilter inputFilter;
|
||||
private IItemFilter outputFilter;
|
||||
|
||||
|
||||
private int outputFilterUpgradeSlot = 36;
|
||||
private int inputFilterUpgradeSlot = 37;
|
||||
private int speedUpgradeSlot = 38;
|
||||
private int startFilterSlot = 39;
|
||||
|
||||
private List<Point> slotLocations = new ArrayList<Point>();
|
||||
|
||||
|
||||
List<FilterChangeListener> filterListeners = new ArrayList<FilterChangeListener>();
|
||||
|
||||
public ExternalConnectionContainer(InventoryPlayer playerInv, IConduitBundle bundle, ForgeDirection dir) {
|
||||
@@ -62,60 +62,64 @@ public class ExternalConnectionContainer extends Container {
|
||||
addSlotToContainer(new Slot(playerInv, i, x, y));
|
||||
slotLocations.add(new Point(x, y));
|
||||
}
|
||||
|
||||
|
||||
itemConduit = bundle.getConduit(IItemConduit.class);
|
||||
if(itemConduit != null) {
|
||||
|
||||
|
||||
x = 10;
|
||||
y = 67;
|
||||
FilterUpgradeInventory fi = new FilterUpgradeInventory(itemConduit, dir, false);
|
||||
addSlotToContainer(new FilterSlot(fi, 0, x, y));
|
||||
slotLocations.add(new Point(x, y));
|
||||
|
||||
|
||||
x = 10;
|
||||
y = 67;
|
||||
fi = new FilterUpgradeInventory(itemConduit, dir, true);
|
||||
addSlotToContainer(new FilterSlot(fi, 0, x, y));
|
||||
slotLocations.add(new Point(x, y));
|
||||
|
||||
|
||||
x = 10;
|
||||
y = 85;
|
||||
SpeedUpgradesInventory si = new SpeedUpgradesInventory(itemConduit, dir);
|
||||
addSlotToContainer(new Slot(si, 0, x, y));
|
||||
slotLocations.add(new Point(x, y));
|
||||
|
||||
|
||||
addFilterSlots(dir);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void addFilterSlots(ForgeDirection dir) {
|
||||
|
||||
|
||||
List<Slot> slots;
|
||||
inputFilter = itemConduit.getInputFilter(dir);
|
||||
List<Slot> slots = inputFilter.getSlots();
|
||||
for(Slot slot : slots) {
|
||||
addSlotToContainer(slot);
|
||||
slotLocations.add(new Point(slot.xDisplayPosition, slot.yDisplayPosition));
|
||||
}
|
||||
|
||||
outputFilter = itemConduit.getOutputFilter(dir);
|
||||
slots = outputFilter.getSlots();
|
||||
for(Slot slot : slots) {
|
||||
addSlotToContainer(slot);
|
||||
slotLocations.add(new Point(slot.xDisplayPosition, slot.yDisplayPosition));
|
||||
if(inputFilter != null) {
|
||||
slots = inputFilter.getSlots();
|
||||
for (Slot slot : slots) {
|
||||
addSlotToContainer(slot);
|
||||
slotLocations.add(new Point(slot.xDisplayPosition, slot.yDisplayPosition));
|
||||
}
|
||||
}
|
||||
|
||||
outputFilter = itemConduit.getOutputFilter(dir);
|
||||
if(outputFilter != null) {
|
||||
slots = outputFilter.getSlots();
|
||||
for (Slot slot : slots) {
|
||||
addSlotToContainer(slot);
|
||||
slotLocations.add(new Point(slot.xDisplayPosition, slot.yDisplayPosition));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void filterChanged() {
|
||||
|
||||
protected void filterChanged() {
|
||||
int slotsToRemove = inventorySlots.size() - startFilterSlot;
|
||||
for(int i=0;i<slotsToRemove;i++) {
|
||||
for (int i = 0; i < slotsToRemove; i++) {
|
||||
inventorySlots.remove(inventorySlots.size() - 1);
|
||||
slotLocations.remove(inventorySlots.size() - 1);
|
||||
}
|
||||
addFilterSlots(dir);
|
||||
|
||||
for(FilterChangeListener list : filterListeners) {
|
||||
addFilterSlots(dir);
|
||||
|
||||
for (FilterChangeListener list : filterListeners) {
|
||||
list.onFilterChanged();
|
||||
}
|
||||
}
|
||||
@@ -123,30 +127,30 @@ public class ExternalConnectionContainer extends Container {
|
||||
public void setInputSlotsVisible(boolean visible) {
|
||||
setSlotsVisible(visible, inputFilterUpgradeSlot, inputFilterUpgradeSlot + 1);
|
||||
setSlotsVisible(visible, speedUpgradeSlot, speedUpgradeSlot + 1);
|
||||
|
||||
|
||||
if(inputFilter == null) {
|
||||
return;
|
||||
}
|
||||
int startIndex = startFilterSlot;
|
||||
int endIndex = inputFilter.getSlotCount() + startIndex;
|
||||
setSlotsVisible(visible, startIndex, endIndex);
|
||||
|
||||
int endIndex = inputFilter.getSlotCount() + startIndex;
|
||||
setSlotsVisible(visible, startIndex, endIndex);
|
||||
|
||||
}
|
||||
|
||||
public void setOutputSlotsVisible(boolean visible) {
|
||||
|
||||
|
||||
setSlotsVisible(visible, outputFilterUpgradeSlot, outputFilterUpgradeSlot + 1);
|
||||
|
||||
|
||||
if(outputFilter == null) {
|
||||
return;
|
||||
}
|
||||
int startIndex = startFilterSlot + inputFilter.getSlotCount();
|
||||
int startIndex = startFilterSlot + (inputFilter == null ? 0 : inputFilter.getSlotCount());
|
||||
int endIndex = startIndex + outputFilter.getSlotCount();
|
||||
setSlotsVisible(visible, startIndex, endIndex);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void setInventorySlotsVisible(boolean visible) {
|
||||
public void setInventorySlotsVisible(boolean visible) {
|
||||
setSlotsVisible(visible, 0, 36);
|
||||
}
|
||||
|
||||
@@ -171,13 +175,13 @@ public class ExternalConnectionContainer extends Container {
|
||||
@Override
|
||||
public ItemStack slotClick(int par1, int par2, int par3, EntityPlayer par4EntityPlayer) {
|
||||
if(par4EntityPlayer.worldObj != null) {
|
||||
// if(itemConduit != null) {
|
||||
// itemConduit.setInputFilter(dir, inputFilter);
|
||||
// itemConduit.setOutputFilter(dir, outputFilter);
|
||||
// if(par4EntityPlayer.worldObj.isRemote) {
|
||||
// par4EntityPlayer.worldObj.markBlockForUpdate(bundle.getEntity().xCoord, bundle.getEntity().xCoord, bundle.getEntity().xCoord);
|
||||
// }
|
||||
// }
|
||||
// if(itemConduit != null) {
|
||||
// itemConduit.setInputFilter(dir, inputFilter);
|
||||
// itemConduit.setOutputFilter(dir, outputFilter);
|
||||
// if(par4EntityPlayer.worldObj.isRemote) {
|
||||
// par4EntityPlayer.worldObj.markBlockForUpdate(bundle.getEntity().xCoord, bundle.getEntity().xCoord, bundle.getEntity().xCoord);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
try {
|
||||
return super.slotClick(par1, par2, par3, par4EntityPlayer);
|
||||
@@ -192,20 +196,18 @@ public class ExternalConnectionContainer extends Container {
|
||||
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private class FilterSlot extends Slot {
|
||||
|
||||
public FilterSlot(IInventory par1iInventory, int par2, int par3, int par4) {
|
||||
super(par1iInventory, par2, par3, par4);
|
||||
super(par1iInventory, par2, par3, par4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChanged() {
|
||||
filterChanged();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
private static final int ID_REDSTONE_BUTTON = 12614;
|
||||
|
||||
private static final int ID_COLOR_BUTTON = 179816;
|
||||
|
||||
|
||||
private static final int ID_LOOP = 22;
|
||||
private static final int ID_ROUND_ROBIN = 24;
|
||||
private static final int ID_PRIORITY_UP = 25;
|
||||
@@ -60,12 +60,12 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
boolean inOutShowIn = false;
|
||||
|
||||
private IItemFilter activeFilter;
|
||||
|
||||
|
||||
private int priLeft = 120;
|
||||
private int priWidth = 32;
|
||||
|
||||
private GuiToolTip priorityTooltip;
|
||||
|
||||
|
||||
private BasicItemFilterGui filterGui;
|
||||
|
||||
protected ItemSettings(final GuiExternalConnection gui, IConduit con) {
|
||||
@@ -125,17 +125,17 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
priDownB = new IconButtonEIO(gui, ID_PRIORITY_DOWN, x, y, IconEIO.MINUS_BUT);
|
||||
priDownB.setSize(10, 10);
|
||||
|
||||
priorityTooltip = new GuiToolTip(new Rectangle(priLeft + 9, y, priWidth, 20), Lang.localize("gui.conduit.item.priority"));
|
||||
priorityTooltip = new GuiToolTip(new Rectangle(priLeft + 9, y, priWidth, 20), Lang.localize("gui.conduit.item.priority"));
|
||||
|
||||
gui.container.filterListeners.add(new FilterChangeListener() {
|
||||
|
||||
|
||||
@Override
|
||||
public void onFilterChanged() {
|
||||
filtersChanged();
|
||||
filtersChanged();
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private String getHeading() {
|
||||
@@ -167,14 +167,14 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
ConnectionMode mode = con.getConectionMode(gui.dir);
|
||||
if(mode == ConnectionMode.INPUT) {
|
||||
showInput = true;
|
||||
gui.container.setInputSlotsVisible(true);
|
||||
gui.container.setOutputSlotsVisible(false);
|
||||
gui.container.setInventorySlotsVisible(true);
|
||||
// gui.container.setInputSlotsVisible(true);
|
||||
// gui.container.setOutputSlotsVisible(false);
|
||||
// gui.container.setInventorySlotsVisible(true);
|
||||
} else if(mode == ConnectionMode.OUTPUT) {
|
||||
showOutput = true;
|
||||
gui.container.setInputSlotsVisible(false);
|
||||
gui.container.setOutputSlotsVisible(true);
|
||||
gui.container.setInventorySlotsVisible(true);
|
||||
// gui.container.setInputSlotsVisible(false);
|
||||
// gui.container.setOutputSlotsVisible(true);
|
||||
// gui.container.setInventorySlotsVisible(true);
|
||||
} else if(mode == ConnectionMode.IN_OUT) {
|
||||
|
||||
if(nextFilterB != null) {
|
||||
@@ -188,26 +188,29 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
if(!showInput && !showOutput) {
|
||||
filterGui = null;
|
||||
activeFilter = null;
|
||||
gui.container.setInventorySlotsVisible(false);
|
||||
} else {
|
||||
} else if(showInput) {
|
||||
activeFilter = itemConduit.getInputFilter(gui.dir);
|
||||
gui.container.setInventorySlotsVisible(true);
|
||||
if(showInput) {
|
||||
activeFilter = itemConduit.getInputFilter(gui.dir);
|
||||
filterGui = new BasicItemFilterGui(gui, itemConduit, true);
|
||||
gui.container.setInputSlotsVisible(true);
|
||||
gui.container.setOutputSlotsVisible(false);
|
||||
} else {
|
||||
activeFilter = itemConduit.getOutputFilter(gui.dir);
|
||||
filterGui = new BasicItemFilterGui(gui, itemConduit, false);
|
||||
gui.container.setInputSlotsVisible(false);
|
||||
gui.container.setOutputSlotsVisible(true);
|
||||
gui.container.setInputSlotsVisible(true);
|
||||
gui.container.setOutputSlotsVisible(false);
|
||||
if(activeFilter != null) {
|
||||
filterGui = new BasicItemFilterGui(gui, itemConduit, true);
|
||||
|
||||
}
|
||||
} else if(showOutput) {
|
||||
activeFilter = itemConduit.getOutputFilter(gui.dir);
|
||||
gui.container.setInputSlotsVisible(false);
|
||||
gui.container.setOutputSlotsVisible(true);
|
||||
gui.container.setInventorySlotsVisible(true);
|
||||
if(activeFilter != null) {
|
||||
filterGui = new BasicItemFilterGui(gui, itemConduit, false);
|
||||
}
|
||||
}
|
||||
|
||||
updateButtons();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void filtersChanged() {
|
||||
if(filterGui != null) {
|
||||
filterGui.deactivate();
|
||||
@@ -218,28 +221,35 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
if(mode == ConnectionMode.DISABLED) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
boolean showInput = mode == ConnectionMode.INPUT || (mode == ConnectionMode.IN_OUT && inOutShowIn);
|
||||
if(showInput) {
|
||||
activeFilter = itemConduit.getInputFilter(gui.dir);
|
||||
filterGui = new BasicItemFilterGui(gui, itemConduit, true);
|
||||
gui.container.setInventorySlotsVisible(true);
|
||||
gui.container.setInputSlotsVisible(true);
|
||||
gui.container.setOutputSlotsVisible(false);
|
||||
|
||||
activeFilter = itemConduit.getInputFilter(gui.dir);
|
||||
if(activeFilter != null) {
|
||||
filterGui = new BasicItemFilterGui(gui, itemConduit, true);
|
||||
}
|
||||
} else {
|
||||
activeFilter = itemConduit.getOutputFilter(gui.dir);
|
||||
filterGui = new BasicItemFilterGui(gui, itemConduit, false);
|
||||
gui.container.setInventorySlotsVisible(true);
|
||||
gui.container.setInputSlotsVisible(false);
|
||||
gui.container.setOutputSlotsVisible(true);
|
||||
|
||||
activeFilter = itemConduit.getOutputFilter(gui.dir);
|
||||
if(activeFilter != null) {
|
||||
filterGui = new BasicItemFilterGui(gui, itemConduit, false);
|
||||
}
|
||||
|
||||
}
|
||||
gui.container.setInventorySlotsVisible(true);
|
||||
filterGui.updateButtons();
|
||||
|
||||
if(filterGui != null) {
|
||||
filterGui.updateButtons();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void updateButtons() {
|
||||
if(activeFilter == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ConnectionMode mode = con.getConectionMode(gui.dir);
|
||||
if(mode == ConnectionMode.DISABLED) {
|
||||
@@ -248,7 +258,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
boolean outputActive = (mode == ConnectionMode.IN_OUT && !inOutShowIn) || (mode == ConnectionMode.OUTPUT);
|
||||
int chanCol;
|
||||
if(!outputActive) {
|
||||
|
||||
|
||||
rsB.onGuiInit();
|
||||
rsB.setMode(itemConduit.getExtractionRedstoneMode(gui.dir));
|
||||
|
||||
@@ -271,7 +281,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
priDownB.onGuiInit();
|
||||
gui.addToolTip(priorityTooltip);
|
||||
}
|
||||
|
||||
|
||||
if(filterGui != null) {
|
||||
filterGui.updateButtons();
|
||||
}
|
||||
@@ -284,13 +294,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
if(guiButton.id == NEXT_FILTER_ID) {
|
||||
inOutShowIn = !inOutShowIn;
|
||||
updateGuiVisibility();
|
||||
}
|
||||
|
||||
if(activeFilter == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(guiButton.id == ID_COLOR_BUTTON) {
|
||||
} else if(guiButton.id == ID_COLOR_BUTTON) {
|
||||
itemConduit.setExtractionSignalColor(gui.dir, DyeColor.values()[colorB.getColorIndex()]);
|
||||
EnderIO.packetPipeline.sendToServer(new PacketExtractMode(itemConduit, gui.dir));
|
||||
} else if(guiButton.id == ID_LOOP) {
|
||||
@@ -298,22 +302,20 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
EnderIO.packetPipeline.sendToServer(new PacketItemConduitFilter(itemConduit, gui.dir));
|
||||
} else if(guiButton.id == ID_ROUND_ROBIN) {
|
||||
itemConduit.setRoundRobinEnabled(gui.dir, !itemConduit.isRoundRobinEnabled(gui.dir));
|
||||
EnderIO.packetPipeline.sendToServer(new PacketItemConduitFilter(itemConduit, gui.dir));
|
||||
EnderIO.packetPipeline.sendToServer(new PacketItemConduitFilter(itemConduit, gui.dir));
|
||||
} else if(guiButton.id == ID_PRIORITY_UP) {
|
||||
itemConduit.setOutputPriority(gui.dir, itemConduit.getOutputPriority(gui.dir) + 1);
|
||||
EnderIO.packetPipeline.sendToServer(new PacketItemConduitFilter(itemConduit, gui.dir));
|
||||
} else if(guiButton.id == ID_PRIORITY_DOWN) {
|
||||
itemConduit.setOutputPriority(gui.dir, itemConduit.getOutputPriority(gui.dir) - 1);
|
||||
EnderIO.packetPipeline.sendToServer(new PacketItemConduitFilter(itemConduit, gui.dir));
|
||||
}
|
||||
}
|
||||
|
||||
if(filterGui != null) {
|
||||
filterGui.actionPerformed(guiButton);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected void connectionModeChanged(ConnectionMode conectionMode) {
|
||||
super.connectionModeChanged(conectionMode);
|
||||
@@ -324,8 +326,8 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
protected void renderCustomOptions(int top, float par1, int par2, int par3) {
|
||||
ConnectionMode mode = con.getConectionMode(gui.dir);
|
||||
if(mode != ConnectionMode.DISABLED) {
|
||||
|
||||
RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png");
|
||||
|
||||
RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png");
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft(), gui.getGuiTop() + 55, 0, 55, gui.getXSize(), 145);
|
||||
|
||||
FontRenderer fr = gui.getFontRenderer();
|
||||
@@ -334,7 +336,7 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
int x = 0;
|
||||
int rgb = ColorUtil.getRGB(Color.darkGray);
|
||||
fr.drawString(heading, left + x, top, rgb);
|
||||
|
||||
|
||||
boolean outputActive = (mode == ConnectionMode.IN_OUT && !inOutShowIn) || (mode == ConnectionMode.OUTPUT);
|
||||
if(outputActive) {
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
@@ -342,11 +344,11 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
String str = itemConduit.getOutputPriority(gui.dir) + "";
|
||||
int sw = fr.getStringWidth(str);
|
||||
fr.drawString(str, left + priLeft + priWidth - sw - gap, top, ColorUtil.getRGB(Color.black));
|
||||
|
||||
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
RenderUtil.bindTexture("enderio:textures/gui/itemFilter.png");
|
||||
gui.drawTexturedModalRect(gui.getGuiLeft() + 9, gui.getGuiTop() + 66, 94, 220, 18, 18);
|
||||
|
||||
|
||||
} else {
|
||||
//draw speed upgrade slot
|
||||
GL11.glColor3f(1, 1, 1);
|
||||
@@ -365,18 +367,18 @@ public class ItemSettings extends BaseSettingsPanel {
|
||||
gui.container.setInputSlotsVisible(false);
|
||||
gui.container.setOutputSlotsVisible(false);
|
||||
rsB.detach();
|
||||
colorB.detach();
|
||||
colorB.detach();
|
||||
roundRobinB.detach();
|
||||
loopB.detach();
|
||||
nextFilterB.detach();
|
||||
priUpB.detach();
|
||||
priDownB.detach();
|
||||
gui.removeToolTip(priorityTooltip);
|
||||
|
||||
|
||||
if(filterGui != null) {
|
||||
filterGui.deactivate();
|
||||
filterGui = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -11,6 +11,10 @@ import io.netty.buffer.ByteBuf;
|
||||
public class FilterRegister {
|
||||
|
||||
public static void writeFilter(ByteBuf buf, IItemFilter filter) {
|
||||
if(filter == null) {
|
||||
ByteBufUtils.writeUTF8String(buf, "nullFilter");
|
||||
return;
|
||||
}
|
||||
String name = filter.getClass().getName();
|
||||
ByteBufUtils.writeUTF8String(buf, name);
|
||||
|
||||
@@ -21,6 +25,9 @@ public class FilterRegister {
|
||||
|
||||
public static IItemFilter readFilter(ByteBuf buf) {
|
||||
String className = ByteBufUtils.readUTF8String(buf);
|
||||
if(className.equals("nullFilter")) {
|
||||
return null;
|
||||
}
|
||||
NBTTagCompound tag = NetworkUtil.readNBTTagCompound(buf);
|
||||
try {
|
||||
Class<?> clz = Class.forName(className);
|
||||
@@ -36,6 +43,8 @@ public class FilterRegister {
|
||||
public static IItemFilter getFilterForUpgrade(ItemStack stack) {
|
||||
if(stack != null && stack.getItem() == Items.paper) {
|
||||
return new ItemFilter(true);
|
||||
} else if(stack != null && stack.getItem() == Items.stick) {
|
||||
return new ItemFilter(false);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -199,12 +199,12 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
|
||||
@Override
|
||||
public IItemFilter getInputFilter(ForgeDirection dir) {
|
||||
IItemFilter res = inputFilters.get(dir);
|
||||
if(res == null) {
|
||||
res = new ItemFilter();
|
||||
inputFilters.put(dir, res);
|
||||
}
|
||||
return res;
|
||||
return inputFilters.get(dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemFilter getOutputFilter(ForgeDirection dir) {
|
||||
return outputFilters.get(dir);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -251,16 +251,6 @@ public class ItemConduit extends AbstractConduit implements IItemConduit {
|
||||
return metaData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemFilter getOutputFilter(ForgeDirection dir) {
|
||||
IItemFilter res = outputFilters.get(dir);
|
||||
if(res == null) {
|
||||
res = new ItemFilter();
|
||||
outputFilters.put(dir, res);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExtractionRedstoneMode(RedstoneControlMode mode, ForgeDirection dir) {
|
||||
extractionModes.put(dir, mode);
|
||||
|
||||
@@ -78,7 +78,7 @@ class NetworkedInventory {
|
||||
}
|
||||
|
||||
boolean isSticky() {
|
||||
return con.getOutputFilter(conDir).isValid() && con.getOutputFilter(conDir).isSticky();
|
||||
return con.getOutputFilter(conDir) != null && con.getOutputFilter(conDir).isValid() && con.getOutputFilter(conDir).isSticky();
|
||||
}
|
||||
|
||||
int getPriority() {
|
||||
@@ -208,7 +208,7 @@ class NetworkedInventory {
|
||||
for (Target target : targets) {
|
||||
if(target.stickyInput && !matchedStickyInput) {
|
||||
IItemFilter of = target.inv.con.getOutputFilter(target.inv.conDir);
|
||||
matchedStickyInput = of.isValid() && of.doesItemPassFilter(toExtract);
|
||||
matchedStickyInput = of != null && of.isValid() && of.doesItemPassFilter(toExtract);
|
||||
}
|
||||
if(target.stickyInput || !matchedStickyInput) {
|
||||
if(target.inv.recheckInv) {
|
||||
|
||||
Reference in new issue
Block a user