Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
63 Zeilen
4.9 KiB
Diff
63 Zeilen
4.9 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Anthony MacAllister <anthonymmacallister@gmail.com>
|
|
Date: Thu, 26 Jul 2018 15:30:03 -0400
|
|
Subject: [PATCH] EntityTransformedEvent
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/EntityMushroomCow.java b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
|
index 1d96ecb2fda1b567866f620b183a5811f75fa7f2..8b199971bd67a196168afb2e63d4c72919fec8d2 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityMushroomCow.java
|
|
@@ -112,6 +112,7 @@ public class EntityMushroomCow extends EntityCow {
|
|
if (CraftEventFactory.callEntityTransformEvent(this, entitycow, EntityTransformEvent.TransformReason.SHEARED).isCancelled()) {
|
|
return false;
|
|
}
|
|
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitycow.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.SHEARED).callEvent()) return false; // Paper
|
|
this.world.addEntity(entitycow, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.SHEARED);
|
|
|
|
this.die(); // CraftBukkit - from above
|
|
diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java
|
|
index 6ca4fa43c41ad555c093b90cf08cfdb1e73fda22..6e0020ae0b4d2f2597843129b83fff0d194de337 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityVillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityVillager.java
|
|
@@ -699,6 +699,7 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation
|
|
if (CraftEventFactory.callEntityTransformEvent(this, entitywitch, EntityTransformEvent.TransformReason.LIGHTNING).isCancelled()) {
|
|
return;
|
|
}
|
|
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entitywitch.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.LIGHTNING).callEvent()) return; // Paper
|
|
this.world.addEntity(entitywitch, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.LIGHTNING);
|
|
// CraftBukkit end
|
|
this.die();
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
index 83d5731b7f964136edf7cfabb96421e0788d067a..97a1dedf7460d513a560d722b2e0f1bf09fe669c 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombie.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombie.java
|
|
@@ -257,6 +257,7 @@ public class EntityZombie extends EntityMonster {
|
|
return;
|
|
}
|
|
// CraftBukkit end
|
|
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entityzombie.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.DROWNED).callEvent()) return; // Paper
|
|
this.world.addEntity(entityzombie, CreatureSpawnEvent.SpawnReason.DROWNED); // CraftBukkit - added spawn reason
|
|
this.die();
|
|
}
|
|
@@ -463,6 +464,7 @@ public class EntityZombie extends EntityMonster {
|
|
if (CraftEventFactory.callEntityTransformEvent(this, entityzombievillager, EntityTransformEvent.TransformReason.INFECTION).isCancelled()) {
|
|
return;
|
|
}
|
|
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entityvillager.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.INFECTED).callEvent()) return; // Paper
|
|
entityvillager.die(); // CraftBukkit - from above
|
|
this.world.addEntity(entityzombievillager, CreatureSpawnEvent.SpawnReason.INFECTION); // CraftBukkit - add SpawnReason
|
|
// CraftBukkit end
|
|
diff --git a/src/main/java/net/minecraft/server/EntityZombieVillager.java b/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
index 5c2d132c3a495650c5c279065e6659a88de0421d..b1818d269a78b6cb5594dd2f21c91ab1452649f7 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityZombieVillager.java
|
|
@@ -197,6 +197,7 @@ public class EntityZombieVillager extends EntityZombie implements VillagerDataHo
|
|
((ZombieVillager) getBukkitEntity()).setConversionTime(-1); // SPIGOT-5208: End conversion to stop event spam
|
|
return;
|
|
}
|
|
+ if (!new com.destroystokyo.paper.event.entity.EntityTransformedEvent(this.getBukkitEntity(), entityvillager.getBukkitEntity(), com.destroystokyo.paper.event.entity.EntityTransformedEvent.TransformedReason.CURED).callEvent()) return; // Paper
|
|
this.die(); // CraftBukkit - from above
|
|
worldserver.addEntity(entityvillager, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.CURED); // CraftBukkit - add SpawnReason
|
|
// CraftBukkit end
|