diff --git a/common/buildcraft/core/network/serializers/ClassMapping.java b/common/buildcraft/core/network/serializers/ClassMapping.java index 038863da..fb4830d2 100644 --- a/common/buildcraft/core/network/serializers/ClassMapping.java +++ b/common/buildcraft/core/network/serializers/ClassMapping.java @@ -288,7 +288,12 @@ public class ClassMapping extends ClassSerializer { } for (Field f : enumFields) { - data.writeByte(((Enum) f.get(obj)).ordinal()); + if (f.get(obj) == null) { + data.writeBoolean(false); + } else { + data.writeBoolean(true); + data.writeByte(((Enum) f.get(obj)).ordinal()); + } } for (Field f : floatFields) { @@ -358,7 +363,9 @@ public class ClassMapping extends ClassSerializer { } for (Field f : enumFields) { - f.set(obj, ((Class) f.getGenericType()).getEnumConstants()[data.readByte()]); + if (data.readBoolean()) { + f.set(obj, ((Class) f.getGenericType()).getEnumConstants()[data.readByte()]); + } } for (Field f : floatFields) { diff --git a/common/buildcraft/core/triggers/BCStatement.java b/common/buildcraft/core/triggers/BCStatement.java index 4e0f0ce4..cf24c276 100755 --- a/common/buildcraft/core/triggers/BCStatement.java +++ b/common/buildcraft/core/triggers/BCStatement.java @@ -73,7 +73,7 @@ public abstract class BCStatement implements IStatement { } @Override - public final ITriggerParameter createParameter(int index) { + public ITriggerParameter createParameter(int index) { return new TriggerParameter(); } diff --git a/common/buildcraft/transport/triggers/TriggerParameterSignal.java b/common/buildcraft/transport/triggers/TriggerParameterSignal.java index 937428d6..14541c53 100755 --- a/common/buildcraft/transport/triggers/TriggerParameterSignal.java +++ b/common/buildcraft/transport/triggers/TriggerParameterSignal.java @@ -22,10 +22,18 @@ import buildcraft.core.triggers.StatementIconProvider; public class TriggerParameterSignal implements ITriggerParameter { @NetworkData - boolean active; + private boolean active; @NetworkData - PipeWire color; + private PipeWire color = PipeWire.RED; + + public TriggerParameterSignal() { + + } + + public TriggerParameterSignal(TriggerPipeSignal trigger) { + + } @Override public ItemStack getItemStackToDraw() { @@ -87,6 +95,4 @@ public class TriggerParameterSignal implements ITriggerParameter { @Override public void readFromNBT(NBTTagCompound compound) { } - - } diff --git a/common/buildcraft/transport/triggers/TriggerPipeSignal.java b/common/buildcraft/transport/triggers/TriggerPipeSignal.java index 7043c386..21ca3748 100644 --- a/common/buildcraft/transport/triggers/TriggerPipeSignal.java +++ b/common/buildcraft/transport/triggers/TriggerPipeSignal.java @@ -76,6 +76,7 @@ public class TriggerPipeSignal extends BCTrigger { return StatementIconProvider.Trigger_PipeSignal_Yellow_Inactive; } } + return -1; } @@ -83,4 +84,9 @@ public class TriggerPipeSignal extends BCTrigger { public ITrigger rotateLeft() { return this; } + + @Override + public ITriggerParameter createParameter(int index) { + return new TriggerParameterSignal(this); + } }