Posted May 20, 201312 yr I have made a custom liquid, but: - When I place the flowing one down, the game crashes - When I place the still one down, it doesn't flow, but when i change the block underneath it, the game crashes Error log: http://pastebin.com/g3aFB9KW BlockStill: package TreviModdingCrew.LiquidEnergy.block; import TreviModdingCrew.LiquidEnergy.Main; import net.minecraft.block.BlockStationary; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.Icon; import net.minecraftforge.liquids.ILiquid; public class BlockEnergyLiquid_Still extends BlockStationary implements ILiquid { private String name; public BlockEnergyLiquid_Still(int par1, String name) { super(par1, Material.water); this.setHardness(100F); this.setLightOpacity(3); this.setCreativeTab(Main.liqEne_Tab); this.name = name; this.setUnlocalizedName(name); this.setTickRandomly(true); } @Override public int getRenderType() { return 4; } @Override public int stillLiquidId() { return this.blockID; } @Override public boolean isMetaSensitive() { return false; } @Override public int stillLiquidMeta() { return 0; } @Override public void registerIcons(IconRegister iconReg) { System.out.println(Main.modid + ":" + this.getUnlocalizedName()); this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)), iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)) }; } } BlockFlowing: package TreviModdingCrew.LiquidEnergy.block; import net.minecraft.block.BlockFlowing; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.util.Icon; import net.minecraftforge.liquids.ILiquid; import TreviModdingCrew.LiquidEnergy.Main; public class BlockEnergyLiquid_Flowing extends BlockFlowing implements ILiquid { private String name; public BlockEnergyLiquid_Flowing(int par1, String name) { super(par1, Material.water); this.setHardness(100F); this.setLightOpacity(3); this.setCreativeTab(Main.liqEne_Tab); this.name = name; this.setUnlocalizedName(name); this.setTickRandomly(true); } @Override public int getRenderType() { return 4; } @Override public int stillLiquidId() { return Main.energyLiquid_Still.blockID; } @Override public boolean isMetaSensitive() { return false; } @Override public int stillLiquidMeta() { return 0; } @Override public void registerIcons(IconRegister iconReg) { System.out.println(Main.modid + ":" + this.getUnlocalizedName()); this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)), iconReg.registerIcon(Main.modid + ":" + this.name) }; } }
May 20, 201312 yr flowing liquid block needs to be one ID lower than the still block (or vice versa, I forget, search for liquid on the forum)
May 20, 201312 yr the flowing block id has to be one lower than the still id, also when you do public void registerIcons(IconRegister iconReg) { System.out.println(Main.modid + ":" + this.getUnlocalizedName()); this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)), iconReg.registerIcon(Main.modid + ":" + this.name.substring(0, 12)) }; } change it to public void registerIcons(IconRegister iconReg) { System.out.println(Main.modid + ":" + this.getUnlocalizedName()); this.theIcon = new Icon[] { iconReg.registerIcon(Main.modid + ":" + this.name.substring(5)), iconReg.registerIcon(Main.modid + ":" + this.name.substring(5)) }; }
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.