Removes Lingering Splash Potion protection from 1.14 for now.

Will be put back in when we move to 1.14 officially.

https://github.com/BentoBoxWorld/BentoBox/issues/810
This commit is contained in:
tastybento 2019-07-13 22:37:27 -07:00
parent e284a6b57a
commit 6bbe9a3f2a

View File

@ -25,6 +25,7 @@ import world.bentobox.bentobox.api.flags.Flag;
import world.bentobox.bentobox.api.flags.FlagListener; import world.bentobox.bentobox.api.flags.FlagListener;
import world.bentobox.bentobox.lists.Flags; import world.bentobox.bentobox.lists.Flags;
import world.bentobox.bentobox.util.Util; import world.bentobox.bentobox.util.Util;
import world.bentobox.bentobox.versions.ServerCompatibility;
/** /**
@ -84,8 +85,8 @@ public class HurtingListener extends FlagListener {
} }
if ((Util.isPassiveEntity(e.getCaught()) && checkIsland(e, e.getPlayer(), e.getCaught().getLocation(), Flags.HURT_ANIMALS)) if ((Util.isPassiveEntity(e.getCaught()) && checkIsland(e, e.getPlayer(), e.getCaught().getLocation(), Flags.HURT_ANIMALS))
|| (Util.isHostileEntity(e.getCaught()) && checkIsland(e, e.getPlayer(), e.getCaught().getLocation(), Flags.HURT_MONSTERS)) || (Util.isHostileEntity(e.getCaught()) && checkIsland(e, e.getPlayer(), e.getCaught().getLocation(), Flags.HURT_MONSTERS))
|| (e.getCaught() instanceof Villager && checkIsland(e, e.getPlayer(), e.getCaught().getLocation(), Flags.HURT_VILLAGERS))) { || (e.getCaught() instanceof Villager && checkIsland(e, e.getPlayer(), e.getCaught().getLocation(), Flags.HURT_VILLAGERS))) {
e.getHook().remove(); e.getHook().remove();
} }
@ -154,6 +155,12 @@ public class HurtingListener extends FlagListener {
*/ */
@EventHandler(priority = EventPriority.LOW, ignoreCancelled=true) @EventHandler(priority = EventPriority.LOW, ignoreCancelled=true)
public void onLingeringPotionSplash(final LingeringPotionSplashEvent e) { public void onLingeringPotionSplash(final LingeringPotionSplashEvent e) {
// TODO Switch this to 1.13 when we move to 1.14 officially
if (!ServerCompatibility.getInstance().isVersion(ServerCompatibility.ServerVersion.V1_14, ServerCompatibility.ServerVersion.V1_14_1)) {
// We're disabling this check for non-1.14 servers.
return;
}
// Try to get the shooter // Try to get the shooter
Projectile projectile = e.getEntity(); Projectile projectile = e.getEntity();
if (projectile.getShooter() instanceof Player) { if (projectile.getShooter() instanceof Player) {