1.21.5
Co-authored-by: Bjarne Koll <git@lynxplay.dev> Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Co-authored-by: MiniDigger | Martin <admin@minidigger.dev> Co-authored-by: Nassim Jahnke <nassim@njahnke.dev> Co-authored-by: Noah van der Aa <ndvdaa@gmail.com> Co-authored-by: Owen1212055 <23108066+Owen1212055@users.noreply.github.com> Co-authored-by: Shane Freeder <theboyetronic@gmail.com> Co-authored-by: Spottedleaf <Spottedleaf@users.noreply.github.com> Co-authored-by: Tamion <70228790+notTamion@users.noreply.github.com> Co-authored-by: Warrior <50800980+Warriorrrr@users.noreply.github.com>
This commit is contained in:
@@ -20,7 +20,7 @@ public class CraftPalette implements Palette {
|
||||
|
||||
@Override
|
||||
public List<BlockState> getBlocks() {
|
||||
List<BlockState> blocks = new ArrayList<>();
|
||||
List<BlockState> blocks = new ArrayList<>(this.palette.blocks().size());
|
||||
for (StructureTemplate.StructureBlockInfo blockInfo : this.palette.blocks()) {
|
||||
blocks.add(CraftBlockStates.getBlockState(this.registry, blockInfo.pos(), blockInfo.state(), blockInfo.nbt()));
|
||||
}
|
||||
|
||||
@@ -90,14 +90,14 @@ public class CraftStructure implements Structure {
|
||||
.setRandom(randomSource);
|
||||
definedstructureinfo.palette = palette;
|
||||
|
||||
BlockPos blockPosition = CraftBlockVector.toBlockPosition(location);
|
||||
BlockPos pos = CraftBlockVector.toBlockPosition(location);
|
||||
WorldGenLevel handle = ((CraftRegionAccessor) regionAccessor).getHandle();
|
||||
|
||||
TransformerGeneratorAccess access = new TransformerGeneratorAccess();
|
||||
access.setHandle(handle);
|
||||
access.setStructureTransformer(new CraftStructureTransformer(handle, new ChunkPos(blockPosition), blockTransformers, entityTransformers));
|
||||
access.setDelegate(handle);
|
||||
access.setStructureTransformer(new CraftStructureTransformer(handle, new ChunkPos(pos), blockTransformers, entityTransformers));
|
||||
|
||||
this.structure.placeInWorld(access, blockPosition, blockPosition, definedstructureinfo, randomSource, 2);
|
||||
this.structure.placeInWorld(access, pos, pos, definedstructureinfo, randomSource, 2);
|
||||
access.getStructureTransformer().discard();
|
||||
}
|
||||
|
||||
|
||||
@@ -163,8 +163,8 @@ public class CraftStructureManager implements StructureManager {
|
||||
Preconditions.checkArgument(outputStream != null, "outputStream cannot be null");
|
||||
Preconditions.checkArgument(structure != null, "structure cannot be null");
|
||||
|
||||
CompoundTag nbttagcompound = ((CraftStructure) structure).getHandle().save(new CompoundTag());
|
||||
NbtIo.writeCompressed(nbttagcompound, outputStream);
|
||||
CompoundTag tag = ((CraftStructure) structure).getHandle().save(new CompoundTag());
|
||||
NbtIo.writeCompressed(tag, outputStream);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -175,9 +175,9 @@ public class CraftStructureManager implements StructureManager {
|
||||
private ResourceLocation createAndValidateMinecraftStructureKey(NamespacedKey structureKey) {
|
||||
Preconditions.checkArgument(structureKey != null, "NamespacedKey structureKey cannot be null");
|
||||
|
||||
ResourceLocation minecraftkey = CraftNamespacedKey.toMinecraft(structureKey);
|
||||
Preconditions.checkArgument(!minecraftkey.getPath().contains("//"), "Resource key for Structures can not contain \"//\"");
|
||||
return minecraftkey;
|
||||
ResourceLocation key = CraftNamespacedKey.toMinecraft(structureKey);
|
||||
Preconditions.checkArgument(!key.getPath().contains("//"), "Resource key for Structures can not contain \"//\"");
|
||||
return key;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user