mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Add toggle to allow piston cheating
This commit is contained in:
parent
6bc57f184a
commit
03fd558e1b
@ -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); }
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user