commit
740cb92802
7 changed files with 17 additions and 5 deletions
common/net/minecraft/src/buildcraft
api/liquids
core
energy
factory
transport
|
@ -18,6 +18,15 @@ public class LiquidManager {
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getLiquidIDForFilledItem(ItemStack filledItem) {
|
||||
LiquidStack liquidForFilledItem = getLiquidForFilledItem(filledItem);
|
||||
|
||||
if (liquidForFilledItem == null)
|
||||
return 0;
|
||||
|
||||
return liquidForFilledItem.itemID;
|
||||
}
|
||||
|
||||
public static ItemStack getFilledItemForLiquid(LiquidStack liquid) {
|
||||
for (LiquidData data : liquids)
|
||||
|
|
|
@ -74,7 +74,7 @@ public class TriggerLiquidContainer extends Trigger {
|
|||
int seachedLiquidId = 0;
|
||||
|
||||
if (parameter != null && parameter.getItem() != null)
|
||||
seachedLiquidId = LiquidManager.getLiquidForFilledItem(parameter.getItem()).itemID;
|
||||
seachedLiquidId = LiquidManager.getLiquidIDForFilledItem(parameter.getItem());
|
||||
|
||||
LiquidSlot[] liquids = container.getLiquidSlots();
|
||||
|
||||
|
|
|
@ -124,7 +124,7 @@ public class EngineIron extends Engine {
|
|||
super.update();
|
||||
|
||||
if (itemInInventory != null) {
|
||||
int liquidId = LiquidManager.getLiquidForFilledItem(itemInInventory).itemID;
|
||||
int liquidId = LiquidManager.getLiquidIDForFilledItem(itemInInventory);
|
||||
|
||||
if (liquidId != 0) {
|
||||
if (fill(Orientations.Unknown, BuildCraftAPI.BUCKET_VOLUME, liquidId, false) == BuildCraftAPI.BUCKET_VOLUME) {
|
||||
|
|
|
@ -102,7 +102,7 @@ public class BlockRefinery extends BlockContainer {
|
|||
return true;
|
||||
} else {
|
||||
|
||||
int liquidId = LiquidManager.getLiquidForFilledItem(entityplayer.getCurrentEquippedItem()).itemID;
|
||||
int liquidId = LiquidManager.getLiquidIDForFilledItem(entityplayer.getCurrentEquippedItem());
|
||||
|
||||
if (liquidId != 0) {
|
||||
int qty = ((TileRefinery) world.getBlockTileEntity(i, j, k)).fill(Orientations.Unknown,
|
||||
|
|
|
@ -92,7 +92,7 @@ public class BlockTank extends BlockContainer implements ITextureProvider {
|
|||
ItemStack current = entityplayer.inventory.getCurrentItem();
|
||||
if (current != null) {
|
||||
|
||||
int liquidId = LiquidManager.getLiquidForFilledItem(current).itemID;
|
||||
int liquidId = LiquidManager.getLiquidIDForFilledItem(current);
|
||||
|
||||
TileTank tank = (TileTank) world.getBlockTileEntity(i, j, k);
|
||||
|
||||
|
|
|
@ -141,6 +141,9 @@ public class PipeTransportPower extends PipeTransport {
|
|||
if (entity instanceof TileGenericPipe) {
|
||||
TileGenericPipe nearbyTile = (TileGenericPipe) entity;
|
||||
|
||||
if (nearbyTile.pipe == null)
|
||||
continue;
|
||||
|
||||
PipeTransportPower nearbyTransport = (PipeTransportPower) nearbyTile.pipe.transport;
|
||||
|
||||
nearbyTransport.requestEnergy(Orientations.values()[i].reverse(), transferQuery[i]);
|
||||
|
|
|
@ -93,7 +93,7 @@ public class TriggerPipeContents extends Trigger implements ITriggerPipe {
|
|||
int seachedLiquidId = 0;
|
||||
|
||||
if (parameter != null && parameter.getItem() != null)
|
||||
seachedLiquidId = LiquidManager.getLiquidForFilledItem(parameter.getItem()).itemID;
|
||||
seachedLiquidId = LiquidManager.getLiquidIDForFilledItem(parameter.getItem());
|
||||
|
||||
if (kind == Kind.Empty) {
|
||||
for (LiquidBuffer b : transportLiquids.side)
|
||||
|
|
Loading…
Add table
Reference in a new issue