Jump to content

Godis_apan

Members
  • Posts

    109
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Godis_apan

  1. Why do you init the renderers inside the config.load() and config.save(), seems stupid. @Override public void initClient() { config = new Configuration(new File("./config/Legions/Client.cfg"), true); config.load(); loadConfigurations(); config.save(); addKeys(); addEvents(); addRenders(); } That would make more sense for me. I dont know if that affects the renderers, tell me if it does, other wise I will look through your code more carefully.
  2. This could work for example. So this makes sure it always drops one item. Then it add a random int (fortune + 2). If you want less, remove the "2 + ". public int quantityDropped(int meta, int fortune, Random random) { return 1 + random.nextInt(2 + fortune); }
  3. I've also noticed that the fillFluidContainer(FluidStack fluid, ItemStack container) also returns null, is this an error/problem on my side of coding or does the Forge code simply not work. Would be grateful for any answer.
  4. If you need a method that ticks all the time, use updateEntity() provided in the TileEntity. That ticks all the time and you get access to the world from the worldObj in the TileEntity. This method is commonly used to make blocks have a cool down or a progress bar. If you need access to the block just use worldObj.getBlockId(x, y, z) (worldObj.getBlock(x, y, z) in 1.7.2).
  5. So I was playing around with fluids in guis and when I try to put a fluid into a tank using the method from the FluidContainerRegistry, it always returns null. Even if I put a water bucket or a lava bucket. If I try to put in a fluid without using that method, just defining one like: FluidStack fluid = new FluidStack(Mod.fluid, bucketSize); it works, but not when I'm using the method to get the the fluid out of the bucket. TileEntity Code: (The only important part is updateEntity(), all other code works fine and is tested, so I'm just posting that method) @Override public void updateEntity() { FluidStack fluid = tank.getFluid(); int bucketSize = FluidContainerRegistry.BUCKET_VOLUME; if (!worldObj.isRemote) { ItemStack stack = items[0]; if (stack != null) { FluidStack liquid = null; if (stack.getItem().getContainerItem() != null) { liquid = FluidContainerRegistry.getFluidForFilledItem(stack); } if (liquid != null) { if (fill(ForgeDirection.UNKNOWN, liquid, false) == liquid.amount) { fill(ForgeDirection.UNKNOWN, liquid, true); setInventorySlotContents(0, consumeItem(stack)); //consumes the item (for method look down below) } } } if (items[1] != null) { if (FluidContainerRegistry.isBucket(items[1])) { if (tank.getFluid() != null) { if (tank.getFluidAmount() >= bucketSize) { setInventorySlotContents(1, FluidContainerRegistry.fillFluidContainer(tank.getFluid(), items[1])); drain(ForgeDirection.UNKNOWN, tank.getFluid(), bucketSize, true); } } } } } } I've got two slots; one for filling and one for draining a bucket. The drain() and fill() methods are both working, there is nothing wrong there. consumeItem(ItemStack stack): public static ItemStack consumeItem(ItemStack stack) { if (stack.stackSize == 1) { if (stack.getItem().getContainerItem() != null) { return stack.getItem().getContainerItem(stack); } else { return null; } } else { stack.splitStack(1); return stack; } } Thanks for any help!
  6. I belive RailCraft overwrote the vanilla rails with the itemList[] that existed in 1.6.4. But since that registered items/itemblocks using ID's it was removed in the update. Therefor that wouldn't work in 1.7.4. So we have to wait for cpw's amazing wonders of awesomeness
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.