Merge pull request #1470 from fabricator77/BuildCraft-5.0.x

Restore bucket handler so empty buckets fill correctly.
This commit is contained in:
SpaceToad 2014-03-19 18:19:03 +01:00
commit 7bee2a9717
2 changed files with 5 additions and 6 deletions

View file

@ -186,11 +186,10 @@ public class BuildCraftEnergy extends BuildCraftMod {
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("fuel", FluidContainerRegistry.BUCKET_VOLUME), new ItemStack(bucketFuel), new ItemStack(Items.bucket));
}
// TODO: Are these still really necessary? If not, remove the
// BucketHandler class as well.
//BucketHandler.INSTANCE.buckets.put(blockOil, bucketOil);
//BucketHandler.INSTANCE.buckets.put(blockFuel, bucketFuel);
//MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
// BucketHandler ensures empty buckets fill with the correct liquid.
BucketHandler.INSTANCE.buckets.put(blockOil, bucketOil);
BucketHandler.INSTANCE.buckets.put(blockFuel, bucketFuel);
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
BuildcraftRecipes.refinery.addRecipe(new FluidStack(fluidOil, 1), new FluidStack(fluidFuel, 1), 12, 1);

View file

@ -46,7 +46,7 @@ public class BucketHandler {
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos) {
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
Item bucket = Item.getItemFromBlock(block);
Item bucket = buckets.get(block);
if (bucket != null && world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0) {
world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);