Skip to content
This repository has been archived by the owner on Mar 10, 2021. It is now read-only.

Commit

Permalink
Fix buckets not being destroyed when placing hot liquid in a tank. Cl…
Browse files Browse the repository at this point in the history
…ay buckets cannot pick up liquids from tanks, because Forge is unable to recognize it as a bucket...
  • Loading branch information
bonii-xx committed Aug 4, 2014
1 parent 8ebe966 commit ed5d068
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
Expand Up @@ -27,12 +27,16 @@ public ClayBucket(Block contents, String name, String texture)
public ClayBucket(Block contents)
{
super(contents);
this.setContainerItem(iguanaman.iguanatweakstconstruct.claybuckets.IguanaItems.clayBucketFired);

if(contents == Blocks.flowing_lava)
{
isHot = true;
else
this.setContainerItem(null);
}
else {
isHot = false;
this.setContainerItem(IguanaItems.clayBucketFired);
}
}


Expand Down
Expand Up @@ -19,20 +19,11 @@
import tconstruct.smeltery.items.FilledBucket;

public class ClayBucketTinkerLiquids extends FilledBucket {
private final boolean isHot;

public ClayBucketTinkerLiquids(Block b) {
super(b);

this.setUnlocalizedName(Reference.prefix("clayBucket"));
this.setContainerItem(IguanaItems.clayBucketFired);

// all fluids above 1000° are hot. Lava has 1300.
Fluid fluid = FluidRegistry.lookupFluidForBlock(b);
if(fluid == null)
isHot = false;
else
isHot = fluid.getTemperature() >= 1000;
this.setContainerItem(null);
}

@Override
Expand All @@ -41,15 +32,8 @@ public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer

if(result.getItem() == Items.bucket)
{
FluidStack fluidStack = FluidContainerRegistry.getFluidForFilledItem(itemStack);
// bucket is destroyed if it's a hot fluid
if(fluidStack != null && fluidStack.getFluid().getTemperature() >= 1000)
{
itemStack.stackSize--;
return itemStack;
}

return new ItemStack(IguanaItems.clayBucketFired);
itemStack.stackSize--;
return itemStack;
}
return result;
}
Expand Down

0 comments on commit ed5d068

Please sign in to comment.