Skip to content

Commit

Permalink
SPIGOT-7827: Sync EntityPortalEvent with PlayerPortalEvent since non-…
Browse files Browse the repository at this point in the history
…players can now create portals
  • Loading branch information
md-5 committed Jul 10, 2024
1 parent 2444c8b commit bed1e3f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nms-patches/net/minecraft/world/entity/Entity.patch
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ public CraftPortalEvent(EntityPortalEvent portalEvent) {
to = portalEvent.getTo();
searchRadius = portalEvent.getSearchRadius();
cancelled = portalEvent.isCancelled();
creationRadius = 0;
canCreatePortal = false;
creationRadius = portalEvent.getCreationRadius();
canCreatePortal = portalEvent.getCanCreatePortal();
}

public CraftPortalEvent(PlayerPortalEvent portalEvent) {
Expand Down

0 comments on commit bed1e3f

Please sign in to comment.