mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-14 06:24:12 +01:00
Fix dedicated server crash when using schematicannon printing
Closes #355
This commit is contained in:
parent
dd4b3385f8
commit
0e9aad6763
@ -13,7 +13,6 @@ import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld;
|
|||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.block.Blocks;
|
import net.minecraft.block.Blocks;
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.item.ArmorStandEntity;
|
import net.minecraft.entity.item.ArmorStandEntity;
|
||||||
import net.minecraft.entity.item.ItemFrameEntity;
|
import net.minecraft.entity.item.ItemFrameEntity;
|
||||||
@ -41,8 +40,8 @@ public class SchematicWorld extends WrappedWorld {
|
|||||||
public BlockPos anchor;
|
public BlockPos anchor;
|
||||||
public boolean renderMode;
|
public boolean renderMode;
|
||||||
|
|
||||||
public SchematicWorld() {
|
public SchematicWorld(World original) {
|
||||||
this(BlockPos.ZERO, Minecraft.getInstance().world);
|
this(BlockPos.ZERO, original);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SchematicWorld(BlockPos anchor, World original) {
|
public SchematicWorld(BlockPos anchor, World original) {
|
||||||
|
@ -28,6 +28,7 @@ import net.minecraft.nbt.NBTUtil;
|
|||||||
import net.minecraft.util.Mirror;
|
import net.minecraft.util.Mirror;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.gen.feature.template.PlacementSettings;
|
import net.minecraft.world.gen.feature.template.PlacementSettings;
|
||||||
import net.minecraft.world.gen.feature.template.Template;
|
import net.minecraft.world.gen.feature.template.Template;
|
||||||
|
|
||||||
@ -120,9 +121,10 @@ public class SchematicHandler {
|
|||||||
if (size.equals(BlockPos.ZERO))
|
if (size.equals(BlockPos.ZERO))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
SchematicWorld w = new SchematicWorld();
|
World clientWorld = Minecraft.getInstance().world;
|
||||||
SchematicWorld wMirroredFB = new SchematicWorld();
|
SchematicWorld w = new SchematicWorld(clientWorld);
|
||||||
SchematicWorld wMirroredLR = new SchematicWorld();
|
SchematicWorld wMirroredFB = new SchematicWorld(clientWorld);
|
||||||
|
SchematicWorld wMirroredLR = new SchematicWorld(clientWorld);
|
||||||
PlacementSettings placementSettings = new PlacementSettings();
|
PlacementSettings placementSettings = new PlacementSettings();
|
||||||
|
|
||||||
schematic.addBlocksToWorld(w, BlockPos.ZERO, placementSettings);
|
schematic.addBlocksToWorld(w, BlockPos.ZERO, placementSettings);
|
||||||
|
Loading…
Reference in New Issue
Block a user