13
0
geforkt von Mirrors/Paper

SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-players can now create portals

By: md_5 <git@md-5.net>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2024-07-10 19:43:43 +10:00
Ursprung 4377eb6edb
Commit 71bc2b07ed
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -861,7 +861,7 @@
+ org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
+ Location enter = bukkitEntity.getLocation();
+
+ EntityPortalEvent event = new EntityPortalEvent(bukkitEntity, enter, exit, searchRadius);
+ EntityPortalEvent event = new EntityPortalEvent(bukkitEntity, enter, exit, searchRadius, true, creationRadius);
+ event.getEntity().getServer().getPluginManager().callEvent(event);
+ if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null || !entity.isAlive()) {
+ return null;

Datei anzeigen

@ -19,8 +19,8 @@ public class CraftPortalEvent {
to = portalEvent.getTo();
searchRadius = portalEvent.getSearchRadius();
cancelled = portalEvent.isCancelled();
creationRadius = 0;
canCreatePortal = false;
creationRadius = portalEvent.getCreationRadius();
canCreatePortal = portalEvent.getCanCreatePortal();
}
public CraftPortalEvent(PlayerPortalEvent portalEvent) {