started work on better pipe signal actions, for #1877
This commit is contained in:
parent
31cc8b6438
commit
40268062db
4 changed files with 26 additions and 7 deletions
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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) {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue