Posted September 8, 201510 yr I don't understand why I'm getting this error. My fluid is registered. Why is this happening? This is the method I'm using to register everything. It works perfectly fine until I add the fluid there, doesn't matter if it comes before or after everything else. public static void init() { FluidRegistry.registerFluid(honey); for (int i = 0; i < items.length; i++) { GameRegistry.registerItem(items[i], items[i].getUnlocalizedName()); } for (int i = 0; i < blocks.length; i++) { GameRegistry.registerBlock(blocks[i], blocks[i].getUnlocalizedName()); } } And this is how it's registered in the blocks array: honey_fluid = new HoneyClassic("honey_fluid", honey, Material.water),
September 8, 201510 yr Author Didn't see that... Okay, well that fixes the texture. But I'm still getting the same exact error.
September 9, 201510 yr Author I used this site's own tutorial to try to do this. Inside the preInit() of the main class is: CoreRegistry.init() Inside CoreRegistry (leaving all unrelated things out) is this: public static Fluid honey = new Fluid("honey").setViscosity(6500); public static Block honey_fluid; public static Block[] blocks = { honey_fluid = new HoneyClassic("honey", honey, Material.water), }; public static void init() { honey.setBlock(honey_fluid); FluidRegistry.registerFluid(honey); for (int i = 0; i < blocks.length; i++) { GameRegistry.registerBlock(blocks[i], blocks[i].getUnlocalizedName()); } } Inside HoneyClassic is this: public class HoneyClassic extends BlockFluidClassic { private String name; @SideOnly(Side.CLIENT) protected IIcon stillIcon; @SideOnly(Side.CLIENT) protected IIcon flowingIcon; public HoneyClassic(String name, Fluid fluid, Material material) { super(fluid, material); this.name = name; this.setCreativeTab(CoreTabs.core); this.setBlockName(name); } @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess par1IBlockAccess, int par2, int par3, int par4) { return Tools.getColour("gold", 2); } @Override public IIcon getIcon(int side, int meta) { return (side == 0 || side == 1) ? stillIcon : flowingIcon; } @SideOnly(Side.CLIENT) @Override public void registerBlockIcons(IIconRegister register) { stillIcon = register.registerIcon(Tools.get(name + "_still")); flowingIcon = register.registerIcon(Tools.get(name + "_flowing")); } @Override public boolean canDisplace(IBlockAccess world, int x, int y, int z) { if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false; return super.canDisplace(world, x, y, z); } @Override public boolean displaceIfPossible(World world, int x, int y, int z) { if (world.getBlock(x, y, z).getMaterial().isLiquid()) return false; return super.displaceIfPossible(world, x, y, z); } }
September 9, 201510 yr See this bit here? See how it occurs after this bit here? Yeah, they need to be reversed. This is why you do not define your blocks, items, and fluids outside of a method. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.