diff --git a/src/main/java/net/h31ix/anticheat/manage/Backend.java b/src/main/java/net/h31ix/anticheat/manage/Backend.java index 4f5ed67..882172c 100644 --- a/src/main/java/net/h31ix/anticheat/manage/Backend.java +++ b/src/main/java/net/h31ix/anticheat/manage/Backend.java @@ -186,7 +186,14 @@ public class Backend public boolean checkLongReachBlock(Player player, double x, double y, double z) { - return (x >= magic.BLOCK_MAX_DISTANCE || y > magic.BLOCK_MAX_DISTANCE || z > magic.BLOCK_MAX_DISTANCE); + if(isInstantBreakExempt(player)) + { + return false; + } + else + { + return (x >= magic.BLOCK_MAX_DISTANCE || y > magic.BLOCK_MAX_DISTANCE || z > magic.BLOCK_MAX_DISTANCE); + } } public boolean checkLongReachDamage(double x, double y, double z) diff --git a/src/main/java/net/h31ix/anticheat/util/yaml/CommentedConfiguration.java b/src/main/java/net/h31ix/anticheat/util/yaml/CommentedConfiguration.java index b329d66..4264037 100644 --- a/src/main/java/net/h31ix/anticheat/util/yaml/CommentedConfiguration.java +++ b/src/main/java/net/h31ix/anticheat/util/yaml/CommentedConfiguration.java @@ -24,9 +24,7 @@ import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.logging.Level; import org.bukkit.Bukkit; @@ -41,19 +39,19 @@ import org.yaml.snakeyaml.representer.Representer; public class CommentedConfiguration extends YamlConfiguration { private Map comments = new HashMap(); - + private final DumperOptions yamlOptions = new DumperOptions(); private final Representer yamlRepresenter = new YamlRepresenter(); - private final Yaml yaml = new Yaml(new YamlConstructor(), yamlRepresenter, yamlOptions); - + private final Yaml yaml = new Yaml(new YamlConstructor(), yamlRepresenter, yamlOptions); + @Override public String saveToString() { yamlOptions.setIndent(options().indent()); yamlOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); yamlRepresenter.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - + String dump = yaml.dump(getValues(false)); - + if (dump.equals(BLANK_CONFIG)) { dump = ""; } else { @@ -74,14 +72,14 @@ public class CommentedConfiguration extends YamlConfiguration return dump; } - + @Override public void load(InputStream stream) throws IOException, InvalidConfigurationException { InputStreamReader reader = new InputStreamReader(stream); StringBuilder builder = new StringBuilder(); BufferedReader input = new BufferedReader(reader); - + try { String line; int i = 0; @@ -98,8 +96,8 @@ public class CommentedConfiguration extends YamlConfiguration } loadFromString(builder.toString()); - } - + } + public static CommentedConfiguration loadConfig(File file) { CommentedConfiguration config = new CommentedConfiguration(); @@ -113,5 +111,5 @@ public class CommentedConfiguration extends YamlConfiguration } return config; - } + } }