mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 06:24:43 +00:00
Setup and import of 1.16 YEET
This commit is contained in:
931 files changed
+18847
-9127
No files matched your search
@@ -19,6 +19,7 @@
|
||||
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
|
||||
@@ -48,6 +49,7 @@ public class GuiContainerEvent extends Event
|
||||
*/
|
||||
public static class DrawForeground extends GuiContainerEvent
|
||||
{
|
||||
private final MatrixStack mStack;
|
||||
private final int mouseX;
|
||||
private final int mouseY;
|
||||
|
||||
@@ -55,16 +57,23 @@ public class GuiContainerEvent extends Event
|
||||
* Called directly after the GuiContainer has drawn any foreground elements.
|
||||
*
|
||||
* @param guiContainer The container.
|
||||
* @param mStack The MatrixStack.
|
||||
* @param mouseX The current X position of the players mouse.
|
||||
* @param mouseY The current Y position of the players mouse.
|
||||
*/
|
||||
public DrawForeground(ContainerScreen guiContainer, int mouseX, int mouseY)
|
||||
public DrawForeground(ContainerScreen guiContainer, MatrixStack mStack, int mouseX, int mouseY)
|
||||
{
|
||||
super(guiContainer);
|
||||
this.mStack = mStack;
|
||||
this.mouseX = mouseX;
|
||||
this.mouseY = mouseY;
|
||||
}
|
||||
|
||||
public MatrixStack getMatrixStack()
|
||||
{
|
||||
return mStack;
|
||||
}
|
||||
|
||||
public int getMouseX()
|
||||
{
|
||||
return mouseX;
|
||||
@@ -82,6 +91,7 @@ public class GuiContainerEvent extends Event
|
||||
*/
|
||||
public static class DrawBackground extends GuiContainerEvent
|
||||
{
|
||||
private final MatrixStack mStack;
|
||||
private final int mouseX;
|
||||
private final int mouseY;
|
||||
|
||||
@@ -89,16 +99,23 @@ public class GuiContainerEvent extends Event
|
||||
* Called directly after the GuiContainer has drawn any background elements.
|
||||
*
|
||||
* @param guiContainer The container.
|
||||
* @param mStack The MatrixStack.
|
||||
* @param mouseX The current X position of the players mouse.
|
||||
* @param mouseY The current Y position of the players mouse.
|
||||
*/
|
||||
public DrawBackground(ContainerScreen guiContainer, int mouseX, int mouseY)
|
||||
public DrawBackground(ContainerScreen guiContainer, MatrixStack mStack, int mouseX, int mouseY)
|
||||
{
|
||||
super(guiContainer);
|
||||
this.mStack = mStack;
|
||||
this.mouseX = mouseX;
|
||||
this.mouseY = mouseY;
|
||||
}
|
||||
|
||||
public MatrixStack getMatrixStack()
|
||||
{
|
||||
return mStack;
|
||||
}
|
||||
|
||||
public int getMouseX()
|
||||
{
|
||||
return mouseX;
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.IGuiEventListener;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
@@ -127,18 +128,28 @@ public class GuiScreenEvent extends Event
|
||||
|
||||
public static class DrawScreenEvent extends GuiScreenEvent
|
||||
{
|
||||
private final MatrixStack mStack;
|
||||
private final int mouseX;
|
||||
private final int mouseY;
|
||||
private final float renderPartialTicks;
|
||||
|
||||
public DrawScreenEvent(Screen gui, int mouseX, int mouseY, float renderPartialTicks)
|
||||
public DrawScreenEvent(Screen gui, MatrixStack mStack, int mouseX, int mouseY, float renderPartialTicks)
|
||||
{
|
||||
super(gui);
|
||||
this.mStack = mStack;
|
||||
this.mouseX = mouseX;
|
||||
this.mouseY = mouseY;
|
||||
this.renderPartialTicks = renderPartialTicks;
|
||||
}
|
||||
|
||||
/**
|
||||
* The MatrixStack to render with.
|
||||
*/
|
||||
public MatrixStack getMatrixStack()
|
||||
{
|
||||
return mStack;
|
||||
}
|
||||
|
||||
/**
|
||||
* The x coordinate of the mouse pointer on the screen.
|
||||
*/
|
||||
@@ -170,9 +181,9 @@ public class GuiScreenEvent extends Event
|
||||
@Cancelable
|
||||
public static class Pre extends DrawScreenEvent
|
||||
{
|
||||
public Pre(Screen gui, int mouseX, int mouseY, float renderPartialTicks)
|
||||
public Pre(Screen gui, MatrixStack mStack, int mouseX, int mouseY, float renderPartialTicks)
|
||||
{
|
||||
super(gui, mouseX, mouseY, renderPartialTicks);
|
||||
super(gui, mStack, mouseX, mouseY, renderPartialTicks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -181,9 +192,9 @@ public class GuiScreenEvent extends Event
|
||||
*/
|
||||
public static class Post extends DrawScreenEvent
|
||||
{
|
||||
public Post(Screen gui, int mouseX, int mouseY, float renderPartialTicks)
|
||||
public Post(Screen gui, MatrixStack mStack, int mouseX, int mouseY, float renderPartialTicks)
|
||||
{
|
||||
super(gui, mouseX, mouseY, renderPartialTicks);
|
||||
super(gui, mStack, mouseX, mouseY, renderPartialTicks);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ package net.minecraftforge.client.event;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
import net.minecraft.client.MainWindow;
|
||||
@@ -70,19 +71,22 @@ public class RenderGameOverlayEvent extends Event
|
||||
VIGNETTE
|
||||
}
|
||||
|
||||
private final MatrixStack mStack;
|
||||
private final float partialTicks;
|
||||
private final MainWindow window;
|
||||
private final ElementType type;
|
||||
|
||||
public RenderGameOverlayEvent(float partialTicks, MainWindow window)
|
||||
public RenderGameOverlayEvent(MatrixStack mStack, float partialTicks, MainWindow window)
|
||||
{
|
||||
this.mStack = mStack;
|
||||
this.partialTicks = partialTicks;
|
||||
this.window = window;
|
||||
this.type = null;
|
||||
}
|
||||
|
||||
private RenderGameOverlayEvent(RenderGameOverlayEvent parent, ElementType type)
|
||||
private RenderGameOverlayEvent(MatrixStack mStack, RenderGameOverlayEvent parent, ElementType type)
|
||||
{
|
||||
this.mStack = mStack;
|
||||
this.partialTicks = parent.getPartialTicks();
|
||||
this.window = parent.getWindow();
|
||||
this.type = type;
|
||||
@@ -90,17 +94,17 @@ public class RenderGameOverlayEvent extends Event
|
||||
|
||||
public static class Pre extends RenderGameOverlayEvent
|
||||
{
|
||||
public Pre(RenderGameOverlayEvent parent, ElementType type)
|
||||
public Pre(MatrixStack mStack, RenderGameOverlayEvent parent, ElementType type)
|
||||
{
|
||||
super(parent, type);
|
||||
super(mStack, parent, type);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post extends RenderGameOverlayEvent
|
||||
{
|
||||
public Post(RenderGameOverlayEvent parent, ElementType type)
|
||||
public Post(MatrixStack mStack, RenderGameOverlayEvent parent, ElementType type)
|
||||
{
|
||||
super(parent, type);
|
||||
super(mStack, parent, type);
|
||||
}
|
||||
@Override public boolean isCancelable(){ return false; }
|
||||
}
|
||||
@@ -111,9 +115,9 @@ public class RenderGameOverlayEvent extends Event
|
||||
private final int x;
|
||||
private final int y;
|
||||
private int increment;
|
||||
public BossInfo(RenderGameOverlayEvent parent, ElementType type, ClientBossInfo bossInfo, int x, int y, int increment)
|
||||
public BossInfo(MatrixStack mStack, RenderGameOverlayEvent parent, ElementType type, ClientBossInfo bossInfo, int x, int y, int increment)
|
||||
{
|
||||
super(parent, type);
|
||||
super(mStack, parent, type);
|
||||
this.bossInfo = bossInfo;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
@@ -166,9 +170,9 @@ public class RenderGameOverlayEvent extends Event
|
||||
{
|
||||
private final ArrayList<String> left;
|
||||
private final ArrayList<String> right;
|
||||
public Text(RenderGameOverlayEvent parent, ArrayList<String> left, ArrayList<String> right)
|
||||
public Text(MatrixStack mStack, RenderGameOverlayEvent parent, ArrayList<String> left, ArrayList<String> right)
|
||||
{
|
||||
super(parent, ElementType.TEXT);
|
||||
super(mStack, parent, ElementType.TEXT);
|
||||
this.left = left;
|
||||
this.right = right;
|
||||
}
|
||||
@@ -189,9 +193,9 @@ public class RenderGameOverlayEvent extends Event
|
||||
private int posX;
|
||||
private int posY;
|
||||
|
||||
public Chat(RenderGameOverlayEvent parent, int posX, int posY)
|
||||
public Chat(MatrixStack mStack, RenderGameOverlayEvent parent, int posX, int posY)
|
||||
{
|
||||
super(parent, ElementType.CHAT);
|
||||
super(mStack, parent, ElementType.CHAT);
|
||||
this.setPosX(posX);
|
||||
this.setPosY(posY);
|
||||
}
|
||||
|
||||
@@ -19,12 +19,11 @@
|
||||
|
||||
package net.minecraftforge.client.event;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.entity.EntityRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.EntityEvent;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
@@ -53,20 +52,14 @@ import net.minecraftforge.eventbus.api.Event;
|
||||
public class RenderNameplateEvent extends EntityEvent
|
||||
{
|
||||
|
||||
private String nameplateContent;
|
||||
private final String originalContent;
|
||||
private ITextComponent nameplateContent;
|
||||
private final ITextComponent originalContent;
|
||||
private final EntityRenderer<?> entityRenderer;
|
||||
private final MatrixStack matrixStack;
|
||||
private final IRenderTypeBuffer renderTypeBuffer;
|
||||
private final int packedLight;
|
||||
|
||||
@Deprecated //TODO 1.16: upon removal, also remove @Nullable on getEntityRenderer(), and update its javadoc
|
||||
public RenderNameplateEvent(Entity entity, String content, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer)
|
||||
{
|
||||
this(entity, content, null, matrixStack, renderTypeBuffer, 0);
|
||||
}
|
||||
|
||||
public RenderNameplateEvent(Entity entity, String content, EntityRenderer<?> entityRenderer, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int packedLight)
|
||||
public RenderNameplateEvent(Entity entity, ITextComponent content, EntityRenderer<?> entityRenderer, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int packedLight)
|
||||
{
|
||||
super(entity);
|
||||
this.originalContent = content;
|
||||
@@ -80,7 +73,7 @@ public class RenderNameplateEvent extends EntityEvent
|
||||
/**
|
||||
* Sets the content that is to be rendered on the name plate/tag
|
||||
*/
|
||||
public void setContent(String contents)
|
||||
public void setContent(ITextComponent contents)
|
||||
{
|
||||
this.nameplateContent = contents;
|
||||
}
|
||||
@@ -88,7 +81,7 @@ public class RenderNameplateEvent extends EntityEvent
|
||||
/**
|
||||
* The content being rendered on the name plate/tag
|
||||
*/
|
||||
public String getContent()
|
||||
public ITextComponent getContent()
|
||||
{
|
||||
return this.nameplateContent;
|
||||
}
|
||||
@@ -96,7 +89,7 @@ public class RenderNameplateEvent extends EntityEvent
|
||||
/**
|
||||
* The original content being rendered on the name plate/tag
|
||||
*/
|
||||
public String getOriginalContent()
|
||||
public ITextComponent getOriginalContent()
|
||||
{
|
||||
return this.originalContent;
|
||||
}
|
||||
@@ -104,7 +97,6 @@ public class RenderNameplateEvent extends EntityEvent
|
||||
/**
|
||||
* The entity renderer that renders the name plate/tag, if it was provided
|
||||
*/
|
||||
@Nullable
|
||||
public EntityRenderer<?> getEntityRenderer()
|
||||
{
|
||||
return this.entityRenderer;
|
||||
|
||||
@@ -26,6 +26,7 @@ import javax.annotation.Nonnull;
|
||||
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextProperties;
|
||||
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
|
||||
import net.minecraftforge.eventbus.api.Cancelable;
|
||||
import net.minecraftforge.eventbus.api.Event;
|
||||
@@ -46,12 +47,12 @@ public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api
|
||||
{
|
||||
@Nonnull
|
||||
protected final ItemStack stack;
|
||||
protected final List<String> lines;
|
||||
protected final List<? extends ITextProperties> lines;
|
||||
protected int x;
|
||||
protected int y;
|
||||
protected FontRenderer fr;
|
||||
|
||||
public RenderTooltipEvent(@Nonnull ItemStack stack, @Nonnull List<String> lines, int x, int y, @Nonnull FontRenderer fr)
|
||||
public RenderTooltipEvent(@Nonnull ItemStack stack, @Nonnull List<? extends ITextProperties> lines, int x, int y, @Nonnull FontRenderer fr)
|
||||
{
|
||||
this.stack = stack;
|
||||
this.lines = Collections.unmodifiableList(lines); // Leave editing to ItemTooltipEvent
|
||||
@@ -75,7 +76,7 @@ public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api
|
||||
* @return An <i>unmodifiable</i> list of strings. Use {@link ItemTooltipEvent} to modify tooltip text.
|
||||
*/
|
||||
@Nonnull
|
||||
public List<String> getLines()
|
||||
public List<? extends ITextProperties> getLines()
|
||||
{
|
||||
return lines;
|
||||
}
|
||||
@@ -117,7 +118,7 @@ public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api
|
||||
private int screenHeight;
|
||||
private int maxWidth;
|
||||
|
||||
public Pre(@Nonnull ItemStack stack, @Nonnull List<String> lines, int x, int y, int screenWidth, int screenHeight, int maxWidth, @Nonnull FontRenderer fr)
|
||||
public Pre(@Nonnull ItemStack stack, @Nonnull List<? extends ITextProperties> lines, int x, int y, int screenWidth, int screenHeight, int maxWidth, @Nonnull FontRenderer fr)
|
||||
{
|
||||
super(stack, lines, x, y, fr);
|
||||
this.screenWidth = screenWidth;
|
||||
@@ -200,7 +201,7 @@ public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api
|
||||
private final int width;
|
||||
private final int height;
|
||||
|
||||
public Post(@Nonnull ItemStack stack, @Nonnull List<String> textLines, int x, int y, @Nonnull FontRenderer fr, int width, int height)
|
||||
public Post(@Nonnull ItemStack stack, @Nonnull List<? extends ITextProperties> textLines, int x, int y, @Nonnull FontRenderer fr, int width, int height)
|
||||
{
|
||||
super(stack, textLines, x, y, fr);
|
||||
this.width = width;
|
||||
@@ -229,7 +230,7 @@ public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api
|
||||
*/
|
||||
public static class PostBackground extends Post
|
||||
{
|
||||
public PostBackground(@Nonnull ItemStack stack, @Nonnull List<String> textLines, int x, int y, @Nonnull FontRenderer fr, int width, int height)
|
||||
public PostBackground(@Nonnull ItemStack stack, @Nonnull List<? extends ITextProperties> textLines, int x, int y, @Nonnull FontRenderer fr, int width, int height)
|
||||
{ super(stack, textLines, x, y, fr, width, height); }
|
||||
}
|
||||
|
||||
@@ -238,7 +239,7 @@ public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api
|
||||
*/
|
||||
public static class PostText extends Post
|
||||
{
|
||||
public PostText(@Nonnull ItemStack stack, @Nonnull List<String> textLines, int x, int y, @Nonnull FontRenderer fr, int width, int height)
|
||||
public PostText(@Nonnull ItemStack stack, @Nonnull List<? extends ITextProperties> textLines, int x, int y, @Nonnull FontRenderer fr, int width, int height)
|
||||
{ super(stack, textLines, x, y, fr, width, height); }
|
||||
}
|
||||
|
||||
@@ -254,7 +255,7 @@ public abstract class RenderTooltipEvent extends net.minecraftforge.eventbus.api
|
||||
private int borderStart;
|
||||
private int borderEnd;
|
||||
|
||||
public Color(@Nonnull ItemStack stack, @Nonnull List<String> textLines, int x, int y, @Nonnull FontRenderer fr, int background, int borderStart,
|
||||
public Color(@Nonnull ItemStack stack, @Nonnull List<? extends ITextProperties> textLines, int x, int y, @Nonnull FontRenderer fr, int background, int borderStart,
|
||||
int borderEnd)
|
||||
{
|
||||
super(stack, textLines, x, y, fr);
|
||||
|
||||
@@ -21,8 +21,8 @@ package net.minecraftforge.client.event;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
import net.minecraft.util.math.vector.Matrix4f;
|
||||
|
||||
public class RenderWorldLastEvent extends net.minecraftforge.eventbus.api.Event
|
||||
{
|
||||
@@ -32,16 +32,6 @@ public class RenderWorldLastEvent extends net.minecraftforge.eventbus.api.Event
|
||||
private final Matrix4f projectionMatrix;
|
||||
private final long finishTimeNano;
|
||||
|
||||
@Deprecated // TODO: Remove in 1.16
|
||||
public RenderWorldLastEvent(WorldRenderer context, MatrixStack mat, float partialTicks)
|
||||
{
|
||||
this.context = context;
|
||||
this.mat = mat;
|
||||
this.partialTicks = partialTicks;
|
||||
this.projectionMatrix = null;
|
||||
this.finishTimeNano = 0;
|
||||
}
|
||||
|
||||
public RenderWorldLastEvent(WorldRenderer context, MatrixStack mat, float partialTicks, Matrix4f projectionMatrix, long finishTimeNano)
|
||||
{
|
||||
this.context = context;
|
||||
|
||||
Reference in new issue
Block a user