From a759353afa1738f0daee43706ef4a71302e8457b Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 13 Nov 2012 21:54:57 -0500 Subject: [PATCH] Add in the basic IBlockLiquid interface. The actual block implementation will follow. --- .../minecraftforge/liquids/IBlockLiquid.java | 59 +++++++++++++++++++ .../net/minecraftforge/liquids/ILiquid.java | 23 ++++++-- 2 files changed, 78 insertions(+), 4 deletions(-) create mode 100644 common/net/minecraftforge/liquids/IBlockLiquid.java diff --git a/common/net/minecraftforge/liquids/IBlockLiquid.java b/common/net/minecraftforge/liquids/IBlockLiquid.java new file mode 100644 index 0000000000..d57a1944b1 --- /dev/null +++ b/common/net/minecraftforge/liquids/IBlockLiquid.java @@ -0,0 +1,59 @@ +package net.minecraftforge.liquids; + +import net.minecraft.src.NBTTagCompound; + +/** + * Implementors of this interface are a liquid which may receive a block implementation and can be placed in the world. + * + * @author cpw + * + */ +public interface IBlockLiquid extends ILiquid { + /** + * Controls the type of block that is generated by this IBlockLiquid + * @author cpw + * + */ + public enum BlockType { + /** + * No block. Completeness really. + */ + NONE, + /** + * Vanilla style block, up to 8 flowing states. May be able to generate new sources. + */ + VANILLA, + /** + * Finite liquid style, uses cellular automata to model flowing behaviour. + */ + FINITE; + } + + /** + * Can this liquid, when placed in a specific configuration, generate new source blocks of the liquid. + * @return + */ + public boolean willGenerateSources(); + + /** + * @return the distance this liquid will flow if placed in the world. Maximum of 7 levels for vanilla types. + */ + public int getFlowDistance(); + + /** + * @return the RGB rendering for this liquid + */ + public byte[] getLiquidRGB(); + + /** + * Get the texture file for rendering the liquid + * @return + */ + public String getLiquidBlockTextureFile(); + /** + * Custom properties of the liquid. + * @return + */ + public NBTTagCompound getLiquidProperties(); + +} diff --git a/common/net/minecraftforge/liquids/ILiquid.java b/common/net/minecraftforge/liquids/ILiquid.java index 3d33f3d03b..f0efa91277 100644 --- a/common/net/minecraftforge/liquids/ILiquid.java +++ b/common/net/minecraftforge/liquids/ILiquid.java @@ -1,20 +1,35 @@ -/** +/** * 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 */ package net.minecraftforge.liquids; +/** + * Liquids implement this interface + * + */ public interface ILiquid { + /** + * The itemId of the liquid item + * @return + */ public int stillLiquidId(); + /** + * Is this liquid a metadata based liquid + * @return + */ public boolean isMetaSensitive(); + /** + * The item metadata of the liquid + * @return + */ public int stillLiquidMeta(); - }