|
@@ -27,6 +27,7 @@ import net.fabricmc.api.Environment;
|
|
import net.minecraft.client.gui.components.AbstractWidget;
|
|
import net.minecraft.client.gui.components.AbstractWidget;
|
|
import net.minecraft.client.gui.components.events.GuiEventListener;
|
|
import net.minecraft.client.gui.components.events.GuiEventListener;
|
|
import net.minecraft.client.gui.screens.Screen;
|
|
import net.minecraft.client.gui.screens.Screen;
|
|
|
|
+import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
|
|
import net.minecraft.world.InteractionResult;
|
|
import net.minecraft.world.InteractionResult;
|
|
import net.minecraft.world.InteractionResultHolder;
|
|
import net.minecraft.world.InteractionResultHolder;
|
|
|
|
|
|
@@ -59,6 +60,14 @@ public interface GuiEvent {
|
|
* @see ScreenRenderPost#render(Screen, PoseStack, int, int, float)
|
|
* @see ScreenRenderPost#render(Screen, PoseStack, int, int, float)
|
|
*/
|
|
*/
|
|
Event<ScreenRenderPost> RENDER_POST = EventFactory.createLoop();
|
|
Event<ScreenRenderPost> RENDER_POST = EventFactory.createLoop();
|
|
|
|
+ /**
|
|
|
|
+ * @see ContainerScreenRenderBackground#render(AbstractContainerScreen, PoseStack, int, int, float)
|
|
|
|
+ */
|
|
|
|
+ Event<ContainerScreenRenderBackground> RENDER_CONTAINER_BACKGROUND = EventFactory.createLoop();
|
|
|
|
+ /**
|
|
|
|
+ * @see ContainerScreenRenderForeground#render(AbstractContainerScreen, PoseStack, int, int, float)
|
|
|
|
+ */
|
|
|
|
+ Event<ContainerScreenRenderForeground> RENDER_CONTAINER_FOREGROUND = EventFactory.createLoop();
|
|
/**
|
|
/**
|
|
* @see SetScreen#modifyScreen(Screen)
|
|
* @see SetScreen#modifyScreen(Screen)
|
|
*/
|
|
*/
|
|
@@ -146,6 +155,36 @@ public interface GuiEvent {
|
|
void render(Screen screen, PoseStack matrices, int mouseX, int mouseY, float delta);
|
|
void render(Screen screen, PoseStack matrices, int mouseX, int mouseY, float delta);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Environment(EnvType.CLIENT)
|
|
|
|
+ interface ContainerScreenRenderBackground {
|
|
|
|
+ /**
|
|
|
|
+ * Invoked after a container screen's background are rendered.
|
|
|
|
+ * Equivalent to Forge's {@code ContainerScreenEvent.DrawBackground} event.
|
|
|
|
+ *
|
|
|
|
+ * @param screen The screen.
|
|
|
|
+ * @param matrices The pose stack.
|
|
|
|
+ * @param mouseX The scaled x-coordinate of the mouse cursor.
|
|
|
|
+ * @param mouseY The scaled y-coordinate of the mouse cursor.
|
|
|
|
+ * @param delta The current tick delta.
|
|
|
|
+ */
|
|
|
|
+ void render(AbstractContainerScreen<?> screen, PoseStack matrices, int mouseX, int mouseY, float delta);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Environment(EnvType.CLIENT)
|
|
|
|
+ interface ContainerScreenRenderForeground {
|
|
|
|
+ /**
|
|
|
|
+ * Invoked after a screen has finished rendering most of the foreground, but before any floating widgets are rendered.
|
|
|
|
+ * Equivalent to Forge's {@code ContainerScreenEvent.DrawForeground} event.
|
|
|
|
+ *
|
|
|
|
+ * @param screen The screen.
|
|
|
|
+ * @param matrices The pose stack.
|
|
|
|
+ * @param mouseX The scaled x-coordinate of the mouse cursor.
|
|
|
|
+ * @param mouseY The scaled y-coordinate of the mouse cursor.
|
|
|
|
+ * @param delta The current tick delta.
|
|
|
|
+ */
|
|
|
|
+ void render(AbstractContainerScreen<?> screen, PoseStack matrices, int mouseX, int mouseY, float delta);
|
|
|
|
+ }
|
|
|
|
+
|
|
@Environment(EnvType.CLIENT)
|
|
@Environment(EnvType.CLIENT)
|
|
interface SetScreen {
|
|
interface SetScreen {
|
|
/**
|
|
/**
|