use of fr.neatmonster.nocheatplus.compat.blocks.init.vanilla.special.MultiClientProtocolBlockShapePatch in project NoCheatPlus by NoCheatPlus.
the class VanillaBlocksFactory method setupVanillaBlocks.
public Collection<String> setupVanillaBlocks(final WorldConfigProvider<?> worldConfigProvider) {
// Vanilla blocks (abort with first failure, low to high MC version).
final List<BlockPropertiesSetup> setups = new LinkedList<BlockPropertiesSetup>();
final List<String> success = new LinkedList<String>();
try {
setups.add(new BlocksMC1_5());
setups.add(new BlocksMC1_6_1());
setups.add(new BlocksMC1_7_2());
setups.add(new BlocksMC1_8());
setups.add(new BlocksMC1_9());
setups.add(new BlocksMC1_10());
setups.add(new BlocksMC1_11());
setups.add(new BlocksMC1_12());
} catch (Throwable t) {
}
for (final BlockPropertiesSetup setup : setups) {
try {
// Assume the blocks setup to message success.
setup.setupBlockProperties(worldConfigProvider);
success.add(setup.getClass().getSimpleName());
// TODO: Do logging from here ?
} catch (Throwable t) {
StaticLog.logSevere(setup.getClass().getSimpleName() + ".setupBlockProperties could not execute properly: " + t.getClass().getSimpleName() + " - " + t.getMessage());
StaticLog.logSevere(t);
// Abort further processing.
break;
}
}
// Patches for special circumstances.
for (IPatchBlockPropertiesSetup patch : new IPatchBlockPropertiesSetup[] { new MultiClientProtocolBlockShapePatch() }) {
try {
if (patch.isAvailable()) {
patch.setupBlockProperties(worldConfigProvider);
String description = patch.getNeutralDescription();
if (description == null || description.isEmpty()) {
description = patch.getClass().getSimpleName();
}
StaticLog.logInfo("Update block-info: " + description);
}
} catch (Throwable t) {
StaticLog.logSevere(patch.getClass().getSimpleName() + " could not be processed: " + t.getClass().getSimpleName() + " - " + t.getMessage());
StaticLog.logSevere(t);
}
}
return success;
}
Aggregations