Skip to content

Commit

Permalink
LambDynamicLights v1.2.2: Fix random crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
LambdAurora committed Jul 16, 2020
1 parent 636081b commit 0efc013
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ archives_base_name = lambdynamiclights
# currently not on the main fabric site, check on the maven: https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api
fabric_version=0.14.0+build.371-1.16
spruceui_version=1.5.8
modmenu_version=1.12.2+build.17
modmenu_version=1.14.1+build.26
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@

package me.lambdaurora.lambdynlights.mixin;

import me.lambdaurora.lambdynlights.LambDynLights;
import me.lambdaurora.lambdynlights.gui.SettingsScreen;
import me.lambdaurora.spruceui.Tooltip;
import me.lambdaurora.spruceui.option.SpruceSimpleActionOption;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.screen.VideoOptionsScreen;
import net.minecraft.client.gui.screen.options.GameOptionsScreen;
import net.minecraft.client.gui.widget.ButtonListWidget;
import net.minecraft.client.options.GameOptions;
import net.minecraft.client.options.Option;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -30,15 +32,23 @@ public class VideoOptionsScreenMixin extends GameOptionsScreen
@Shadow
private ButtonListWidget list;

private Option lambdynlights_option;

public VideoOptionsScreenMixin(Screen parent, GameOptions gameOptions, Text title)
{
super(parent, gameOptions, title);
}

@Inject(method = "<init>", at = @At("TAIL"))
private void onConstruct(Screen parent, GameOptions gameOptions, CallbackInfo ci)
{
this.lambdynlights_option = new SpruceSimpleActionOption("lambdynlights.menu.title", btn -> this.client.openScreen(new SettingsScreen(this)));
}

@Inject(method = "init", at = @At("TAIL"))
private void onInit(CallbackInfo ci)
{
this.list.addSingleOptionEntry(LambDynLights.get().config.dynamicLightsModeOption);
this.list.addSingleOptionEntry(this.lambdynlights_option);
}

@Inject(method = "render", at = @At("TAIL"))
Expand Down

0 comments on commit 0efc013

Please sign in to comment.