From d3a178375e26c169f81200f2610aae2fd552b669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Speiger=20B=C3=A4r?= Date: Thu, 26 Dec 2013 01:14:26 +0100 Subject: [PATCH] Added gate changing on FluidPipes --- .../transport/pipes/PipeFluidsIron.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/common/buildcraft/transport/pipes/PipeFluidsIron.java b/common/buildcraft/transport/pipes/PipeFluidsIron.java index dafe22b5..f7738cd4 100644 --- a/common/buildcraft/transport/pipes/PipeFluidsIron.java +++ b/common/buildcraft/transport/pipes/PipeFluidsIron.java @@ -7,12 +7,17 @@ */ package buildcraft.transport.pipes; +import java.util.LinkedList; +import java.util.Map; + import buildcraft.BuildCraftTransport; import buildcraft.api.core.IIconProvider; +import buildcraft.api.gates.IAction; import buildcraft.transport.Pipe; import buildcraft.transport.PipeIconProvider; import buildcraft.transport.PipeTransportFluids; import buildcraft.transport.TileGenericPipe; +import buildcraft.transport.triggers.ActionPipeDirection; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.entity.player.EntityPlayer; @@ -89,6 +94,28 @@ public class PipeFluidsIron extends Pipe { } + @Override + protected void actionsActivated(Map actions) { + super.actionsActivated(actions); + + for (Map.Entry action : actions.entrySet()) { + if (action.getKey() instanceof ActionPipeDirection && action.getValue() != null && action.getValue()) { + logic.setFacing(((ActionPipeDirection) action.getKey()).direction); + break; + } + } + } + + @Override + public LinkedList getActions() { + LinkedList action = super.getActions(); + for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) { + if (container.isPipeConnected(direction)) + action.add(BuildCraftTransport.actionPipeDirection[direction.ordinal()]); + } + return action; + } + @Override public boolean canConnectRedstone() { return true;