From 63180af9fd59be443adff88605e7f900587fcd17 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 10 Nov 2012 21:41:04 -0500 Subject: [PATCH] Migrate liquid API to forge --- common/buildcraft/BuildCraftCore.java | 8 +- common/buildcraft/BuildCraftEnergy.java | 6 +- .../api/fuels/IronEngineCoolant.java | 3 +- .../buildcraft/api/fuels/IronEngineFuel.java | 5 +- common/buildcraft/api/liquids/ILiquid.java | 20 ---- .../buildcraft/api/liquids/ILiquidTank.java | 27 ----- .../api/liquids/ITankContainer.java | 46 -------- common/buildcraft/api/liquids/LiquidData.java | 45 -------- .../api/liquids/LiquidDictionary.java | 57 --------- .../buildcraft/api/liquids/LiquidManager.java | 64 ---------- .../buildcraft/api/liquids/LiquidStack.java | 109 ------------------ common/buildcraft/api/liquids/LiquidTank.java | 100 ---------------- .../api/recipes/RefineryRecipe.java | 3 +- common/buildcraft/api/tools/IToolPipette.java | 2 +- .../core/triggers/DefaultTriggerProvider.java | 2 +- .../core/triggers/TriggerLiquidContainer.java | 6 +- common/buildcraft/core/utils/Utils.java | 2 +- common/buildcraft/energy/BlockOilFlowing.java | 16 +-- common/buildcraft/energy/BlockOilStill.java | 2 +- common/buildcraft/energy/Engine.java | 2 +- common/buildcraft/energy/EngineIron.java | 6 +- common/buildcraft/energy/TileEngine.java | 6 +- common/buildcraft/factory/BlockRefinery.java | 4 +- common/buildcraft/factory/BlockTank.java | 4 +- common/buildcraft/factory/TilePump.java | 6 +- common/buildcraft/factory/TileRefinery.java | 10 +- common/buildcraft/factory/TileTank.java | 10 +- .../buildcraft/factory/gui/GuiRefinery.java | 4 +- .../buildcraft/factory/render/RenderTank.java | 2 +- .../transport/IPipeTransportLiquidsHook.java | 2 +- .../transport/PipeTransportLiquids.java | 10 +- .../buildcraft/transport/TileGenericPipe.java | 6 +- .../transport/network/PacketLiquidUpdate.java | 2 +- .../transport/pipes/PipeLiquidsSandstone.java | 2 +- .../transport/pipes/PipeLiquidsVoid.java | 2 +- .../transport/pipes/PipeLiquidsWood.java | 6 +- .../transport/pipes/PipeLogicIron.java | 2 +- .../transport/pipes/PipeLogicWood.java | 2 +- .../transport/render/RenderPipe.java | 2 +- .../triggers/TriggerPipeContents.java | 6 +- 40 files changed, 77 insertions(+), 542 deletions(-) delete mode 100644 common/buildcraft/api/liquids/ILiquid.java delete mode 100644 common/buildcraft/api/liquids/ILiquidTank.java delete mode 100644 common/buildcraft/api/liquids/ITankContainer.java delete mode 100644 common/buildcraft/api/liquids/LiquidData.java delete mode 100644 common/buildcraft/api/liquids/LiquidDictionary.java delete mode 100644 common/buildcraft/api/liquids/LiquidManager.java delete mode 100644 common/buildcraft/api/liquids/LiquidStack.java delete mode 100644 common/buildcraft/api/liquids/LiquidTank.java diff --git a/common/buildcraft/BuildCraftCore.java b/common/buildcraft/BuildCraftCore.java index 38d5f244..03582017 100644 --- a/common/buildcraft/BuildCraftCore.java +++ b/common/buildcraft/BuildCraftCore.java @@ -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 { diff --git a/common/buildcraft/BuildCraftEnergy.java b/common/buildcraft/BuildCraftEnergy.java index 7ef78edb..04652440 100644 --- a/common/buildcraft/BuildCraftEnergy.java +++ b/common/buildcraft/BuildCraftEnergy.java @@ -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) diff --git a/common/buildcraft/api/fuels/IronEngineCoolant.java b/common/buildcraft/api/fuels/IronEngineCoolant.java index d8adb443..0675a2d4 100644 --- a/common/buildcraft/api/fuels/IronEngineCoolant.java +++ b/common/buildcraft/api/fuels/IronEngineCoolant.java @@ -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 { diff --git a/common/buildcraft/api/fuels/IronEngineFuel.java b/common/buildcraft/api/fuels/IronEngineFuel.java index baf9006a..1076083e 100644 --- a/common/buildcraft/api/fuels/IronEngineFuel.java +++ b/common/buildcraft/api/fuels/IronEngineFuel.java @@ -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 { diff --git a/common/buildcraft/api/liquids/ILiquid.java b/common/buildcraft/api/liquids/ILiquid.java deleted file mode 100644 index 74d9fbe9..00000000 --- a/common/buildcraft/api/liquids/ILiquid.java +++ /dev/null @@ -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(); - -} diff --git a/common/buildcraft/api/liquids/ILiquidTank.java b/common/buildcraft/api/liquids/ILiquidTank.java deleted file mode 100644 index d570e16e..00000000 --- a/common/buildcraft/api/liquids/ILiquidTank.java +++ /dev/null @@ -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); -} diff --git a/common/buildcraft/api/liquids/ITankContainer.java b/common/buildcraft/api/liquids/ITankContainer.java deleted file mode 100644 index 47fa6653..00000000 --- a/common/buildcraft/api/liquids/ITankContainer.java +++ /dev/null @@ -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(); - -} diff --git a/common/buildcraft/api/liquids/LiquidData.java b/common/buildcraft/api/liquids/LiquidData.java deleted file mode 100644 index 97187772..00000000 --- a/common/buildcraft/api/liquids/LiquidData.java +++ /dev/null @@ -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"); - } - -} diff --git a/common/buildcraft/api/liquids/LiquidDictionary.java b/common/buildcraft/api/liquids/LiquidDictionary.java deleted file mode 100644 index fece9bfa..00000000 --- a/common/buildcraft/api/liquids/LiquidDictionary.java +++ /dev/null @@ -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 - */ -public abstract class LiquidDictionary -{ - - private static Map liquids = new HashMap(); - - /** - * 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; - } -} diff --git a/common/buildcraft/api/liquids/LiquidManager.java b/common/buildcraft/api/liquids/LiquidManager.java deleted file mode 100644 index a9494951..00000000 --- a/common/buildcraft/api/liquids/LiquidManager.java +++ /dev/null @@ -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 liquids = new LinkedList(); - - 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; - } - - -} diff --git a/common/buildcraft/api/liquids/LiquidStack.java b/common/buildcraft/api/liquids/LiquidStack.java deleted file mode 100644 index 60ec6e06..00000000 --- a/common/buildcraft/api/liquids/LiquidStack.java +++ /dev/null @@ -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; - } -} diff --git a/common/buildcraft/api/liquids/LiquidTank.java b/common/buildcraft/api/liquids/LiquidTank.java deleted file mode 100644 index 62f51755..00000000 --- a/common/buildcraft/api/liquids/LiquidTank.java +++ /dev/null @@ -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; - } -} diff --git a/common/buildcraft/api/recipes/RefineryRecipe.java b/common/buildcraft/api/recipes/RefineryRecipe.java index 6b98e537..44ec2aaf 100644 --- a/common/buildcraft/api/recipes/RefineryRecipe.java +++ b/common/buildcraft/api/recipes/RefineryRecipe.java @@ -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 { diff --git a/common/buildcraft/api/tools/IToolPipette.java b/common/buildcraft/api/tools/IToolPipette.java index 763642e0..0dd54b9e 100644 --- a/common/buildcraft/api/tools/IToolPipette.java +++ b/common/buildcraft/api/tools/IToolPipette.java @@ -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 { diff --git a/common/buildcraft/core/triggers/DefaultTriggerProvider.java b/common/buildcraft/core/triggers/DefaultTriggerProvider.java index 5975a9ea..0ce35427 100644 --- a/common/buildcraft/core/triggers/DefaultTriggerProvider.java +++ b/common/buildcraft/core/triggers/DefaultTriggerProvider.java @@ -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 { diff --git a/common/buildcraft/core/triggers/TriggerLiquidContainer.java b/common/buildcraft/core/triggers/TriggerLiquidContainer.java index ecf83ee4..806b06c4 100644 --- a/common/buildcraft/core/triggers/TriggerLiquidContainer.java +++ b/common/buildcraft/core/triggers/TriggerLiquidContainer.java @@ -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 { diff --git a/common/buildcraft/core/utils/Utils.java b/common/buildcraft/core/utils/Utils.java index a04ee61f..f5f5c91b 100644 --- a/common/buildcraft/core/utils/Utils.java +++ b/common/buildcraft/core/utils/Utils.java @@ -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; diff --git a/common/buildcraft/energy/BlockOilFlowing.java b/common/buildcraft/energy/BlockOilFlowing.java index 3d09e39c..ab8a201f 100644 --- a/common/buildcraft/energy/BlockOilFlowing.java +++ b/common/buildcraft/energy/BlockOilFlowing.java @@ -1,8 +1,8 @@ -/** +/** * Copyright (c) SpaceToad, 2011 * 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 * http://www.mod-buildcraft.com/MMPL-1.0.txt */ @@ -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 { @@ -30,7 +30,7 @@ public class BlockOilFlowing extends BlockFluid implements ILiquid { public BlockOilFlowing(int i, Material material) { super(i, material); - + setHardness(100F); setLightOpacity(3); } @@ -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) { diff --git a/common/buildcraft/energy/BlockOilStill.java b/common/buildcraft/energy/BlockOilStill.java index 0be9b81a..eae18b53 100644 --- a/common/buildcraft/energy/BlockOilStill.java +++ b/common/buildcraft/energy/BlockOilStill.java @@ -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 { diff --git a/common/buildcraft/energy/Engine.java b/common/buildcraft/energy/Engine.java index 13d4cede..8b42764f 100644 --- a/common/buildcraft/energy/Engine.java +++ b/common/buildcraft/energy/Engine.java @@ -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; diff --git a/common/buildcraft/energy/EngineIron.java b/common/buildcraft/energy/EngineIron.java index a79b3e75..cc350d08 100644 --- a/common/buildcraft/energy/EngineIron.java +++ b/common/buildcraft/energy/EngineIron.java @@ -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; diff --git a/common/buildcraft/energy/TileEngine.java b/common/buildcraft/energy/TileEngine.java index 0c0f983b..d0293377 100644 --- a/common/buildcraft/energy/TileEngine.java +++ b/common/buildcraft/energy/TileEngine.java @@ -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; diff --git a/common/buildcraft/factory/BlockRefinery.java b/common/buildcraft/factory/BlockRefinery.java index ad44d9ed..f98e59eb 100644 --- a/common/buildcraft/factory/BlockRefinery.java +++ b/common/buildcraft/factory/BlockRefinery.java @@ -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; diff --git a/common/buildcraft/factory/BlockTank.java b/common/buildcraft/factory/BlockTank.java index 38955d40..617ee700 100644 --- a/common/buildcraft/factory/BlockTank.java +++ b/common/buildcraft/factory/BlockTank.java @@ -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; diff --git a/common/buildcraft/factory/TilePump.java b/common/buildcraft/factory/TilePump.java index 47ba85a3..2425152b 100644 --- a/common/buildcraft/factory/TilePump.java +++ b/common/buildcraft/factory/TilePump.java @@ -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; diff --git a/common/buildcraft/factory/TileRefinery.java b/common/buildcraft/factory/TileRefinery.java index b84220d5..afb0aaea 100644 --- a/common/buildcraft/factory/TileRefinery.java +++ b/common/buildcraft/factory/TileRefinery.java @@ -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; diff --git a/common/buildcraft/factory/TileTank.java b/common/buildcraft/factory/TileTank.java index 9e102e10..df5e48f6 100644 --- a/common/buildcraft/factory/TileTank.java +++ b/common/buildcraft/factory/TileTank.java @@ -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; diff --git a/common/buildcraft/factory/gui/GuiRefinery.java b/common/buildcraft/factory/gui/GuiRefinery.java index d037e095..06ca52c4 100644 --- a/common/buildcraft/factory/gui/GuiRefinery.java +++ b/common/buildcraft/factory/gui/GuiRefinery.java @@ -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; diff --git a/common/buildcraft/factory/render/RenderTank.java b/common/buildcraft/factory/render/RenderTank.java index 4804b2df..718e163e 100644 --- a/common/buildcraft/factory/render/RenderTank.java +++ b/common/buildcraft/factory/render/RenderTank.java @@ -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; diff --git a/common/buildcraft/transport/IPipeTransportLiquidsHook.java b/common/buildcraft/transport/IPipeTransportLiquidsHook.java index 0ba99ef7..6ee0664b 100644 --- a/common/buildcraft/transport/IPipeTransportLiquidsHook.java +++ b/common/buildcraft/transport/IPipeTransportLiquidsHook.java @@ -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 { diff --git a/common/buildcraft/transport/PipeTransportLiquids.java b/common/buildcraft/transport/PipeTransportLiquids.java index ac3bf9c3..a0fbca17 100644 --- a/common/buildcraft/transport/PipeTransportLiquids.java +++ b/common/buildcraft/transport/PipeTransportLiquids.java @@ -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; diff --git a/common/buildcraft/transport/TileGenericPipe.java b/common/buildcraft/transport/TileGenericPipe.java index 27e7ee0c..d0920fec 100644 --- a/common/buildcraft/transport/TileGenericPipe.java +++ b/common/buildcraft/transport/TileGenericPipe.java @@ -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; diff --git a/common/buildcraft/transport/network/PacketLiquidUpdate.java b/common/buildcraft/transport/network/PacketLiquidUpdate.java index 51098a75..082f6fa6 100644 --- a/common/buildcraft/transport/network/PacketLiquidUpdate.java +++ b/common/buildcraft/transport/network/PacketLiquidUpdate.java @@ -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; diff --git a/common/buildcraft/transport/pipes/PipeLiquidsSandstone.java b/common/buildcraft/transport/pipes/PipeLiquidsSandstone.java index e0b2931d..bc6769d9 100644 --- a/common/buildcraft/transport/pipes/PipeLiquidsSandstone.java +++ b/common/buildcraft/transport/pipes/PipeLiquidsSandstone.java @@ -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; diff --git a/common/buildcraft/transport/pipes/PipeLiquidsVoid.java b/common/buildcraft/transport/pipes/PipeLiquidsVoid.java index 97638539..382f8640 100644 --- a/common/buildcraft/transport/pipes/PipeLiquidsVoid.java +++ b/common/buildcraft/transport/pipes/PipeLiquidsVoid.java @@ -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; diff --git a/common/buildcraft/transport/pipes/PipeLiquidsWood.java b/common/buildcraft/transport/pipes/PipeLiquidsWood.java index 8d12cd26..7186c3bc 100644 --- a/common/buildcraft/transport/pipes/PipeLiquidsWood.java +++ b/common/buildcraft/transport/pipes/PipeLiquidsWood.java @@ -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; diff --git a/common/buildcraft/transport/pipes/PipeLogicIron.java b/common/buildcraft/transport/pipes/PipeLogicIron.java index 420ee1b0..f058cf82 100644 --- a/common/buildcraft/transport/pipes/PipeLogicIron.java +++ b/common/buildcraft/transport/pipes/PipeLogicIron.java @@ -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; diff --git a/common/buildcraft/transport/pipes/PipeLogicWood.java b/common/buildcraft/transport/pipes/PipeLogicWood.java index c5e37e3a..d0e7ca3b 100644 --- a/common/buildcraft/transport/pipes/PipeLogicWood.java +++ b/common/buildcraft/transport/pipes/PipeLogicWood.java @@ -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; diff --git a/common/buildcraft/transport/render/RenderPipe.java b/common/buildcraft/transport/render/RenderPipe.java index b08b0b14..24d5877f 100644 --- a/common/buildcraft/transport/render/RenderPipe.java +++ b/common/buildcraft/transport/render/RenderPipe.java @@ -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; diff --git a/common/buildcraft/transport/triggers/TriggerPipeContents.java b/common/buildcraft/transport/triggers/TriggerPipeContents.java index 61167943..86a0970d 100644 --- a/common/buildcraft/transport/triggers/TriggerPipeContents.java +++ b/common/buildcraft/transport/triggers/TriggerPipeContents.java @@ -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;