mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-11-26 20:55:41 +01:00
Fixes Glowing Item frames protection (#1985)
* Fixes glowing item frame protection. Glowing item frames were not protected. Fixes #475 * Fixes check-style.
This commit is contained in:
parent
aad10ad74f
commit
6f2a9929c0
@ -198,6 +198,7 @@ public class BlockInteractionListener extends FlagListener {
|
|||||||
case END_PORTAL_FRAME:
|
case END_PORTAL_FRAME:
|
||||||
checkIsland(e, player, loc, Flags.PLACE_BLOCKS);
|
checkIsland(e, player, loc, Flags.PLACE_BLOCKS);
|
||||||
break;
|
break;
|
||||||
|
case GLOW_ITEM_FRAME:
|
||||||
case ITEM_FRAME:
|
case ITEM_FRAME:
|
||||||
checkIsland(e, player, loc, Flags.ITEM_FRAME);
|
checkIsland(e, player, loc, Flags.ITEM_FRAME);
|
||||||
break;
|
break;
|
||||||
|
@ -52,7 +52,7 @@ public class PlaceBlocksListener extends FlagListener {
|
|||||||
*/
|
*/
|
||||||
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
|
||||||
public void onPlayerHitItemFrame(PlayerInteractEntityEvent e) {
|
public void onPlayerHitItemFrame(PlayerInteractEntityEvent e) {
|
||||||
if (e.getRightClicked().getType().equals(EntityType.ITEM_FRAME)) {
|
if (e.getRightClicked().getType().equals(EntityType.ITEM_FRAME) || e.getRightClicked().getType().equals(EntityType.GLOW_ITEM_FRAME)) {
|
||||||
if (!checkIsland(e, e.getPlayer(), e.getRightClicked().getLocation(), Flags.PLACE_BLOCKS)) return;
|
if (!checkIsland(e, e.getPlayer(), e.getRightClicked().getLocation(), Flags.PLACE_BLOCKS)) return;
|
||||||
checkIsland(e, e.getPlayer(), e.getRightClicked().getLocation(), Flags.ITEM_FRAME);
|
checkIsland(e, e.getPlayer(), e.getRightClicked().getLocation(), Flags.ITEM_FRAME);
|
||||||
}
|
}
|
||||||
|
@ -110,6 +110,7 @@ public class BlockInteractionListenerTest extends AbstractCommonSetup {
|
|||||||
clickedBlocks.put(Material.DRAGON_EGG, Flags.DRAGON_EGG);
|
clickedBlocks.put(Material.DRAGON_EGG, Flags.DRAGON_EGG);
|
||||||
clickedBlocks.put(Material.END_PORTAL_FRAME, Flags.PLACE_BLOCKS);
|
clickedBlocks.put(Material.END_PORTAL_FRAME, Flags.PLACE_BLOCKS);
|
||||||
clickedBlocks.put(Material.ITEM_FRAME, Flags.ITEM_FRAME);
|
clickedBlocks.put(Material.ITEM_FRAME, Flags.ITEM_FRAME);
|
||||||
|
clickedBlocks.put(Material.GLOW_ITEM_FRAME, Flags.ITEM_FRAME);
|
||||||
clickedBlocks.put(Material.SWEET_BERRY_BUSH, Flags.BREAK_BLOCKS);
|
clickedBlocks.put(Material.SWEET_BERRY_BUSH, Flags.BREAK_BLOCKS);
|
||||||
clickedBlocks.put(Material.CAKE, Flags.CAKE);
|
clickedBlocks.put(Material.CAKE, Flags.CAKE);
|
||||||
clickedBlocks.put(Material.BEEHIVE, Flags.HIVE);
|
clickedBlocks.put(Material.BEEHIVE, Flags.HIVE);
|
||||||
|
Loading…
Reference in New Issue
Block a user