mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-26 11:08:02 +01:00
More compat for 1.14.
This commit is contained in:
parent
75bb0adbe6
commit
11c95861f9
@ -945,7 +945,7 @@ public void onBlockDispense(BlockDispenseEvent event) {
|
|||||||
@EventHandler(ignoreCancelled = true)
|
@EventHandler(ignoreCancelled = true)
|
||||||
public void onLingeringSplash(LingeringPotionSplashEvent event) {
|
public void onLingeringSplash(LingeringPotionSplashEvent event) {
|
||||||
AreaEffectCloud aec = event.getAreaEffectCloud();
|
AreaEffectCloud aec = event.getAreaEffectCloud();
|
||||||
LingeringPotion potion = event.getEntity();
|
ThrownPotion potion = event.getEntity();
|
||||||
World world = potion.getWorld();
|
World world = potion.getWorld();
|
||||||
Cause cause = create(event.getEntity());
|
Cause cause = create(event.getEntity());
|
||||||
|
|
||||||
|
@ -102,6 +102,9 @@ public WorldGuardEntityListener(WorldGuardPlugin plugin) {
|
|||||||
*/
|
*/
|
||||||
public void registerEvents() {
|
public void registerEvents() {
|
||||||
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
plugin.getServer().getPluginManager().registerEvents(this, plugin);
|
||||||
|
if (!EntityCreatePortalEvent.class.isAnnotationPresent(Deprecated.class)) {
|
||||||
|
plugin.getServer().getPluginManager().registerEvents(new UselessIn114Listener(), plugin);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
@ -666,15 +669,17 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
private static class UselessIn114Listener implements Listener {
|
||||||
public void onCreatePortal(EntityCreatePortalEvent event) {
|
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||||
ConfigurationManager cfg = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
|
public void onCreatePortal(EntityCreatePortalEvent event) {
|
||||||
WorldConfiguration wcfg = cfg.get(BukkitAdapter.adapt(event.getEntity().getWorld()));
|
ConfigurationManager cfg = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
|
||||||
|
WorldConfiguration wcfg = cfg.get(BukkitAdapter.adapt(event.getEntity().getWorld()));
|
||||||
|
|
||||||
switch (event.getEntityType()) {
|
switch (event.getEntityType()) {
|
||||||
case ENDER_DRAGON:
|
case ENDER_DRAGON:
|
||||||
if (wcfg.blockEnderDragonPortalCreation) event.setCancelled(true);
|
if (wcfg.blockEnderDragonPortalCreation) event.setCancelled(true);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -437,7 +437,11 @@ public void onPlayerPortal(PlayerPortalEvent event) {
|
|||||||
if (event.getCause() != TeleportCause.NETHER_PORTAL) {
|
if (event.getCause() != TeleportCause.NETHER_PORTAL) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!event.useTravelAgent()) { // either end travel (even though we checked cause) or another plugin is fucking with us, shouldn't create a portal though
|
try {
|
||||||
|
if (!event.useTravelAgent()) { // either end travel (even though we checked cause) or another plugin is fucking with us, shouldn't create a portal though
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} catch (NoSuchMethodError ignored) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TravelAgent pta = event.getPortalTravelAgent();
|
TravelAgent pta = event.getPortalTravelAgent();
|
||||||
|
@ -30,8 +30,11 @@ public ServerReport() {
|
|||||||
|
|
||||||
Server server = Bukkit.getServer();
|
Server server = Bukkit.getServer();
|
||||||
|
|
||||||
append("Server ID", server.getServerId());
|
try {
|
||||||
append("Server Name", server.getServerName());
|
append("Server ID", server.getServerId());
|
||||||
|
append("Server Name", server.getServerName());
|
||||||
|
} catch (NoSuchMethodError ignored) {
|
||||||
|
}
|
||||||
append("Bukkit Version", server.getBukkitVersion());
|
append("Bukkit Version", server.getBukkitVersion());
|
||||||
append("Implementation", server.getVersion());
|
append("Implementation", server.getVersion());
|
||||||
append("Player Count", "%d/%d", Bukkit.getOnlinePlayers().size(), server.getMaxPlayers());
|
append("Player Count", "%d/%d", Bukkit.getOnlinePlayers().size(), server.getMaxPlayers());
|
||||||
|
Loading…
Reference in New Issue
Block a user