Add compatibility option to set blocks as instantly breakable.

This commit is contained in:
asofold 2013-01-21 05:59:52 +01:00
parent b54b558322
commit 8d1ee85d9d
3 changed files with 11 additions and 1 deletions

View File

@ -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";
}

View File

@ -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);
}
}
}
// /**

View File

@ -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]?