mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-26 02:57:42 +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)
|
||||
public void onLingeringSplash(LingeringPotionSplashEvent event) {
|
||||
AreaEffectCloud aec = event.getAreaEffectCloud();
|
||||
LingeringPotion potion = event.getEntity();
|
||||
ThrownPotion potion = event.getEntity();
|
||||
World world = potion.getWorld();
|
||||
Cause cause = create(event.getEntity());
|
||||
|
||||
|
@ -102,6 +102,9 @@ public WorldGuardEntityListener(WorldGuardPlugin plugin) {
|
||||
*/
|
||||
public void registerEvents() {
|
||||
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)
|
||||
@ -666,6 +669,7 @@ public void onCreatureSpawn(CreatureSpawnEvent event) {
|
||||
}
|
||||
}
|
||||
|
||||
private static class UselessIn114Listener implements Listener {
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onCreatePortal(EntityCreatePortalEvent event) {
|
||||
ConfigurationManager cfg = WorldGuard.getInstance().getPlatform().getGlobalStateManager();
|
||||
@ -677,6 +681,7 @@ public void onCreatePortal(EntityCreatePortalEvent event) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGH, ignoreCancelled = true)
|
||||
public void onPigZap(PigZapEvent event) {
|
||||
|
@ -437,9 +437,13 @@ public void onPlayerPortal(PlayerPortalEvent event) {
|
||||
if (event.getCause() != TeleportCause.NETHER_PORTAL) {
|
||||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
TravelAgent pta = event.getPortalTravelAgent();
|
||||
if (pta == null) { // possible, but shouldn't create a portal
|
||||
return;
|
||||
|
@ -30,8 +30,11 @@ public ServerReport() {
|
||||
|
||||
Server server = Bukkit.getServer();
|
||||
|
||||
try {
|
||||
append("Server ID", server.getServerId());
|
||||
append("Server Name", server.getServerName());
|
||||
} catch (NoSuchMethodError ignored) {
|
||||
}
|
||||
append("Bukkit Version", server.getBukkitVersion());
|
||||
append("Implementation", server.getVersion());
|
||||
append("Player Count", "%d/%d", Bukkit.getOnlinePlayers().size(), server.getMaxPlayers());
|
||||
|
Loading…
Reference in New Issue
Block a user