mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-12-26 10:28:05 +01:00
Add compatibility option to set blocks as instantly breakable.
This commit is contained in:
parent
b54b558322
commit
8d1ee85d9d
@ -10,5 +10,6 @@ public class RootConfPaths {
|
||||
|
||||
// Sub-paths that are used with different path prefixes potentially.
|
||||
public static final String SUB_IGNOREPASSABLE = "ignorepassable";
|
||||
public static final String SUB_ALLOWINSTANTBREAK = "allowinstantbreak";
|
||||
|
||||
}
|
||||
|
@ -1029,6 +1029,15 @@ public class BlockProperties {
|
||||
if (id == null || id < 0 || id >= 4096) LogUtil.logWarning("[NoCheatplus] Bad block id (" + pathPrefix + RootConfPaths.SUB_IGNOREPASSABLE + "): " + input);
|
||||
else blockFlags[id] |= F_IGN_PASSABLE;
|
||||
}
|
||||
|
||||
// Allow instant breaking.
|
||||
for (final String input : config.getStringList(pathPrefix + RootConfPaths.SUB_ALLOWINSTANTBREAK)){
|
||||
final Integer id = RawConfigFile.parseTypeId(input);
|
||||
if (id == null || id < 0 || id >= 4096) LogUtil.logWarning("[NoCheatplus] Bad block id (" + pathPrefix + RootConfPaths.SUB_ALLOWINSTANTBREAK + "): " + input);
|
||||
else {
|
||||
setBlockProps(id, instantType);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// /**
|
||||
|
@ -25,7 +25,7 @@ public class DefaultConfig extends ConfigFile {
|
||||
* NCP build needed for this config.
|
||||
* (Should only increment with changing or removing paths.)
|
||||
*/
|
||||
public static final int buildNumber = 322;
|
||||
public static final int buildNumber = 326;
|
||||
|
||||
// TODO: auto input full version or null to an extra variable or several [fail safe for other syntax checking]?
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user