[1.12.x] Added BucketUse event to ForgeUniversal Bucket (#4454)
This commit is contained in:
parent
7a31b10364
commit
f97c535fa4
1 changed files with 4 additions and 0 deletions
|
@ -37,6 +37,7 @@ import net.minecraft.util.text.translation.I18n;
|
|||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
||||
import net.minecraftforge.event.ForgeEventFactory;
|
||||
import net.minecraftforge.fluids.capability.IFluidHandlerItem;
|
||||
import net.minecraftforge.fluids.capability.wrappers.FluidBucketWrapper;
|
||||
import net.minecraftforge.fml.common.eventhandler.Event;
|
||||
|
@ -160,6 +161,9 @@ public class UniversalBucket extends Item
|
|||
// clicked on a block?
|
||||
RayTraceResult mop = this.rayTrace(world, player, false);
|
||||
|
||||
ActionResult<ItemStack> ret = ForgeEventFactory.onBucketUse(player, world, itemstack, mop);
|
||||
if (ret != null) return ret;
|
||||
|
||||
if(mop == null || mop.typeOfHit != RayTraceResult.Type.BLOCK)
|
||||
{
|
||||
return ActionResult.newResult(EnumActionResult.PASS, itemstack);
|
||||
|
|
Loading…
Reference in a new issue