Fix wrong world being passed into portal event (#8174)

This commit is contained in:
Jake Potrebic 2022-07-22 17:42:34 -07:00 committed by GitHub
parent 4952c04610
commit 1a8bea734a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -5,7 +5,7 @@ Subject: [PATCH] Add EntityPortalReadyEvent
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
index 19a64b582bc042e426220e080d9c21b3a82cf3f7..cff8490a2f08215fdd8c5d819ec76cafd8a8cb90 100644 index 19a64b582bc042e426220e080d9c21b3a82cf3f7..76b9beb0d8ebeee0f603d2740ba71beabbf19e25 100644
--- a/src/main/java/net/minecraft/world/entity/Entity.java --- a/src/main/java/net/minecraft/world/entity/Entity.java
+++ b/src/main/java/net/minecraft/world/entity/Entity.java +++ b/src/main/java/net/minecraft/world/entity/Entity.java
@@ -2856,6 +2856,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource { @@ -2856,6 +2856,13 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource {
@ -13,7 +13,7 @@ index 19a64b582bc042e426220e080d9c21b3a82cf3f7..cff8490a2f08215fdd8c5d819ec76caf
this.level.getProfiler().push("portal"); this.level.getProfiler().push("portal");
this.portalTime = i; this.portalTime = i;
+ // Paper start + // Paper start
+ io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver.getWorld(), org.bukkit.PortalType.NETHER); + io.papermc.paper.event.entity.EntityPortalReadyEvent event = new io.papermc.paper.event.entity.EntityPortalReadyEvent(this.getBukkitEntity(), worldserver1 == null ? null : worldserver1.getWorld(), org.bukkit.PortalType.NETHER);
+ if (!event.callEvent()) { + if (!event.callEvent()) {
+ this.portalTime = 0; + this.portalTime = 0;
+ } else { + } else {