summaryrefslogtreecommitdiffstats
path: root/nms-patches/EntityVillager.patch
diff options
context:
space:
mode:
Diffstat (limited to 'nms-patches/EntityVillager.patch')
-rw-r--r--nms-patches/EntityVillager.patch24
1 files changed, 19 insertions, 5 deletions
diff --git a/nms-patches/EntityVillager.patch b/nms-patches/EntityVillager.patch
index 6cfcdfc5..7d9705c9 100644
--- a/nms-patches/EntityVillager.patch
+++ b/nms-patches/EntityVillager.patch
@@ -1,21 +1,23 @@
--- a/net/minecraft/server/EntityVillager.java
+++ b/net/minecraft/server/EntityVillager.java
-@@ -7,6 +7,14 @@
+@@ -7,6 +7,16 @@
import javax.annotation.Nullable;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
+// CraftBukkit start
+import org.bukkit.Bukkit;
+import org.bukkit.craftbukkit.entity.CraftVillager;
++import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe;
+import org.bukkit.entity.Villager;
++import org.bukkit.event.entity.EntityTransformEvent;
+import org.bukkit.event.entity.VillagerAcquireTradeEvent;
+import org.bukkit.event.entity.VillagerReplenishTradeEvent;
+// CraftBukkit end
public class EntityVillager extends EntityAgeable implements NPC, IMerchant {
-@@ -38,7 +46,7 @@
+@@ -38,7 +48,7 @@
public EntityVillager(World world, int i) {
super(EntityTypes.VILLAGER, world);
@@ -24,7 +26,7 @@
this.setProfession(i);
this.setSize(0.6F, 1.95F);
((Navigation) this.getNavigation()).a(true);
-@@ -120,7 +128,14 @@
+@@ -120,7 +130,14 @@
MerchantRecipe merchantrecipe = (MerchantRecipe) iterator.next();
if (merchantrecipe.h()) {
@@ -40,7 +42,7 @@
}
}
-@@ -132,7 +147,7 @@
+@@ -132,7 +149,7 @@
}
}
@@ -49,7 +51,7 @@
}
}
-@@ -434,7 +449,20 @@
+@@ -434,7 +451,20 @@
for (int l = 0; l < k; ++l) {
EntityVillager.IMerchantRecipeOption entityvillager_imerchantrecipeoption = aentityvillager_imerchantrecipeoption3[l];
@@ -71,3 +73,15 @@
}
}
+@@ -574,6 +604,11 @@
+ entitywitch.setCustomNameVisible(this.getCustomNameVisible());
+ }
+
++ // CraftBukkit start
++ if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) {
++ return;
++ }
++ // CraftBukkit end
+ this.world.addEntity(entitywitch);
+ this.die();
+ }