mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 10:06:11 +03:00
33 lines
1.5 KiB
Diff
33 lines
1.5 KiB
Diff
--- ../src-base/minecraft/net/minecraft/item/ItemHangingEntity.java
|
|
+++ ../src-work/minecraft/net/minecraft/item/ItemHangingEntity.java
|
|
@@ -1,6 +1,10 @@
|
|
package net.minecraft.item;
|
|
|
|
import javax.annotation.Nullable;
|
|
+
|
|
+import org.bukkit.entity.Player;
|
|
+import org.bukkit.event.hanging.HangingPlaceEvent;
|
|
+
|
|
import net.minecraft.creativetab.CreativeTabs;
|
|
import net.minecraft.entity.EntityHanging;
|
|
import net.minecraft.entity.item.EntityItemFrame;
|
|
@@ -34,6 +38,18 @@
|
|
{
|
|
if (!worldIn.isRemote)
|
|
{
|
|
+ // CraftBukkit start - fire HangingPlaceEvent
|
|
+ Player who = (playerIn == null) ? null : (Player) playerIn.getBukkitEntity();
|
|
+ org.bukkit.block.Block blockClicked = worldIn.getWorld().getBlockAt(pos.getX(), pos.getY(), pos.getZ());
|
|
+ org.bukkit.block.BlockFace blockFace = org.bukkit.craftbukkit.block.CraftBlock.notchToBlockFace(facing);
|
|
+
|
|
+ HangingPlaceEvent event = new HangingPlaceEvent((org.bukkit.entity.Hanging) entityhanging.getBukkitEntity(), who, blockClicked, blockFace);
|
|
+ worldIn.getServer().getPluginManager().callEvent(event);
|
|
+
|
|
+ if (event.isCancelled()) {
|
|
+ return EnumActionResult.FAIL;
|
|
+ }
|
|
+ // CraftBukkit end
|
|
entityhanging.playPlaceSound();
|
|
worldIn.spawnEntityInWorld(entityhanging);
|
|
}
|