mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2025-01-10 02:19:30 +01:00
Fixes missing FLAG check on clicking minecart entities
Players could open minecart entities, even without flag requirement. Fixes #2031
This commit is contained in:
parent
4792ff3f62
commit
866dff6244
@ -3,7 +3,10 @@ package world.bentobox.bentobox.listeners.flags.protection;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.*;
|
||||
import org.bukkit.entity.minecart.HopperMinecart;
|
||||
import org.bukkit.entity.minecart.PoweredMinecart;
|
||||
import org.bukkit.entity.minecart.RideableMinecart;
|
||||
import org.bukkit.entity.minecart.StorageMinecart;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerInteractAtEntityEvent;
|
||||
@ -47,6 +50,18 @@ public class EntityInteractListener extends FlagListener {
|
||||
// Minecart riding
|
||||
this.checkIsland(e, p, l, Flags.MINECART);
|
||||
}
|
||||
else if (e.getRightClicked() instanceof StorageMinecart)
|
||||
{
|
||||
this.checkIsland(e, p, l, Flags.CHEST);
|
||||
}
|
||||
else if (e.getRightClicked() instanceof HopperMinecart)
|
||||
{
|
||||
this.checkIsland(e, p, l, Flags.HOPPER);
|
||||
}
|
||||
else if (e.getRightClicked() instanceof PoweredMinecart)
|
||||
{
|
||||
this.checkIsland(e, p, l, Flags.FURNACE);
|
||||
}
|
||||
else if (!ServerCompatibility.getInstance().isVersion(
|
||||
ServerCompatibility.ServerVersion.V1_18,
|
||||
ServerCompatibility.ServerVersion.V1_18_1,
|
||||
|
Loading…
Reference in New Issue
Block a user