fixed indentation
This commit is contained in:
parent
55f4efb65c
commit
cdd9ae1199
1 changed files with 30 additions and 27 deletions
|
@ -18,18 +18,18 @@ import buildcraft.api.transport.IPipeTile.PipeType;
|
||||||
|
|
||||||
public abstract class PipeTransport {
|
public abstract class PipeTransport {
|
||||||
|
|
||||||
public static final String PIPE_IO_SETTINGS = "iosetting";
|
public static final String PIPE_IO_SETTINGS = "iosetting";
|
||||||
|
|
||||||
public TileGenericPipe container;
|
public TileGenericPipe container;
|
||||||
|
|
||||||
protected boolean[] inputsOpen = new boolean[ForgeDirection.VALID_DIRECTIONS.length];
|
protected boolean[] inputsOpen = new boolean[ForgeDirection.VALID_DIRECTIONS.length];
|
||||||
protected boolean[] outputsOpen = new boolean[ForgeDirection.VALID_DIRECTIONS.length];
|
protected boolean[] outputsOpen = new boolean[ForgeDirection.VALID_DIRECTIONS.length];
|
||||||
|
|
||||||
public PipeTransport() {
|
public PipeTransport() {
|
||||||
for (int b = 0; b < ForgeDirection.VALID_DIRECTIONS.length; b++) {
|
for (int b = 0; b < ForgeDirection.VALID_DIRECTIONS.length; b++) {
|
||||||
inputsOpen[b] = true;
|
inputsOpen[b] = true;
|
||||||
outputsOpen[b] = true;
|
outputsOpen[b] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract PipeType getPipeType();
|
public abstract PipeType getPipeType();
|
||||||
|
@ -40,24 +40,27 @@ public abstract class PipeTransport {
|
||||||
|
|
||||||
public void readFromNBT(NBTTagCompound nbt) {
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
if (nbt.hasKey(PIPE_IO_SETTINGS)) {
|
if (nbt.hasKey(PIPE_IO_SETTINGS)) {
|
||||||
int iosettings = nbt.getInteger(PIPE_IO_SETTINGS);
|
int iosettings = nbt.getInteger(PIPE_IO_SETTINGS);
|
||||||
for (int b = 0; b < ForgeDirection.VALID_DIRECTIONS.length; b++) {
|
for (int b = 0; b < ForgeDirection.VALID_DIRECTIONS.length; b++) {
|
||||||
inputsOpen[b] = (iosettings & (1 << b)) == 1;
|
inputsOpen[b] = (iosettings & (1 << b)) == 1;
|
||||||
outputsOpen[b] = (iosettings & (1 << (b + 8))) == 1;
|
outputsOpen[b] = (iosettings & (1 << (b + 8))) == 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void writeToNBT(NBTTagCompound nbt) {
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
int iosettings = 0;
|
int iosettings = 0;
|
||||||
|
|
||||||
for (int b = 0; b < ForgeDirection.VALID_DIRECTIONS.length; b++) {
|
for (int b = 0; b < ForgeDirection.VALID_DIRECTIONS.length; b++) {
|
||||||
if (inputsOpen[b]) {
|
if (inputsOpen[b]) {
|
||||||
iosettings |= 1 << b;
|
iosettings |= 1 << b;
|
||||||
}
|
}
|
||||||
if (outputsOpen[b]) {
|
|
||||||
iosettings |= 1 << (b + 8);
|
if (outputsOpen[b]) {
|
||||||
}
|
iosettings |= 1 << (b + 8);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nbt.setInteger(PIPE_IO_SETTINGS, iosettings);
|
nbt.setInteger(PIPE_IO_SETTINGS, iosettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,16 +92,16 @@ public abstract class PipeTransport {
|
||||||
return outputsOpen[to.ordinal()];
|
return outputsOpen[to.ordinal()];
|
||||||
}
|
}
|
||||||
|
|
||||||
public void allowInput(ForgeDirection from, boolean allow) {
|
public void allowInput(ForgeDirection from, boolean allow) {
|
||||||
if (from != ForgeDirection.UNKNOWN) {
|
if (from != ForgeDirection.UNKNOWN) {
|
||||||
inputsOpen[from.ordinal()] = allow;
|
inputsOpen[from.ordinal()] = allow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void allowOutput(ForgeDirection to, boolean allow) {
|
public void allowOutput(ForgeDirection to, boolean allow) {
|
||||||
if (to != ForgeDirection.UNKNOWN) {
|
if (to != ForgeDirection.UNKNOWN) {
|
||||||
outputsOpen[to.ordinal()] = allow;
|
outputsOpen[to.ordinal()] = allow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dropContents() {
|
public void dropContents() {
|
||||||
|
|
Loading…
Reference in a new issue