Yet more porting, bodge to let SchematicWorld implement IServerWorld
This commit is contained in:
parent
74fadd94d6
commit
3be810a9eb
6 changed files with 22 additions and 8 deletions
|
@ -60,7 +60,7 @@ public class ContraptionRenderer {
|
|||
}
|
||||
|
||||
private static SuperByteBuffer buildStructureBuffer(Contraption c) {
|
||||
if (renderWorld == null || renderWorld.getWorld() != Minecraft.getInstance().world)
|
||||
if (renderWorld == null || renderWorld.getWrappedWorld() != Minecraft.getInstance().world)
|
||||
renderWorld = new PlacementSimulationWorld(Minecraft.getInstance().world);
|
||||
|
||||
MatrixStack ms = new MatrixStack();
|
||||
|
|
|
@ -10,8 +10,8 @@ import java.util.function.Predicate;
|
|||
import java.util.stream.Stream;
|
||||
|
||||
import com.simibubi.create.foundation.utility.BlockHelper;
|
||||
|
||||
import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
|
@ -26,11 +26,16 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MutableBoundingBox;
|
||||
import net.minecraft.world.*;
|
||||
import net.minecraft.world.EmptyTickList;
|
||||
import net.minecraft.world.IServerWorld;
|
||||
import net.minecraft.world.ITickList;
|
||||
import net.minecraft.world.LightType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.BiomeRegistry;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
public class SchematicWorld extends WrappedWorld {
|
||||
public class SchematicWorld extends WrappedWorld implements IServerWorld {
|
||||
|
||||
private Map<BlockPos, BlockState> blocks;
|
||||
private Map<BlockPos, TileEntity> tileEntities;
|
||||
|
@ -189,4 +194,11 @@ public class SchematicWorld extends WrappedWorld {
|
|||
return tileEntities.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerWorld getWorld() {
|
||||
if (this.world instanceof ServerWorld) {
|
||||
return (ServerWorld) this.world;
|
||||
}
|
||||
throw new IllegalStateException("Cannot use IServerWorld#getWorld in a client environment");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.google.gson.JsonObject;
|
|||
import com.google.gson.JsonSyntaxException;
|
||||
import com.simibubi.create.Create;
|
||||
|
||||
import net.minecraft.advancements.criterion.EntityPredicate;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
|
@ -52,7 +53,7 @@ public class KineticBlockTrigger extends CriterionTriggerBase<KineticBlockTrigge
|
|||
private final Block block;
|
||||
|
||||
public Instance(Block block) {
|
||||
super(KineticBlockTrigger.ID);
|
||||
super(KineticBlockTrigger.ID, EntityPredicate.AndPredicate.EMPTY); // FIXME: Is this right?
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
|
|
|
@ -244,7 +244,7 @@ public class GuiGameElement {
|
|||
RenderHelper.disableStandardItemLighting();
|
||||
|
||||
ClientWorld world = Minecraft.getInstance().world;
|
||||
if (renderWorld == null || renderWorld.getWorld() != world)
|
||||
if (renderWorld == null || renderWorld.getWrappedWorld() != world)
|
||||
renderWorld = new FluidRenderWorld(world);
|
||||
|
||||
for (Direction d : Iterate.directions) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class WrappedWorld extends World {
|
|||
|
||||
// FIXME
|
||||
// @Override
|
||||
public World getWorld() {
|
||||
public World getWrappedWorld() {
|
||||
return world;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.simibubi.create.foundation.utility.Lang;
|
|||
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.Biomes;
|
||||
import net.minecraft.world.biome.Biome.Category;
|
||||
import net.minecraft.world.gen.feature.ConfiguredFeature;
|
||||
import net.minecraftforge.common.ForgeConfigSpec;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
@ -56,7 +57,7 @@ public enum AllWorldFeatures {
|
|||
|
||||
if (biome.getRegistryName() == Biomes.THE_VOID.getRegistryName())
|
||||
continue;
|
||||
if (biome == Biomes.NETHER)
|
||||
if (biome.getCategory() == Category.NETHER)
|
||||
continue;
|
||||
|
||||
if (entry.featureInstances.containsKey(biome))
|
||||
|
|
Loading…
Reference in a new issue