MixinPalettedContainer
This commit is contained in:
+6
-4
@@ -206,14 +206,16 @@ public class WorldGeneratorWrapper extends AbstractWorldGeneratorWrapper
|
||||
chunk.setStatus(ChunkStatus.STRUCTURE_REFERENCES);
|
||||
chunkGen.createBiomes(serverWorld.registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), chunk);
|
||||
ChunkStatus.NOISE.generate(Executor, serverWorld, chunkGen, templateManager, lightEngine, null, chunkList);
|
||||
// TODO: Find why this dosnt work (seems like the "Executor" is doing this)
|
||||
// TODO: Find why this doesn't work (seems like the "Executor" is doing this)
|
||||
ChunkStatus.SURFACE.generate(Executor, serverWorld, chunkGen, templateManager, lightEngine, null, chunkList);
|
||||
|
||||
// this feature has been proven to be thread safe,
|
||||
// so we will add it
|
||||
FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext = new FeaturePlaceContext<>(lodServerWorld, chunkGen, serverWorld.random, chunk.getPos().getWorldPosition(), null);
|
||||
SnowAndFreezeFeature snowFeature = new SnowAndFreezeFeature(NoneFeatureConfiguration.CODEC);
|
||||
snowFeature.place(featurePlaceContext);
|
||||
|
||||
// TODO: Find why this doesn't work
|
||||
// FeaturePlaceContext<NoneFeatureConfiguration> featurePlaceContext = new FeaturePlaceContext<>(lodServerWorld, chunkGen, serverWorld.random, chunk.getPos().getWorldPosition(), null);
|
||||
// SnowAndFreezeFeature snowFeature = new SnowAndFreezeFeature(NoneFeatureConfiguration.CODEC);
|
||||
// snowFeature.place(featurePlaceContext);
|
||||
|
||||
|
||||
lodBuilder.generateLodNodeFromChunk(lodDim, new ChunkWrapper(chunk), new LodBuilderConfig(DistanceGenerationMode.SURFACE));
|
||||
|
||||
@@ -30,3 +30,7 @@ accessible field net/minecraft/client/renderer/texture/TextureAtlasSprite mainIm
|
||||
accessible method net/minecraft/client/renderer/texture/TextureAtlasSprite$AnimatedTexture getFrameX (I)I
|
||||
accessible method net/minecraft/client/renderer/texture/TextureAtlasSprite$AnimatedTexture getFrameY (I)I
|
||||
extendable class com/mojang/math/Matrix4f
|
||||
|
||||
# hacky stuff
|
||||
mutable field Lnet/minecraft/world/level/chunk/PalettedContainer traces Lnet/minecraft/util/DebugBuffer;
|
||||
mutable field Lnet/minecraft/world/level/chunk/PalettedContainer lock Ljava/util/concurrent/Semaphore;
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.seibel.lod.fabric.mixins.unsafe;
|
||||
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import net.minecraft.util.DebugBuffer;
|
||||
import net.minecraft.world.level.chunk.PalettedContainer;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Final;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Mutable;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import java.util.concurrent.Semaphore;
|
||||
|
||||
/**
|
||||
* NOTE: THIS IS NOT A FIX TO THE PROBLEM.
|
||||
* TODO: Do/Find an actual fix to this
|
||||
*
|
||||
* @author Ran
|
||||
*/
|
||||
@Mixin(PalettedContainer.class)
|
||||
public class MixinPalettedContainer {
|
||||
@Mutable
|
||||
@Shadow @Final private Semaphore lock;
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void setSemaphore(CallbackInfo ci) {
|
||||
this.lock = new Semaphore(2);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,9 @@
|
||||
"minVersion": "0.8",
|
||||
"package": "com.seibel.lod.fabric.mixins",
|
||||
"compatibilityLevel": "JAVA_16",
|
||||
"mixins": [],
|
||||
"mixins": [
|
||||
"unsafe.MixinPalettedContainer"
|
||||
],
|
||||
"client": [
|
||||
"MixinMinecraft",
|
||||
"MixinOptionsScreen",
|
||||
|
||||
Reference in New Issue
Block a user