mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-26 23:13:21 +00:00
allow shift click on side config button to reset all sides to default
This commit is contained in:
1 parent
87d7701ec0
commit
28c919ee09
13 files changed
+160
-76
No files matched your search
@@ -7,6 +7,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.util.BlockCoord;
|
||||
|
||||
public class PacketIoMode implements IMessage, IMessageHandler<PacketIoMode, IMessage> {
|
||||
|
||||
@@ -19,10 +20,20 @@ public class PacketIoMode implements IMessage, IMessageHandler<PacketIoMode, IMe
|
||||
public PacketIoMode() {
|
||||
}
|
||||
|
||||
public PacketIoMode(IIoConfigurable cont) {
|
||||
BlockCoord location = cont.getLocation();
|
||||
this.x = location.x;
|
||||
this.y = location.y;
|
||||
this.z = location.z;
|
||||
this.mode = IoMode.NONE;
|
||||
this.face = ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
public PacketIoMode(IIoConfigurable cont, ForgeDirection face) {
|
||||
this.x = cont.getLocation().x;
|
||||
this.y = cont.getLocation().y;
|
||||
this.z = cont.getLocation().z;
|
||||
BlockCoord location = cont.getLocation();
|
||||
this.x = location.x;
|
||||
this.y = location.y;
|
||||
this.z = location.z;
|
||||
this.face = face;
|
||||
mode = cont.getIoMode(face);
|
||||
}
|
||||
@@ -52,7 +63,11 @@ public class PacketIoMode implements IMessage, IMessageHandler<PacketIoMode, IMe
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if(te instanceof IIoConfigurable) {
|
||||
IIoConfigurable me = (IIoConfigurable) te;
|
||||
me.setIoMode(message.face, message.mode);
|
||||
if(message.face == ForgeDirection.UNKNOWN) {
|
||||
me.clearAllIoModes();
|
||||
} else {
|
||||
me.setIoMode(message.face, message.mode);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user