mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-09-28 14:47:30 +02:00
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:
parent
e284a6b57a
commit
6bbe9a3f2a
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user