Fixed Startup Errors
This commit is contained in:
parent
05eac6f539
commit
d07afd9b01
6 changed files with 18 additions and 23 deletions
|
@ -14,8 +14,8 @@ import ru.bclib.api.biomes.BiomeAPI;
|
|||
|
||||
@Mixin(CreateWorldScreen.class)
|
||||
public class CreateWorldScreenMixin {
|
||||
@Inject(method = "<init>", at = @At("HEAD"))
|
||||
private static void bcl_init(Screen screen,
|
||||
@Inject(method = "<init>", at = @At("TAIL"))
|
||||
private void bcl_init(Screen screen,
|
||||
DataPackConfig dataPackConfig,
|
||||
WorldGenSettingsComponent worldGenSettingsComponent,
|
||||
CallbackInfo ci) {
|
||||
|
|
|
@ -49,9 +49,14 @@ public class FogRendererMixin {
|
|||
}
|
||||
|
||||
@Inject(method = "setupFog", at = @At("HEAD"), cancellable = true)
|
||||
private static void bclib_fogDensity(Camera camera, FogRenderer.FogMode fogMode, float viewDistance, boolean thickFog, CallbackInfo info) {
|
||||
private static void bclib_fogDensity(Camera camera,
|
||||
FogRenderer.FogMode fogMode,
|
||||
float viewDistance,
|
||||
boolean thickFog,
|
||||
float g,
|
||||
CallbackInfo ci) {
|
||||
if (CustomFogRenderer.applyFogDensity(camera, viewDistance, thickFog)) {
|
||||
info.cancel();
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package ru.bclib.mixin.common;
|
||||
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.world.level.levelgen.presets.WorldPreset;
|
||||
import net.minecraft.world.level.levelgen.presets.WorldPresets;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
@Mixin(WorldPresets.class)
|
||||
public interface WorldPresetsAccessor {
|
||||
@Invoker("register")
|
||||
public static ResourceKey<WorldPreset> callRegister(String string) {
|
||||
throw new RuntimeException("Not Implemented");
|
||||
}
|
||||
}
|
|
@ -4,6 +4,7 @@ import net.minecraft.core.Holder;
|
|||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.data.BuiltinRegistries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.biome.Biome;
|
||||
import net.minecraft.world.level.biome.MultiNoiseBiomeSource;
|
||||
import net.minecraft.world.level.dimension.BuiltinDimensionTypes;
|
||||
|
@ -26,6 +27,7 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.ModifyArg;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import ru.bclib.BCLib;
|
||||
import ru.bclib.world.generator.BCLibEndBiomeSource;
|
||||
import ru.bclib.world.generator.BCLibNetherBiomeSource;
|
||||
|
||||
|
@ -33,7 +35,7 @@ import java.util.Map;
|
|||
|
||||
@Mixin(WorldPresets.Bootstrap.class)
|
||||
public abstract class WorldPresetsBootstrapMixin {
|
||||
private static final ResourceKey<WorldPreset> BCL_NORMAL = WorldPresetsAccessor.callRegister("normal");
|
||||
private static final ResourceKey<WorldPreset> BCL_NORMAL = bcl_register("normal");
|
||||
@Shadow @Final private Registry<WorldPreset> presets;
|
||||
@Shadow @Final private Registry<Biome> biomes;
|
||||
@Shadow @Final private Registry<StructureSet> structureSets;
|
||||
|
@ -43,6 +45,11 @@ public abstract class WorldPresetsBootstrapMixin {
|
|||
@Shadow @Final private Holder<DimensionType> endDimensionType;
|
||||
@Shadow @Final private Holder<NoiseGeneratorSettings> endNoiseSettings;
|
||||
|
||||
//see WorldPresets.register
|
||||
private static ResourceKey<WorldPreset> bcl_register(String string) {
|
||||
return ResourceKey.create(Registry.WORLD_PRESET_REGISTRY, BCLib.makeID(string));
|
||||
}
|
||||
|
||||
@ModifyArg(method="run", at=@At(value="INVOKE", ordinal = 0, target="Lnet/minecraft/world/level/levelgen/presets/WorldPresets$Bootstrap;registerCustomOverworldPreset(Lnet/minecraft/resources/ResourceKey;Lnet/minecraft/world/level/dimension/LevelStem;)Lnet/minecraft/core/Holder;"))
|
||||
private LevelStem bcl_getOverworldStem(LevelStem overworldStem){
|
||||
LevelStem bclNether = new LevelStem(
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
"ItemStackMixin",
|
||||
"TagLoaderMixin",
|
||||
"MainMixin",
|
||||
"WorldPresetsAccessor",
|
||||
"WorldPresetsBootstrapMixin",
|
||||
"WorldOpenFlowsMixin",
|
||||
"WorldGenPropertiesMixin"
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
"depends": {
|
||||
"fabricloader": ">=0.14.3",
|
||||
"fabric": ">=0.52.0",
|
||||
"minecraft": "1.19"
|
||||
"minecraft": "1.19-alpha.22.18.a"
|
||||
},
|
||||
"custom":{
|
||||
"modmenu":{
|
||||
|
|
Loading…
Reference in a new issue