diff --git a/build.gradle b/build.gradle index 2fc5362b4..b94ff4fac 100644 --- a/build.gradle +++ b/build.gradle @@ -39,8 +39,7 @@ minecraft { workingDirectory project.file('run') // property 'mixin.env.disableRefMap', 'true' arg '-mixin.config=create.mixins.json' - //jvmArgs '-XX:+UnlockCommercialFeatures' - jvmArgs '-Dmixin.env.disableRefMap=true' + jvmArgs '-XX:+UnlockCommercialFeatures' property 'forge.logging.console.level', 'info' property 'fml.earlyprogresswindow', 'false' mods { @@ -110,10 +109,6 @@ repositories { maven { url = "https://www.cursemaven.com" } - - flatDir { - dirs 'deps' - } } configurations { @@ -140,9 +135,6 @@ dependencies { // runtimeOnly fg.deobf("slimeknights.mantle:Mantle:1.16.3-1.6.40") // runtimeOnly fg.deobf("slimeknights.tconstruct:TConstruct:1.16.3-3.0.1.24") - compileOnly fg.deobf("local:starlight-1.0.0-RC1") - //runtimeOnly fg.deobf("local:starlight-1.0.0-RC1") - annotationProcessor 'org.spongepowered:mixin:0.8:processor' } diff --git a/deps/starlight-1.0.0-RC1.jar b/deps/starlight-1.0.0-RC1.jar deleted file mode 100644 index 5578a6bf2..000000000 Binary files a/deps/starlight-1.0.0-RC1.jar and /dev/null differ diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java index 23f188946..bf5ffde42 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java @@ -16,7 +16,6 @@ import com.simibubi.create.foundation.render.backend.instancing.IInstanceRendere import com.simibubi.create.foundation.render.backend.light.GridAlignedBB; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld; -import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorldStarlight; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; @@ -40,7 +39,6 @@ import net.minecraft.world.gen.feature.template.Template; import net.minecraft.world.lighting.WorldLightManager; import net.minecraftforge.client.ForgeHooksClient; import net.minecraftforge.client.model.data.EmptyModelData; -import net.minecraftforge.fml.ModList; public class RenderedContraption { private final HashMap renderLayers = new HashMap<>(); @@ -172,14 +170,6 @@ public class RenderedContraption { } private static PlacementSimulationWorld setupRenderWorld(World world, Contraption c) { - if (ModList.get().isLoaded("starlight")) { - return PlacementSimulationWorldStarlight.setupRenderWorldStarlight(world, c); - } else { - return setupRenderWorldVanilla(world, c); - } - } - - private static PlacementSimulationWorld setupRenderWorldVanilla(World world, Contraption c) { PlacementSimulationWorld renderWorld = new PlacementSimulationWorld(world); renderWorld.setTileEntities(c.presentTileEntities.values()); diff --git a/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java b/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java index 632bf6870..e60bb7a40 100644 --- a/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java +++ b/src/main/java/com/simibubi/create/content/schematics/SchematicWorld.java @@ -12,7 +12,6 @@ import java.util.stream.Stream; import com.simibubi.create.Create; import com.simibubi.create.foundation.utility.worldWrappers.WrappedChunkProvider; import com.simibubi.create.foundation.utility.worldWrappers.WrappedWorld; -import com.simibubi.create.foundation.utility.worldWrappers.chunk.WrappedChunk; import net.minecraft.block.AbstractFurnaceBlock; import net.minecraft.block.Block; @@ -54,7 +53,7 @@ public class SchematicWorld extends WrappedWorld implements IServerWorld { } public SchematicWorld(BlockPos anchor, World original) { - super(original, new WrappedChunkProvider(WrappedChunk::new)); + super(original, new WrappedChunkProvider()); this.blocks = new HashMap<>(); this.tileEntities = new HashMap<>(); this.bounds = new MutableBoundingBox(); @@ -110,7 +109,7 @@ public class SchematicWorld extends WrappedWorld implements IServerWorld { } return null; } - + protected void onTEadded(TileEntity tileEntity, BlockPos pos) { tileEntity.setLocation(this, pos); } diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorld.java index 0ffde3ab4..ac5fdae65 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorld.java @@ -6,7 +6,6 @@ import java.util.HashSet; import java.util.function.Predicate; import com.simibubi.create.foundation.render.backend.instancing.IFlywheelWorld; -import com.simibubi.create.foundation.utility.worldWrappers.chunk.WrappedChunk; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; @@ -26,7 +25,7 @@ public class PlacementSimulationWorld extends WrappedWorld implements IFlywheelW private final BlockPos.Mutable scratch = new BlockPos.Mutable(); public PlacementSimulationWorld(World wrapped) { - this(wrapped, new WrappedChunkProvider(WrappedChunk::new)); + this(wrapped, new WrappedChunkProvider()); } public PlacementSimulationWorld(World wrapped, WrappedChunkProvider chunkProvider) { diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorldStarlight.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorldStarlight.java deleted file mode 100644 index 1b2ba2ab7..000000000 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorldStarlight.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.simibubi.create.foundation.utility.worldWrappers; - -import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.foundation.utility.worldWrappers.chunk.WrappedChunkStarlight; - -import ca.spottedleaf.starlight.common.light.VariableBlockLightHandler; -import ca.spottedleaf.starlight.common.light.VariableBlockLightHandlerImpl; -import ca.spottedleaf.starlight.common.world.ExtendedWorld; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraft.world.chunk.IChunk; -import net.minecraft.world.gen.feature.template.Template; -import net.minecraft.world.lighting.WorldLightManager; - -public class PlacementSimulationWorldStarlight extends PlacementSimulationWorld implements ExtendedWorld { - - VariableBlockLightHandler variableBlockLightHandler = new VariableBlockLightHandlerImpl(); - - public PlacementSimulationWorldStarlight(World wrapped) { - super(wrapped, new WrappedChunkProvider(WrappedChunkStarlight::new)); - } - - @Override - public Chunk getChunkAtImmediately(int i, int i1) { - return null; - } - - @Override - public IChunk getAnyChunkImmediately(int i, int i1) { - return null; - } - - @Override - public VariableBlockLightHandler getCustomLightHandler() { - return variableBlockLightHandler; - } - - @Override - public void setCustomLightHandler(VariableBlockLightHandler variableBlockLightHandler) { - this.variableBlockLightHandler = variableBlockLightHandler; - } - - public static PlacementSimulationWorld setupRenderWorldStarlight(World world, Contraption c) { - PlacementSimulationWorld renderWorld = new PlacementSimulationWorldStarlight(world); - - renderWorld.setTileEntities(c.presentTileEntities.values()); - - for (Template.BlockInfo info : c.getBlocks() - .values()) - renderWorld.setBlockState(info.pos, info.state); - - WorldLightManager lighter = renderWorld.lighter; - - renderWorld.chunkProvider.getLightSources().forEach((pos) -> lighter.func_215573_a(pos, renderWorld.getLightValue(pos))); - - lighter.tick(Integer.MAX_VALUE, true, false); - - return renderWorld; - } -} diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedChunkProvider.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedChunkProvider.java index a364ceb47..4bb1dfffa 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedChunkProvider.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedChunkProvider.java @@ -21,12 +21,6 @@ public class WrappedChunkProvider extends AbstractChunkProvider { public HashMap chunks; - protected final ChunkFactory chunkFactory; - - public WrappedChunkProvider(ChunkFactory chunkFactory) { - this.chunkFactory = chunkFactory; - } - public WrappedChunkProvider setWorld(PlacementSimulationWorld world) { this.world = world; this.chunks = new HashMap<>(); @@ -64,8 +58,7 @@ public class WrappedChunkProvider extends AbstractChunkProvider { if (chunks == null) return null; - - return chunks.computeIfAbsent(pos, $ -> chunkFactory.create(world, x, z)); + return chunks.computeIfAbsent(pos, $ -> new WrappedChunk(world, x, z)); } @Override @@ -77,8 +70,4 @@ public class WrappedChunkProvider extends AbstractChunkProvider { public WorldLightManager getLightManager() { return world.getLightingProvider(); } - - public interface ChunkFactory { - WrappedChunk create(PlacementSimulationWorld world, int x, int z); - } } diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/chunk/WrappedChunk.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/chunk/WrappedChunk.java index b8b06bd1d..c7bd8101d 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/chunk/WrappedChunk.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/chunk/WrappedChunk.java @@ -219,7 +219,7 @@ public class WrappedChunk implements IChunk { @Override public void addStructureReference(Structure arg0, long arg1) { - + } @Override @@ -239,17 +239,17 @@ public class WrappedChunk implements IChunk { @Override public void setStructureReferences(Map, LongSet> arg0) { - + } @Override public void setStructureStart(Structure arg0, StructureStart arg1) { - + } @Override public void setStructureStarts(Map, StructureStart> p_201612_1_) { - + } @Override @@ -257,5 +257,4 @@ public class WrappedChunk implements IChunk { return null; } - } diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/chunk/WrappedChunkStarlight.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/chunk/WrappedChunkStarlight.java deleted file mode 100644 index 839e8469c..000000000 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/chunk/WrappedChunkStarlight.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.simibubi.create.foundation.utility.worldWrappers.chunk; - -import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld; - -import ca.spottedleaf.starlight.common.chunk.ExtendedChunk; -import ca.spottedleaf.starlight.common.light.SWMRNibbleArray; -import ca.spottedleaf.starlight.common.light.StarLightEngine; -import net.minecraft.world.chunk.ChunkSection; -import net.minecraft.world.chunk.IChunk; - -public class WrappedChunkStarlight extends WrappedChunk implements ExtendedChunk { - - private SWMRNibbleArray[] blockNibbles; - private SWMRNibbleArray[] skyNibbles; - private boolean[] skyEmptinessMap; - private boolean[] blockEmptinessMap; - - public WrappedChunkStarlight(PlacementSimulationWorld world, int x, int z) { - super(world, x, z); - - this.blockNibbles = StarLightEngine.getFilledEmptyLight(world); - this.skyNibbles = StarLightEngine.getFilledEmptyLight(world); - this.skyEmptinessMap = getEmptySectionsForChunk(this); - this.blockEmptinessMap = getEmptySectionsForChunk(this); - } - - @Override - public SWMRNibbleArray[] getBlockNibbles() { - return blockNibbles; - } - - @Override - public void setBlockNibbles(SWMRNibbleArray[] swmrNibbleArrays) { - this.blockNibbles = swmrNibbleArrays; - } - - @Override - public SWMRNibbleArray[] getSkyNibbles() { - return skyNibbles; - } - - @Override - public void setSkyNibbles(SWMRNibbleArray[] swmrNibbleArrays) { - this.skyNibbles = swmrNibbleArrays; - } - - @Override - public boolean[] getSkyEmptinessMap() { - return skyEmptinessMap; - } - - @Override - public void setSkyEmptinessMap(boolean[] booleans) { - this.skyEmptinessMap = booleans; - } - - @Override - public boolean[] getBlockEmptinessMap() { - return blockEmptinessMap; - } - - @Override - public void setBlockEmptinessMap(boolean[] booleans) { - this.blockEmptinessMap = booleans; - } - - public static boolean[] getEmptySectionsForChunk(IChunk chunk) { - ChunkSection[] sections = chunk.getSections(); - boolean[] ret = new boolean[sections.length]; - - for (int i = 0; i < sections.length; ++i) { - ret[i] = sections[i] == null || sections[i].isEmpty(); - } - - return ret; - } -}