Added an option to disable particle effects on deny

This commit is contained in:
Matthew Miller 2018-09-28 12:15:50 +10:00
parent f235e870a7
commit a6261b9071
3 changed files with 8 additions and 2 deletions

View File

@ -77,6 +77,7 @@ public abstract class ConfigurationManager {
public boolean blockInGameOp;
public boolean migrateRegionsToUuid;
public boolean keepUnresolvedNames;
public boolean particleEffects;
@Unreported public Map<String, String> hostKeys = new HashMap<>();
public boolean hostKeysAllowFMLClients;

View File

@ -62,6 +62,7 @@ public void load() {
config.removeProperty("auto-invincible-permission");
usePlayerMove = config.getBoolean("use-player-move-event", true);
usePlayerTeleports = config.getBoolean("use-player-teleports", true);
particleEffects = config.getBoolean("use-particle-effects", true);
deopOnJoin = config.getBoolean("security.deop-everyone-on-join", false);
blockInGameOp = config.getBoolean("security.block-in-game-op-command", false);

View File

@ -1046,11 +1046,15 @@ private boolean isItemAppliedToBlock(ItemStack item, Block clicked) {
private void playDenyEffect(Player player, Location location) {
//player.playSound(location, Sound.SUCCESSFUL_HIT, 0.2f, 0.4f);
player.playEffect(location, Effect.SMOKE, BlockFace.UP);
if (WorldGuard.getInstance().getPlatform().getGlobalStateManager().particleEffects) {
player.playEffect(location, Effect.SMOKE, BlockFace.UP);
}
}
private void playDenyEffect(Location location) {
location.getWorld().playEffect(location, Effect.SMOKE, BlockFace.UP);
if (WorldGuard.getInstance().getPlatform().getGlobalStateManager().particleEffects) {
location.getWorld().playEffect(location, Effect.SMOKE, BlockFace.UP);
}
}
public class SpigotCompatListener implements Listener {