Updated everything(need to update the sodium stuff)

This commit is contained in:
coolGi2007
2022-01-09 20:09:06 +10:30
parent ae820320de
commit b13626689b
18 changed files with 212 additions and 71 deletions
@@ -105,6 +105,9 @@ public class Config extends ConfigGui
@ConfigAnnotations.Entry
public static HorizontalQuality horizontalQuality = IQuality.HORIZONTAL_QUALITY_DEFAULT;
@ConfigAnnotations.Entry
public static DropoffQuality dropoffQuality = IQuality.DROPOFF_QUALITY_DEFAULT;
}
@@ -168,8 +171,9 @@ public class Config extends ConfigGui
@ConfigAnnotations.Entry
public static DistanceGenerationMode distanceGenerationMode = IWorldGenerator.DISTANCE_GENERATION_MODE_DEFAULT;
// FIXME: Temperary override. In 1.18, the newer Unstable gnerator is more usable
@ConfigAnnotations.Entry
public static boolean allowUnstableFeatureGeneration = IWorldGenerator.ALLOW_UNSTABLE_FEATURE_GENERATION_DEFAULT;
public static boolean allowUnstableFeatureGeneration = true;//IWorldGenerator.ALLOW_UNSTABLE_FEATURE_GENERATION_DEFAULT;
@ConfigAnnotations.Entry
public static BlocksToAvoid blocksToAvoid = IWorldGenerator.BLOCKS_TO_AVOID_DEFAULT;
@@ -96,7 +96,16 @@ public class ChunkPosWrapper extends AbstractChunkPosWrapper
@Override
public boolean equals(Object o)
{
return chunkPos.equals(o);
// If the object is compared with itself then return true
if (o == this) {
return true;
}
// Check if o is an instance of RegionPos or not
if (!(o instanceof ChunkPosWrapper)) {
return false;
}
ChunkPosWrapper c = (ChunkPosWrapper) o;
return c.chunkPos.equals(chunkPos);
}
@Override
@@ -13,6 +13,8 @@ import com.seibel.lod.common.wrappers.block.BlockShapeWrapper;
import com.seibel.lod.common.wrappers.world.BiomeWrapper;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.LightLayer;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.LiquidBlock;
import net.minecraft.world.level.block.LiquidBlockContainer;
@@ -31,6 +33,7 @@ import net.minecraft.world.level.levelgen.Heightmap;
public class ChunkWrapper implements IChunkWrapper
{
private ChunkAccess chunk;
private BlockAndTintGetter lightSource;
private final int CHUNK_SECTION_SHIFT = 4;
private final int CHUNK_SECTION_MASK = 0b1111;
private final int CHUNK_SIZE_SHIFT = 4;
@@ -66,7 +69,7 @@ public class ChunkWrapper implements IChunkWrapper
@Override
public IBiomeWrapper getBiome(int x, int y, int z)
{
return BiomeWrapper.getBiomeWrapper(chunk.getBiomes().getNoiseBiome((x & CHUNK_SIZE_MASK) >> 2, y >> 2, (z & CHUNK_SIZE_MASK) >> 2));
return BiomeWrapper.getBiomeWrapper(chunk.getNoiseBiome((x & CHUNK_SIZE_MASK) >> 2, y >> 2, (z & CHUNK_SIZE_MASK) >> 2));
}
@Override
@@ -85,9 +88,16 @@ public class ChunkWrapper implements IChunkWrapper
return BlockShapeWrapper.getBlockShapeWrapper(block, this, x, y, z);
}
@Deprecated
public ChunkWrapper(ChunkAccess chunk)
{
this.chunk = chunk;
this.lightSource = null;
}
public ChunkWrapper(ChunkAccess chunk, BlockAndTintGetter lightSource)
{
this.chunk = chunk;
this.lightSource = lightSource;
}
public ChunkAccess getChunk() {
@@ -157,4 +167,16 @@ public class ChunkWrapper implements IChunkWrapper
{
return chunk.getLightEmission(new BlockPos(x,y,z));
}
@Override
public int getBlockLight(int x, int y, int z) {
if (lightSource == null) return -1;
return lightSource.getBrightness(LightLayer.BLOCK, new BlockPos(x,y,z));
}
@Override
public int getSkyLight(int x, int y, int z) {
if (lightSource == null) return -1;
return lightSource.getBrightness(LightLayer.SKY, new BlockPos(x, y, z));
}
}
@@ -185,6 +185,16 @@ public class LodConfigWrapperSingleton implements ILodConfigWrapperSingleton
ConfigGui.editSingleOption.getEntry("client.graphics.quality.horizontalQuality").value = newHorizontalQuality;
ConfigGui.editSingleOption.saveOption("client.graphics.quality.horizontalQuality");
}
@Override
public DropoffQuality getDropoffQuality() {
return Config.Client.Graphics.Quality.dropoffQuality;
}
@Override
public void setDropoffQuality(DropoffQuality newDropoffQuality) {
ConfigGui.editSingleOption.getEntry("client.graphics.quality.dropoffQuality").value = newDropoffQuality;
ConfigGui.editSingleOption.saveOption("client.graphics.quality.dropoffQuality");
}
}
@@ -31,7 +31,7 @@ public class TexturedButtonWidget extends ImageButton {
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderTexture(0, WIDGETS_LOCATION);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, this.alpha);
int i = this.getYImage(this.isHovered());
int i = this.getYImage(this.isHovered);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.enableDepthTest();
@@ -2,18 +2,16 @@ package com.seibel.lod.common.wrappers.minecraft;
import java.awt.*;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.stream.Collectors;
import com.mojang.blaze3d.platform.NativeImage;
import com.mojang.blaze3d.systems.RenderSystem;
import com.seibel.lod.common.wrappers.WrapperFactory;
import com.seibel.lod.common.wrappers.misc.LightMapWrapper;
import com.seibel.lod.core.handlers.IReflectionHandler;
import com.seibel.lod.core.handlers.ReflectionHandler;
import com.seibel.lod.core.api.ModAccessorApi;
import com.seibel.lod.core.util.LodUtil;
import net.minecraft.client.renderer.FogRenderer;
import net.minecraft.client.renderer.LightTexture;
import net.minecraft.world.level.material.FogType;
import org.lwjgl.opengl.GL20;
import com.mojang.math.Vector3f;
import com.seibel.lod.core.objects.math.Mat4f;
@@ -22,18 +20,20 @@ import com.seibel.lod.core.objects.math.Vec3f;
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.minecraft.IMinecraftRenderWrapper;
import com.seibel.lod.core.wrapperInterfaces.modAccessor.ISodiumAccessor;
import com.seibel.lod.common.wrappers.McObjectConverter;
import com.seibel.lod.common.wrappers.WrapperFactory;
import com.seibel.lod.common.wrappers.block.BlockPosWrapper;
import com.seibel.lod.common.wrappers.chunk.ChunkPosWrapper;
import net.minecraft.client.Camera;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.FogRenderer;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.LevelRenderer;
import net.minecraft.client.renderer.LevelRenderer.RenderChunkInfo;
import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher.CompiledChunk;
import net.minecraft.core.BlockPos;
import net.minecraft.world.effect.MobEffects;
import net.minecraft.world.level.material.FogType;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.phys.Vec3;
@@ -42,7 +42,7 @@ import net.minecraft.world.phys.Vec3;
* related to rendering in Minecraft.
*
* @author James Seibel
* @version 12-14-2021
* @version 12-12-2021
*/
public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
{
@@ -50,8 +50,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
private static final Minecraft MC = Minecraft.getInstance();
private static final GameRenderer GAME_RENDERER = MC.gameRenderer;
private static final WrapperFactory FACTORY = WrapperFactory.INSTANCE;
@Override
public Vec3f getLookAtVector()
@@ -102,6 +101,7 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
float[] colorValues = RenderSystem.getShaderFogColor();
return new Color(colorValues[0], colorValues[1], colorValues[2], colorValues[3]);
}
// getUnderWaterFogColor() is the same as getFogColor()
@Override
public Color getSkyColor() {
@@ -140,36 +140,26 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
* This method returns the ChunkPos of all chunks that Minecraft
* is going to render this frame. <br><br>
* <p>
* Note: This isn't perfect. It will return some chunks that are outside
* the clipping plane. (For example, if you are high above the ground some chunks
* will be incorrectly added, even though they are outside render range).
*/
@Override
public HashSet<AbstractChunkPosWrapper> getVanillaRenderedChunks()
{
HashSet<AbstractChunkPosWrapper> loadedPos = new HashSet<>();
// Wow, those are some long names!
// go through every RenderInfo to get the compiled chunks
LevelRenderer renderer = MC.levelRenderer;
for (LevelRenderer.RenderChunkInfo worldRenderer$LocalRenderInformationContainer : renderer.renderChunks)
{
CompiledChunk compiledChunk = worldRenderer$LocalRenderInformationContainer.chunk.getCompiledChunk();
if (!compiledChunk.hasNoRenderableLayers())
{
// add the ChunkPos for every rendered chunk
BlockPos bpos = worldRenderer$LocalRenderInformationContainer.chunk.getOrigin();
loadedPos.add(new ChunkPosWrapper(bpos));
}
public HashSet<AbstractChunkPosWrapper> getVanillaRenderedChunks() {
ISodiumAccessor sodium = ModAccessorApi.get(ISodiumAccessor.class);
if (sodium != null) {
return sodium.getNormalRenderedChunks();
}
return loadedPos;
LevelRenderer levelRenderer = MC.levelRenderer;
LinkedHashSet<LevelRenderer.RenderChunkInfo> chunks = levelRenderer.renderChunkStorage.get().renderChunks;
return (chunks.stream().map((chunk) -> {
AABB chunkBoundingBox = chunk.chunk.bb;
return FACTORY.createChunkPos(Math.floorDiv((int) chunkBoundingBox.minX, 16),
Math.floorDiv((int) chunkBoundingBox.minZ, 16));
}).collect(Collectors.toCollection(HashSet::new)));
}
@Override
public int[] getLightmapPixels()
{
@@ -203,11 +193,10 @@ public class MinecraftRenderWrapper implements IMinecraftRenderWrapper
int col =
((c.getRed() & 0xFF) << 16) | // blue
((c.getGreen() & 0xFF) << 8) | // green
((c.getBlue() & 0xFF)) | // red
((c.getAlpha() & 0xFF) << 24); // alpha
((c.getGreen() & 0xFF) << 8) | // green
((c.getBlue() & 0xFF)) | // red
((c.getAlpha() & 0xFF) << 24); // alpha
// 2D array stored in a 1D array.
// Thank you Tim from College ;)
pixels[u * lightMapWidth + v] = col;
@@ -25,9 +25,12 @@ import java.util.concurrent.ConcurrentMap;
import com.seibel.lod.core.enums.WorldType;
import com.seibel.lod.core.wrapperInterfaces.block.AbstractBlockPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
import com.seibel.lod.core.wrapperInterfaces.world.IBiomeWrapper;
import com.seibel.lod.core.wrapperInterfaces.world.IWorldWrapper;
import com.seibel.lod.common.wrappers.block.BlockPosWrapper;
import com.seibel.lod.common.wrappers.chunk.ChunkWrapper;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.core.BlockPos;
@@ -35,6 +38,9 @@ import net.minecraft.server.level.ServerChunkCache;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.LightLayer;
import net.minecraft.world.level.chunk.ChunkAccess;
import net.minecraft.world.level.chunk.ChunkStatus;
import org.jetbrains.annotations.Nullable;
/**
@@ -138,7 +144,8 @@ public class WorldWrapper implements IWorldWrapper
}
@Override
public short getMinHeight() {
public short getMinHeight()
{
return (short) world.getMinBuildHeight();
}
@@ -170,5 +177,12 @@ public class WorldWrapper implements IWorldWrapper
return world.getSeaLevel();
}
@Override
public IChunkWrapper tryGetChunk(AbstractChunkPosWrapper pos) {
ChunkAccess chunk = world.getChunk(pos.getX(), pos.getZ(), ChunkStatus.EMPTY, false);
if (chunk == null) return null;
return new ChunkWrapper(chunk, world);
}
}
@@ -39,8 +39,6 @@ import net.minecraft.sounds.SoundSource;
import net.minecraft.world.DifficultyInstance;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.level.EmptyTickList;
import net.minecraft.world.level.TickList;
import net.minecraft.world.level.WorldGenLevel;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.BiomeManager;
@@ -62,6 +60,7 @@ import net.minecraft.world.level.material.Fluid;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.storage.LevelData;
import net.minecraft.world.phys.AABB;
import net.minecraft.world.ticks.LevelTickAccess;
import org.jetbrains.annotations.Nullable;
@@ -106,7 +105,7 @@ public class LodServerWorld implements WorldGenLevel
@Override
public Biome getBiome(BlockPos pos)
{
return chunk.getBiomes().getNoiseBiome(pos.getX() >> 2, pos.getY() >> 2, pos.getZ() >> 2);
return chunk.getNoiseBiome(pos.getX() >> 2, pos.getY() >> 2, pos.getZ() >> 2);
}
@Override
@@ -140,9 +139,19 @@ public class LodServerWorld implements WorldGenLevel
}
@Override
public TickList<Block> getBlockTicks()
public long nextSubTickCount() {
return 0;
}
@Override
public LevelTickAccess<Block> getBlockTicks()
{
return EmptyTickList.empty();
return null;
}
@Override
public LevelTickAccess<Fluid> getFluidTicks() {
return null;
}
@Override
@@ -152,17 +161,11 @@ public class LodServerWorld implements WorldGenLevel
}
@Override
public Stream<? extends StructureStart<?>> startsForFeature(SectionPos p_241827_1_, StructureFeature<?> p_241827_2_)
public List<? extends StructureStart<?>> startsForFeature(SectionPos p_241827_1_, StructureFeature<?> p_241827_2_)
{
return serverWorld.startsForFeature(p_241827_1_, p_241827_2_);
}
@Override
public TickList<Fluid> getLiquidTicks()
{
return EmptyTickList.empty();
}
@Override
public LevelLightEngine getLightEngine()
{
@@ -115,7 +115,7 @@ public class WorldGeneratorWrapper extends AbstractWorldGeneratorWrapper
ChunkAccess ca = serverWorld.getChunkSource().getChunk(chunkX, chunkZ, targetStatus, true);
if (ca == null) throw new RuntimeException("This should NEVER be null due to bool being true");
lodBuilder.generateLodNodeFromChunk(lodDim, new ChunkWrapper(ca), new LodBuilderConfig(generationMode));
lodBuilder.generateLodNodeFromChunk(lodDim, new ChunkWrapper(ca, serverWorld), new LodBuilderConfig(generationMode), false);
// long duration = System.nanoTime()-t;
@@ -13,6 +13,12 @@ accessible field net/minecraft/client/renderer/LevelRenderer renderChunks Lit/un
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;
# used for grabbing vanilla rendered chunks
accessible field net/minecraft/client/renderer/LevelRenderer renderChunkStorage Ljava/util/concurrent/atomic/AtomicReference;
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkStorage
accessible class net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo
accessible field net/minecraft/client/renderer/LevelRenderer$RenderChunkInfo chunk Lnet/minecraft/client/renderer/chunk/ChunkRenderDispatcher$RenderChunk;
# lighting
accessible field net/minecraft/client/renderer/LightTexture lightPixels Lcom/mojang/blaze3d/platform/NativeImage;
accessible field net/minecraft/world/level/lighting/LevelLightEngine blockEngine Lnet/minecraft/world/level/lighting/LayerLightEngine;
+1 -1
Submodule core updated: 5ac51dd2a5...d1e1970c18
+21
View File
@@ -1,5 +1,6 @@
plugins {
id "com.github.johnrengelman.shadow" version "7.0.0"
id "com.modrinth.minotaur" version "1.2.1"
}
loom {
@@ -20,10 +21,20 @@ configurations {
repositories {
// Required for ModMenu
maven { url "https://maven.terraformersmc.com/" }
// Required for Sodium
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
}
dependencies {
// Fabric loader
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
// TODO: This is only for LodMain, try to find a way to remove it
@@ -35,12 +46,22 @@ dependencies {
exclude(group: "net.fabricmc.fabric-api")
}
// Sodium
modImplementation "maven.modrinth:sodium:${project.sodium_version}"
implementation "org.joml:joml:1.10.2"
// Iris
// modImplementation "maven.modrinth:iris:${project.iris_version}"
// Toml
implementation("com.electronwill.night-config:toml:${rootProject.toml_version}")
shadowMe("com.electronwill.night-config:toml:${rootProject.toml_version}") {}
common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowMe(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
// Compression
common 'org.tukaani:xz:1.9'
common 'org.apache.commons:commons-compress:1.21'
shadowMe 'org.tukaani:xz:1.9'
@@ -41,6 +41,7 @@ import net.fabricmc.fabric.mixin.event.lifecycle.client.ClientChunkManagerMixin;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientChunkCache;
import net.minecraft.client.multiplayer.ClientPacketListener;
import net.minecraft.core.BlockPos;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.Level;
@@ -59,6 +60,7 @@ import org.lwjgl.glfw.GLFW;
public class ClientProxy
{
private final EventApi eventApi = EventApi.INSTANCE;
private final ClientApi clientApi = ClientApi.INSTANCE;
/**
@@ -68,6 +70,8 @@ public class ClientProxy
public void registerEvents() {
// TODO: Fix this if it's wrong
/* Registor the mod accessor*/
/* World Events */
//ServerTickEvents.START_SERVER_TICK.register(this::serverTickEvent);
ServerTickEvents.END_SERVER_TICK.register(this::serverTickEvent);
@@ -76,8 +80,6 @@ public class ClientProxy
//ServerChunkEvents.CHUNK_LOAD.register(this::chunkLoadEvent);
ClientChunkEvents.CHUNK_LOAD.register(this::chunkLoadEvent);
/* World Events */
ServerWorldEvents.LOAD.register((server, level) -> this.worldLoadEvent(level));
ServerWorldEvents.UNLOAD.register((server, level) -> this.worldUnloadEvent(level));
@@ -101,7 +103,8 @@ public class ClientProxy
public void chunkLoadEvent(LevelAccessor level, LevelChunk chunk)
{
eventApi.chunkLoadEvent(new ChunkWrapper(chunk), DimensionTypeWrapper.getDimensionTypeWrapper(level.dimensionType()));
clientApi.clientChunkLoadEvent(new ChunkWrapper(chunk, level),
WorldWrapper.getWorldWrapper(level));
}
public void worldSaveEvent()
@@ -145,7 +148,7 @@ public class ClientProxy
* }
*/
public void blockChangeEvent(LevelAccessor world, BlockPos pos) {
IChunkWrapper chunk = new ChunkWrapper(world.getChunk(pos));
IChunkWrapper chunk = new ChunkWrapper(world.getChunk(pos), world);
DimensionTypeWrapper dimType = DimensionTypeWrapper.getDimensionTypeWrapper(world.dimensionType());
// recreate the LOD where the blocks were changed
@@ -22,9 +22,13 @@ package com.seibel.lod.fabric;
import com.seibel.lod.common.LodCommonMain;
import com.seibel.lod.core.ModInfo;
import com.seibel.lod.core.api.ClientApi;
import com.seibel.lod.core.api.ModAccessorApi;
import com.seibel.lod.core.wrapperInterfaces.modAccessor.ISodiumAccessor;
import com.seibel.lod.fabric.modAccessor.SodiumAccessor;
import com.seibel.lod.fabric.wrappers.DependencySetup;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.loader.api.FabricLoader;
/**
* Initialize and setup the Mod. <br>
@@ -60,6 +64,9 @@ public class Main implements ClientModInitializer
// Check if this works
client_proxy = new ClientProxy();
client_proxy.registerEvents();
if (FabricLoader.getInstance().isModLoaded("sodium")) {
ModAccessorApi.bind(ISodiumAccessor.class, new SodiumAccessor());
}
}
public static void initServer() {
@@ -23,7 +23,7 @@ import java.util.concurrent.Semaphore;
@Mixin(PalettedContainer.class)
public class MixinPalettedContainer {
@Mutable
@Shadow @Final private Semaphore lock;
private Semaphore lock;
@Inject(method = "<init>", at = @At("RETURN"))
private void setSemaphore(CallbackInfo ci) {
@@ -0,0 +1,43 @@
package com.seibel.lod.fabric.modAccessor;
import java.util.HashSet;
import java.util.stream.Collectors;
import com.seibel.lod.core.util.SingletonHandler;
import com.seibel.lod.core.wrapperInterfaces.IWrapperFactory;
import com.seibel.lod.core.wrapperInterfaces.chunk.AbstractChunkPosWrapper;
import com.seibel.lod.core.wrapperInterfaces.modAccessor.ISodiumAccessor;
import me.jellysquid.mods.sodium.client.render.SodiumWorldRenderer;
import net.minecraft.client.Minecraft;
import net.minecraft.core.SectionPos;
import net.minecraft.world.level.ChunkPos;
import net.minecraft.world.level.LevelHeightAccessor;
public class SodiumAccessor implements ISodiumAccessor {
IWrapperFactory factory = SingletonHandler.get(IWrapperFactory.class);
@Override
public String getModName() {
return "Sodium-Fabric-1.18.X";
}
@Override
public HashSet<AbstractChunkPosWrapper> getNormalRenderedChunks() {
SodiumWorldRenderer renderer = SodiumWorldRenderer.instance();
LevelHeightAccessor height = Minecraft.getInstance().level;
// 0b11 = Lighted chunk & loaded chunk
return renderer.getChunkTracker().getChunks(0b11).filter(
(long l) -> {
for (int i = height.getMinSection(); i<height.getMaxSection(); i++) {
SectionPos p = SectionPos.of(new ChunkPos(l), i);
if (renderer.isBoxVisible(p.minBlockX()+1, p.minBlockY()+1, p.minBlockZ()+1,
p.maxBlockX()-1, p.maxBlockY()-1, p.maxBlockZ()-1)) return true;
}
return false;
}).mapToObj((long l) -> {
return (AbstractChunkPosWrapper)factory.createChunkPos(l);
}).collect(Collectors.toCollection(HashSet::new));
}
}
@@ -19,6 +19,7 @@
package com.seibel.lod.forge;
import com.seibel.lod.core.api.ClientApi;
import com.seibel.lod.core.api.EventApi;
import com.seibel.lod.core.wrapperInterfaces.chunk.IChunkWrapper;
import com.seibel.lod.common.wrappers.chunk.ChunkWrapper;
@@ -42,6 +43,7 @@ import net.minecraftforge.eventbus.api.SubscribeEvent;
public class ForgeClientProxy
{
private final EventApi eventApi = EventApi.INSTANCE;
private final ClientApi clientApi = ClientApi.INSTANCE;
@@ -54,7 +56,7 @@ public class ForgeClientProxy
@SubscribeEvent
public void chunkLoadEvent(ChunkEvent.Load event)
{
eventApi.chunkLoadEvent(new ChunkWrapper(event.getChunk()), DimensionTypeWrapper.getDimensionTypeWrapper(event.getWorld().dimensionType()));
clientApi.clientChunkLoadEvent(new ChunkWrapper(event.getChunk(), event.getWorld()), WorldWrapper.getWorldWrapper(event.getWorld()));
}
@SubscribeEvent
@@ -88,7 +90,7 @@ public class ForgeClientProxy
event.getClass() == BlockEvent.FluidPlaceBlockEvent.class ||
event.getClass() == BlockEvent.PortalSpawnEvent.class)
{
IChunkWrapper chunk = new ChunkWrapper(event.getWorld().getChunk(event.getPos()));
IChunkWrapper chunk = new ChunkWrapper(event.getWorld().getChunk(event.getPos()), event.getWorld());
DimensionTypeWrapper dimType = DimensionTypeWrapper.getDimensionTypeWrapper(event.getWorld().dimensionType());
// recreate the LOD where the blocks were changed
+13 -5
View File
@@ -1,14 +1,22 @@
org.gradle.jvmargs=-Xmx2048M
minecraft_version=1.17.1
minecraft_version=1.18.1
archives_base_name=DistantHorizons
mod_version=1.5.4a
maven_group=com.seibel.lod
toml_version=3.6.0
fabric_loader_version=0.11.6
fabric_api_version=0.37.1+1.17
modmenu_version=2.0.14
forge_version=37.1.0
# Fabric loader
fabric_loader_version=0.12.12
fabric_api_version=0.44.0+1.18
# Fabric mods
modmenu_version=3.0.0
sodium_version=mc1.17.1-0.3.3
# iris_version=1.17.x-v1.1.4
# Forge loader
forge_version=39.0.5
# Forge mods
## currentlly no mods ##