From 4eb05ed5716085784c8ea0c29747f97d5b6ad2ae Mon Sep 17 00:00:00 2001 From: Christian Date: Wed, 28 Aug 2013 22:16:59 -0400 Subject: [PATCH] Small fix to container registry. emptyContainer is not null, it's "NULL_EMPTYCONTAINER" now and won't match any valid container. --- .../net/minecraftforge/fluids/FluidContainerRegistry.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/net/minecraftforge/fluids/FluidContainerRegistry.java b/common/net/minecraftforge/fluids/FluidContainerRegistry.java index cf37e565bf..64f8bff4a4 100644 --- a/common/net/minecraftforge/fluids/FluidContainerRegistry.java +++ b/common/net/minecraftforge/fluids/FluidContainerRegistry.java @@ -31,6 +31,7 @@ public abstract class FluidContainerRegistry public static final int BUCKET_VOLUME = 1000; public static final ItemStack EMPTY_BUCKET = new ItemStack(Item.bucketEmpty); public static final ItemStack EMPTY_BOTTLE = new ItemStack(Item.glassBottle); + private static final ItemStack NULL_EMPTYCONTAINER = new ItemStack(Item.bucketEmpty); static { @@ -126,7 +127,7 @@ public abstract class FluidContainerRegistry } containerFluidMap.put(Arrays.asList(data.filledContainer.itemID, data.filledContainer.getItemDamage()), data); - if (data.emptyContainer != null) + if (data.emptyContainer != null && data.emptyContainer != NULL_EMPTYCONTAINER) { filledContainerMap.put(Arrays.asList(data.emptyContainer.itemID, data.emptyContainer.getItemDamage(), data.fluid.fluidID), data); emptyContainers.add(Arrays.asList(data.emptyContainer.itemID, data.emptyContainer.getItemDamage())); @@ -240,6 +241,7 @@ public abstract class FluidContainerRegistry public final ItemStack filledContainer; public final ItemStack emptyContainer; + public FluidContainerData(FluidStack stack, ItemStack filledContainer, ItemStack emptyContainer) { this(stack, filledContainer, emptyContainer, false); @@ -249,7 +251,7 @@ public abstract class FluidContainerRegistry { this.fluid = stack; this.filledContainer = filledContainer; - this.emptyContainer = emptyContainer; + this.emptyContainer = emptyContainer == null ? NULL_EMPTYCONTAINER : emptyContainer; if (stack == null || filledContainer == null || emptyContainer == null && !nullEmpty) {