diff options
author | FearThe1337 <admin@fearthe1337.com> | 2015-02-15 12:24:14 +1100 |
---|---|---|
committer | md_5 <git@md-5.net> | 2015-02-15 12:24:14 +1100 |
commit | 116514c162035ff7fd99e97fe70b7af9f055ec6d (patch) | |
tree | a828a7c4c250c63adff1402c3e17992ce1ada43a /nms-patches | |
parent | 9648edfa6136394153d524fa89c347d86f455641 (diff) | |
download | craftbukkit-116514c162035ff7fd99e97fe70b7af9f055ec6d.tar craftbukkit-116514c162035ff7fd99e97fe70b7af9f055ec6d.tar.gz craftbukkit-116514c162035ff7fd99e97fe70b7af9f055ec6d.tar.lz craftbukkit-116514c162035ff7fd99e97fe70b7af9f055ec6d.tar.xz craftbukkit-116514c162035ff7fd99e97fe70b7af9f055ec6d.zip |
Implement armor stand event.
Diffstat (limited to 'nms-patches')
-rw-r--r-- | nms-patches/EntityArmorStand.patch | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/nms-patches/EntityArmorStand.patch b/nms-patches/EntityArmorStand.patch index 07de6e30..622528ba 100644 --- a/nms-patches/EntityArmorStand.patch +++ b/nms-patches/EntityArmorStand.patch @@ -1,6 +1,45 @@ ---- ../work/decompile-8eb82bde/net/minecraft/server/EntityArmorStand.java 2015-02-01 18:12:22.718390345 +1100 -+++ src/main/java/net/minecraft/server/EntityArmorStand.java 2015-02-01 18:12:22.718390345 +1100 -@@ -343,6 +343,11 @@ +--- ../work/decompile-8eb82bde/net/minecraft/server/EntityArmorStand.java 2015-02-15 12:22:56.729511128 +1100 ++++ src/main/java/net/minecraft/server/EntityArmorStand.java 2015-02-15 12:22:56.729511128 +1100 +@@ -2,6 +2,15 @@ + + import java.util.List; + ++// CraftBukkit start ++import org.bukkit.EquipmentSlot; ++import org.bukkit.craftbukkit.CraftEquipmentSlot; ++import org.bukkit.craftbukkit.inventory.CraftItemStack; ++import org.bukkit.entity.ArmorStand; ++import org.bukkit.entity.Player; ++import org.bukkit.event.player.PlayerArmorStandManipulateEvent; ++// CraftBukkit end ++ + public class EntityArmorStand extends EntityLiving { + + private static final Vector3f a = new Vector3f(0.0F, 0.0F, 0.0F); +@@ -323,6 +332,22 @@ + ItemStack itemstack1 = entityhuman.inventory.getItem(j); + ItemStack itemstack2; + ++ // CraftBukkit start ++ org.bukkit.inventory.ItemStack armorStandItem = CraftItemStack.asCraftMirror(itemstack); ++ org.bukkit.inventory.ItemStack playerHeldItem = CraftItemStack.asCraftMirror(itemstack1); ++ ++ Player player = (Player) entityhuman.getBukkitEntity(); ++ ArmorStand self = (ArmorStand) this.getBukkitEntity(); ++ ++ EquipmentSlot slot = CraftEquipmentSlot.getSlot(i); ++ PlayerArmorStandManipulateEvent armorStandManipulateEvent = new PlayerArmorStandManipulateEvent(player,self,playerHeldItem,armorStandItem,slot); ++ this.world.getServer().getPluginManager().callEvent(armorStandManipulateEvent); ++ ++ if (armorStandManipulateEvent.isCancelled()) { ++ return; ++ } ++ // CraftBukkit end ++ + if (entityhuman.abilities.canInstantlyBuild && (itemstack == null || itemstack.getItem() == Item.getItemOf(Blocks.AIR)) && itemstack1 != null) { + itemstack2 = itemstack1.cloneItemStack(); + itemstack2.count = 1; +@@ -343,6 +368,11 @@ } public boolean damageEntity(DamageSource damagesource, float f) { @@ -12,7 +51,7 @@ if (!this.world.isStatic && !this.h) { if (DamageSource.OUT_OF_WORLD.equals(damagesource)) { this.die(); -@@ -542,6 +547,8 @@ +@@ -542,6 +572,8 @@ } this.datawatcher.watch(10, Byte.valueOf(b0)); |