forked from SteamWar/SteamWar
Merge remote-tracking branch 'origin/ReflectionReduction' into Refactor/remove-old-dependencies
This commit is contained in:
@@ -127,7 +127,7 @@ public class AutoChecker {
|
||||
else if (!itemsInInv.getOrDefault(itemType, EnumSet.noneOf(Material.class)).contains(material)) {
|
||||
result.getForbiddenItems().computeIfAbsent(pos, blockVector3 -> new HashSet<>()).add(itemType);
|
||||
} else if (material == Material.DISPENSER && (itemType == Material.ARROW || itemType == Material.FIRE_CHARGE)) {
|
||||
counter += Core.getVersion() >= 21 ? item.getInt("count") : item.getByte("Count");
|
||||
counter += item.getInt("count");
|
||||
}
|
||||
if (item.containsKey("tag")) {
|
||||
result.getForbiddenNbt().computeIfAbsent(pos, blockVector3 -> new HashSet<>()).add(itemType);
|
||||
|
||||
@@ -172,16 +172,14 @@ public class AutoCheckerResult {
|
||||
blockScanResult.getDefunctNbt().forEach(blockVector3 -> {
|
||||
SchematicSystem.MESSAGE.sendPrefixless("AUTO_CHECKER_RESULT_DEFUNCT_NBT", p, SchematicSystem.MESSAGE.parse("AUTO_CHECKER_RESULT_TELEPORT_HERE", p), tpCommandTo(blockVector3), blockVector3.getX(), blockVector3.getY(), blockVector3.getZ());
|
||||
});
|
||||
if(Core.getVersion() > 12) {
|
||||
blockScanResult.getDesignBlocks().forEach((material, poss) -> {
|
||||
if (material == Material.WATER || material == Material.LAVA) return;
|
||||
if(material.getBlastResistance() > type.Schematic.MaxDesignBlastResistance) {
|
||||
poss.forEach(pos -> {
|
||||
SchematicSystem.MESSAGE.sendPrefixless("AUTO_CHECKER_RESULT_DESIGN_BLOCK", p, SchematicSystem.MESSAGE.parse("AUTO_CHECKER_RESULT_TELEPORT_HERE", p), tpCommandTo(pos), material.name(), pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
blockScanResult.getDesignBlocks().forEach((material, poss) -> {
|
||||
if (material == Material.WATER || material == Material.LAVA) return;
|
||||
if(material.getBlastResistance() > type.Schematic.MaxDesignBlastResistance) {
|
||||
poss.forEach(pos -> {
|
||||
SchematicSystem.MESSAGE.sendPrefixless("AUTO_CHECKER_RESULT_DESIGN_BLOCK", p, SchematicSystem.MESSAGE.parse("AUTO_CHECKER_RESULT_TELEPORT_HERE", p), tpCommandTo(pos), material.name(), pos.getBlockX(), pos.getBlockY(), pos.getBlockZ());
|
||||
});
|
||||
}
|
||||
});
|
||||
entities.forEach(blockPos -> {
|
||||
SchematicSystem.MESSAGE.sendPrefixless("AUTO_CHECKER_RESULT_ENTITY", p, SchematicSystem.MESSAGE.parse("AUTO_CHECKER_RESULT_TELEPORT_HERE", p), tpCommandTo(blockPos), blockPos.getX(), blockPos.getY(), blockPos.getZ());
|
||||
});
|
||||
|
||||
+2
-5
@@ -35,7 +35,6 @@ import de.steamwar.command.AbstractSWCommand;
|
||||
import de.steamwar.command.SWCommand;
|
||||
import de.steamwar.command.TypeMapper;
|
||||
import de.steamwar.command.TypeValidator;
|
||||
import de.steamwar.core.Core;
|
||||
import de.steamwar.linkage.Linked;
|
||||
import de.steamwar.schematicsystem.SchematicSystem;
|
||||
import de.steamwar.schematicsystem.autocheck.AutoCheckerResult;
|
||||
@@ -161,10 +160,8 @@ public class SchematicCommand extends SWCommand {
|
||||
NORMAL
|
||||
}
|
||||
|
||||
private static final Function<CompoundTag, Integer> getCount = item -> Core.getVersion() >= 21 ? item.getInt("count") : item.getByte("Count");
|
||||
private static final BiFunction<CompoundTag, Integer, CompoundTag> setCount = (item, count) -> Core.getVersion() >= 21 ?
|
||||
item.createBuilder().putInt("count", count).build() :
|
||||
item.createBuilder().putByte("Count", count.byteValue()).build();
|
||||
private static final Function<CompoundTag, Integer> getCount = item -> item.getInt("count");
|
||||
private static final BiFunction<CompoundTag, Integer, CompoundTag> setCount = (item, count) -> item.createBuilder().putInt("count", count).build();
|
||||
|
||||
public static Clipboard fixClipboard(Clipboard clipboard, AutoCheckerResult result, GameModeConfig<Material, String> type) throws Exception {
|
||||
for (BlockPos blockPos : result.getBlockScanResult().getRecords()) {
|
||||
|
||||
-4
@@ -87,10 +87,6 @@ public class CheckPart extends SWCommand {
|
||||
|
||||
@Register("fix")
|
||||
public void fixSchematicCommand(Player player, @ErrorMessage("UTIL_CHECK_TYPE_NOT_FOUND") GameModeConfig<Material, String> type) {
|
||||
if(Core.getVersion() < 15) {
|
||||
SchematicSystem.MESSAGE.send("COMMAND_FIX_WRONG_VERSION", player);
|
||||
return;
|
||||
}
|
||||
Clipboard clipboard;
|
||||
try {
|
||||
clipboard = WorldEdit.getInstance().getSessionManager().findByName(player.getName()).getClipboard().getClipboard();
|
||||
|
||||
Reference in New Issue
Block a user