Format code

This commit is contained in:
2026-05-16 23:08:09 +02:00
parent 81dd8045f2
commit d110df924e
562 changed files with 11025 additions and 10059 deletions
@@ -57,7 +57,7 @@ import static de.steamwar.schematicsystem.commands.schematiccommand.SchematicCom
public class SchematicCommand extends SWCommand {
public SchematicCommand() {
super("schematic", new String[] {"schem", "/schem", "/schematic"});
super("schematic", new String[]{"schem", "/schem", "/schematic"});
}
@Register("help")
@@ -174,7 +174,7 @@ public class SchematicCommand extends SWCommand {
toBeCheckedInvs.putAll(result.getBlockScanResult().getForbiddenItems());
toBeCheckedInvs.putAll(result.getBlockScanResult().getForbiddenNbt());
for (Map.Entry<BlockPos, Set<Material>> entry: toBeCheckedInvs.entrySet()) {
for (Map.Entry<BlockPos, Set<Material>> entry : toBeCheckedInvs.entrySet()) {
BlockPos pos = entry.getKey();
Set<Material> materials = entry.getValue();
BlockVector3 vector = BlockVector3.at(pos.getX(), pos.getY(), pos.getZ());
@@ -183,11 +183,11 @@ public class SchematicCommand extends SWCommand {
CompoundTagBuilder builder = CompoundTagBuilder.create();
List<CompoundTag> list = new ArrayList<>();
for (CompoundTag items : tag.getList("Items", CompoundTag.class)) {
if(materials.contains(Material.matchMaterial(items.getString("id")))) {
if (materials.contains(Material.matchMaterial(items.getString("id")))) {
continue;
}
if(items.containsKey("tag")) {
if (items.containsKey("tag")) {
continue;
}
@@ -197,9 +197,9 @@ public class SchematicCommand extends SWCommand {
clipboard.setBlock(vector, block.toBaseBlock(builder.build()));
}
if(type.Schematic.MaxDispenserItems > 0 ) {
if (type.Schematic.MaxDispenserItems > 0) {
for (Map.Entry<BlockPos, Integer> entry : result.getBlockScanResult().getDispenserItems().entrySet()) {
if(entry.getValue() <= type.Schematic.MaxDispenserItems) {
if (entry.getValue() <= type.Schematic.MaxDispenserItems) {
continue;
}
@@ -213,16 +213,16 @@ public class SchematicCommand extends SWCommand {
List<CompoundTag> list = new ArrayList<>();
int diff = entry.getValue() - type.Schematic.MaxDispenserItems;
for (CompoundTag item : items) {
if(item == null) {
if (item == null) {
continue;
}
if(diff == 0) {
if (diff == 0) {
list.add(item);
continue;
}
if(diff > getCount.apply(item)) {
if (diff > getCount.apply(item)) {
diff -= getCount.apply(item);
continue;
}
@@ -237,7 +237,7 @@ public class SchematicCommand extends SWCommand {
}
}
if(!result.isLimitedBlocksOK()) {
if (!result.isLimitedBlocksOK()) {
Set<Material> toReplace = type.Schematic.Limited.entrySet().stream()
.filter(setIntegerEntry -> setIntegerEntry.getValue() == 0)
.flatMap(setIntegerEntry -> setIntegerEntry.getKey().stream())
@@ -250,7 +250,7 @@ public class SchematicCommand extends SWCommand {
for (int k = min.getBlockZ(); k <= max.getBlockZ(); k++) {
BlockVector3 vector = BlockVector3.at(i, j, k);
BaseBlock block = clipboard.getFullBlock(vector);
if(toReplace.contains(Material.matchMaterial(block.getBlockType().getId()))) {
if (toReplace.contains(Material.matchMaterial(block.getBlockType().getId()))) {
clipboard.setBlock(vector, replaceType.toBaseBlock());
}
}