Comment out fluids until King gets his hands on it
This commit is contained in:
parent
6eb9915690
commit
9cf0a5b68b
|
@ -22,6 +22,7 @@ import net.minecraft.world.World;
|
|||
*/
|
||||
public abstract class BlockFluidBase extends Block implements IFluidBlock
|
||||
{
|
||||
/*
|
||||
protected final static Map<Integer, Boolean> defaultDisplacementIds = new HashMap<Integer, Boolean>();
|
||||
|
||||
static
|
||||
|
@ -45,10 +46,11 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
protected int maxScaledLight = 0;
|
||||
|
||||
protected final String fluidName;
|
||||
|
||||
*/
|
||||
public BlockFluidBase(int id, Fluid fluid, Material material)
|
||||
{
|
||||
super(id, material);
|
||||
super(material);
|
||||
/*
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.setTickRandomly(true);
|
||||
this.disableStats();
|
||||
|
@ -62,8 +64,9 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
fluid.setBlockID(id);
|
||||
|
||||
displacementIds.putAll(defaultDisplacementIds);
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
public BlockFluidBase setQuantaPerBlock(int quantaPerBlock)
|
||||
{
|
||||
if (quantaPerBlock > 16 || quantaPerBlock < 1) quantaPerBlock = 8;
|
||||
|
@ -107,7 +110,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
|
||||
/**
|
||||
* Returns true if the block at (x, y, z) is displaceable. Does not displace the block.
|
||||
*/
|
||||
* /
|
||||
public boolean canDisplace(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
if (world.isAirBlock(x, y, z)) return true;
|
||||
|
@ -148,7 +151,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
|
||||
/**
|
||||
* Attempt to displace the block at (x, y, z), return true if it was displaced.
|
||||
*/
|
||||
* /
|
||||
public boolean displaceIfPossible(World world, int x, int y, int z)
|
||||
{
|
||||
if (world.isAirBlock(x, y, z))
|
||||
|
@ -202,7 +205,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
|
||||
public abstract int getMaxRenderHeightMeta();
|
||||
|
||||
/* BLOCK FUNCTIONS */
|
||||
/* BLOCK FUNCTIONS * /
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z)
|
||||
{
|
||||
|
@ -329,7 +332,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
return mat == this.blockMaterial ? false : super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
|
||||
/* FLUID FUNCTIONS */
|
||||
/* FLUID FUNCTIONS * /
|
||||
public static final int getDensity(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
Block block = Block.blocksList[world.getBlockId(x, y, z)];
|
||||
|
@ -446,7 +449,7 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
return vec;
|
||||
}
|
||||
|
||||
/* IFluidBlock */
|
||||
/* IFluidBlock * /
|
||||
@Override
|
||||
public Fluid getFluid()
|
||||
{
|
||||
|
@ -461,4 +464,5 @@ public abstract class BlockFluidBase extends Block implements IFluidBlock
|
|||
if (remaining > 1) remaining = 1.0f;
|
||||
return remaining * (density > 0 ? 1 : -1);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -17,17 +17,18 @@ import net.minecraft.world.World;
|
|||
*/
|
||||
public class BlockFluidClassic extends BlockFluidBase
|
||||
{
|
||||
/*
|
||||
protected boolean[] isOptimalFlowDirection = new boolean[4];
|
||||
protected int[] flowCost = new int[4];
|
||||
|
||||
protected FluidStack stack;
|
||||
|
||||
*/
|
||||
public BlockFluidClassic(int id, Fluid fluid, Material material)
|
||||
{
|
||||
super(id, fluid, material);
|
||||
stack = new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME);
|
||||
//stack = new FluidStack(fluid, FluidContainerRegistry.BUCKET_VOLUME);
|
||||
}
|
||||
|
||||
/*
|
||||
public BlockFluidClassic setFluidStack(FluidStack stack)
|
||||
{
|
||||
this.stack = stack;
|
||||
|
@ -328,11 +329,12 @@ public class BlockFluidClassic extends BlockFluidBase
|
|||
}
|
||||
return quantaRemaining >= compare ? quantaRemaining : compare;
|
||||
}
|
||||
|
||||
*/
|
||||
/* IFluidBlock */
|
||||
@Override
|
||||
public FluidStack drain(World world, int x, int y, int z, boolean doDrain)
|
||||
{
|
||||
/*
|
||||
if (!isSourceBlock(world, x, y, z))
|
||||
{
|
||||
return null;
|
||||
|
@ -344,11 +346,15 @@ public class BlockFluidClassic extends BlockFluidBase
|
|||
}
|
||||
|
||||
return stack.copy();
|
||||
*/
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrain(World world, int x, int y, int z)
|
||||
{
|
||||
return isSourceBlock(world, x, y, z);
|
||||
return false; //isSourceBlock(world, x, y, z);
|
||||
}
|
||||
@Override public Fluid getFluid(){ return null; }
|
||||
@Override public float getFilledPercentage(World world, int x, int y, int z) { return 0; }
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ public class BlockFluidFinite extends BlockFluidBase
|
|||
{
|
||||
super(id, fluid, material);
|
||||
}
|
||||
|
||||
/*
|
||||
@Override
|
||||
public int getQuantaValue(IBlockAccess world, int x, int y, int z)
|
||||
{
|
||||
|
@ -320,4 +320,6 @@ public class BlockFluidFinite extends BlockFluidBase
|
|||
{
|
||||
return false;
|
||||
}
|
||||
@Override public Fluid getFluid() { return null; }
|
||||
@Override public float getFilledPercentage(World world, int x, int y, int z) { return 0; }
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDummyContainer;
|
||||
import net.minecraftforge.common.ForgeModContainer;
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.LoaderException;
|
||||
import net.minecraft.item.EnumRarity;
|
||||
|
@ -116,7 +116,7 @@ public class Fluid
|
|||
{
|
||||
this.block = block;
|
||||
}
|
||||
else if (!ForgeDummyContainer.forceDuplicateFluidBlockCrash)
|
||||
else if (!ForgeModContainer.forceDuplicateFluidBlockCrash)
|
||||
{
|
||||
FMLLog.warning("A mod has attempted to assign Block " + block + " to the Fluid '" + fluidName + "' but this Fluid has already been linked to BlockID "
|
||||
+ this.block + ". Configure your mods to prevent this from happening.");
|
||||
|
@ -172,10 +172,12 @@ public class Fluid
|
|||
return this.fluidName;
|
||||
}
|
||||
|
||||
/*
|
||||
public final int getID()
|
||||
{
|
||||
return FluidRegistry.getFluidID(this.fluidName);
|
||||
}
|
||||
*/
|
||||
|
||||
public final Block getBlock()
|
||||
{
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
@ -24,20 +25,21 @@ import net.minecraftforge.event.Event;
|
|||
*/
|
||||
public abstract class FluidContainerRegistry
|
||||
{
|
||||
/*
|
||||
private static Map<List, FluidContainerData> containerFluidMap = new HashMap();
|
||||
private static Map<List, FluidContainerData> filledContainerMap = new HashMap();
|
||||
private static Set<List> emptyContainers = new HashSet();
|
||||
|
||||
public static final int BUCKET_VOLUME = 1000;
|
||||
public static final ItemStack EMPTY_BUCKET = new ItemStack(Item.bucketEmpty);
|
||||
public static final ItemStack EMPTY_BOTTLE = new ItemStack(Item.glassBottle);
|
||||
private static final ItemStack NULL_EMPTYCONTAINER = new ItemStack(Item.bucketEmpty);
|
||||
public static final ItemStack EMPTY_BUCKET = new ItemStack(Items.bucket);
|
||||
public static final ItemStack EMPTY_BOTTLE = new ItemStack(Items.glass_bottle);
|
||||
private static final ItemStack NULL_EMPTYCONTAINER = new ItemStack(Items.bucket);
|
||||
|
||||
static
|
||||
{
|
||||
registerFluidContainer(FluidRegistry.WATER, new ItemStack(Item.bucketWater), EMPTY_BUCKET);
|
||||
registerFluidContainer(FluidRegistry.LAVA, new ItemStack(Item.bucketLava), EMPTY_BUCKET);
|
||||
registerFluidContainer(FluidRegistry.WATER, new ItemStack(Item.potion), EMPTY_BOTTLE);
|
||||
registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.water_bucket), EMPTY_BUCKET);
|
||||
registerFluidContainer(FluidRegistry.LAVA, new ItemStack(Items.lava_bucket), EMPTY_BUCKET);
|
||||
registerFluidContainer(FluidRegistry.WATER, new ItemStack(Items.potionitem), EMPTY_BOTTLE);
|
||||
}
|
||||
|
||||
private FluidContainerRegistry(){}
|
||||
|
@ -52,7 +54,7 @@ public abstract class FluidContainerRegistry
|
|||
* @param emptyContainer
|
||||
* ItemStack representing the container when it is empty.
|
||||
* @return True if container was successfully registered; false if it already is.
|
||||
*/
|
||||
* /
|
||||
public static boolean registerFluidContainer(FluidStack stack, ItemStack filledContainer, ItemStack emptyContainer)
|
||||
{
|
||||
return registerFluidContainer(new FluidContainerData(stack, filledContainer, emptyContainer));
|
||||
|
@ -69,7 +71,7 @@ public abstract class FluidContainerRegistry
|
|||
* @param emptyContainer
|
||||
* ItemStack representing the container when it is empty.
|
||||
* @return True if container was successfully registered; false if it already is.
|
||||
*/
|
||||
* /
|
||||
public static boolean registerFluidContainer(Fluid fluid, ItemStack filledContainer, ItemStack emptyContainer)
|
||||
{
|
||||
if (!FluidRegistry.isFluidRegistered(fluid))
|
||||
|
@ -87,7 +89,7 @@ public abstract class FluidContainerRegistry
|
|||
* @param filledContainer
|
||||
* ItemStack representing the container when it is full.
|
||||
* @return True if container was successfully registered; false if it already is.
|
||||
*/
|
||||
* /
|
||||
public static boolean registerFluidContainer(FluidStack stack, ItemStack filledContainer)
|
||||
{
|
||||
return registerFluidContainer(new FluidContainerData(stack, filledContainer, null, true));
|
||||
|
@ -102,7 +104,7 @@ public abstract class FluidContainerRegistry
|
|||
* @param filledContainer
|
||||
* ItemStack representing the container when it is full.
|
||||
* @return True if container was successfully registered; false if it already is.
|
||||
*/
|
||||
* /
|
||||
public static boolean registerFluidContainer(Fluid fluid, ItemStack filledContainer)
|
||||
{
|
||||
if (!FluidRegistry.isFluidRegistered(fluid))
|
||||
|
@ -118,19 +120,19 @@ public abstract class FluidContainerRegistry
|
|||
* @param data
|
||||
* See {@link FluidContainerData}.
|
||||
* @return True if container was successfully registered; false if it already is.
|
||||
*/
|
||||
* /
|
||||
public static boolean registerFluidContainer(FluidContainerData data)
|
||||
{
|
||||
if (isFilledContainer(data.filledContainer))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
containerFluidMap.put(Arrays.asList(data.filledContainer.itemID, data.filledContainer.getItemDamage()), data);
|
||||
containerFluidMap.put(Arrays.asList(data.filledContainer, data.filledContainer.getItemDamage()), data);
|
||||
|
||||
if (data.emptyContainer != null && data.emptyContainer != NULL_EMPTYCONTAINER)
|
||||
{
|
||||
filledContainerMap.put(Arrays.asList(data.emptyContainer.itemID, data.emptyContainer.getItemDamage(), data.fluid.fluidID), data);
|
||||
emptyContainers.add(Arrays.asList(data.emptyContainer.itemID, data.emptyContainer.getItemDamage()));
|
||||
filledContainerMap.put(Arrays.asList(data.emptyContainer, data.emptyContainer.getItemDamage(), data.fluid.fluidID), data);
|
||||
emptyContainers.add(Arrays.asList(data.emptyContainer, data.emptyContainer.getItemDamage()));
|
||||
}
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new FluidContainerRegisterEvent(data));
|
||||
|
@ -143,7 +145,7 @@ public abstract class FluidContainerRegistry
|
|||
* @param container
|
||||
* The fluid container.
|
||||
* @return FluidStack representing stored fluid.
|
||||
*/
|
||||
* /
|
||||
public static FluidStack getFluidForFilledItem(ItemStack container)
|
||||
{
|
||||
if (container == null)
|
||||
|
@ -151,7 +153,7 @@ public abstract class FluidContainerRegistry
|
|||
return null;
|
||||
}
|
||||
|
||||
FluidContainerData data = containerFluidMap.get(Arrays.asList(container.itemID, container.getItemDamage()));
|
||||
FluidContainerData data = containerFluidMap.get(Arrays.asList(container, container.getItemDamage()));
|
||||
return data == null ? null : data.fluid.copy();
|
||||
}
|
||||
|
||||
|
@ -165,7 +167,7 @@ public abstract class FluidContainerRegistry
|
|||
* @param container
|
||||
* ItemStack representing the empty container.
|
||||
* @return Filled container if successful, otherwise null.
|
||||
*/
|
||||
* /
|
||||
public static ItemStack fillFluidContainer(FluidStack fluid, ItemStack container)
|
||||
{
|
||||
if (container == null || fluid == null)
|
||||
|
@ -173,7 +175,7 @@ public abstract class FluidContainerRegistry
|
|||
return null;
|
||||
}
|
||||
|
||||
FluidContainerData data = filledContainerMap.get(Arrays.asList(container.itemID, container.getItemDamage(), fluid.fluidID));
|
||||
FluidContainerData data = filledContainerMap.get(Arrays.asList(container, container.getItemDamage(), fluid.fluidID));
|
||||
if (data != null && fluid.amount >= data.fluid.amount)
|
||||
{
|
||||
return data.filledContainer.copy();
|
||||
|
@ -183,7 +185,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
/**
|
||||
* Determines if a container holds a specific fluid.
|
||||
*/
|
||||
* /
|
||||
public static boolean containsFluid(ItemStack container, FluidStack fluid)
|
||||
{
|
||||
if (container == null || fluid == null)
|
||||
|
@ -191,7 +193,7 @@ public abstract class FluidContainerRegistry
|
|||
return false;
|
||||
}
|
||||
|
||||
FluidContainerData data = filledContainerMap.get(Arrays.asList(container.itemID, container.getItemDamage(), fluid.fluidID));
|
||||
FluidContainerData data = filledContainerMap.get(Arrays.asList(container, container.getItemDamage(), fluid.fluidID));
|
||||
return data == null ? false : data.fluid.isFluidEqual(fluid);
|
||||
}
|
||||
|
||||
|
@ -207,7 +209,7 @@ public abstract class FluidContainerRegistry
|
|||
return true;
|
||||
}
|
||||
|
||||
FluidContainerData data = containerFluidMap.get(Arrays.asList(container.itemID, container.getItemDamage()));
|
||||
FluidContainerData data = containerFluidMap.get(Arrays.asList(container, container.getItemDamage()));
|
||||
return data != null && data.emptyContainer.isItemEqual(EMPTY_BUCKET);
|
||||
}
|
||||
|
||||
|
@ -218,7 +220,7 @@ public abstract class FluidContainerRegistry
|
|||
|
||||
public static boolean isEmptyContainer(ItemStack container)
|
||||
{
|
||||
return container != null && emptyContainers.contains(Arrays.asList(container.itemID, container.getItemDamage()));
|
||||
return container != null && emptyContainers.contains(Arrays.asList(container, container.getItemDamage()));
|
||||
}
|
||||
|
||||
public static boolean isFilledContainer(ItemStack container)
|
||||
|
@ -234,7 +236,7 @@ public abstract class FluidContainerRegistry
|
|||
/**
|
||||
* Wrapper class for the registry entries. Ensures that none of the attempted registrations
|
||||
* contain null references unless permitted.
|
||||
*/
|
||||
* /
|
||||
public static class FluidContainerData
|
||||
{
|
||||
public final FluidStack fluid;
|
||||
|
@ -274,5 +276,5 @@ public abstract class FluidContainerRegistry
|
|||
this.data = data.copy();
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -4,7 +4,6 @@ package net.minecraftforge.fluids;
|
|||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraftforge.common.network.ForgePacket;
|
||||
|
||||
import com.google.common.collect.BiMap;
|
||||
|
@ -15,6 +14,7 @@ import com.google.common.io.ByteStreams;
|
|||
|
||||
public class FluidIdMapPacket extends ForgePacket
|
||||
{
|
||||
/*
|
||||
private BiMap<String, Integer> fluidIds = HashBiMap.create();
|
||||
|
||||
@Override
|
||||
|
@ -49,4 +49,5 @@ public class FluidIdMapPacket extends ForgePacket
|
|||
{
|
||||
FluidRegistry.initFluidIDs(fluidIds);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import com.google.common.collect.ImmutableMap;
|
|||
*/
|
||||
public abstract class FluidRegistry
|
||||
{
|
||||
/*
|
||||
static int maxID = 0;
|
||||
|
||||
static HashMap<String, Fluid> fluids = new HashMap();
|
||||
|
@ -52,7 +53,7 @@ public abstract class FluidRegistry
|
|||
|
||||
/**
|
||||
* Called by Forge to prepare the ID map for server -> client sync.
|
||||
*/
|
||||
* /
|
||||
static void initFluidIDs(BiMap<String, Integer> newfluidIDs)
|
||||
{
|
||||
maxID = newfluidIDs.size();
|
||||
|
@ -66,7 +67,7 @@ public abstract class FluidRegistry
|
|||
* @param fluid
|
||||
* The fluid to register.
|
||||
* @return True if the fluid was successfully registered; false if there is a name clash.
|
||||
*/
|
||||
* /
|
||||
public static boolean registerFluid(Fluid fluid)
|
||||
{
|
||||
if (fluidIDs.containsKey(fluid.getName()))
|
||||
|
@ -126,7 +127,7 @@ public abstract class FluidRegistry
|
|||
|
||||
/**
|
||||
* Returns a read-only map containing Fluid Names and their associated Fluids.
|
||||
*/
|
||||
* /
|
||||
public static Map<String, Fluid> getRegisteredFluids()
|
||||
{
|
||||
return ImmutableMap.copyOf(fluids);
|
||||
|
@ -134,7 +135,7 @@ public abstract class FluidRegistry
|
|||
|
||||
/**
|
||||
* Returns a read-only map containing Fluid Names and their associated IDs.
|
||||
*/
|
||||
* /
|
||||
public static Map<String, Integer> getRegisteredFluidIDs()
|
||||
{
|
||||
return ImmutableMap.copyOf(fluidIDs);
|
||||
|
@ -167,4 +168,5 @@ public abstract class FluidRegistry
|
|||
this.fluidID = fluidID;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
*/
|
||||
public class FluidStack
|
||||
{
|
||||
/*
|
||||
public int fluidID;
|
||||
public int amount;
|
||||
public NBTTagCompound tag;
|
||||
|
@ -52,7 +53,7 @@ public class FluidStack
|
|||
/**
|
||||
* This provides a safe method for retrieving a FluidStack - if the Fluid is invalid, the stack
|
||||
* will return as null.
|
||||
*/
|
||||
* /
|
||||
public static FluidStack loadFluidStackFromNBT(NBTTagCompound nbt)
|
||||
{
|
||||
if (nbt == null)
|
||||
|
@ -102,7 +103,7 @@ public class FluidStack
|
|||
|
||||
/**
|
||||
* @return A copy of this FluidStack
|
||||
*/
|
||||
* /
|
||||
public FluidStack copy()
|
||||
{
|
||||
return new FluidStack(fluidID, amount, tag);
|
||||
|
@ -114,7 +115,7 @@ public class FluidStack
|
|||
* @param other
|
||||
* The FluidStack for comparison
|
||||
* @return true if the Fluids (IDs and NBT Tags) are the same
|
||||
*/
|
||||
* /
|
||||
public boolean isFluidEqual(FluidStack other)
|
||||
{
|
||||
return other != null && fluidID == other.fluidID && isFluidStackTagEqual(other);
|
||||
|
@ -127,7 +128,7 @@ public class FluidStack
|
|||
|
||||
/**
|
||||
* Determines if the NBT Tags are equal. Useful if the FluidIDs are known to be equal.
|
||||
*/
|
||||
* /
|
||||
public static boolean areFluidStackTagsEqual(FluidStack stack1, FluidStack stack2)
|
||||
{
|
||||
return stack1 == null && stack2 == null ? true : stack1 == null || stack2 == null ? false : stack1.isFluidStackTagEqual(stack2);
|
||||
|
@ -138,7 +139,7 @@ public class FluidStack
|
|||
*
|
||||
* @param other
|
||||
* @return true if this FluidStack contains the other FluidStack (same fluid and >= amount)
|
||||
*/
|
||||
* /
|
||||
public boolean containsFluid(FluidStack other)
|
||||
{
|
||||
return isFluidEqual(other) && amount >= other.amount;
|
||||
|
@ -150,7 +151,7 @@ public class FluidStack
|
|||
* @param other
|
||||
* - the FluidStack for comparison
|
||||
* @return true if the two FluidStacks are exactly the same
|
||||
*/
|
||||
* /
|
||||
public boolean isFluidStackIdentical(FluidStack other)
|
||||
{
|
||||
return isFluidEqual(other) && amount == other.amount;
|
||||
|
@ -163,7 +164,7 @@ public class FluidStack
|
|||
* @param other
|
||||
* The ItemStack for comparison
|
||||
* @return true if the Fluids (IDs and NBT Tags) are the same
|
||||
*/
|
||||
* /
|
||||
public boolean isFluidEqual(ItemStack other)
|
||||
{
|
||||
if (other == null)
|
||||
|
@ -189,7 +190,7 @@ public class FluidStack
|
|||
* Default equality comparison for a FluidStack. Same functionality as isFluidEqual().
|
||||
*
|
||||
* This is included for use in data structures.
|
||||
*/
|
||||
* /
|
||||
@Override
|
||||
public final boolean equals(Object o)
|
||||
{
|
||||
|
@ -200,4 +201,5 @@ public class FluidStack
|
|||
|
||||
return isFluidEqual((FluidStack) o);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -12,6 +12,13 @@ import net.minecraft.tileentity.TileEntity;
|
|||
*/
|
||||
public class FluidTank implements IFluidTank
|
||||
{
|
||||
@Override public FluidStack getFluid() { return null; }
|
||||
@Override public int getFluidAmount() { return 0; }
|
||||
@Override public int getCapacity() { return 0; }
|
||||
@Override public FluidTankInfo getInfo() { return null; }
|
||||
@Override public int fill(FluidStack resource, boolean doFill) { return 0; }
|
||||
@Override public FluidStack drain(int maxDrain, boolean doDrain){ return null; }
|
||||
/*
|
||||
protected FluidStack fluid;
|
||||
protected int capacity;
|
||||
protected TileEntity tile;
|
||||
|
@ -69,7 +76,7 @@ public class FluidTank implements IFluidTank
|
|||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
/* IFluidTank */
|
||||
/* IFluidTank * /
|
||||
@Override
|
||||
public FluidStack getFluid()
|
||||
{
|
||||
|
@ -127,7 +134,7 @@ public class FluidTank implements IFluidTank
|
|||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
|
||||
}
|
||||
return fluid.amount;
|
||||
}
|
||||
|
@ -150,7 +157,7 @@ public class FluidTank implements IFluidTank
|
|||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidFillingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
|
||||
}
|
||||
return filled;
|
||||
}
|
||||
|
@ -180,9 +187,10 @@ public class FluidTank implements IFluidTank
|
|||
|
||||
if (tile != null)
|
||||
{
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord, this));
|
||||
FluidEvent.fireEvent(new FluidEvent.FluidDrainingEvent(fluid, tile.func_145831_w(), tile.field_145851_c, tile.field_145848_d, tile.field_145849_e, this));
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package net.minecraftforge.fluids;
|
||||
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Implement this interface on TileEntities which should handle fluids, generally storing them in
|
||||
|
|
|
@ -12,16 +12,21 @@ import net.minecraft.nbt.NBTTagCompound;
|
|||
*/
|
||||
public class ItemFluidContainer extends Item implements IFluidContainerItem
|
||||
{
|
||||
@Override public FluidStack getFluid(ItemStack container){ return null; }
|
||||
@Override public int getCapacity(ItemStack container){ return 0; }
|
||||
@Override public int fill(ItemStack container, FluidStack resource, boolean doFill) { return 0; }
|
||||
@Override public FluidStack drain(ItemStack container, int maxDrain, boolean doDrain){ return null; }
|
||||
/*
|
||||
protected int capacity;
|
||||
|
||||
public ItemFluidContainer(int itemID)
|
||||
{
|
||||
super(itemID);
|
||||
super();
|
||||
}
|
||||
|
||||
public ItemFluidContainer(int itemID, int capacity)
|
||||
{
|
||||
super(itemID);
|
||||
super();
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
|
@ -31,7 +36,7 @@ public class ItemFluidContainer extends Item implements IFluidContainerItem
|
|||
return this;
|
||||
}
|
||||
|
||||
/* IFluidContainerItem */
|
||||
/* IFluidContainerItem * /
|
||||
@Override
|
||||
public FluidStack getFluid(ItemStack container)
|
||||
{
|
||||
|
@ -155,4 +160,5 @@ public class ItemFluidContainer extends Item implements IFluidContainerItem
|
|||
}
|
||||
return stack;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@ package net.minecraftforge.fluids;
|
|||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
|
@ -16,6 +16,11 @@ import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
|||
*/
|
||||
public class RenderBlockFluid implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
@Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {}
|
||||
@Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { return false; }
|
||||
@Override public boolean shouldRender3DInInventory() { return false; }
|
||||
@Override public int getRenderId() { return 0; }
|
||||
/*
|
||||
public static RenderBlockFluid instance = new RenderBlockFluid();
|
||||
|
||||
static final float LIGHT_Y_NEG = 0.5F;
|
||||
|
@ -68,7 +73,7 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
|
|||
return !world.getBlockMaterial(x, y, z).isSolid() && world.getBlockId(x, y - block.densityDir, z) == block.blockID ? 1 : block.getQuantaPercentage(world, x, y, z) * 0.875F;
|
||||
}
|
||||
|
||||
/* ISimpleBlockRenderingHandler */
|
||||
/* ISimpleBlockRenderingHandler * /
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer){}
|
||||
|
||||
|
@ -324,4 +329,5 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler
|
|||
{
|
||||
return FluidRegistry.renderIdFluid;
|
||||
}
|
||||
*/
|
||||
}
|
|
@ -3,7 +3,7 @@ package net.minecraftforge.fluids;
|
|||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* Reference Tile Entity implementation of {@link IFluidHandler}. Use/extend this or write your own.
|
||||
|
@ -13,6 +13,13 @@ import net.minecraftforge.common.ForgeDirection;
|
|||
*/
|
||||
public class TileFluidHandler extends TileEntity implements IFluidHandler
|
||||
{
|
||||
@Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { return 0; }
|
||||
@Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { return null; }
|
||||
@Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { return null; }
|
||||
@Override public boolean canFill(ForgeDirection from, Fluid fluid) { return false; }
|
||||
@Override public boolean canDrain(ForgeDirection from, Fluid fluid) { return false; }
|
||||
@Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { return null; }
|
||||
/*
|
||||
protected FluidTank tank = new FluidTank(FluidContainerRegistry.BUCKET_VOLUME);
|
||||
|
||||
@Override
|
||||
|
@ -29,7 +36,7 @@ public class TileFluidHandler extends TileEntity implements IFluidHandler
|
|||
tank.readFromNBT(tag);
|
||||
}
|
||||
|
||||
/* IFluidHandler */
|
||||
/* IFluidHandler * /
|
||||
@Override
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
|
@ -69,4 +76,5 @@ public class TileFluidHandler extends TileEntity implements IFluidHandler
|
|||
{
|
||||
return new FluidTankInfo[] { tank.getInfo() };
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue