Migrate liquid API to forge
This commit is contained in:
parent
97a7391166
commit
63180af9fd
40 changed files with 77 additions and 542 deletions
|
@ -31,9 +31,6 @@ import buildcraft.api.core.BuildCraftAPI;
|
|||
import buildcraft.api.gates.Action;
|
||||
import buildcraft.api.gates.ActionManager;
|
||||
import buildcraft.api.gates.Trigger;
|
||||
import buildcraft.api.liquids.LiquidData;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.power.PowerFramework;
|
||||
import buildcraft.core.BlockIndex;
|
||||
import buildcraft.core.BuildCraftConfiguration;
|
||||
|
@ -72,8 +69,11 @@ import net.minecraft.src.ItemStack;
|
|||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.Property;
|
||||
import net.minecraftforge.liquids.LiquidData;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
@Mod(name="BuildCraft", version=Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", dependencies="required-after:Forge@[5.0,)")
|
||||
@Mod(name="BuildCraft", version=Version.VERSION, useMetadata = false, modid = "BuildCraft|Core", dependencies="required-after:Forge@[6.3.0.364,)")
|
||||
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
|
||||
public class BuildCraftCore {
|
||||
public static enum RenderMode {
|
||||
|
|
|
@ -25,9 +25,6 @@ import buildcraft.api.core.BuildCraftAPI;
|
|||
import buildcraft.api.fuels.IronEngineCoolant;
|
||||
import buildcraft.api.fuels.IronEngineFuel;
|
||||
import buildcraft.api.gates.Trigger;
|
||||
import buildcraft.api.liquids.LiquidData;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.recipes.RefineryRecipe;
|
||||
import buildcraft.core.BlockIndex;
|
||||
import buildcraft.core.DefaultProps;
|
||||
|
@ -56,6 +53,9 @@ import net.minecraft.src.Material;
|
|||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.Property;
|
||||
import net.minecraftforge.liquids.LiquidData;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
@Mod(name="BuildCraft Energy", version=Version.VERSION, useMetadata = false, modid = "BuildCraft|Energy", dependencies = DefaultProps.DEPENDENCY_CORE)
|
||||
@NetworkMod(channels = {DefaultProps.NET_CHANNEL_NAME}, packetHandler = PacketHandler.class, clientSideRequired = true, serverSideRequired = true)
|
||||
|
|
|
@ -2,7 +2,8 @@ package buildcraft.api.fuels;
|
|||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
|
||||
|
||||
public class IronEngineCoolant {
|
||||
|
|
|
@ -11,8 +11,9 @@ package buildcraft.api.fuels;
|
|||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
|
||||
|
||||
public class IronEngineFuel {
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) SpaceToad, 2011
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* 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
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package buildcraft.api.liquids;
|
||||
|
||||
public interface ILiquid {
|
||||
|
||||
public int stillLiquidId();
|
||||
|
||||
public boolean isMetaSensitive();
|
||||
|
||||
public int stillLiquidMeta();
|
||||
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
package buildcraft.api.liquids;
|
||||
|
||||
public interface ILiquidTank {
|
||||
|
||||
/**
|
||||
* @return LiquidStack representing the liquid contained in the tank, null if empty.
|
||||
*/
|
||||
LiquidStack getLiquid();
|
||||
void setLiquid(LiquidStack liquid);
|
||||
void setCapacity(int capacity);
|
||||
int getCapacity();
|
||||
|
||||
/**
|
||||
*
|
||||
* @param resource
|
||||
* @param doFill
|
||||
* @return Amount of liquid used for filling.
|
||||
*/
|
||||
int fill(LiquidStack resource, boolean doFill);
|
||||
/**
|
||||
*
|
||||
* @param maxDrain
|
||||
* @param doDrain
|
||||
* @return Null if nothing was drained, otherwise a LiquidStack containing the drained.
|
||||
*/
|
||||
LiquidStack drain(int maxDrain, boolean doDrain);
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
package buildcraft.api.liquids;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
public interface ITankContainer {
|
||||
|
||||
/**
|
||||
* Fills liquid into internal tanks, distribution is left to the ITankContainer.
|
||||
* @param from Orientation the liquid is pumped in from.
|
||||
* @param resource LiquidStack representing the maximum amount of liquid filled into the ITankContainer
|
||||
* @param doFill If false filling will only be simulated.
|
||||
* @return Amount of resource that was filled into internal tanks.
|
||||
*/
|
||||
int fill(ForgeDirection from, LiquidStack resource, boolean doFill);
|
||||
/**
|
||||
* Fills liquid into the specified internal tank.
|
||||
* @param from Orientation the liquid is pumped in from.
|
||||
* @param resource LiquidStack representing the maximum amount of liquid filled into the ITankContainer
|
||||
* @param doFill If false filling will only be simulated.
|
||||
* @return Amount of resource that was filled into internal tanks.
|
||||
*/
|
||||
int fill(int tankIndex, LiquidStack resource, boolean doFill);
|
||||
|
||||
/**
|
||||
* Drains liquid out of internal tanks, distribution is left to the ITankContainer.
|
||||
* @param from Orientation the liquid is drained to.
|
||||
* @param maxDrain Maximum amount of liquid to drain.
|
||||
* @param doDrain If false draining will only be simulated.
|
||||
* @return LiquidStack representing the liquid and amount actually drained from the ITankContainer
|
||||
*/
|
||||
LiquidStack drain(ForgeDirection from, int maxDrain, boolean doDrain);
|
||||
/**
|
||||
* Drains liquid out of the specified internal tank.
|
||||
* @param from Orientation the liquid is drained to.
|
||||
* @param maxDrain Maximum amount of liquid to drain.
|
||||
* @param doDrain If false draining will only be simulated.
|
||||
* @return LiquidStack representing the liquid and amount actually drained from the ITankContainer
|
||||
*/
|
||||
LiquidStack drain(int tankIndex, int maxDrain, boolean doDrain);
|
||||
|
||||
/**
|
||||
* @return Array of {@link LiquidTank}s contained in this ITankContainer
|
||||
*/
|
||||
ILiquidTank[] getTanks();
|
||||
|
||||
}
|
|
@ -1,45 +0,0 @@
|
|||
/**
|
||||
* Copyright (c) SpaceToad, 2011
|
||||
* http://www.mod-buildcraft.com
|
||||
*
|
||||
* 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
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package buildcraft.api.liquids;
|
||||
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
public class LiquidData {
|
||||
|
||||
public final LiquidStack stillLiquid;
|
||||
public final LiquidStack movingLiquid;
|
||||
|
||||
public final ItemStack filled;
|
||||
public final ItemStack container;
|
||||
|
||||
public LiquidData(int stillLiquidId, int movingLiquidId, Item filled) {
|
||||
this(new LiquidStack(stillLiquidId, LiquidManager.BUCKET_VOLUME), new LiquidStack(movingLiquidId, LiquidManager.BUCKET_VOLUME), new ItemStack(filled, 1), new ItemStack(Item.bucketEmpty));
|
||||
}
|
||||
|
||||
public LiquidData(int stillLiquidId, int movingLiquidId, ItemStack filled) {
|
||||
this(new LiquidStack(stillLiquidId, LiquidManager.BUCKET_VOLUME), new LiquidStack(movingLiquidId, LiquidManager.BUCKET_VOLUME), filled, new ItemStack(Item.bucketEmpty));
|
||||
}
|
||||
|
||||
public LiquidData(LiquidStack stillLiquid, ItemStack filled, ItemStack container) {
|
||||
this(stillLiquid, stillLiquid, filled, container);
|
||||
}
|
||||
|
||||
public LiquidData(LiquidStack stillLiquid, LiquidStack movingLiquid, ItemStack filled, ItemStack container) {
|
||||
this.stillLiquid = stillLiquid;
|
||||
this.movingLiquid = movingLiquid;
|
||||
this.filled = filled;
|
||||
this.container = container;
|
||||
|
||||
if(stillLiquid == null || filled == null || container == null)
|
||||
throw new RuntimeException("stillLiquid, filled, or container is null, this is an error");
|
||||
}
|
||||
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
package buildcraft.api.liquids;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* When creating liquids you should register them with this class.
|
||||
*
|
||||
* @author CovertJaguar <railcraft.wikispaces.com>
|
||||
*/
|
||||
public abstract class LiquidDictionary
|
||||
{
|
||||
|
||||
private static Map<String, LiquidStack> liquids = new HashMap<String, LiquidStack>();
|
||||
|
||||
/**
|
||||
* When creating liquids you should call this function.
|
||||
*
|
||||
* Upon passing it a name and liquid item it will return either
|
||||
* a preexisting implementation of that liquid or the liquid passed in.
|
||||
*
|
||||
*
|
||||
* @param name the name of the liquid
|
||||
* @param liquid the liquid to use if one doesn't exist
|
||||
* @return
|
||||
*/
|
||||
public static LiquidStack getOrCreateLiquid(String name, LiquidStack liquid)
|
||||
{
|
||||
LiquidStack existing = liquids.get(name);
|
||||
if(existing != null) {
|
||||
return existing.copy();
|
||||
}
|
||||
liquids.put(name, liquid.copy());
|
||||
return liquid;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the liquid matching the name,
|
||||
* if such a liquid exists.
|
||||
*
|
||||
* Can return null.
|
||||
*
|
||||
* @param name the name of the liquid
|
||||
* @param amount the amout of liquid
|
||||
* @return
|
||||
*/
|
||||
public static LiquidStack getLiquid(String name, int amount)
|
||||
{
|
||||
LiquidStack liquid = liquids.get(name);
|
||||
if(liquid == null)
|
||||
return null;
|
||||
|
||||
liquid = liquid.copy();
|
||||
liquid.amount = amount;
|
||||
return liquid;
|
||||
}
|
||||
}
|
|
@ -1,64 +0,0 @@
|
|||
package buildcraft.api.liquids;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import net.minecraft.src.ItemStack;
|
||||
|
||||
public class LiquidManager {
|
||||
|
||||
public static final int BUCKET_VOLUME = 1000;
|
||||
public static LinkedList<LiquidData> liquids = new LinkedList<LiquidData>();
|
||||
|
||||
public static LiquidStack getLiquidForFilledItem(ItemStack filledItem) {
|
||||
if (filledItem == null)
|
||||
return null;
|
||||
|
||||
for (LiquidData liquid : liquids)
|
||||
if (liquid.filled.isItemEqual(filledItem))
|
||||
return liquid.stillLiquid;
|
||||
|
||||
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)
|
||||
if(data.stillLiquid.isLiquidEqual(liquid))
|
||||
return data.filled.copy();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ItemStack fillLiquidContainer(int liquidId, int quantity, ItemStack emptyContainer) {
|
||||
return fillLiquidContainer(new LiquidStack(liquidId, quantity, 0), emptyContainer);
|
||||
}
|
||||
|
||||
public static ItemStack fillLiquidContainer(LiquidStack liquid, ItemStack emptyContainer) {
|
||||
for(LiquidData data : liquids)
|
||||
if(liquid.containsLiquid(data.stillLiquid)
|
||||
&& data.container.isItemEqual(emptyContainer))
|
||||
return data.filled.copy();
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean isLiquid(ItemStack block) {
|
||||
if (block.itemID == 0)
|
||||
return false;
|
||||
|
||||
for (LiquidData liquid : liquids)
|
||||
if (liquid.stillLiquid.isLiquidEqual(block) || liquid.movingLiquid.isLiquidEqual(block))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,109 +0,0 @@
|
|||
package buildcraft.api.liquids;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.Item;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraft.src.NBTTagCompound;
|
||||
|
||||
/**
|
||||
* ItemStack substitute for liquids
|
||||
* @author SirSengir
|
||||
*/
|
||||
public class LiquidStack {
|
||||
public int itemID;
|
||||
public int amount;
|
||||
public int itemMeta;
|
||||
|
||||
private LiquidStack() {
|
||||
}
|
||||
|
||||
public LiquidStack(int itemID, int amount) {
|
||||
this(itemID, amount, 0);
|
||||
}
|
||||
|
||||
public LiquidStack(Item item, int amount) {
|
||||
this(item.shiftedIndex, amount, 0);
|
||||
}
|
||||
|
||||
public LiquidStack(Block block, int amount) {
|
||||
this(block.blockID, amount, 0);
|
||||
}
|
||||
|
||||
public LiquidStack(int itemID, int amount, int itemDamage) {
|
||||
this.itemID = itemID;
|
||||
this.amount = amount;
|
||||
this.itemMeta = itemDamage;
|
||||
}
|
||||
|
||||
public NBTTagCompound writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
nbttagcompound.setShort("Id", (short) itemID);
|
||||
nbttagcompound.setInteger("Amount", amount);
|
||||
nbttagcompound.setShort("Meta", (short) itemMeta);
|
||||
return nbttagcompound;
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
itemID = nbttagcompound.getShort("Id");
|
||||
amount = nbttagcompound.getInteger("Amount");
|
||||
itemMeta = nbttagcompound.getShort("Meta");
|
||||
}
|
||||
|
||||
/**
|
||||
* @return A copy of this LiquidStack
|
||||
*/
|
||||
public LiquidStack copy() {
|
||||
return new LiquidStack(itemID, amount, itemMeta);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param other
|
||||
* @return true if this LiquidStack contains the same liquid as the one passed in.
|
||||
*/
|
||||
public boolean isLiquidEqual(LiquidStack other) {
|
||||
if(other == null)
|
||||
return false;
|
||||
|
||||
return itemID == other.itemID && itemMeta == other.itemMeta;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param other
|
||||
* @return true if this LiquidStack contains the other liquid (liquids are equal and amount >= other.amount).
|
||||
*/
|
||||
public boolean containsLiquid(LiquidStack other) {
|
||||
if(!isLiquidEqual(other))
|
||||
return false;
|
||||
|
||||
return amount >= other.amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param other ItemStack containing liquids.
|
||||
* @return true if this LiquidStack contains the same liquid as the one passed in.
|
||||
*/
|
||||
public boolean isLiquidEqual(ItemStack other) {
|
||||
if(other == null)
|
||||
return false;
|
||||
|
||||
return itemID == other.itemID && itemMeta == other.getItemDamage();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ItemStack representation of this LiquidStack
|
||||
*/
|
||||
public ItemStack asItemStack() {
|
||||
return new ItemStack(itemID, 1, itemMeta);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a liquid stack from the passed nbttagcompound and returns it.
|
||||
*
|
||||
* @param nbttagcompound
|
||||
* @return
|
||||
*/
|
||||
public static LiquidStack loadLiquidStackFromNBT(NBTTagCompound nbttagcompound) {
|
||||
LiquidStack liquidstack = new LiquidStack();
|
||||
liquidstack.readFromNBT(nbttagcompound);
|
||||
return liquidstack.itemID == 0 ? null : liquidstack;
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
package buildcraft.api.liquids;
|
||||
|
||||
/**
|
||||
* Reference implementation of ILiquidTank. Use this or implement your own.
|
||||
*/
|
||||
public class LiquidTank implements ILiquidTank {
|
||||
private LiquidStack liquid;
|
||||
private int capacity;
|
||||
|
||||
public LiquidTank(int capacity) {
|
||||
this(null, capacity);
|
||||
}
|
||||
|
||||
public LiquidTank(int liquidId, int quantity, int capacity) {
|
||||
this(new LiquidStack(liquidId, quantity), capacity);
|
||||
}
|
||||
public LiquidTank(LiquidStack liquid, int capacity) {
|
||||
this.liquid = liquid;
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LiquidStack getLiquid() {
|
||||
return this.liquid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLiquid(LiquidStack liquid) {
|
||||
this.liquid = liquid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCapacity(int capacity) {
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return this.capacity;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(LiquidStack resource, boolean doFill) {
|
||||
if(resource == null || resource.itemID <= 0)
|
||||
return 0;
|
||||
|
||||
if(liquid == null || liquid.itemID <= 0) {
|
||||
if(resource.amount <= capacity) {
|
||||
if(doFill)
|
||||
this.liquid = resource.copy();
|
||||
return resource.amount;
|
||||
} else {
|
||||
if(doFill) {
|
||||
this.liquid = resource.copy();
|
||||
this.liquid.amount = capacity;
|
||||
}
|
||||
return capacity;
|
||||
}
|
||||
}
|
||||
|
||||
if(!liquid.isLiquidEqual(resource))
|
||||
return 0;
|
||||
|
||||
int space = capacity - liquid.amount;
|
||||
if(resource.amount <= space) {
|
||||
if(doFill)
|
||||
this.liquid.amount += resource.amount;
|
||||
return resource.amount;
|
||||
} else {
|
||||
|
||||
if(doFill)
|
||||
this.liquid.amount = capacity;
|
||||
return space;
|
||||
}
|
||||
|
||||
}
|
||||
@Override
|
||||
public LiquidStack drain(int maxDrain, boolean doDrain) {
|
||||
if(liquid == null || liquid.itemID <= 0)
|
||||
return null;
|
||||
if(liquid.amount <= 0)
|
||||
return null;
|
||||
|
||||
int used = maxDrain;
|
||||
if(liquid.amount < used)
|
||||
used = liquid.amount;
|
||||
|
||||
if(doDrain) {
|
||||
liquid.amount -= used;
|
||||
}
|
||||
|
||||
LiquidStack drained = new LiquidStack(liquid.itemID, used, liquid.itemMeta);
|
||||
|
||||
// Reset liquid if emptied
|
||||
if(liquid.amount <= 0)
|
||||
liquid = null;
|
||||
|
||||
return drained;
|
||||
}
|
||||
}
|
|
@ -11,7 +11,8 @@ package buildcraft.api.recipes;
|
|||
|
||||
import java.util.LinkedList;
|
||||
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
|
||||
|
||||
public class RefineryRecipe {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package buildcraft.api.tools;
|
||||
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
public interface IToolPipette {
|
||||
|
||||
|
|
|
@ -6,13 +6,13 @@ import buildcraft.BuildCraftCore;
|
|||
import buildcraft.api.gates.IOverrideDefaultTriggers;
|
||||
import buildcraft.api.gates.ITrigger;
|
||||
import buildcraft.api.gates.ITriggerProvider;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.transport.IPipe;
|
||||
import buildcraft.core.IMachine;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.IInventory;
|
||||
import net.minecraft.src.TileEntity;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
|
||||
public class DefaultTriggerProvider implements ITriggerProvider {
|
||||
|
||||
|
|
|
@ -11,11 +11,11 @@ package buildcraft.core.triggers;
|
|||
|
||||
import buildcraft.api.gates.ITriggerParameter;
|
||||
import buildcraft.api.gates.Trigger;
|
||||
import buildcraft.api.liquids.ILiquidTank;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import net.minecraft.src.TileEntity;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
|
||||
public class TriggerLiquidContainer extends Trigger {
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ import buildcraft.BuildCraftCore;
|
|||
import buildcraft.api.core.IAreaProvider;
|
||||
import buildcraft.api.core.LaserKind;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ILiquid;
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.api.liquids.ILiquid;
|
||||
import buildcraft.api.transport.IPipeConnection;
|
||||
import buildcraft.api.transport.IPipeEntry;
|
||||
import buildcraft.api.transport.IPipedItem;
|
||||
|
|
|
@ -13,13 +13,13 @@ import java.util.Random;
|
|||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.BuildCraftEnergy;
|
||||
import buildcraft.api.liquids.ILiquid;
|
||||
import buildcraft.core.DefaultProps;
|
||||
|
||||
import net.minecraft.src.Block;
|
||||
import net.minecraft.src.BlockFluid;
|
||||
import net.minecraft.src.Material;
|
||||
import net.minecraft.src.World;
|
||||
import net.minecraftforge.liquids.ILiquid;
|
||||
|
||||
|
||||
public class BlockOilFlowing extends BlockFluid implements ILiquid {
|
||||
|
@ -45,7 +45,7 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid {
|
|||
return DefaultProps.TEXTURE_BLOCKS;
|
||||
}
|
||||
|
||||
private void func_30003_j(World world, int i, int j, int k) {
|
||||
private void updateFlow(World world, int i, int j, int k) {
|
||||
int l = world.getBlockMetadata(i, j, k);
|
||||
world.setBlockAndMetadata(i, j, k, blockID + 1, l);
|
||||
world.markBlocksDirty(i, j, k, i, j, k);
|
||||
|
@ -86,10 +86,10 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid {
|
|||
world.notifyBlocksOfNeighborChange(i, j, k, blockID);
|
||||
}
|
||||
} else if (flag) {
|
||||
func_30003_j(world, i, j, k);
|
||||
updateFlow(world, i, j, k);
|
||||
}
|
||||
} else {
|
||||
func_30003_j(world, i, j, k);
|
||||
updateFlow(world, i, j, k);
|
||||
}
|
||||
if (liquidCanDisplaceBlock(world, i, j - 1, k)) {
|
||||
if (l >= 8) {
|
||||
|
|
|
@ -11,11 +11,11 @@ package buildcraft.energy;
|
|||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.BuildCraftEnergy;
|
||||
import buildcraft.api.liquids.ILiquid;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import net.minecraft.src.BlockStationary;
|
||||
import net.minecraft.src.Material;
|
||||
import net.minecraft.src.World;
|
||||
import net.minecraftforge.liquids.ILiquid;
|
||||
|
||||
|
||||
public class BlockOilStill extends BlockStationary implements ILiquid {
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
package buildcraft.energy;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.LiquidTank;
|
||||
import net.minecraftforge.liquids.LiquidTank;
|
||||
import buildcraft.core.network.TileNetworkData;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
import buildcraft.energy.gui.ContainerEngine;
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
package buildcraft.energy;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidTank;
|
||||
import buildcraft.api.fuels.IronEngineCoolant;
|
||||
import buildcraft.api.fuels.IronEngineFuel;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.liquids.LiquidTank;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.core.utils.Utils;
|
||||
import buildcraft.energy.gui.ContainerEngine;
|
||||
|
|
|
@ -14,12 +14,12 @@ import java.util.LinkedList;
|
|||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.BuildCraftEnergy;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidTank;
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.api.gates.IOverrideDefaultTriggers;
|
||||
import buildcraft.api.gates.ITrigger;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.liquids.LiquidTank;
|
||||
import buildcraft.api.power.IPowerProvider;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerFramework;
|
||||
|
|
|
@ -23,9 +23,9 @@ import net.minecraft.src.World;
|
|||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.BuildCraftFactory;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import buildcraft.core.GuiIds;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
|
|
|
@ -13,8 +13,8 @@ import java.util.ArrayList;
|
|||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.core.utils.Utils;
|
||||
|
||||
|
|
|
@ -15,10 +15,10 @@ import java.util.TreeSet;
|
|||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.power.IPowerProvider;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerFramework;
|
||||
|
|
|
@ -11,12 +11,12 @@ package buildcraft.factory;
|
|||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidTank;
|
||||
import buildcraft.api.core.SafeTimeTracker;
|
||||
import buildcraft.api.liquids.ILiquidTank;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.liquids.LiquidTank;
|
||||
import buildcraft.api.power.IPowerProvider;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerFramework;
|
||||
|
|
|
@ -10,12 +10,12 @@ package buildcraft.factory;
|
|||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidTank;
|
||||
import buildcraft.api.core.SafeTimeTracker;
|
||||
import buildcraft.api.liquids.ILiquidTank;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.liquids.LiquidTank;
|
||||
import buildcraft.core.TileBuildCraft;
|
||||
import buildcraft.core.network.PacketPayload;
|
||||
import buildcraft.core.network.PacketUpdate;
|
||||
|
|
|
@ -11,11 +11,11 @@ package buildcraft.factory.gui;
|
|||
|
||||
import net.minecraft.src.InventoryPlayer;
|
||||
import net.minecraft.src.ItemStack;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.recipes.RefineryRecipe;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.core.gui.GuiAdvancedInterface;
|
||||
|
|
|
@ -19,10 +19,10 @@ import net.minecraft.src.TileEntitySpecialRenderer;
|
|||
import net.minecraft.src.World;
|
||||
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.core.render.RenderEntityBlock;
|
||||
import buildcraft.core.render.RenderEntityBlock.BlockInterface;
|
||||
import buildcraft.factory.TileTank;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
package buildcraft.transport;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
|
||||
public interface IPipeTransportLiquidsHook {
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@ package buildcraft.transport;
|
|||
|
||||
import buildcraft.BuildCraftCore;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidTank;
|
||||
import buildcraft.api.core.SafeTimeTracker;
|
||||
import buildcraft.api.gates.ITrigger;
|
||||
import buildcraft.api.liquids.ILiquidTank;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.liquids.LiquidTank;
|
||||
import buildcraft.api.transport.IPipeEntry;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.core.IMachine;
|
||||
|
|
|
@ -20,13 +20,13 @@ import cpw.mods.fml.common.asm.SideOnly;
|
|||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.BuildCraftTransport;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.api.core.SafeTimeTracker;
|
||||
import buildcraft.api.gates.IOverrideDefaultTriggers;
|
||||
import buildcraft.api.gates.ITrigger;
|
||||
import buildcraft.api.liquids.ILiquidTank;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.power.IPowerProvider;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.transport.IPipe;
|
||||
|
|
|
@ -5,7 +5,7 @@ import java.io.DataOutputStream;
|
|||
import java.io.IOException;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.core.network.PacketCoordinates;
|
||||
import buildcraft.core.network.PacketIds;
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
package buildcraft.transport.pipes;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.transport.IPipeTransportLiquidsHook;
|
||||
import buildcraft.transport.Pipe;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
package buildcraft.transport.pipes;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.transport.IPipeTransportLiquidsHook;
|
||||
import buildcraft.transport.Pipe;
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
package buildcraft.transport.pipes;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.api.core.Position;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.api.power.IPowerProvider;
|
||||
import buildcraft.api.power.IPowerReceptor;
|
||||
import buildcraft.api.power.PowerFramework;
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
package buildcraft.transport.pipes;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import buildcraft.api.transport.IPipeEntry;
|
||||
import buildcraft.transport.Pipe;
|
||||
|
|
|
@ -11,7 +11,7 @@ package buildcraft.transport.pipes;
|
|||
|
||||
import buildcraft.BuildCraftTransport;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.ITankContainer;
|
||||
import net.minecraftforge.liquids.ITankContainer;
|
||||
import buildcraft.api.tools.IToolWrench;
|
||||
import buildcraft.api.transport.PipeManager;
|
||||
import buildcraft.core.proxy.CoreProxy;
|
||||
|
|
|
@ -34,7 +34,7 @@ import org.lwjgl.opengl.GL11;
|
|||
import buildcraft.BuildCraftCore;
|
||||
import buildcraft.BuildCraftCore.RenderMode;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.api.transport.IPipedItem;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.core.render.RenderEntityBlock;
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
|
||||
package buildcraft.transport.triggers;
|
||||
|
||||
import net.minecraftforge.liquids.ILiquidTank;
|
||||
import net.minecraftforge.liquids.LiquidManager;
|
||||
import net.minecraftforge.liquids.LiquidStack;
|
||||
import buildcraft.api.gates.ITriggerParameter;
|
||||
import buildcraft.api.gates.Trigger;
|
||||
import buildcraft.api.liquids.ILiquidTank;
|
||||
import buildcraft.api.liquids.LiquidManager;
|
||||
import buildcraft.api.liquids.LiquidStack;
|
||||
import buildcraft.core.DefaultProps;
|
||||
import buildcraft.transport.EntityData;
|
||||
import buildcraft.transport.ITriggerPipe;
|
||||
|
|
Loading…
Reference in a new issue