Refactor EnginePermBuild to more suitable structure.

This commit is contained in:
ulumulu1510
2017-04-03 12:33:13 +02:00
parent 093dbde473
commit edfabb7718
5 changed files with 313 additions and 357 deletions

View File

@@ -52,7 +52,7 @@ public class FactionsLwcModule extends JavaModule
if ( ! MConf.get().lwcMustHaveBuildRightsToCreate) return;
// ... and the player don't have build rights here ...
// NOTE: We verbosely check the build rights so that a proper info message is sent
// NOTE: We verbosely check the build rights so that a proper info message is sent
if (EnginePermBuild.canPlayerBuildAt(event.getPlayer(), PS.valueOf(event.getBlock()), true)) return;
// ... then cancel the event.

View File

@@ -53,11 +53,8 @@ public class EngineSpigot extends Engine
// Only care for armor stands.
if (entity.getType() != EntityType.ARMOR_STAND) return;
// If we can't use ...
if (EnginePermBuild.canPlayerUseEntity(player, entity, verboose)) return;
// ... block use.
event.setCancelled(true);
// If we can't use, block it
EnginePermBuild.useEntity(player, entity, verboose, event);
}
/*