Fix HomeCheck (no essentials) + BONE_MEAL Material

Bypass the PlayerHomeCheck if Essentials is not installed (causes exceptions)
Fix BONE_MEAL multi-version support
This commit is contained in:
Drc-DEV 2019-02-18 15:21:17 +01:00 committed by GitHub
parent 16081752ad
commit 96fe8d059e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -660,6 +660,9 @@ public class FactionsPlayerListener implements Listener {
if (event.getPlayer().hasPermission("factions.homes.bypass")) {
return;
}
if (Bukkit.getPluginManager().getPlugin("Essentials") == null) {
return;
}
boolean isHome = false;
for (String str : SavageFactions.plugin.ess.getUser(event.getPlayer()).getHomes()) {
Location home = SavageFactions.plugin.ess.getUser(event.getPlayer()).getHome(str);
@ -956,7 +959,7 @@ public class FactionsPlayerListener implements Listener {
Block block = event.getClickedBlock();
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && block.getType() == MultiversionMaterials.GRASS_BLOCK.parseMaterial()
&& event.hasItem() && event.getItem().getType() == Material.BONE_MEAL) {
&& event.hasItem() && event.getItem().getType() == MultiversionMaterials.BONE_MEAL.parseMaterial()) {
if (!FactionsBlockListener.playerCanBuildDestroyBlock(event.getPlayer(), block.getLocation(), PermissableAction.BUILD.name(), true)) {
FPlayer me = FPlayers.getInstance().getById(event.getPlayer().getUniqueId().toString());
Faction otherFaction = Board.getInstance().getFactionAt(new FLocation(block.getLocation()));