SPIGOT-7997: Cancelling EntityTransformEvent does not reset StrayConversionTime
This commit is contained in:
parent
8da2a0a646
commit
21d34ea471
@ -1,11 +1,22 @@
|
||||
--- a/net/minecraft/world/entity/monster/EntitySkeleton.java
|
||||
+++ b/net/minecraft/world/entity/monster/EntitySkeleton.java
|
||||
@@ -99,7 +99,7 @@
|
||||
@@ -94,12 +94,17 @@
|
||||
}
|
||||
|
||||
protected void doFreezeConversion() {
|
||||
- this.convertTo(EntityTypes.STRAY, ConversionParams.single(this, true, true), (entityskeletonstray) -> {
|
||||
+ net.minecraft.world.entity.monster.EntitySkeletonStray converted = this.convertTo(EntityTypes.STRAY, ConversionParams.single(this, true, true), (entityskeletonstray) -> { // CraftBukkit
|
||||
if (!this.isSilent()) {
|
||||
this.level().levelEvent((EntityHuman) null, 1048, this.blockPosition(), 0);
|
||||
}
|
||||
|
||||
- });
|
||||
+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.FROZEN, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.FROZEN); // CraftBukkit - add spawn and transform reasons
|
||||
+ // CraftBukkit start
|
||||
+ }, org.bukkit.event.entity.EntityTransformEvent.TransformReason.FROZEN, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.FROZEN);
|
||||
+ if (converted == null) {
|
||||
+ ((org.bukkit.entity.Skeleton) getBukkitEntity()).setConversionTime(-1); // CraftBukkit - SPIGOT-7997: End conversion to stop event spam
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
x
Reference in New Issue
Block a user