-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to 1.19 + Mixin Organization + Wild Registry Rewrite
- Loading branch information
Showing
52 changed files
with
229 additions
and
212 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,60 @@ | ||
package net.ludocrypt.limlib.api; | ||
|
||
import net.ludocrypt.limlib.access.DimensionEffectsAccess; | ||
import net.minecraft.structure.StructureSet; | ||
import com.google.common.base.Supplier; | ||
import com.google.common.base.Suppliers; | ||
|
||
import net.ludocrypt.limlib.access.DimensionTypeAccess; | ||
import net.minecraft.util.Identifier; | ||
import net.minecraft.util.math.noise.DoublePerlinNoiseSampler; | ||
import net.minecraft.util.registry.Registry; | ||
import net.minecraft.util.registry.RegistryKey; | ||
import net.minecraft.world.World; | ||
import net.minecraft.world.biome.Biome; | ||
import net.minecraft.world.dimension.DimensionOptions; | ||
import net.minecraft.world.dimension.DimensionType; | ||
import net.minecraft.world.gen.chunk.ChunkGeneratorSettings; | ||
|
||
public class LiminalWorld { | ||
|
||
private final Identifier identifier; | ||
private final DimensionType dimensionType; | ||
private final DimensionOptionsGetter dimensionOptionsGetter; | ||
private final LiminalEffects liminalEffects; | ||
private final Supplier<DimensionType> dimensionType; | ||
private final Supplier<DimensionOptions> dimensionOptions; | ||
|
||
public LiminalWorld(Identifier identifier, DimensionType dimensionType, DimensionOptionsGetter dimensionOptionsGetter, LiminalEffects liminalEffects) { | ||
public LiminalWorld(Identifier identifier, LiminalEffects liminalEffects, Supplier<DimensionType> dimensionType, Supplier<DimensionOptions> dimensionOptions) { | ||
this.identifier = identifier; | ||
this.dimensionType = dimensionType; | ||
this.dimensionOptionsGetter = dimensionOptionsGetter; | ||
this.liminalEffects = liminalEffects; | ||
((DimensionEffectsAccess) (Object) this.dimensionType).setLiminalEffects(liminalEffects); | ||
this.dimensionType = Suppliers.memoize(() -> { | ||
DimensionType type = dimensionType.get(); | ||
((DimensionTypeAccess) (Object) type).setLiminalEffects(liminalEffects); | ||
return type; | ||
}); | ||
this.dimensionOptions = Suppliers.memoize(dimensionOptions); | ||
} | ||
|
||
public Identifier getIdentifier() { | ||
return identifier; | ||
return this.identifier; | ||
} | ||
|
||
public RegistryKey<DimensionType> getDimensionTypeKey() { | ||
return RegistryKey.of(Registry.DIMENSION_TYPE_KEY, identifier); | ||
return RegistryKey.of(Registry.DIMENSION_TYPE_KEY, this.identifier); | ||
} | ||
|
||
public RegistryKey<DimensionOptions> getDimensionKey() { | ||
return RegistryKey.of(Registry.DIMENSION_KEY, identifier); | ||
return RegistryKey.of(Registry.DIMENSION_KEY, this.identifier); | ||
} | ||
|
||
public RegistryKey<World> getWorldKey() { | ||
return RegistryKey.of(Registry.WORLD_KEY, identifier); | ||
return RegistryKey.of(Registry.WORLD_KEY, this.identifier); | ||
} | ||
|
||
public DimensionType getDimensionType() { | ||
return dimensionType; | ||
return this.dimensionType.get(); | ||
} | ||
|
||
public DimensionOptionsGetter getDimensionOptionsGetter() { | ||
return dimensionOptionsGetter; | ||
public DimensionOptions getDimensionOptions() { | ||
return this.dimensionOptions.get(); | ||
} | ||
|
||
public LiminalEffects getLiminalEffects() { | ||
return liminalEffects; | ||
} | ||
|
||
@FunctionalInterface | ||
public static interface DimensionOptionsGetter { | ||
public DimensionOptions get(LiminalWorld world, Registry<DimensionType> dimensionTypeRegistry, Registry<Biome> biomeRegistry, Registry<StructureSet> structureSetRegistry, Registry<ChunkGeneratorSettings> chunkGeneratorSettingsRegistry, Registry<DoublePerlinNoiseSampler.NoiseParameters> noiseParametersRegistry); | ||
return this.liminalEffects; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 0 additions & 9 deletions
9
src/main/java/net/ludocrypt/limlib/impl/LevelStorageHacks.java
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/main/java/net/ludocrypt/limlib/mixin/RegistryOpsMixin.java
This file was deleted.
Oops, something went wrong.
29 changes: 0 additions & 29 deletions
29
src/main/java/net/ludocrypt/limlib/mixin/WorldPresetsRegistrarMixin.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/net/ludocrypt/limlib/mixin/client/render/BackgroundRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package net.ludocrypt.limlib.mixin.client.render; | ||
|
||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.ModifyVariable; | ||
|
||
import net.ludocrypt.limlib.access.DimensionTypeAccess; | ||
import net.ludocrypt.limlib.api.LiminalEffects; | ||
import net.minecraft.client.MinecraftClient; | ||
import net.minecraft.client.render.BackgroundRenderer; | ||
|
||
@Mixin(BackgroundRenderer.class) | ||
public abstract class BackgroundRendererMixin { | ||
|
||
@ModifyVariable(method = "render", at = @At(value = "STORE", ordinal = 4), ordinal = 2) | ||
private static float corners$modifySkyColor(float in) { | ||
MinecraftClient client = MinecraftClient.getInstance(); | ||
|
||
LiminalEffects effects = ((DimensionTypeAccess) (Object) client.world.getDimension()).getLiminalEffects(); | ||
|
||
if (effects.getSkyShading().isPresent()) { | ||
return effects.getSkyShading().get(); | ||
} | ||
|
||
return 1.0F; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...crypt/limlib/mixin/GameRendererMixin.java → ...ixin/client/render/GameRendererMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...limlib/mixin/WorldRendererAfterMixin.java → ...lient/render/WorldRendererAfterMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...imlib/mixin/WorldRendererBeforeMixin.java → ...ient/render/WorldRendererBeforeMixin.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.