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:
Ursprung
4377eb6edb
Commit
71bc2b07ed
@ -861,7 +861,7 @@
|
|||||||
+ org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
|
+ org.bukkit.entity.Entity bukkitEntity = entity.getBukkitEntity();
|
||||||
+ Location enter = bukkitEntity.getLocation();
|
+ 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);
|
+ event.getEntity().getServer().getPluginManager().callEvent(event);
|
||||||
+ if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null || !entity.isAlive()) {
|
+ if (event.isCancelled() || event.getTo() == null || event.getTo().getWorld() == null || !entity.isAlive()) {
|
||||||
+ return null;
|
+ return null;
|
||||||
|
@ -19,8 +19,8 @@ public class CraftPortalEvent {
|
|||||||
to = portalEvent.getTo();
|
to = portalEvent.getTo();
|
||||||
searchRadius = portalEvent.getSearchRadius();
|
searchRadius = portalEvent.getSearchRadius();
|
||||||
cancelled = portalEvent.isCancelled();
|
cancelled = portalEvent.isCancelled();
|
||||||
creationRadius = 0;
|
creationRadius = portalEvent.getCreationRadius();
|
||||||
canCreatePortal = false;
|
canCreatePortal = portalEvent.getCanCreatePortal();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CraftPortalEvent(PlayerPortalEvent portalEvent) {
|
public CraftPortalEvent(PlayerPortalEvent portalEvent) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren