Skip to content

Commit

Permalink
removed broken mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticpasta1 committed Jul 31, 2023
1 parent 3759413 commit 7f1f49d
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 82 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,32 @@

public class AtlantisChunkSkylightProvider extends SkyLightEngine {

public AtlantisChunkSkylightProvider(LightChunkGetter chunkProvider) {
super(chunkProvider);
}
public AtlantisChunkSkylightProvider(LightChunkGetter chunkProvider) {
super(chunkProvider);
}

@Override
protected int computeLevelFromNeighbor(long sourceId, long targetId, int level) {
int propagatedLevel = super.computeLevelFromNeighbor(sourceId, targetId, level);
@Override
protected int computeLevelFromNeighbor(long sourceId, long targetId, int level) {
int propagatedLevel = super.computeLevelFromNeighbor(sourceId, targetId, level);

if (AtlantisConfig.INSTANCE.shouldHavePerBiomeLighting.get()) {
BlockPos blockPos = BlockPos.of(targetId);
ChunkPos chunkPos = new ChunkPos(blockPos);
BlockPos blockPos = BlockPos.of(targetId);
ChunkPos chunkPos = new ChunkPos(blockPos);

BlockGetter blockGetter = chunkSource.getChunkForLighting(chunkPos.x, chunkPos.z);
if (blockGetter instanceof ChunkAccess chunkAccess) {
Holder<Biome> biome = chunkAccess.getNoiseBiome(
QuartPos.fromBlock(blockPos.getX()),
QuartPos.fromBlock(blockPos.getY()),
QuartPos.fromBlock(blockPos.getZ())
);
if (biome.unwrapKey().isPresent()) {
if (ACommonFEvents.map != null) {
if (ACommonFEvents.map.containsKey(biome.unwrapKey().get().location())) {
return Math.min(ACommonFEvents.map.get(biome.unwrapKey().get().location()), propagatedLevel);
}
}
}
}
}
return propagatedLevel;
}
BlockGetter blockGetter = chunkSource.getChunkForLighting(chunkPos.x, chunkPos.z);
if (blockGetter instanceof ChunkAccess chunkAccess) {
Holder<Biome> biome = chunkAccess.getNoiseBiome(
QuartPos.fromBlock(blockPos.getX()),
QuartPos.fromBlock(blockPos.getY()),
QuartPos.fromBlock(blockPos.getZ())
);
if (biome.unwrapKey().isPresent()) {
if (ACommonFEvents.map != null) {
if (ACommonFEvents.map.containsKey(biome.unwrapKey().get().location())) {
return Math.min(ACommonFEvents.map.get(biome.unwrapKey().get().location()), propagatedLevel);
}
}
}
}
return propagatedLevel;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.mystic.atlantis.mixin;

import com.mystic.atlantis.config.AtlantisConfig;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Mutable;
Expand All @@ -25,7 +26,7 @@ abstract public class LightingProviderMixin implements LightEventListener {
@Inject(at = @At("TAIL"), method = "<init>")
public void init(LightChunkGetter chunkProvider, boolean hasBlockLight, boolean hasSkyLight, CallbackInfo ci) {
if(chunkProvider.getLevel() instanceof Level level){
if (DimensionAtlantis.isAtlantisDimension(level)) {
if (DimensionAtlantis.isAtlantisDimension(level) && AtlantisConfig.INSTANCE.shouldHavePerBiomeLighting.get()) {
skyEngine = hasSkyLight ? new AtlantisChunkSkylightProvider(chunkProvider) : null;
}
}
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion src/main/resources/atlantis.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"RedstoneAccessor",
"RedstoneWireBlockMixin",
"RenderBubblesMixin",
"SkyLightEngineRadonFix",
"WorldLightManagerMixin"
],
"client": [
Expand Down

0 comments on commit 7f1f49d

Please sign in to comment.