Fix legacy handling for ItemBucket subclasses and non-universal buckets (#3038)
This commit is contained in:
parent
1871cf1b02
commit
1a8ad6bbee
1 changed files with 16 additions and 2 deletions
|
@ -9,13 +9,27 @@
|
|||
|
||||
if (raytraceresult == null)
|
||||
{
|
||||
@@ -175,4 +177,9 @@
|
||||
@@ -175,4 +177,23 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
+
|
||||
+ @Override
|
||||
+ public net.minecraftforge.common.capabilities.ICapabilityProvider initCapabilities(ItemStack stack, net.minecraft.nbt.NBTTagCompound nbt) {
|
||||
+ return new net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper(stack);
|
||||
+ if (this.getClass() == ItemBucket.class)
|
||||
+ {
|
||||
+ if (net.minecraftforge.fluids.FluidRegistry.isUniversalBucketEnabled())
|
||||
+ {
|
||||
+ return new net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper(stack);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return new net.minecraftforge.fluids.capability.wrappers.FluidContainerRegistryWrapper(stack); // when fluid container registry is gone, just use FluidBucketWrapper
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return super.initCapabilities(stack, nbt);
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue