Skip to content

Commit

Permalink
Patch owolib/gadget compat
Browse files Browse the repository at this point in the history
  • Loading branch information
RacoonDog authored and MineGame159 committed Aug 7, 2024
1 parent 31e879e commit c094f46
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.client.gui.screen.ChatScreen;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.text.Style;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -36,8 +37,8 @@ private void onRenderBackground(CallbackInfo info) {
}

@Inject(method = "handleTextClick", at = @At(value = "HEAD"), cancellable = true)
private void onInvalidClickEvent(Style style, CallbackInfoReturnable<Boolean> cir) {
if (!(style.getClickEvent() instanceof RunnableClickEvent runnableClickEvent)) return;
private void onInvalidClickEvent(@Nullable Style style, CallbackInfoReturnable<Boolean> cir) {
if (style == null || !(style.getClickEvent() instanceof RunnableClickEvent runnableClickEvent)) return;

runnableClickEvent.runnable.run();
cir.setReturnValue(true);
Expand Down

0 comments on commit c094f46

Please sign in to comment.