From cdf7f58331a1c1123043361414e872be93e01ea0 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Sat, 9 Dec 2023 13:47:42 +0200 Subject: Fix client-sided field initialisers being used in common classes Fixes #231. Fabric Loader 0.15 fixes the treatment of client-only fields, so this code crashed before. --- src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java | 2 +- src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java index bfe64a2..a18d706 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WItemSlot.java @@ -85,7 +85,7 @@ public class WItemSlot extends WWidget { private final List peers = new ArrayList<>(); @Nullable @Environment(EnvType.CLIENT) - private BackgroundPainter backgroundPainter = null; + private BackgroundPainter backgroundPainter; @Nullable private Icon icon = null; private boolean iconOnlyPaintedForEmptySlots = false; diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java index 63ccdea..c1aef2a 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WPanel.java @@ -25,7 +25,7 @@ public abstract class WPanel extends WWidget { */ protected final List children = new WidgetList(this, new ArrayList<>()); @Environment(EnvType.CLIENT) - private BackgroundPainter backgroundPainter = null; + private BackgroundPainter backgroundPainter; /** * Removes the widget from this panel. -- cgit