Fix
Changes to be committed: modified: src/main/java/org/dimdev/dimcore/schematic/Schematic.java modified: src/main/java/org/dimdev/dimcore/schematic/v2/RelativeBlockSample.java modified: src/main/java/org/dimdev/dimcore/schematic/v2/Schematic.java modified: src/main/java/org/dimdev/dimcore/schematic/v2/SchematicBlockPalette.java modified: src/main/java/org/dimdev/dimcore/schematic/v2/SchematicPlacer.java modified: src/main/java/org/dimdev/dimdoors/util/AnnotatedNbt.java
This commit is contained in:
parent
714adbbe2a
commit
c5e79d1020
6 changed files with 9 additions and 10 deletions
|
@ -366,7 +366,7 @@ public class Schematic implements BlockView {
|
|||
// Place the schematic's blocks
|
||||
this.setBlocks(world, xBase, yBase, zBase);
|
||||
|
||||
// Set BlockEntity data
|
||||
// Set BlockEntity data
|
||||
for (CompoundTag BlockEntityNBT : tileEntities) {
|
||||
Vec3i schematicPos = new BlockPos(BlockEntityNBT.getInt("x"), BlockEntityNBT.getInt("y"), BlockEntityNBT.getInt("z"));
|
||||
BlockPos pos = new BlockPos(xBase, yBase, zBase).add(schematicPos);
|
||||
|
@ -469,7 +469,7 @@ public class Schematic implements BlockView {
|
|||
|
||||
ServerWorld w;
|
||||
|
||||
if(world instanceof ServerWorldAccess) {
|
||||
if (world instanceof ServerWorldAccess) {
|
||||
w = ((ServerWorldAccess) world).toServerWorld();
|
||||
} else {
|
||||
w = (ServerWorld) world;
|
||||
|
|
|
@ -76,7 +76,7 @@ public class RelativeBlockSample implements BlockView, ModifiableWorld {
|
|||
if (block instanceof ConditionalBlockEntityProvider && ((ConditionalBlockEntityProvider) block).hasBlockEntity(this.getBlockState(pos)) && ((ConditionalBlockEntityProvider) block).hasBlockEntity(pos, this)) {
|
||||
return ((ConditionalBlockEntityProvider) block).createBlockEntity(this.world);
|
||||
} else {
|
||||
return ((BlockEntityProvider)block).createBlockEntity(this.world);
|
||||
return ((BlockEntityProvider) block).createBlockEntity(this.world);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -35,7 +35,7 @@ public class Schematic {
|
|||
Codec.BYTE_BUFFER.fieldOf("BlockData").forGetter(Schematic::getBlockData),
|
||||
Codec.list(CompoundTag.CODEC).optionalFieldOf("BlockEntities", ImmutableList.of()).forGetter(Schematic::getBlockEntities),
|
||||
Codec.list(CompoundTag.CODEC).optionalFieldOf("Entities", ImmutableList.of()).forGetter(Schematic::getEntities)
|
||||
).apply(instance, Schematic::new);
|
||||
).apply(instance, Schematic::new);
|
||||
});
|
||||
|
||||
private final int version;
|
||||
|
|
|
@ -26,7 +26,7 @@ public class SchematicBlockPalette {
|
|||
|
||||
static DataResult<BlockState> to(String string) {
|
||||
if (!string.contains("[") && !string.contains("]")) {
|
||||
BlockState state = Registry.BLOCK.get(new Identifier(string)).getDefaultState();
|
||||
BlockState state = Registry.BLOCK.get(new Identifier(string)).getDefaultState();
|
||||
return DataResult.success(state);
|
||||
} else {
|
||||
Block block = Objects.requireNonNull(Registry.BLOCK.get(new Identifier(string.substring(0, string.indexOf("[")))));
|
||||
|
@ -37,7 +37,7 @@ public class SchematicBlockPalette {
|
|||
String[] stateArray = string.substring(string.indexOf("[") + 1, string.length() - 1).split(",");
|
||||
for (String stateString : stateArray) {
|
||||
Property<?> property = Objects.requireNonNull(block.getStateManager().getProperty(stateString.split("=")[0]));
|
||||
state = process(property,stateString.split("=")[1], state);
|
||||
state = process(property, stateString.split("=")[1], state);
|
||||
}
|
||||
|
||||
System.out.println(state);
|
||||
|
@ -52,7 +52,7 @@ public class SchematicBlockPalette {
|
|||
// Ensures that [ and ] are only added when properties are present
|
||||
boolean flag = true;
|
||||
Iterator<Property<?>> iterator = state.getProperties().iterator();
|
||||
while(iterator.hasNext()) {
|
||||
while (iterator.hasNext()) {
|
||||
if (flag) {
|
||||
builder.append("[");
|
||||
flag = false;
|
||||
|
|
|
@ -56,7 +56,7 @@ public final class SchematicPlacer {
|
|||
List<CompoundTag> entityTags = schematic.getEntities();
|
||||
for (CompoundTag tag : entityTags) {
|
||||
// Ensures compatibility with worldedit schematics
|
||||
if (SchematicPlacer.fixId(tag)){
|
||||
if (SchematicPlacer.fixId(tag)) {
|
||||
System.err.println("An unexpected error occurred parsing this entity");
|
||||
System.err.println(tag.toString());
|
||||
throw new IllegalStateException("Entity in schematic \"" + schematic.getMetadata().getName() + "\" did not have an Id tag, nor an id tag!");
|
||||
|
@ -93,7 +93,7 @@ public final class SchematicPlacer {
|
|||
DoubleTag.of(x + originX),
|
||||
DoubleTag.of(y + originY),
|
||||
DoubleTag.of(z + originZ)
|
||||
),
|
||||
),
|
||||
(byte) 6
|
||||
)
|
||||
);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.dimdev.dimdoors.util;
|
||||
|
||||
import org.dimdev.dimdoors.util.RotatedLocation;
|
||||
import com.google.gson.Gson;
|
||||
import com.mojang.serialization.Dynamic;
|
||||
import com.mojang.serialization.JsonOps;
|
||||
|
|
Loading…
Reference in a new issue