Add toggle to allow piston cheating

This commit is contained in:
nossr50 2019-07-07 06:11:15 -07:00
parent 6bc57f184a
commit 03fd558e1b
3 changed files with 10 additions and 0 deletions

View File

@ -145,6 +145,7 @@ public class ExperienceConfig extends AutoUpdateConfigLoader {
/* EXPLOIT TOGGLES */
public boolean isEndermanEndermiteFarmingPrevented() { return config.getBoolean("ExploitFix.EndermanEndermiteFarms", true); }
public boolean isPistonCheatingPrevented() { return config.getBoolean("ExploitFix.PistonCheating", true); }
public boolean isPistonExploitPrevented() { return config.getBoolean("ExploitFix.Pistons", false); }
public boolean allowUnsafeEnchantments() { return config.getBoolean("ExploitFix.UnsafeEnchantments", false); }
public boolean isCOTWBreedingPrevented() { return config.getBoolean("ExploitFix.COTWBreeding", true); }

View File

@ -129,6 +129,10 @@ public class BlockListener implements Listener {
if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
return;
if(!ExperienceConfig.getInstance().isPistonCheatingPrevented()) {
return;
}
BlockFace direction = event.getDirection();
Block movedBlock = event.getBlock();
movedBlock = movedBlock.getRelative(direction, 2);
@ -152,6 +156,10 @@ public class BlockListener implements Listener {
if(WorldBlacklist.isWorldBlacklisted(event.getBlock().getWorld()))
return;
if(!ExperienceConfig.getInstance().isPistonCheatingPrevented()) {
return;
}
// Get opposite direction so we get correct block
BlockFace direction = event.getDirection();
Block movedBlock = event.getBlock().getRelative(direction);

View File

@ -33,6 +33,7 @@ ExploitFix:
Acrobatics: true
LavaStoneAndCobbleFarming: true
TreeFellerReducedXP: true
PistonCheating: true
Experience_Bars:
# Turn this to false if you wanna disable XP bars
Enable: true