bandaid fix

This commit is contained in:
CreepyCre 2021-02-22 21:11:47 +01:00
parent c1dd774b2f
commit c65fd8af66
5 changed files with 9 additions and 6 deletions

View file

@ -45,7 +45,8 @@ public class SchematicV2Command {
SchematicPlacer.place(
Schematic.fromTag(NbtIo.readCompressed(in)),
ctx.getSource().getWorld(),
ctx.getSource().getPlayer().getBlockPos()
ctx.getSource().getPlayer().getBlockPos(),
false
);
} catch (IOException e) {
e.printStackTrace();

View file

@ -59,7 +59,7 @@ public abstract class SchematicV2Gateway implements Gateway, BiPredicate<Structu
TemplateUtils.replacePlaceholders(this.schematic, world);
this.replaced = true;
}
SchematicPlacer.place(this.schematic, world, pos);
SchematicPlacer.place(this.schematic, world, pos, false);
this.generateRandomBits(world, pos);
}

View file

@ -99,11 +99,13 @@ public class RelativeBlockSample implements BlockView, ModifiableWorld {
return this.blockContainer.get(pos).getFluidState();
}
public void place(BlockPos origin, ServerWorld world, boolean blockUpdate, boolean biomes) {
public void place(BlockPos origin, StructureWorldAccess world, boolean blockUpdate, boolean biomes) {
if (!(world instanceof ServerWorld)) blockUpdate = false;
boolean finalBlockUpdate = blockUpdate;
this.blockContainer.forEach((pos, state) -> {
BlockPos actualPos = origin.add(pos);
world.setBlockState(actualPos, state, 0, 0);
if (blockUpdate) world.getChunkManager().markForUpdate(actualPos);
if (finalBlockUpdate) ((ServerWorld) world).getChunkManager().markForUpdate(actualPos);
});
for (Map.Entry<BlockPos, CompoundTag> entry : this.blockEntityContainer.entrySet()) {
BlockPos pos = entry.getKey();

View file

@ -27,7 +27,7 @@ public final class SchematicPlacer {
private SchematicPlacer() {
}
public static void place(Schematic schematic, ServerWorld world, BlockPos origin, boolean blockUpdate) {
public static void place(Schematic schematic, StructureWorldAccess world, BlockPos origin, boolean blockUpdate) {
LOGGER.debug("Placing schematic: {}", schematic.getMetadata().getName());
for (String id : schematic.getMetadata().getRequiredMods()) {
if (!FabricLoader.getInstance().isModLoaded(id)) {

View file

@ -24,7 +24,7 @@ public class WorldlyBlockSample implements BlockView, ModifiableTestableWorld {
}
public void place(BlockPos origin, boolean biomes) {
this.relativeBlockSample.place(origin, this.world, biomes);
this.relativeBlockSample.place(origin, this.world, false, biomes);
}
@Nullable