Merge branch 'master' of github.com:SirSengir/BuildCraft
This commit is contained in:
commit
8a6d6b0ffe
10 changed files with 44 additions and 14 deletions
|
@ -27,7 +27,7 @@ public class BptBlockEngine extends BptBlock {
|
||||||
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
|
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
|
||||||
int o = slot.cpt.getInteger("orientation");
|
int o = slot.cpt.getInteger("orientation");
|
||||||
|
|
||||||
o = ForgeDirection.values()[o].getLeftRotation().ordinal();
|
o = ForgeDirection.values()[o].getRotation(ForgeDirection.DOWN).ordinal();
|
||||||
|
|
||||||
slot.cpt.setInteger("orientation", o);
|
slot.cpt.setInteger("orientation", o);
|
||||||
}
|
}
|
||||||
|
|
|
@ -478,4 +478,9 @@ public class TileEngine extends TileBuildCraft implements IPowerReceptor, IInven
|
||||||
}
|
}
|
||||||
@Override public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) { return null; }
|
@Override public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) { return null; }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ public class BptBlockRefinery extends BptBlock {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
|
public void rotateLeft(BptSlotInfo slot, IBptContext context) {
|
||||||
slot.meta = ForgeDirection.values()[slot.meta].getLeftRotation().ordinal();
|
slot.meta = ForgeDirection.values()[slot.meta].getRotation(ForgeDirection.DOWN).ordinal();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (c) SpaceToad, 2011
|
* Copyright (c) SpaceToad, 2011
|
||||||
* http://www.mod-buildcraft.com
|
* http://www.mod-buildcraft.com
|
||||||
*
|
*
|
||||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||||
*/
|
*/
|
||||||
|
@ -225,14 +225,14 @@ public class TileRefinery extends TileMachine implements ITankContainer, IPowerR
|
||||||
private boolean containsInput(LiquidStack liquid) {
|
private boolean containsInput(LiquidStack liquid) {
|
||||||
if(liquid == null)
|
if(liquid == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return new LiquidStack(slot1.liquidId, slot1.quantity, 0).containsLiquid(liquid) || new LiquidStack(slot2.liquidId, slot2.quantity, 0).containsLiquid(liquid);
|
return new LiquidStack(slot1.liquidId, slot1.quantity, 0).containsLiquid(liquid) || new LiquidStack(slot2.liquidId, slot2.quantity, 0).containsLiquid(liquid);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean consumeInput(LiquidStack liquid) {
|
private boolean consumeInput(LiquidStack liquid) {
|
||||||
if(liquid == null)
|
if(liquid == null)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(new LiquidStack(slot1.liquidId, slot1.quantity, 0).containsLiquid(liquid)) {
|
if(new LiquidStack(slot1.liquidId, slot1.quantity, 0).containsLiquid(liquid)) {
|
||||||
slot1.quantity -= liquid.amount;
|
slot1.quantity -= liquid.amount;
|
||||||
return true;
|
return true;
|
||||||
|
@ -240,7 +240,7 @@ public class TileRefinery extends TileMachine implements ITankContainer, IPowerR
|
||||||
slot2.quantity -= liquid.amount;
|
slot2.quantity -= liquid.amount;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -457,4 +457,10 @@ public class TileRefinery extends TileMachine implements ITankContainer, IPowerR
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,14 +82,14 @@ public class TileTank extends TileBuildCraft implements ITankContainer
|
||||||
public void readFromNBT(NBTTagCompound data)
|
public void readFromNBT(NBTTagCompound data)
|
||||||
{
|
{
|
||||||
super.readFromNBT(data);
|
super.readFromNBT(data);
|
||||||
|
|
||||||
if(data.hasKey("stored") && data.hasKey("liquidId"))
|
if(data.hasKey("stored") && data.hasKey("liquidId"))
|
||||||
{
|
{
|
||||||
LiquidStack liquid = new LiquidStack(data.getInteger("liquidId"), data.getInteger("stored"), 0);
|
LiquidStack liquid = new LiquidStack(data.getInteger("liquidId"), data.getInteger("stored"), 0);
|
||||||
tank.setLiquid(liquid);
|
tank.setLiquid(liquid);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LiquidStack liquid = new LiquidStack(0, 0, 0);
|
LiquidStack liquid = new LiquidStack(0, 0, 0);
|
||||||
liquid.readFromNBT(data.getCompoundTag("tank"));
|
liquid.readFromNBT(data.getCompoundTag("tank"));
|
||||||
tank.setLiquid(liquid);
|
tank.setLiquid(liquid);
|
||||||
|
@ -253,4 +253,10 @@ public class TileTank extends TileBuildCraft implements ITankContainer
|
||||||
compositeTank.setCapacity(capacity);
|
compositeTank.setCapacity(capacity);
|
||||||
return new ILiquidTank[]{compositeTank};
|
return new ILiquidTank[]{compositeTank};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,4 +464,9 @@ public class PipeTransportLiquids extends PipeTransport implements ITankContaine
|
||||||
return internalTanks;
|
return internalTanks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,7 +548,7 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
|
||||||
@Override
|
@Override
|
||||||
public ILiquidTank[] getTanks(ForgeDirection direction) {
|
public ILiquidTank[] getTanks(ForgeDirection direction) {
|
||||||
if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof ITankContainer)
|
if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof ITankContainer)
|
||||||
return ((ITankContainer) pipe.transport).getTanks(ForgeDirection.UNKNOWN);
|
return ((ITankContainer) pipe.transport).getTanks(direction);
|
||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -629,4 +629,12 @@ public class TileGenericPipe extends TileEntity implements IPowerReceptor, ITank
|
||||||
public double func_82115_m() {
|
public double func_82115_m() {
|
||||||
return 24 * 24;
|
return 24 * 24;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ILiquidTank getTank(ForgeDirection direction, LiquidStack type) {
|
||||||
|
if (BlockGenericPipe.isValid(pipe) && pipe.transport instanceof ITankContainer)
|
||||||
|
return ((ITankContainer) pipe.transport).getTank(direction, type);
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class BptItemPipeDiamond extends BptItem {
|
||||||
newInv[dir * 9 + s] = inv[dir * 9 + s];
|
newInv[dir * 9 + s] = inv[dir * 9 + s];
|
||||||
|
|
||||||
for (int dir = 2; dir <= 5; ++dir) {
|
for (int dir = 2; dir <= 5; ++dir) {
|
||||||
ForgeDirection r = ForgeDirection.values()[dir].getLeftRotation();
|
ForgeDirection r = ForgeDirection.values()[dir].getRotation(ForgeDirection.DOWN);
|
||||||
|
|
||||||
for (int s = 0; s < 9; ++s)
|
for (int s = 0; s < 9; ++s)
|
||||||
newInv[r.ordinal() * 9 + s] = inv[dir * 9 + s];
|
newInv[r.ordinal() * 9 + s] = inv[dir * 9 + s];
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class BptItemPipeIron extends BptItem {
|
||||||
int orientation = slot.meta & 7;
|
int orientation = slot.meta & 7;
|
||||||
int others = slot.meta - orientation;
|
int others = slot.meta - orientation;
|
||||||
|
|
||||||
slot.meta = ForgeDirection.values()[orientation].getLeftRotation().ordinal() + others;
|
slot.meta = ForgeDirection.values()[orientation].getRotation(ForgeDirection.DOWN).ordinal() + others;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class BptItemPipeWooden extends BptItem {
|
||||||
int orientation = slot.meta & 7;
|
int orientation = slot.meta & 7;
|
||||||
int others = slot.meta - orientation;
|
int others = slot.meta - orientation;
|
||||||
|
|
||||||
slot.meta = ForgeDirection.values()[orientation].getLeftRotation().ordinal() + others;
|
slot.meta = ForgeDirection.values()[orientation].getRotation(ForgeDirection.DOWN).ordinal() + others;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue