ENTRIES = new HashMap<>();
static {
ENTRIES.put("true", TRUE);
ENTRIES.put("false", FALSE);
ENTRIES.put("placed", PLACED);
}
}
/**
* All blocks except for protected ones may be broken.
*/
static final BuildMode TRUE = (Player player, GameWorld gameWorld, Block block) -> true;
/**
* Blocks may not be broken.
*/
static final BuildMode FALSE = (Player player, GameWorld gameWorld, Block block) -> false;
/**
* Blocks placed by players may be broken.
*/
static final BuildMode PLACED = (Player player, GameWorld gameWorld, Block block) -> gameWorld.getPlacedBlocks().contains(block);
/**
* Returns if the block can be broken or placed by the player.
*
* The plugin protects dungeon signs before checking this.
*
* @param player the player who breaks or places the block
* @param gameWorld the world the block is in
* @param block the block
* @return if the block can be broken or placed by the player
*/
boolean check(Player player, GameWorld gameWorld, Block block);
}