Gates indicate that trigger require parameter
Also removing normal Inventory Triggers from FilteredBuffer, for now.
This commit is contained in:
parent
753dc868d2
commit
8765dac0e3
4 changed files with 31 additions and 2 deletions
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 6 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.8 KiB |
|
@ -8,6 +8,11 @@
|
|||
*/
|
||||
package buildcraft.transport;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.api.gates.IOverrideDefaultTriggers;
|
||||
import buildcraft.api.gates.ITrigger;
|
||||
import buildcraft.core.TileBuildCraft;
|
||||
import buildcraft.core.inventory.SimpleInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -16,7 +21,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public class TileFilteredBuffer extends TileBuildCraft implements IInventory {
|
||||
public class TileFilteredBuffer extends TileBuildCraft implements IInventory, IOverrideDefaultTriggers {
|
||||
|
||||
private final SimpleInventory inventoryFilters = new SimpleInventory(9, "FilteredBufferFilters", 1);
|
||||
private final SimpleInventory inventoryStorage = new SimpleInventory(9, "FilteredBufferStorage", 64);
|
||||
|
@ -124,4 +129,15 @@ public class TileFilteredBuffer extends TileBuildCraft implements IInventory {
|
|||
public boolean hasCustomInventoryName() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LinkedList<ITrigger> getTriggers() {
|
||||
LinkedList<ITrigger> triggers = new LinkedList<ITrigger>();
|
||||
|
||||
triggers.add(BuildCraftCore.triggerInventoryBelow25);
|
||||
triggers.add(BuildCraftCore.triggerInventoryBelow50);
|
||||
triggers.add(BuildCraftCore.triggerInventoryBelow75);
|
||||
|
||||
return triggers;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -282,12 +282,25 @@ public class GuiGateInterface extends GuiAdvancedInterface {
|
|||
|
||||
drawTexturedModalRect(cornerX + slot.x + 17, cornerY + slot.y - 1, 176, 0, 18, 18);
|
||||
}
|
||||
} else if (_container.triggerState[triggerTracker++]) {
|
||||
}
|
||||
else if (_container.triggerState[triggerTracker++]) {
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
|
||||
drawTexturedModalRect(cornerX + slot.x + 17, cornerY + slot.y + 6, 176, 18, 18, 4);
|
||||
}
|
||||
}
|
||||
else if (slot instanceof TriggerParameterSlot) {
|
||||
TriggerParameterSlot paramSlot = (TriggerParameterSlot) slot;
|
||||
TriggerSlot trigger = (TriggerSlot) slots[s - numSlots * 2];
|
||||
|
||||
if (trigger.isDefined() && trigger.getTrigger().requiresParameter()) {
|
||||
if (paramSlot.getItemStack() == null) {
|
||||
mc.renderEngine.bindTexture(texture);
|
||||
|
||||
drawTexturedModalRect(cornerX + slot.x - 1, cornerY + slot.y - 1, 176, 22, 18, 18);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
drawBackgroundSlots();
|
||||
|
|
Loading…
Reference in a new issue