aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornea <nea@nea.moe>2023-02-17 21:16:45 +0100
committernea <nea@nea.moe>2023-02-17 21:16:45 +0100
commit5d638060e1a8c553f2389ca7e138505d5712d012 (patch)
treee2d38da4fb8b3f508557ab2d5f43819463aac316 /src
parent00a0237b2046d0a297645d5dc196de7c4903da88 (diff)
downloadNotEnoughUpdates-5d638060e1a8c553f2389ca7e138505d5712d012.tar.gz
NotEnoughUpdates-5d638060e1a8c553f2389ca7e138505d5712d012.tar.bz2
NotEnoughUpdates-5d638060e1a8c553f2389ca7e138505d5712d012.zip
Fuck who gives a fuck anymore this wasnt a good git history to begin withfeat/museumhighlightsolo
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/events/GuiContainerBackgroundDrawnEvent.java29
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java3
2 files changed, 31 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/events/GuiContainerBackgroundDrawnEvent.java b/src/main/java/io/github/moulberry/notenoughupdates/events/GuiContainerBackgroundDrawnEvent.java
new file mode 100644
index 00000000..bdb6d1a1
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/events/GuiContainerBackgroundDrawnEvent.java
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2022 NotEnoughUpdates contributors
+ *
+ * This file is part of NotEnoughUpdates.
+ *
+ * NotEnoughUpdates is free software: you can redistribute it
+ * and/or modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * NotEnoughUpdates is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package io.github.moulberry.notenoughupdates.events;
+
+import lombok.Value;
+import net.minecraft.client.gui.inventory.GuiContainer;
+
+@Value
+public class GuiContainerBackgroundDrawnEvent extends NEUEvent {
+ public GuiContainer container;
+ public float partialTicks;
+}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java
index a5bb99b8..8aca73d1 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java
@@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.mixins;
import io.github.moulberry.notenoughupdates.NEUOverlay;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
+import io.github.moulberry.notenoughupdates.events.GuiContainerBackgroundDrawnEvent;
import io.github.moulberry.notenoughupdates.events.SlotClickEvent;
import io.github.moulberry.notenoughupdates.listener.RenderListener;
import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneFavourites;
@@ -330,6 +331,6 @@ public abstract class MixinGuiContainer extends GuiScreen {
@Inject(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GlStateManager;color(FFFF)V", ordinal = 1))
private void drawBackground(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
- AbiphoneFavourites.getInstance().onDrawBackground(this);
+ new GuiContainerBackgroundDrawnEvent(((GuiContainer) (Object) this), partialTicks).post();
}
}