mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-22 10:36:06 +01:00
Fix Portals being blocked in End
This Fixes #463 This is caused by a bug in Bukkit/Bukkit@b2364780cb see line 38 of EntityCreatePortalEvent
This commit is contained in:
parent
a9c6582487
commit
6a2e0e5810
@ -40,7 +40,10 @@ public class MVPortalListener implements Listener {
|
||||
return;
|
||||
}
|
||||
MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getBlocks().get(0).getWorld());
|
||||
event.setCancelled(this.cancelPortalEvent(world, event.getPortalType()));
|
||||
// We have to do it like this due to a bug in 1.1-R3
|
||||
if (this.cancelPortalEvent(world, event.getPortalType())) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -56,13 +59,17 @@ public class MVPortalListener implements Listener {
|
||||
for (Block b : event.getBlocks()) {
|
||||
if (b.getType() == Material.PORTAL) {
|
||||
MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(b.getWorld());
|
||||
event.setCancelled(this.cancelPortalEvent(world, PortalType.NETHER));
|
||||
return;
|
||||
if (this.cancelPortalEvent(world, PortalType.NETHER)) {
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If We're here, then the Portal was an Ender type:
|
||||
MultiverseWorld world = this.plugin.getMVWorldManager().getMVWorld(event.getBlocks().get(0).getWorld());
|
||||
event.setCancelled(this.cancelPortalEvent(world, PortalType.ENDER));
|
||||
if (this.cancelPortalEvent(world, PortalType.ENDER)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean cancelPortalEvent(MultiverseWorld world, PortalType type) {
|
||||
|
Loading…
Reference in New Issue
Block a user