mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-21 12:42:26 +00:00
1.18.x Omnibus (#8239)
This commit is contained in:
1 parent
4011c3fb07
commit
34291c1fb2
89 files changed
+1014
-1192
No files matched your search
@@ -16,13 +16,13 @@ public abstract class EffectRenderer
|
||||
public static final EffectRenderer DUMMY = new EffectRenderer()
|
||||
{
|
||||
@Override
|
||||
public void renderInventoryEffect(MobEffectInstance effect, EffectRenderingInventoryScreen<?> gui, PoseStack mStack, int x, int y, float z)
|
||||
public void renderInventoryEffect(MobEffectInstance effectInstance, EffectRenderingInventoryScreen<?> gui, PoseStack poseStack, int x, int y, float z)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderHUDEffect(MobEffectInstance effect, GuiComponent gui, PoseStack mStack, int x, int y, float z, float alpha)
|
||||
public void renderHUDEffect(MobEffectInstance effectInstance, GuiComponent gui, PoseStack poseStack, int x, int y, float z, float alpha)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -65,26 +65,26 @@ public abstract class EffectRenderer
|
||||
* Called to draw the this Potion onto the player's inventory when it's active.
|
||||
* This can be used to e.g. render Potion icons from your own texture.
|
||||
*
|
||||
* @param effect the active PotionEffect
|
||||
* @param gui the gui instance
|
||||
* @param mStack The PoseStack
|
||||
* @param x the x coordinate
|
||||
* @param y the y coordinate
|
||||
* @param z the z level
|
||||
* @param effectInstance the effect instance
|
||||
* @param gui the gui instance
|
||||
* @param poseStack the pose stack
|
||||
* @param x the x coordinate
|
||||
* @param y the y coordinate
|
||||
* @param z the z level
|
||||
*/
|
||||
public abstract void renderInventoryEffect(MobEffectInstance effect, EffectRenderingInventoryScreen<?> gui, PoseStack mStack, int x, int y, float z);
|
||||
public abstract void renderInventoryEffect(MobEffectInstance effectInstance, EffectRenderingInventoryScreen<?> gui, PoseStack poseStack, int x, int y, float z);
|
||||
|
||||
/**
|
||||
* Called to draw the this Potion onto the player's ingame HUD when it's active.
|
||||
* This can be used to e.g. render Potion icons from your own texture.
|
||||
*
|
||||
* @param effect the active PotionEffect
|
||||
* @param gui the gui instance
|
||||
* @param mStack The PoseStack
|
||||
* @param x the x coordinate
|
||||
* @param y the y coordinate
|
||||
* @param z the z level
|
||||
* @param alpha the alpha value, blinks when the potion is about to run out
|
||||
* @param effectInstance the active PotionEffect
|
||||
* @param gui the gui instance
|
||||
* @param poseStack the pose stack
|
||||
* @param x the x coordinate
|
||||
* @param y the y coordinate
|
||||
* @param z the z level
|
||||
* @param alpha the alpha value, blinks when the potion is about to run out
|
||||
*/
|
||||
public abstract void renderHUDEffect(MobEffectInstance effect, GuiComponent gui, PoseStack mStack, int x, int y, float z, float alpha);
|
||||
public abstract void renderHUDEffect(MobEffectInstance effectInstance, GuiComponent gui, PoseStack poseStack, int x, int y, float z, float alpha);
|
||||
}
|
||||
@@ -205,28 +205,28 @@ public class ForgeHooksClient
|
||||
return result != null ? result : _default;
|
||||
}
|
||||
|
||||
public static boolean onDrawHighlight(LevelRenderer context, Camera info, HitResult target, float partialTicks, PoseStack matrix, MultiBufferSource buffers)
|
||||
public static boolean onDrawHighlight(LevelRenderer context, Camera camera, HitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource)
|
||||
{
|
||||
switch (target.getType()) {
|
||||
case BLOCK:
|
||||
if (!(target instanceof BlockHitResult)) return false;
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawSelectionEvent.HighlightBlock(context, info, target, partialTicks, matrix, buffers));
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawSelectionEvent.HighlightBlock(context, camera, target, partialTick, poseStack, bufferSource));
|
||||
case ENTITY:
|
||||
if (!(target instanceof EntityHitResult)) return false;
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawSelectionEvent.HighlightEntity(context, info, target, partialTicks, matrix, buffers));
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawSelectionEvent.HighlightEntity(context, camera, target, partialTick, poseStack, bufferSource));
|
||||
default:
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawSelectionEvent(context, info, target, partialTicks, matrix, buffers));
|
||||
return MinecraftForge.EVENT_BUS.post(new DrawSelectionEvent(context, camera, target, partialTick, poseStack, bufferSource));
|
||||
}
|
||||
}
|
||||
|
||||
public static void dispatchRenderLast(LevelRenderer context, PoseStack mat, float partialTicks, Matrix4f projectionMatrix, long finishTimeNano)
|
||||
public static void dispatchRenderLast(LevelRenderer context, PoseStack poseStack, float partialTick, Matrix4f projectionMatrix, long finishTimeNano)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new RenderLevelLastEvent(context, mat, partialTicks, projectionMatrix, finishTimeNano));
|
||||
MinecraftForge.EVENT_BUS.post(new RenderLevelLastEvent(context, poseStack, partialTick, projectionMatrix, finishTimeNano));
|
||||
}
|
||||
|
||||
public static boolean renderSpecificFirstPersonHand(InteractionHand hand, PoseStack mat, MultiBufferSource buffers, int light, float partialTicks, float interpPitch, float swingProgress, float equipProgress, ItemStack stack)
|
||||
public static boolean renderSpecificFirstPersonHand(InteractionHand hand, PoseStack poseStack, MultiBufferSource bufferSource, int packedLight, float partialTick, float interpPitch, float swingProgress, float equipProgress, ItemStack stack)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderHandEvent(hand, mat, buffers, light, partialTicks, interpPitch, swingProgress, equipProgress, stack));
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderHandEvent(hand, poseStack, bufferSource, packedLight, partialTick, interpPitch, swingProgress, equipProgress, stack));
|
||||
}
|
||||
|
||||
public static boolean renderSpecificFirstPersonArm(PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight, AbstractClientPlayer player, HumanoidArm arm)
|
||||
@@ -314,8 +314,8 @@ public class ForgeHooksClient
|
||||
return fovModifierEvent.getNewfov();
|
||||
}
|
||||
|
||||
public static double getFieldOfView(GameRenderer renderer, Camera info, double renderPartialTicks, double fov) {
|
||||
EntityViewRenderEvent.FieldOfView event = new EntityViewRenderEvent.FieldOfView(renderer, info, renderPartialTicks, fov);
|
||||
public static double getFieldOfView(GameRenderer renderer, Camera camera, double partialTick, double fov) {
|
||||
EntityViewRenderEvent.FieldOfView event = new EntityViewRenderEvent.FieldOfView(renderer, camera, partialTick, fov);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
return event.getFOV();
|
||||
}
|
||||
@@ -329,16 +329,16 @@ public class ForgeHooksClient
|
||||
//RenderingRegistry.registerBlockHandler(RenderBlockFluid.instance);
|
||||
}
|
||||
|
||||
public static void renderMainMenu(TitleScreen gui, PoseStack mStack, Font font, int width, int height, int alpha)
|
||||
public static void renderMainMenu(TitleScreen gui, PoseStack poseStack, Font font, int width, int height, int alpha)
|
||||
{
|
||||
VersionChecker.Status status = ForgeVersion.getStatus();
|
||||
if (status == BETA || status == BETA_OUTDATED)
|
||||
{
|
||||
// render a warning at the top of the screen,
|
||||
Component line = new TranslatableComponent("forge.update.beta.1", ChatFormatting.RED, ChatFormatting.RESET).withStyle(ChatFormatting.RED);
|
||||
GuiComponent.drawCenteredString(mStack, font, line, width / 2, 4 + (0 * (font.lineHeight + 1)), 0xFFFFFF | alpha);
|
||||
GuiComponent.drawCenteredString(poseStack, font, line, width / 2, 4 + (0 * (font.lineHeight + 1)), 0xFFFFFF | alpha);
|
||||
line = new TranslatableComponent("forge.update.beta.2");
|
||||
GuiComponent.drawCenteredString(mStack, font, line, width / 2, 4 + (1 * (font.lineHeight + 1)), 0xFFFFFF | alpha);
|
||||
GuiComponent.drawCenteredString(poseStack, font, line, width / 2, 4 + (1 * (font.lineHeight + 1)), 0xFFFFFF | alpha);
|
||||
}
|
||||
|
||||
String line = null;
|
||||
@@ -363,40 +363,40 @@ public class ForgeHooksClient
|
||||
return e.getSound();
|
||||
}
|
||||
|
||||
public static void drawScreen(Screen screen, PoseStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
public static void drawScreen(Screen screen, PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
mStack.pushPose();
|
||||
poseStack.pushPose();
|
||||
guiLayers.forEach(layer -> {
|
||||
// Prevent the background layers from thinking the mouse is over their controls and showing them as highlighted.
|
||||
drawScreenInternal(layer, mStack, Integer.MAX_VALUE, Integer.MAX_VALUE, partialTicks);
|
||||
mStack.translate(0,0,2000);
|
||||
drawScreenInternal(layer, poseStack, Integer.MAX_VALUE, Integer.MAX_VALUE, partialTick);
|
||||
poseStack.translate(0,0,2000);
|
||||
});
|
||||
drawScreenInternal(screen, mStack, mouseX, mouseY, partialTicks);
|
||||
mStack.popPose();
|
||||
drawScreenInternal(screen, poseStack, mouseX, mouseY, partialTick);
|
||||
poseStack.popPose();
|
||||
}
|
||||
|
||||
private static void drawScreenInternal(Screen screen, PoseStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
private static void drawScreenInternal(Screen screen, PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
if (!MinecraftForge.EVENT_BUS.post(new ScreenEvent.DrawScreenEvent.Pre(screen, mStack, mouseX, mouseY, partialTicks)))
|
||||
screen.render(mStack, mouseX, mouseY, partialTicks);
|
||||
MinecraftForge.EVENT_BUS.post(new ScreenEvent.DrawScreenEvent.Post(screen, mStack, mouseX, mouseY, partialTicks));
|
||||
if (!MinecraftForge.EVENT_BUS.post(new ScreenEvent.DrawScreenEvent.Pre(screen, poseStack, mouseX, mouseY, partialTick)))
|
||||
screen.render(poseStack, mouseX, mouseY, partialTick);
|
||||
MinecraftForge.EVENT_BUS.post(new ScreenEvent.DrawScreenEvent.Post(screen, poseStack, mouseX, mouseY, partialTick));
|
||||
}
|
||||
|
||||
public static float getFogDensity(FogMode type, Camera info, float partial, float density)
|
||||
public static float getFogDensity(FogMode type, Camera camera, float partialTick, float density)
|
||||
{
|
||||
EntityViewRenderEvent.FogDensity event = new EntityViewRenderEvent.FogDensity(type, info, partial, density);
|
||||
EntityViewRenderEvent.FogDensity event = new EntityViewRenderEvent.FogDensity(type, camera, partialTick, density);
|
||||
if (MinecraftForge.EVENT_BUS.post(event)) return event.getDensity();
|
||||
return -1;
|
||||
}
|
||||
|
||||
public static void onFogRender(FogMode type, Camera info, float partial, float distance)
|
||||
public static void onFogRender(FogMode type, Camera camera, float partialTick, float distance)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new EntityViewRenderEvent.RenderFogEvent(type, info, partial, distance));
|
||||
MinecraftForge.EVENT_BUS.post(new EntityViewRenderEvent.RenderFogEvent(type, camera, partialTick, distance));
|
||||
}
|
||||
|
||||
public static EntityViewRenderEvent.CameraSetup onCameraSetup(GameRenderer renderer, Camera info, float partial)
|
||||
public static EntityViewRenderEvent.CameraSetup onCameraSetup(GameRenderer renderer, Camera camera, float partial)
|
||||
{
|
||||
EntityViewRenderEvent.CameraSetup event = new EntityViewRenderEvent.CameraSetup(renderer, info, partial, info.getYRot(), info.getXRot(), 0);
|
||||
EntityViewRenderEvent.CameraSetup event = new EntityViewRenderEvent.CameraSetup(renderer, camera, partial, camera.getYRot(), camera.getXRot(), 0);
|
||||
MinecraftForge.EVENT_BUS.post(event);
|
||||
return event;
|
||||
}
|
||||
@@ -414,7 +414,7 @@ public class ForgeHooksClient
|
||||
flipXNormal = new Matrix3f(flipX);
|
||||
}
|
||||
|
||||
public static BakedModel handleCameraTransforms(PoseStack matrixStack, BakedModel model, ItemTransforms.TransformType cameraTransformType, boolean leftHandHackery)
|
||||
public static BakedModel handleCameraTransforms(PoseStack poseStack, BakedModel model, ItemTransforms.TransformType cameraTransformType, boolean leftHandHackery)
|
||||
{
|
||||
PoseStack stack = new PoseStack();
|
||||
model = model.handlePerspective(cameraTransformType, stack);
|
||||
@@ -432,19 +432,19 @@ public class ForgeHooksClient
|
||||
nMat.multiplyBackward(flipXNormal);
|
||||
nMat.mul(flipXNormal);
|
||||
}
|
||||
matrixStack.last().pose().multiply(tMat);
|
||||
matrixStack.last().normal().mul(nMat);
|
||||
poseStack.last().pose().multiply(tMat);
|
||||
poseStack.last().normal().mul(nMat);
|
||||
}
|
||||
return model;
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public static TextureAtlasSprite[] getFluidSprites(BlockAndTintGetter world, BlockPos pos, FluidState fluidStateIn)
|
||||
public static TextureAtlasSprite[] getFluidSprites(BlockAndTintGetter level, BlockPos pos, FluidState fluidStateIn)
|
||||
{
|
||||
ResourceLocation overlayTexture = fluidStateIn.getType().getAttributes().getOverlayTexture();
|
||||
return new TextureAtlasSprite[] {
|
||||
Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(fluidStateIn.getType().getAttributes().getStillTexture(world, pos)),
|
||||
Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(fluidStateIn.getType().getAttributes().getFlowingTexture(world, pos)),
|
||||
Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(fluidStateIn.getType().getAttributes().getStillTexture(level, pos)),
|
||||
Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(fluidStateIn.getType().getAttributes().getFlowingTexture(level, pos)),
|
||||
overlayTexture == null ? null : Minecraft.getInstance().getTextureAtlas(TextureAtlas.LOCATION_BLOCKS).apply(overlayTexture),
|
||||
};
|
||||
}
|
||||
@@ -538,17 +538,17 @@ public class ForgeHooksClient
|
||||
return from.getItem().shouldCauseReequipAnimation(from, to, changed);
|
||||
}
|
||||
|
||||
public static RenderGameOverlayEvent.BossInfo renderBossEventPre(PoseStack mStack, Window res, LerpingBossEvent bossInfo, int x, int y, int increment)
|
||||
public static RenderGameOverlayEvent.BossInfo renderBossEventPre(PoseStack poseStack, Window res, LerpingBossEvent bossInfo, int x, int y, int increment)
|
||||
{
|
||||
RenderGameOverlayEvent.BossInfo evt = new RenderGameOverlayEvent.BossInfo(mStack, new RenderGameOverlayEvent(mStack, MinecraftForgeClient.getPartialTick(), res),
|
||||
RenderGameOverlayEvent.BossInfo evt = new RenderGameOverlayEvent.BossInfo(poseStack, new RenderGameOverlayEvent(poseStack, MinecraftForgeClient.getPartialTick(), res),
|
||||
BOSSINFO, bossInfo, x, y, increment);
|
||||
MinecraftForge.EVENT_BUS.post(evt);
|
||||
return evt;
|
||||
}
|
||||
|
||||
public static void renderBossEventPost(PoseStack mStack, Window res)
|
||||
public static void renderBossEventPost(PoseStack poseStack, Window res)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(mStack, new RenderGameOverlayEvent(mStack, MinecraftForgeClient.getPartialTick(), res), BOSSINFO));
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(poseStack, new RenderGameOverlayEvent(poseStack, MinecraftForgeClient.getPartialTick(), res), BOSSINFO));
|
||||
}
|
||||
|
||||
public static ScreenshotEvent onScreenshot(NativeImage image, File screenshotFile)
|
||||
@@ -708,8 +708,8 @@ public class ForgeHooksClient
|
||||
return event;
|
||||
}
|
||||
|
||||
public static void drawItemLayered(ItemRenderer renderer, BakedModel modelIn, ItemStack itemStackIn, PoseStack matrixStackIn,
|
||||
MultiBufferSource bufferIn, int combinedLightIn, int combinedOverlayIn, boolean fabulous)
|
||||
public static void drawItemLayered(ItemRenderer renderer, BakedModel modelIn, ItemStack itemStackIn, PoseStack poseStack,
|
||||
MultiBufferSource bufferSource, int packedLight, int packedOverlay, boolean fabulous)
|
||||
{
|
||||
for(com.mojang.datafixers.util.Pair<BakedModel,RenderType> layerModel : modelIn.getLayerModels(itemStackIn, fabulous))
|
||||
{
|
||||
@@ -719,11 +719,11 @@ public class ForgeHooksClient
|
||||
VertexConsumer ivertexbuilder;
|
||||
if (fabulous)
|
||||
{
|
||||
ivertexbuilder = ItemRenderer.getFoilBufferDirect(bufferIn, rendertype, true, itemStackIn.hasFoil());
|
||||
ivertexbuilder = ItemRenderer.getFoilBufferDirect(bufferSource, rendertype, true, itemStackIn.hasFoil());
|
||||
} else {
|
||||
ivertexbuilder = ItemRenderer.getFoilBuffer(bufferIn, rendertype, true, itemStackIn.hasFoil());
|
||||
ivertexbuilder = ItemRenderer.getFoilBuffer(bufferSource, rendertype, true, itemStackIn.hasFoil());
|
||||
}
|
||||
renderer.renderModelLists(layer, itemStackIn, combinedLightIn, combinedOverlayIn, matrixStackIn, ivertexbuilder);
|
||||
renderer.renderModelLists(layer, itemStackIn, packedLight, packedOverlay, poseStack, ivertexbuilder);
|
||||
}
|
||||
net.minecraftforge.client.ForgeHooksClient.setRenderType(null);
|
||||
}
|
||||
@@ -738,14 +738,14 @@ public class ForgeHooksClient
|
||||
return !(squareDistance > 4096.0f);
|
||||
}
|
||||
|
||||
public static void renderPistonMovedBlocks(BlockPos pos, BlockState state, PoseStack stack, MultiBufferSource buffer, Level world, boolean checkSides, int combinedOverlay, BlockRenderDispatcher blockRenderer) {
|
||||
public static void renderPistonMovedBlocks(BlockPos pos, BlockState state, PoseStack stack, MultiBufferSource bufferSource, Level level, boolean checkSides, int packedOverlay, BlockRenderDispatcher blockRenderer) {
|
||||
RenderType.chunkBufferLayers().stream()
|
||||
.filter(t -> ItemBlockRenderTypes.canRenderInLayer(state, t))
|
||||
.forEach(rendertype ->
|
||||
{
|
||||
setRenderType(rendertype);
|
||||
VertexConsumer ivertexbuilder = buffer.getBuffer(rendertype == RenderType.translucent() ? RenderType.translucentMovingBlock() : rendertype);
|
||||
blockRenderer.getModelRenderer().tesselateBlock(world, blockRenderer.getBlockModel(state), state, pos, stack, ivertexbuilder, checkSides, new Random(), state.getSeed(pos), combinedOverlay);
|
||||
VertexConsumer ivertexbuilder = bufferSource.getBuffer(rendertype == RenderType.translucent() ? RenderType.translucentMovingBlock() : rendertype);
|
||||
blockRenderer.getModelRenderer().tesselateBlock(level, blockRenderer.getBlockModel(state), state, pos, stack, ivertexbuilder, checkSides, new Random(), state.getSeed(pos), packedOverlay);
|
||||
});
|
||||
setRenderType(null);
|
||||
}
|
||||
@@ -865,7 +865,7 @@ public class ForgeHooksClient
|
||||
}
|
||||
|
||||
private static final ResourceLocation ICON_SHEET = new ResourceLocation(ForgeVersion.MOD_ID, "textures/gui/icons.png");
|
||||
public static void drawForgePingInfo(JoinMultiplayerScreen gui, ServerData target, PoseStack mStack, int x, int y, int width, int relativeMouseX, int relativeMouseY) {
|
||||
public static void drawForgePingInfo(JoinMultiplayerScreen gui, ServerData target, PoseStack poseStack, int x, int y, int width, int relativeMouseX, int relativeMouseY) {
|
||||
int idx;
|
||||
String tooltip;
|
||||
if (target.forgeData == null)
|
||||
@@ -904,7 +904,7 @@ public class ForgeHooksClient
|
||||
}
|
||||
|
||||
RenderSystem.setShaderTexture(0, ICON_SHEET);
|
||||
GuiComponent.blit(mStack, x + width - 18, y + 10, 16, 16, 0, idx, 16, 16, 256, 256);
|
||||
GuiComponent.blit(poseStack, x + width - 18, y + 10, 16, 16, 0, idx, 16, 16, 256, 256);
|
||||
|
||||
if(relativeMouseX > width - 15 && relativeMouseX < width && relativeMouseY > 10 && relativeMouseY < 26) {
|
||||
//this is not the most proper way to do it,
|
||||
@@ -918,7 +918,7 @@ public class ForgeHooksClient
|
||||
return Minecraft.getInstance().getConnection()!=null ? Minecraft.getInstance().getConnection().getConnection() : null;
|
||||
}
|
||||
|
||||
public static void handleClientLevelClosing(ClientLevel world)
|
||||
public static void handleClientLevelClosing(ClientLevel level)
|
||||
{
|
||||
Connection client = getClientConnection();
|
||||
// ONLY revert a non-local connection
|
||||
|
||||
@@ -25,18 +25,18 @@ public interface IBlockRenderProperties
|
||||
};
|
||||
|
||||
/**
|
||||
* Spawn a digging particle effect in the Level, this is a wrapper
|
||||
* Spawn a digging particle effect in the level, this is a wrapper
|
||||
* around EffectRenderer.addBlockHitEffects to allow the block more
|
||||
* control over the particles. Useful when you have entirely different
|
||||
* texture sheets for different sides/locations in the Level.
|
||||
* texture sheets for different sides/locations in the level.
|
||||
*
|
||||
* @param state The current state
|
||||
* @param Level The current Level
|
||||
* @param level The current level
|
||||
* @param target The target the player is looking at {x/y/z/side/sub}
|
||||
* @param manager A reference to the current particle manager.
|
||||
* @return True to prevent vanilla digging particles form spawning.
|
||||
*/
|
||||
default boolean addHitEffects(BlockState state, Level Level, HitResult target, ParticleEngine manager)
|
||||
default boolean addHitEffects(BlockState state, Level level, HitResult target, ParticleEngine manager)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -63,14 +63,14 @@ public interface IBlockRenderProperties
|
||||
* Use this to change the fog color used when the entity is "inside" a material.
|
||||
* Vec3d is used here as "r/g/b" 0 - 1 values.
|
||||
*
|
||||
* @param Level The Level.
|
||||
* @param level The level.
|
||||
* @param pos The position at the entity viewport.
|
||||
* @param state The state at the entity viewport.
|
||||
* @param entity the entity
|
||||
* @param originalColor The current fog color, You are not expected to use this, Return as the default if applicable.
|
||||
* @return The new fog color.
|
||||
*/
|
||||
default Vector3d getFogColor(BlockState state, LevelReader Level, BlockPos pos, Entity entity, Vector3d originalColor, float partialTicks)
|
||||
default Vector3d getFogColor(BlockState state, LevelReader level, BlockPos pos, Entity entity, Vector3d originalColor, float partialTick)
|
||||
{
|
||||
if (state.getMaterial() == Material.WATER)
|
||||
{
|
||||
|
||||
@@ -16,5 +16,5 @@ import net.minecraft.client.multiplayer.ClientLevel;
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ICloudRenderHandler {
|
||||
void render(int ticks, float partialTicks, PoseStack matrixStack, ClientLevel world, Minecraft mc, double viewEntityX, double viewEntityY, double viewEntityZ);
|
||||
void render(int ticks, float partialTick, PoseStack poseStack, ClientLevel level, Minecraft minecraft, double camX, double camY, double camZ);
|
||||
}
|
||||
@@ -85,9 +85,9 @@ public interface IItemRenderProperties
|
||||
* @param player Reference to the current client entity
|
||||
* @param width Viewport width
|
||||
* @param height Viewport height
|
||||
* @param partialTicks Partial ticks for the renderer, useful for interpolation
|
||||
* @param partialTick Partial tick for the renderer, useful for interpolation
|
||||
*/
|
||||
default void renderHelmetOverlay(ItemStack stack, Player player, int width, int height, float partialTicks)
|
||||
default void renderHelmetOverlay(ItemStack stack, Player player, int width, int height, float partialTick)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ import net.minecraft.client.multiplayer.ClientLevel;
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface ISkyRenderHandler {
|
||||
void render(int ticks, float partialTicks, PoseStack matrixStack, ClientLevel world, Minecraft mc);
|
||||
void render(int ticks, float partialTick, PoseStack poseStack, ClientLevel level, Minecraft minecraft);
|
||||
}
|
||||
@@ -17,5 +17,5 @@ import net.minecraft.client.multiplayer.ClientLevel;
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IWeatherParticleRenderHandler {
|
||||
void render(int ticks, ClientLevel world, Minecraft mc, Camera activeRenderInfoIn);
|
||||
void render(int ticks, ClientLevel level, Minecraft minecraft, Camera camera);
|
||||
}
|
||||
@@ -16,5 +16,5 @@ import net.minecraft.client.multiplayer.ClientLevel;
|
||||
*/
|
||||
@FunctionalInterface
|
||||
public interface IWeatherRenderHandler {
|
||||
void render(int ticks, float partialTicks, ClientLevel world, Minecraft mc, LightTexture lightmapIn, double xIn, double yIn, double zIn);
|
||||
void render(int ticks, float partialTick, ClientLevel level, Minecraft minecraft, LightTexture lightTexture, double camX, double camY, double camZ);
|
||||
}
|
||||
@@ -43,14 +43,14 @@ public class ContainerScreenEvent extends Event
|
||||
* Called directly after the GuiContainer has drawn any foreground elements.
|
||||
*
|
||||
* @param guiContainer The container.
|
||||
* @param mStack The MatrixStack.
|
||||
* @param poseStack The pose stack.
|
||||
* @param mouseX The current X position of the players mouse.
|
||||
* @param mouseY The current Y position of the players mouse.
|
||||
*/
|
||||
public DrawForeground(AbstractContainerScreen<?> guiContainer, PoseStack mStack, int mouseX, int mouseY)
|
||||
public DrawForeground(AbstractContainerScreen<?> guiContainer, PoseStack poseStack, int mouseX, int mouseY)
|
||||
{
|
||||
super(guiContainer);
|
||||
this.poseStack = mStack;
|
||||
this.poseStack = poseStack;
|
||||
this.mouseX = mouseX;
|
||||
this.mouseY = mouseY;
|
||||
}
|
||||
@@ -85,14 +85,14 @@ public class ContainerScreenEvent extends Event
|
||||
* Called directly after the GuiContainer has drawn any background elements.
|
||||
*
|
||||
* @param guiContainer The container.
|
||||
* @param mStack The MatrixStack.
|
||||
* @param poseStack The PoseStack.
|
||||
* @param mouseX The current X position of the players mouse.
|
||||
* @param mouseY The current Y position of the players mouse.
|
||||
*/
|
||||
public DrawBackground(AbstractContainerScreen<?> guiContainer, PoseStack mStack, int mouseX, int mouseY)
|
||||
public DrawBackground(AbstractContainerScreen<?> guiContainer, PoseStack poseStack, int mouseX, int mouseY)
|
||||
{
|
||||
super(guiContainer);
|
||||
this.poseStack = mStack;
|
||||
this.poseStack = poseStack;
|
||||
this.mouseX = mouseX;
|
||||
this.mouseY = mouseY;
|
||||
}
|
||||
|
||||
@@ -52,9 +52,9 @@ public class DrawSelectionEvent extends Event
|
||||
@Cancelable
|
||||
public static class HighlightBlock extends DrawSelectionEvent
|
||||
{
|
||||
public HighlightBlock(LevelRenderer context, Camera info, HitResult target, float partialTicks, PoseStack matrix, MultiBufferSource buffers)
|
||||
public HighlightBlock(LevelRenderer levelRenderer, Camera camera, HitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource)
|
||||
{
|
||||
super(context, info, target, partialTicks, matrix, buffers);
|
||||
super(levelRenderer, camera, target, partialTick, poseStack, bufferSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,9 +71,9 @@ public class DrawSelectionEvent extends Event
|
||||
@Cancelable
|
||||
public static class HighlightEntity extends DrawSelectionEvent
|
||||
{
|
||||
public HighlightEntity(LevelRenderer context, Camera info, HitResult target, float partialTicks, PoseStack matrix, MultiBufferSource buffers)
|
||||
public HighlightEntity(LevelRenderer levelRenderer, Camera camera, HitResult target, float partialTick, PoseStack poseStack, MultiBufferSource bufferSource)
|
||||
{
|
||||
super(context, info, target, partialTicks, matrix, buffers);
|
||||
super(levelRenderer, camera, target, partialTick, poseStack, bufferSource);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,9 +47,9 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus.
|
||||
{
|
||||
private final FogMode mode;
|
||||
@SuppressWarnings("resource")
|
||||
protected FogEvent(FogMode mode, Camera info, double renderPartialTicks)
|
||||
protected FogEvent(FogMode mode, Camera camera, double partialTick)
|
||||
{
|
||||
super(Minecraft.getInstance().gameRenderer, info, renderPartialTicks);
|
||||
super(Minecraft.getInstance().gameRenderer, camera, partialTick);
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
@@ -65,9 +65,9 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus.
|
||||
{
|
||||
private float density;
|
||||
|
||||
public FogDensity(FogMode type, Camera info, float partialTicks, float density)
|
||||
public FogDensity(FogMode type, Camera camera, float partialTick, float density)
|
||||
{
|
||||
super(type, info, partialTicks);
|
||||
super(type, camera, partialTick);
|
||||
this.setDensity(density);
|
||||
}
|
||||
|
||||
@@ -90,9 +90,9 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus.
|
||||
{
|
||||
private final float farPlaneDistance;
|
||||
|
||||
public RenderFogEvent(FogMode type, Camera info, float partialTicks, float distance)
|
||||
public RenderFogEvent(FogMode type, Camera camera, float partialTicks, float distance)
|
||||
{
|
||||
super(type, info, partialTicks);
|
||||
super(type, camera, partialTicks);
|
||||
this.farPlaneDistance = distance;
|
||||
}
|
||||
|
||||
@@ -113,9 +113,9 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus.
|
||||
private float blue;
|
||||
|
||||
@SuppressWarnings("resource")
|
||||
public FogColors(Camera info, float partialTicks, float red, float green, float blue)
|
||||
public FogColors(Camera camera, float partialTicks, float red, float green, float blue)
|
||||
{
|
||||
super(Minecraft.getInstance().gameRenderer, info, partialTicks);
|
||||
super(Minecraft.getInstance().gameRenderer, camera, partialTicks);
|
||||
this.setRed(red);
|
||||
this.setGreen(green);
|
||||
this.setBlue(blue);
|
||||
@@ -138,9 +138,9 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus.
|
||||
private float pitch;
|
||||
private float roll;
|
||||
|
||||
public CameraSetup(GameRenderer renderer, Camera info, double renderPartialTicks, float yaw, float pitch, float roll)
|
||||
public CameraSetup(GameRenderer renderer, Camera camera, double renderPartialTicks, float yaw, float pitch, float roll)
|
||||
{
|
||||
super(renderer, info, renderPartialTicks);
|
||||
super(renderer, camera, renderPartialTicks);
|
||||
this.setYaw(yaw);
|
||||
this.setPitch(pitch);
|
||||
this.setRoll(roll);
|
||||
@@ -162,8 +162,8 @@ public abstract class EntityViewRenderEvent extends net.minecraftforge.eventbus.
|
||||
{
|
||||
private double fov;
|
||||
|
||||
public FieldOfView(GameRenderer renderer, Camera info, double renderPartialTicks, double fov) {
|
||||
super(renderer, info, renderPartialTicks);
|
||||
public FieldOfView(GameRenderer renderer, Camera camera, double renderPartialTicks, double fov) {
|
||||
super(renderer, camera, renderPartialTicks);
|
||||
this.setFOV(fov);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,15 +44,15 @@ public abstract class RenderLivingEvent<T extends LivingEntity, M extends Entity
|
||||
@Cancelable
|
||||
public static class Pre<T extends LivingEntity, M extends EntityModel<T>> extends RenderLivingEvent<T, M>
|
||||
{
|
||||
public Pre(LivingEntity entity, LivingEntityRenderer<T, M> renderer, float partialRenderTick, PoseStack matrixStack, MultiBufferSource buffers, int light) {
|
||||
super(entity, renderer, partialRenderTick, matrixStack, buffers, light);
|
||||
public Pre(LivingEntity entity, LivingEntityRenderer<T, M> renderer, float partialTick, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) {
|
||||
super(entity, renderer, partialTick, poseStack, multiBufferSource, packedLight);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post<T extends LivingEntity, M extends EntityModel<T>> extends RenderLivingEvent<T, M>
|
||||
{
|
||||
public Post(LivingEntity entity, LivingEntityRenderer<T, M> renderer, float partialRenderTick, PoseStack matrixStack, MultiBufferSource buffers, int light) {
|
||||
super(entity, renderer, partialRenderTick, matrixStack, buffers, light);
|
||||
public Post(LivingEntity entity, LivingEntityRenderer<T, M> renderer, float partialTick, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) {
|
||||
super(entity, renderer, partialTick, poseStack, multiBufferSource, packedLight);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,15 +39,15 @@ public abstract class RenderPlayerEvent extends PlayerEvent
|
||||
@Cancelable
|
||||
public static class Pre extends RenderPlayerEvent
|
||||
{
|
||||
public Pre(Player player, PlayerRenderer renderer, float tick, PoseStack stack, MultiBufferSource buffers, int light) {
|
||||
super(player, renderer, tick, stack, buffers, light);
|
||||
public Pre(Player player, PlayerRenderer renderer, float partialTick, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) {
|
||||
super(player, renderer, partialTick, poseStack, multiBufferSource, packedLight);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Post extends RenderPlayerEvent
|
||||
{
|
||||
public Post(Player player, PlayerRenderer renderer, float tick, PoseStack stack, MultiBufferSource buffers, int light) {
|
||||
super(player, renderer, tick, stack, buffers, light);
|
||||
public Post(Player player, PlayerRenderer renderer, float partialTick, PoseStack poseStack, MultiBufferSource multiBufferSource, int packedLight) {
|
||||
super(player, renderer, partialTick, poseStack, multiBufferSource, packedLight);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ public class ScreenEvent extends Event
|
||||
}
|
||||
|
||||
/**
|
||||
* The MatrixStack to render with.
|
||||
* The PoseStack to render with.
|
||||
*/
|
||||
public PoseStack getPoseStack()
|
||||
{
|
||||
@@ -164,9 +164,9 @@ public class ScreenEvent extends Event
|
||||
@Cancelable
|
||||
public static class Pre extends DrawScreenEvent
|
||||
{
|
||||
public Pre(Screen screen, PoseStack mStack, int mouseX, int mouseY, float renderPartialTicks)
|
||||
public Pre(Screen screen, PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
super(screen, mStack, mouseX, mouseY, renderPartialTicks);
|
||||
super(screen, poseStack, mouseX, mouseY, partialTick);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,9 +175,9 @@ public class ScreenEvent extends Event
|
||||
*/
|
||||
public static class Post extends DrawScreenEvent
|
||||
{
|
||||
public Post(Screen screen, PoseStack mStack, int mouseX, int mouseY, float renderPartialTicks)
|
||||
public Post(Screen screen, PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
super(screen, mStack, mouseX, mouseY, renderPartialTicks);
|
||||
super(screen, poseStack, mouseX, mouseY, partialTick);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -197,7 +197,7 @@ public class ScreenEvent extends Event
|
||||
}
|
||||
|
||||
/**
|
||||
* The MatrixStack to render with.
|
||||
* The PoseStack to render with.
|
||||
*/
|
||||
public PoseStack getPoseStack()
|
||||
{
|
||||
|
||||
@@ -57,9 +57,9 @@ public interface IForgeBakedModel
|
||||
return net.minecraftforge.client.ForgeHooksClient.handlePerspective(self(), cameraTransformType, poseStack);
|
||||
}
|
||||
|
||||
default @Nonnull IModelData getModelData(@Nonnull BlockAndTintGetter world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull IModelData tileData)
|
||||
default @Nonnull IModelData getModelData(@Nonnull BlockAndTintGetter level, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull IModelData modelData)
|
||||
{
|
||||
return tileData;
|
||||
return modelData;
|
||||
}
|
||||
|
||||
default TextureAtlasSprite getParticleIcon(@Nonnull IModelData data)
|
||||
|
||||
@@ -27,27 +27,27 @@ import net.minecraft.core.Vec3i;
|
||||
public interface IForgeVertexConsumer
|
||||
{
|
||||
// Copy of putBulkData, but enables tinting and per-vertex alpha
|
||||
default void putBulkData(PoseStack.Pose matrixStack, BakedQuad bakedQuad, float red, float green, float blue, int lightmapCoord, int overlayColor, boolean readExistingColor) {
|
||||
putBulkData(matrixStack, bakedQuad, red, green, blue, 1.0f, lightmapCoord, overlayColor, readExistingColor);
|
||||
default void putBulkData(PoseStack.Pose poseStack, BakedQuad bakedQuad, float red, float green, float blue, int packedLight, int packedOverlay, boolean readExistingColor) {
|
||||
putBulkData(poseStack, bakedQuad, red, green, blue, 1.0f, packedLight, packedOverlay, readExistingColor);
|
||||
}
|
||||
|
||||
// Copy of putBulkData with alpha support
|
||||
default void putBulkData(PoseStack.Pose matrixEntry, BakedQuad bakedQuad, float red, float green, float blue, float alpha, int lightmapCoord, int overlayColor) {
|
||||
putBulkData(matrixEntry, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, alpha, new int[]{lightmapCoord, lightmapCoord, lightmapCoord, lightmapCoord}, overlayColor, false);
|
||||
default void putBulkData(PoseStack.Pose pose, BakedQuad bakedQuad, float red, float green, float blue, float alpha, int packedLight, int packedOverlay) {
|
||||
putBulkData(pose, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, alpha, new int[]{packedLight, packedLight, packedLight, packedLight}, packedOverlay, false);
|
||||
}
|
||||
|
||||
// Copy of putBulkData with alpha support
|
||||
default void putBulkData(PoseStack.Pose matrixEntry, BakedQuad bakedQuad, float red, float green, float blue, float alpha, int lightmapCoord, int overlayColor, boolean readExistingColor) {
|
||||
putBulkData(matrixEntry, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, alpha, new int[]{lightmapCoord, lightmapCoord, lightmapCoord, lightmapCoord}, overlayColor, readExistingColor);
|
||||
default void putBulkData(PoseStack.Pose pose, BakedQuad bakedQuad, float red, float green, float blue, float alpha, int packedLight, int packedOverlay, boolean readExistingColor) {
|
||||
putBulkData(pose, bakedQuad, new float[]{1.0F, 1.0F, 1.0F, 1.0F}, red, green, blue, alpha, new int[]{packedLight, packedLight, packedLight, packedLight}, packedOverlay, readExistingColor);
|
||||
}
|
||||
|
||||
// Copy of putBulkData with alpha support
|
||||
default void putBulkData(PoseStack.Pose matrixEntry, BakedQuad bakedQuad, float[] baseBrightness, float red, float green, float blue, float alpha, int[] lightmapCoords, int overlayCoords, boolean readExistingColor) {
|
||||
default void putBulkData(PoseStack.Pose pose, BakedQuad bakedQuad, float[] baseBrightness, float red, float green, float blue, float alpha, int[] lightmap, int packedOverlay, boolean readExistingColor) {
|
||||
int[] aint = bakedQuad.getVertices();
|
||||
Vec3i faceNormal = bakedQuad.getDirection().getNormal();
|
||||
Vector3f normal = new Vector3f((float)faceNormal.getX(), (float)faceNormal.getY(), (float)faceNormal.getZ());
|
||||
Matrix4f matrix4f = matrixEntry.pose();
|
||||
normal.transform(matrixEntry.normal());
|
||||
Matrix4f matrix4f = pose.pose();
|
||||
normal.transform(pose.normal());
|
||||
int intSize = DefaultVertexFormat.BLOCK.getIntegerSize();
|
||||
int vertexCount = aint.length / intSize;
|
||||
|
||||
@@ -81,20 +81,20 @@ public interface IForgeVertexConsumer
|
||||
ca = alpha;
|
||||
}
|
||||
|
||||
int lightmapCoord = applyBakedLighting(lightmapCoords[v], bytebuffer);
|
||||
int lightmapCoord = applyBakedLighting(lightmap[v], bytebuffer);
|
||||
float f9 = bytebuffer.getFloat(16);
|
||||
float f10 = bytebuffer.getFloat(20);
|
||||
Vector4f pos = new Vector4f(f, f1, f2, 1.0F);
|
||||
pos.transform(matrix4f);
|
||||
applyBakedNormals(normal, bytebuffer, matrixEntry.normal());
|
||||
((VertexConsumer)this).vertex(pos.x(), pos.y(), pos.z(), cr, cg, cb, ca, f9, f10, overlayCoords, lightmapCoord, normal.x(), normal.y(), normal.z());
|
||||
applyBakedNormals(normal, bytebuffer, pose.normal());
|
||||
((VertexConsumer)this).vertex(pos.x(), pos.y(), pos.z(), cr, cg, cb, ca, f9, f10, packedOverlay, lightmapCoord, normal.x(), normal.y(), normal.z());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
default int applyBakedLighting(int lightmapCoord, ByteBuffer data) {
|
||||
int bl = lightmapCoord&0xFFFF;
|
||||
int sl = (lightmapCoord>>16)&0xFFFF;
|
||||
default int applyBakedLighting(int packedLight, ByteBuffer data) {
|
||||
int bl = packedLight&0xFFFF;
|
||||
int sl = (packedLight>>16)&0xFFFF;
|
||||
int offset = LightUtil.getLightOffset(0) * 4; // int offset for vertex 0 * 4 bytes per int
|
||||
int blBaked = Short.toUnsignedInt(data.getShort(offset));
|
||||
int slBaked = Short.toUnsignedInt(data.getShort(offset + 2));
|
||||
|
||||
@@ -51,7 +51,6 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
public class ForgeIngameGui extends Gui
|
||||
{
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
@@ -111,7 +110,7 @@ public class ForgeIngameGui extends Gui
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
}
|
||||
|
||||
public static final IIngameOverlay VIGNETTE_ELEMENT = OverlayRegistry.registerOverlayTop("Vignette", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay VIGNETTE_ELEMENT = OverlayRegistry.registerOverlayTop("Vignette", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (Minecraft.useFancyGraphics())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
@@ -119,173 +118,173 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay SPYGLASS_ELEMENT = OverlayRegistry.registerOverlayTop("Spyglass", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay SPYGLASS_ELEMENT = OverlayRegistry.registerOverlayTop("Spyglass", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderSpyglassOverlay();
|
||||
});
|
||||
|
||||
public static final IIngameOverlay HELMET_ELEMENT = OverlayRegistry.registerOverlayTop("Helmet", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay HELMET_ELEMENT = OverlayRegistry.registerOverlayTop("Helmet", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderHelmet(partialTicks, mStack);
|
||||
gui.renderHelmet(partialTick, poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay FROSTBITE_ELEMENT = OverlayRegistry.registerOverlayTop("Frostbite", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay FROSTBITE_ELEMENT = OverlayRegistry.registerOverlayTop("Frostbite", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderFrostbite(mStack);
|
||||
gui.renderFrostbite(poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay PORTAL_ELEMENT = OverlayRegistry.registerOverlayTop("Portal", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay PORTAL_ELEMENT = OverlayRegistry.registerOverlayTop("Portal", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
|
||||
if (!gui.minecraft.player.hasEffect(MobEffects.CONFUSION))
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderPortalOverlay(partialTicks);
|
||||
gui.renderPortalOverlay(partialTick);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
public static final IIngameOverlay HOTBAR_ELEMENT = OverlayRegistry.registerOverlayTop("Hotbar", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay HOTBAR_ELEMENT = OverlayRegistry.registerOverlayTop("Hotbar", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
if (gui.minecraft.gameMode.getPlayerMode() == GameType.SPECTATOR)
|
||||
{
|
||||
gui.spectatorGui.renderHotbar(mStack);
|
||||
gui.spectatorGui.renderHotbar(poseStack);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui.renderHotbar(partialTicks, mStack);
|
||||
gui.renderHotbar(partialTick, poseStack);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay CROSSHAIR_ELEMENT = OverlayRegistry.registerOverlayTop("Crosshair", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay CROSSHAIR_ELEMENT = OverlayRegistry.registerOverlayTop("Crosshair", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.setBlitOffset(-90);
|
||||
|
||||
gui.renderCrosshair(mStack);
|
||||
gui.renderCrosshair(poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay BOSS_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Boss Health", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay BOSS_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Boss Health", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.setBlitOffset(-90);
|
||||
|
||||
gui.renderBossHealth(mStack);
|
||||
gui.renderBossHealth(poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay PLAYER_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Player Health", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay PLAYER_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Player Health", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderHealth(screenWidth, screenHeight, mStack);
|
||||
gui.renderHealth(screenWidth, screenHeight, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay ARMOR_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Armor Level",(gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay ARMOR_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Armor Level",(gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderArmor(mStack, screenWidth, screenHeight);
|
||||
gui.renderArmor(poseStack, screenWidth, screenHeight);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay FOOD_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Food Level", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay FOOD_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Food Level", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
boolean isMounted = gui.minecraft.player.getVehicle() instanceof LivingEntity;
|
||||
if (!isMounted && !gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderFood(screenWidth, screenHeight, mStack);
|
||||
gui.renderFood(screenWidth, screenHeight, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay MOUNT_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Mount Health", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay MOUNT_HEALTH_ELEMENT = OverlayRegistry.registerOverlayTop("Mount Health", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderHealthMount(screenWidth, screenHeight, mStack);
|
||||
gui.renderHealthMount(screenWidth, screenHeight, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay AIR_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Air Level", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay AIR_LEVEL_ELEMENT = OverlayRegistry.registerOverlayTop("Air Level", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui && gui.shouldDrawSurvivalElements())
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderAir(screenWidth, screenHeight, mStack);
|
||||
gui.renderAir(screenWidth, screenHeight, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay JUMP_BAR_ELEMENT = OverlayRegistry.registerOverlayTop("Jump Bar", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay JUMP_BAR_ELEMENT = OverlayRegistry.registerOverlayTop("Jump Bar", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (gui.minecraft.player.isRidingJumpable() && !gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderJumpMeter(mStack, screenWidth / 2 - 91);
|
||||
gui.renderJumpMeter(poseStack, screenWidth / 2 - 91);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay EXPERIENCE_BAR_ELEMENT = OverlayRegistry.registerOverlayTop("Experience Bar", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay EXPERIENCE_BAR_ELEMENT = OverlayRegistry.registerOverlayTop("Experience Bar", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.player.isRidingJumpable() && !gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
gui.renderExperience(screenWidth / 2 - 91, mStack);
|
||||
gui.renderExperience(screenWidth / 2 - 91, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay ITEM_NAME_ELEMENT = OverlayRegistry.registerOverlayTop("Item Name", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay ITEM_NAME_ELEMENT = OverlayRegistry.registerOverlayTop("Item Name", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.setupOverlayRenderState(true, false);
|
||||
if (gui.minecraft.options.heldItemTooltips && gui.minecraft.gameMode.getPlayerMode() != GameType.SPECTATOR) {
|
||||
gui.renderSelectedItemName(mStack);
|
||||
gui.renderSelectedItemName(poseStack);
|
||||
} else if (gui.minecraft.player.isSpectator()) {
|
||||
gui.spectatorGui.renderTooltip(mStack);
|
||||
gui.spectatorGui.renderTooltip(poseStack);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay SLEEP_FADE_ELEMENT = OverlayRegistry.registerOverlayTop("Sleep Fade", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
gui.renderSleepFade(screenWidth, screenHeight, mStack);
|
||||
public static final IIngameOverlay SLEEP_FADE_ELEMENT = OverlayRegistry.registerOverlayTop("Sleep Fade", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.renderSleepFade(screenWidth, screenHeight, poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay HUD_TEXT_ELEMENT = OverlayRegistry.registerOverlayTop("Text Columns", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
gui.renderHUDText(screenWidth, screenHeight, mStack);
|
||||
public static final IIngameOverlay HUD_TEXT_ELEMENT = OverlayRegistry.registerOverlayTop("Text Columns", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.renderHUDText(screenWidth, screenHeight, poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay FPS_GRAPH_ELEMENT = OverlayRegistry.registerOverlayTop("FPS Graph", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
gui.renderFPSGraph(mStack);
|
||||
public static final IIngameOverlay FPS_GRAPH_ELEMENT = OverlayRegistry.registerOverlayTop("FPS Graph", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.renderFPSGraph(poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay POTION_ICONS_ELEMENT = OverlayRegistry.registerOverlayTop("Potion Icons", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
gui.renderEffects(mStack);
|
||||
public static final IIngameOverlay POTION_ICONS_ELEMENT = OverlayRegistry.registerOverlayTop("Potion Icons", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
gui.renderEffects(poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay RECORD_OVERLAY_ELEMENT = OverlayRegistry.registerOverlayTop("Record", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay RECORD_OVERLAY_ELEMENT = OverlayRegistry.registerOverlayTop("Record", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.renderRecordOverlay(screenWidth, screenHeight, partialTicks, mStack);
|
||||
gui.renderRecordOverlay(screenWidth, screenHeight, partialTick, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay SUBTITLES_ELEMENT = OverlayRegistry.registerOverlayTop("Subtitles", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay SUBTITLES_ELEMENT = OverlayRegistry.registerOverlayTop("Subtitles", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.renderSubtitles(mStack);
|
||||
gui.renderSubtitles(poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay TITLE_TEXT_ELEMENT = OverlayRegistry.registerOverlayTop("Title Text", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay TITLE_TEXT_ELEMENT = OverlayRegistry.registerOverlayTop("Title Text", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
if (!gui.minecraft.options.hideGui)
|
||||
{
|
||||
gui.renderTitle(screenWidth, screenHeight, partialTicks, mStack);
|
||||
gui.renderTitle(screenWidth, screenHeight, partialTick, poseStack);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay SCOREBOARD_ELEMENT = OverlayRegistry.registerOverlayTop("Scoreboard", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay SCOREBOARD_ELEMENT = OverlayRegistry.registerOverlayTop("Scoreboard", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
|
||||
Scoreboard scoreboard = gui.minecraft.level.getScoreboard();
|
||||
Objective objective = null;
|
||||
@@ -298,24 +297,24 @@ public class ForgeIngameGui extends Gui
|
||||
Objective scoreobjective1 = objective != null ? objective : scoreboard.getDisplayObjective(1);
|
||||
if (scoreobjective1 != null)
|
||||
{
|
||||
gui.displayScoreboardSidebar(mStack, scoreobjective1);
|
||||
gui.displayScoreboardSidebar(poseStack, scoreobjective1);
|
||||
}
|
||||
});
|
||||
|
||||
public static final IIngameOverlay CHAT_PANEL_ELEMENT = OverlayRegistry.registerOverlayTop("Chat History", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay CHAT_PANEL_ELEMENT = OverlayRegistry.registerOverlayTop("Chat History", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
|
||||
gui.renderChat(screenWidth, screenHeight, mStack);
|
||||
gui.renderChat(screenWidth, screenHeight, poseStack);
|
||||
});
|
||||
|
||||
public static final IIngameOverlay PLAYER_LIST_ELEMENT = OverlayRegistry.registerOverlayTop("Player List", (gui, mStack, partialTicks, screenWidth, screenHeight) -> {
|
||||
public static final IIngameOverlay PLAYER_LIST_ELEMENT = OverlayRegistry.registerOverlayTop("Player List", (gui, poseStack, partialTick, screenWidth, screenHeight) -> {
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
|
||||
gui.renderPlayerList(screenWidth, screenHeight, mStack);
|
||||
gui.renderPlayerList(screenWidth, screenHeight, poseStack);
|
||||
});
|
||||
|
||||
public ForgeIngameGui(Minecraft mc)
|
||||
@@ -325,16 +324,16 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack pStack, float partialTicks)
|
||||
public void render(PoseStack poseStack, float partialTick)
|
||||
{
|
||||
this.screenWidth = this.minecraft.getWindow().getGuiScaledWidth();
|
||||
this.screenHeight = this.minecraft.getWindow().getGuiScaledHeight();
|
||||
eventParent = new RenderGameOverlayEvent(pStack, partialTicks, this.minecraft.getWindow());
|
||||
eventParent = new RenderGameOverlayEvent(poseStack, partialTick, this.minecraft.getWindow());
|
||||
|
||||
right_height = 39;
|
||||
left_height = 39;
|
||||
|
||||
if (pre(ALL, pStack)) return;
|
||||
if (pre(ALL, poseStack)) return;
|
||||
|
||||
font = minecraft.font;
|
||||
|
||||
@@ -345,9 +344,9 @@ public class ForgeIngameGui extends Gui
|
||||
{
|
||||
if (!entry.isEnabled()) return;
|
||||
IIngameOverlay overlay = entry.getOverlay();
|
||||
if (pre(overlay, pStack)) return;
|
||||
overlay.render(this, pStack, partialTicks, screenWidth, screenHeight);
|
||||
post(overlay, pStack);
|
||||
if (pre(overlay, poseStack)) return;
|
||||
overlay.render(this, poseStack, partialTick, screenWidth, screenHeight);
|
||||
post(overlay, poseStack);
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
@@ -357,7 +356,7 @@ public class ForgeIngameGui extends Gui
|
||||
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
post(ALL, pStack);
|
||||
post(ALL, poseStack);
|
||||
}
|
||||
|
||||
public boolean shouldDrawSurvivalElements()
|
||||
@@ -365,17 +364,17 @@ public class ForgeIngameGui extends Gui
|
||||
return minecraft.gameMode.canHurtPlayer() && minecraft.getCameraEntity() instanceof Player;
|
||||
}
|
||||
|
||||
protected void renderSubtitles(PoseStack mStack)
|
||||
protected void renderSubtitles(PoseStack poseStack)
|
||||
{
|
||||
this.subtitleOverlay.render(mStack);
|
||||
this.subtitleOverlay.render(poseStack);
|
||||
}
|
||||
|
||||
protected void renderBossHealth(PoseStack mStack)
|
||||
protected void renderBossHealth(PoseStack poseStack)
|
||||
{
|
||||
bind(GuiComponent.GUI_ICONS_LOCATION);
|
||||
RenderSystem.defaultBlendFunc();
|
||||
minecraft.getProfiler().push("bossHealth");
|
||||
this.bossOverlay.render(mStack);
|
||||
this.bossOverlay.render(poseStack);
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
|
||||
@@ -395,7 +394,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
private void renderHelmet(float partialTicks, PoseStack mStack)
|
||||
private void renderHelmet(float partialTick, PoseStack poseStack)
|
||||
{
|
||||
ItemStack itemstack = this.minecraft.player.getInventory().getArmor(3);
|
||||
|
||||
@@ -408,7 +407,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
else
|
||||
{
|
||||
RenderProperties.get(item).renderHelmetOverlay(itemstack, minecraft.player, this.screenWidth, this.screenHeight, partialTicks);
|
||||
RenderProperties.get(item).renderHelmetOverlay(itemstack, minecraft.player, this.screenWidth, this.screenHeight, partialTick);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -420,7 +419,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderArmor(PoseStack mStack, int width, int height)
|
||||
protected void renderArmor(PoseStack poseStack, int width, int height)
|
||||
{
|
||||
minecraft.getProfiler().push("armor");
|
||||
|
||||
@@ -433,15 +432,15 @@ public class ForgeIngameGui extends Gui
|
||||
{
|
||||
if (i < level)
|
||||
{
|
||||
blit(mStack, left, top, 34, 9, 9, 9);
|
||||
blit(poseStack, left, top, 34, 9, 9, 9);
|
||||
}
|
||||
else if (i == level)
|
||||
{
|
||||
blit(mStack, left, top, 25, 9, 9, 9);
|
||||
blit(poseStack, left, top, 25, 9, 9, 9);
|
||||
}
|
||||
else if (i > level)
|
||||
{
|
||||
blit(mStack, left, top, 16, 9, 9, 9);
|
||||
blit(poseStack, left, top, 16, 9, 9, 9);
|
||||
}
|
||||
left += 8;
|
||||
}
|
||||
@@ -452,9 +451,9 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderPortalOverlay(float partialTicks)
|
||||
protected void renderPortalOverlay(float partialTick)
|
||||
{
|
||||
float f1 = Mth.lerp(partialTicks, this.minecraft.player.oPortalTime, this.minecraft.player.portalTime);
|
||||
float f1 = Mth.lerp(partialTick, this.minecraft.player.oPortalTime, this.minecraft.player.portalTime);
|
||||
|
||||
if (f1 > 0.0F)
|
||||
{
|
||||
@@ -462,7 +461,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderAir(int width, int height, PoseStack mStack)
|
||||
protected void renderAir(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
minecraft.getProfiler().push("air");
|
||||
Player player = (Player)this.minecraft.getCameraEntity();
|
||||
@@ -478,7 +477,7 @@ public class ForgeIngameGui extends Gui
|
||||
|
||||
for (int i = 0; i < full + partial; ++i)
|
||||
{
|
||||
blit(mStack, left - i * 8 - 9, top, (i < full ? 16 : 25), 18, 9, 9);
|
||||
blit(poseStack, left - i * 8 - 9, top, (i < full ? 16 : 25), 18, 9, 9);
|
||||
}
|
||||
right_height += 10;
|
||||
}
|
||||
@@ -544,7 +543,7 @@ public class ForgeIngameGui extends Gui
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
|
||||
public void renderFood(int width, int height, PoseStack mStack)
|
||||
public void renderFood(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
minecraft.getProfiler().push("food");
|
||||
|
||||
@@ -578,18 +577,18 @@ public class ForgeIngameGui extends Gui
|
||||
y = top + (random.nextInt(3) - 1);
|
||||
}
|
||||
|
||||
blit(mStack, x, y, 16 + background * 9, 27, 9, 9);
|
||||
blit(poseStack, x, y, 16 + background * 9, 27, 9, 9);
|
||||
|
||||
if (idx < level)
|
||||
blit(mStack, x, y, icon + 36, 27, 9, 9);
|
||||
blit(poseStack, x, y, icon + 36, 27, 9, 9);
|
||||
else if (idx == level)
|
||||
blit(mStack, x, y, icon + 45, 27, 9, 9);
|
||||
blit(poseStack, x, y, icon + 45, 27, 9, 9);
|
||||
}
|
||||
RenderSystem.disableBlend();
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
|
||||
protected void renderSleepFade(int width, int height, PoseStack mStack)
|
||||
protected void renderSleepFade(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
if (minecraft.player.getSleepTimer() > 0)
|
||||
{
|
||||
@@ -605,14 +604,14 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
|
||||
int color = (int)(220.0F * opacity) << 24 | 1052704;
|
||||
fill(mStack, 0, 0, width, height, color);
|
||||
fill(poseStack, 0, 0, width, height, color);
|
||||
// RenderSystem.enableAlphaTest();
|
||||
RenderSystem.enableDepthTest();
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderExperience(int x, PoseStack mStack)
|
||||
protected void renderExperience(int x, PoseStack poseStack)
|
||||
{
|
||||
bind(GUI_ICONS_LOCATION);
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -620,27 +619,27 @@ public class ForgeIngameGui extends Gui
|
||||
|
||||
if (minecraft.gameMode.hasExperience())
|
||||
{
|
||||
super.renderExperienceBar(mStack, x);
|
||||
super.renderExperienceBar(poseStack, x);
|
||||
}
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderJumpMeter(PoseStack mStack, int x)
|
||||
public void renderJumpMeter(PoseStack poseStack, int x)
|
||||
{
|
||||
bind(GUI_ICONS_LOCATION);
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderSystem.disableBlend();
|
||||
|
||||
super.renderJumpMeter(mStack, x);
|
||||
super.renderJumpMeter(poseStack, x);
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
minecraft.getProfiler().pop();
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
protected void renderHUDText(int width, int height, PoseStack mStack)
|
||||
protected void renderHUDText(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
minecraft.getProfiler().push("forgeHudText");
|
||||
RenderSystem.defaultBlendFunc();
|
||||
@@ -660,23 +659,23 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
if (this.minecraft.options.renderDebug && !pre(DEBUG, mStack))
|
||||
if (this.minecraft.options.renderDebug && !pre(DEBUG, poseStack))
|
||||
{
|
||||
debugOverlay.update();
|
||||
listL.addAll(debugOverlay.getLeft());
|
||||
listR.addAll(debugOverlay.getRight());
|
||||
post(DEBUG, mStack);
|
||||
post(DEBUG, poseStack);
|
||||
}
|
||||
|
||||
RenderGameOverlayEvent.Text event = new RenderGameOverlayEvent.Text(mStack, eventParent, listL, listR);
|
||||
RenderGameOverlayEvent.Text event = new RenderGameOverlayEvent.Text(poseStack, eventParent, listL, listR);
|
||||
if (!MinecraftForge.EVENT_BUS.post(event))
|
||||
{
|
||||
int top = 2;
|
||||
for (String msg : listL)
|
||||
{
|
||||
if (msg == null) continue;
|
||||
fill(mStack, 1, top - 1, 2 + font.width(msg) + 1, top + font.lineHeight - 1, -1873784752);
|
||||
font.draw(mStack, msg, 2, top, 14737632);
|
||||
fill(poseStack, 1, top - 1, 2 + font.width(msg) + 1, top + font.lineHeight - 1, -1873784752);
|
||||
font.draw(poseStack, msg, 2, top, 14737632);
|
||||
top += font.lineHeight;
|
||||
}
|
||||
|
||||
@@ -686,30 +685,30 @@ public class ForgeIngameGui extends Gui
|
||||
if (msg == null) continue;
|
||||
int w = font.width(msg);
|
||||
int left = width - 2 - w;
|
||||
fill(mStack, left - 1, top - 1, left + w + 1, top + font.lineHeight - 1, -1873784752);
|
||||
font.draw(mStack, msg, left, top, 14737632);
|
||||
fill(poseStack, left - 1, top - 1, left + w + 1, top + font.lineHeight - 1, -1873784752);
|
||||
font.draw(poseStack, msg, left, top, 14737632);
|
||||
top += font.lineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
minecraft.getProfiler().pop();
|
||||
post(TEXT, mStack);
|
||||
post(TEXT, poseStack);
|
||||
}
|
||||
|
||||
protected void renderFPSGraph(PoseStack mStack)
|
||||
protected void renderFPSGraph(PoseStack poseStack)
|
||||
{
|
||||
if (this.minecraft.options.renderDebug && this.minecraft.options.renderFpsChart)
|
||||
{
|
||||
this.debugOverlay.render(mStack);
|
||||
this.debugOverlay.render(poseStack);
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderRecordOverlay(int width, int height, float partialTicks, PoseStack pStack)
|
||||
protected void renderRecordOverlay(int width, int height, float partialTick, PoseStack pStack)
|
||||
{
|
||||
if (overlayMessageTime > 0)
|
||||
{
|
||||
minecraft.getProfiler().push("overlayMessage");
|
||||
float hue = (float)overlayMessageTime - partialTicks;
|
||||
float hue = (float)overlayMessageTime - partialTick;
|
||||
int opacity = (int)(hue * 255.0F / 20.0F);
|
||||
if (opacity > 255) opacity = 255;
|
||||
|
||||
@@ -730,12 +729,12 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderTitle(int width, int height, float partialTicks, PoseStack pStack)
|
||||
protected void renderTitle(int width, int height, float partialTick, PoseStack pStack)
|
||||
{
|
||||
if (title != null && titleTime > 0)
|
||||
{
|
||||
minecraft.getProfiler().push("titleAndSubtitle");
|
||||
float age = (float)this.titleTime - partialTicks;
|
||||
float age = (float)this.titleTime - partialTick;
|
||||
int opacity = 255;
|
||||
|
||||
if (titleTime > titleFadeOutTime + titleStayTime)
|
||||
@@ -790,7 +789,7 @@ public class ForgeIngameGui extends Gui
|
||||
minecraft.getProfiler().pop();
|
||||
}
|
||||
|
||||
protected void renderPlayerList(int width, int height, PoseStack mStack)
|
||||
protected void renderPlayerList(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
Objective scoreobjective = this.minecraft.level.getScoreboard().getDisplayObjective(0);
|
||||
ClientPacketListener handler = minecraft.player.connection;
|
||||
@@ -798,9 +797,9 @@ public class ForgeIngameGui extends Gui
|
||||
if (minecraft.options.keyPlayerList.isDown() && (!minecraft.isLocalServer() || handler.getOnlinePlayers().size() > 1 || scoreobjective != null))
|
||||
{
|
||||
this.tabList.setVisible(true);
|
||||
if (pre(PLAYER_LIST, mStack)) return;
|
||||
this.tabList.render(mStack, width, this.minecraft.level.getScoreboard(), scoreobjective);
|
||||
post(PLAYER_LIST, mStack);
|
||||
if (pre(PLAYER_LIST, poseStack)) return;
|
||||
this.tabList.render(poseStack, width, this.minecraft.level.getScoreboard(), scoreobjective);
|
||||
post(PLAYER_LIST, poseStack);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -808,7 +807,7 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
}
|
||||
|
||||
protected void renderHealthMount(int width, int height, PoseStack mStack)
|
||||
protected void renderHealthMount(int width, int height, PoseStack poseStack)
|
||||
{
|
||||
Player player = (Player)minecraft.getCameraEntity();
|
||||
Entity tmp = player.getVehicle();
|
||||
@@ -843,12 +842,12 @@ public class ForgeIngameGui extends Gui
|
||||
for (int i = 0; i < rowCount; ++i)
|
||||
{
|
||||
int x = left_align - i * 8 - 9;
|
||||
blit(mStack, x, top, BACKGROUND, 9, 9, 9);
|
||||
blit(poseStack, x, top, BACKGROUND, 9, 9, 9);
|
||||
|
||||
if (i * 2 + 1 + heart < health)
|
||||
blit(mStack, x, top, FULL, 9, 9, 9);
|
||||
blit(poseStack, x, top, FULL, 9, 9, 9);
|
||||
else if (i * 2 + 1 + heart == health)
|
||||
blit(mStack, x, top, HALF, 9, 9, 9);
|
||||
blit(poseStack, x, top, HALF, 9, 9, 9);
|
||||
}
|
||||
|
||||
right_height += 10;
|
||||
@@ -857,21 +856,21 @@ public class ForgeIngameGui extends Gui
|
||||
}
|
||||
|
||||
//Helper macros
|
||||
private boolean pre(ElementType type, PoseStack mStack)
|
||||
private boolean pre(ElementType type, PoseStack poseStack)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(mStack, eventParent, type));
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Pre(poseStack, eventParent, type));
|
||||
}
|
||||
private void post(ElementType type, PoseStack mStack)
|
||||
private void post(ElementType type, PoseStack poseStack)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(mStack, eventParent, type));
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.Post(poseStack, eventParent, type));
|
||||
}
|
||||
private boolean pre(IIngameOverlay overlay, PoseStack mStack)
|
||||
private boolean pre(IIngameOverlay overlay, PoseStack poseStack)
|
||||
{
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PreLayer(mStack, eventParent, overlay));
|
||||
return MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PreLayer(poseStack, eventParent, overlay));
|
||||
}
|
||||
private void post(IIngameOverlay overlay, PoseStack mStack)
|
||||
private void post(IIngameOverlay overlay, PoseStack poseStack)
|
||||
{
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PostLayer(mStack, eventParent, overlay));
|
||||
MinecraftForge.EVENT_BUS.post(new RenderGameOverlayEvent.PostLayer(poseStack, eventParent, overlay));
|
||||
}
|
||||
private void bind(ResourceLocation res)
|
||||
{
|
||||
@@ -892,8 +891,8 @@ public class ForgeIngameGui extends Gui
|
||||
this.block = entity.pick(rayTraceDistance, 0.0F, false);
|
||||
this.liquid = entity.pick(rayTraceDistance, 0.0F, true);
|
||||
}
|
||||
@Override protected void drawGameInformation(PoseStack mStack){}
|
||||
@Override protected void drawSystemInformation(PoseStack mStack){}
|
||||
@Override protected void drawGameInformation(PoseStack poseStack){}
|
||||
@Override protected void drawSystemInformation(PoseStack poseStack){}
|
||||
private List<String> getLeft()
|
||||
{
|
||||
List<String> ret = this.getGameInformation();
|
||||
|
||||
@@ -57,7 +57,7 @@ public class GuiUtils
|
||||
* and filler. It is assumed that the desired texture ResourceLocation object has been bound using
|
||||
* Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
|
||||
*
|
||||
* @param matrixStack the gui matrix stack
|
||||
* @param poseStack the gui pose stack
|
||||
* @param x x axis offset
|
||||
* @param y y axis offset
|
||||
* @param u bound resource location image x offset
|
||||
@@ -69,10 +69,10 @@ public class GuiUtils
|
||||
* @param borderSize the size of the box's borders
|
||||
* @param zLevel the zLevel to draw at
|
||||
*/
|
||||
public static void drawContinuousTexturedBox(PoseStack matrixStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
public static void drawContinuousTexturedBox(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
int borderSize, float zLevel)
|
||||
{
|
||||
drawContinuousTexturedBox(matrixStack, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel);
|
||||
drawContinuousTexturedBox(poseStack, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,7 +80,7 @@ public class GuiUtils
|
||||
* and filler. The provided ResourceLocation object will be bound using
|
||||
* Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
|
||||
*
|
||||
* @param matrixStack the gui matrix stack
|
||||
* @param poseStack the gui pose stack
|
||||
* @param res the ResourceLocation object that contains the desired image
|
||||
* @param x x axis offset
|
||||
* @param y y axis offset
|
||||
@@ -93,10 +93,10 @@ public class GuiUtils
|
||||
* @param borderSize the size of the box's borders
|
||||
* @param zLevel the zLevel to draw at
|
||||
*/
|
||||
public static void drawContinuousTexturedBox(PoseStack matrixStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
public static void drawContinuousTexturedBox(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
int borderSize, float zLevel)
|
||||
{
|
||||
drawContinuousTexturedBox(matrixStack, res, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel);
|
||||
drawContinuousTexturedBox(poseStack, res, x, y, u, v, width, height, textureWidth, textureHeight, borderSize, borderSize, borderSize, borderSize, zLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,7 +104,7 @@ public class GuiUtils
|
||||
* and filler. The provided ResourceLocation object will be bound using
|
||||
* Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
|
||||
*
|
||||
* @param matrixStack the gui matrix stack
|
||||
* @param poseStack the gui pose stack
|
||||
* @param res the ResourceLocation object that contains the desired image
|
||||
* @param x x axis offset
|
||||
* @param y y axis offset
|
||||
@@ -120,12 +120,12 @@ public class GuiUtils
|
||||
* @param rightBorder the size of the box's right border
|
||||
* @param zLevel the zLevel to draw at
|
||||
*/
|
||||
public static void drawContinuousTexturedBox(PoseStack matrixStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
public static void drawContinuousTexturedBox(PoseStack poseStack, ResourceLocation res, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
|
||||
{
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
RenderSystem.setShaderTexture(0, res);
|
||||
drawContinuousTexturedBox(matrixStack, x, y, u, v, width, height, textureWidth, textureHeight, topBorder, bottomBorder, leftBorder, rightBorder, zLevel);
|
||||
drawContinuousTexturedBox(poseStack, x, y, u, v, width, height, textureWidth, textureHeight, topBorder, bottomBorder, leftBorder, rightBorder, zLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -133,7 +133,7 @@ public class GuiUtils
|
||||
* and filler. It is assumed that the desired texture ResourceLocation object has been bound using
|
||||
* Minecraft.getMinecraft().getTextureManager().bindTexture(resourceLocation).
|
||||
*
|
||||
* @param matrixStack the gui matrix stack
|
||||
* @param poseStack the gui pose stack
|
||||
* @param x x axis offset
|
||||
* @param y y axis offset
|
||||
* @param u bound resource location image x offset
|
||||
@@ -148,7 +148,7 @@ public class GuiUtils
|
||||
* @param rightBorder the size of the box's right border
|
||||
* @param zLevel the zLevel to draw at
|
||||
*/
|
||||
public static void drawContinuousTexturedBox(PoseStack matrixStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
public static void drawContinuousTexturedBox(PoseStack poseStack, int x, int y, int u, int v, int width, int height, int textureWidth, int textureHeight,
|
||||
int topBorder, int bottomBorder, int leftBorder, int rightBorder, float zLevel)
|
||||
{
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -166,37 +166,37 @@ public class GuiUtils
|
||||
|
||||
// Draw Border
|
||||
// Top Left
|
||||
drawTexturedModalRect(matrixStack, x, y, u, v, leftBorder, topBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x, y, u, v, leftBorder, topBorder, zLevel);
|
||||
// Top Right
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + canvasWidth, y, u + leftBorder + fillerWidth, v, rightBorder, topBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + canvasWidth, y, u + leftBorder + fillerWidth, v, rightBorder, topBorder, zLevel);
|
||||
// Bottom Left
|
||||
drawTexturedModalRect(matrixStack, x, y + topBorder + canvasHeight, u, v + topBorder + fillerHeight, leftBorder, bottomBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x, y + topBorder + canvasHeight, u, v + topBorder + fillerHeight, leftBorder, bottomBorder, zLevel);
|
||||
// Bottom Right
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + canvasWidth, y + topBorder + canvasHeight, u + leftBorder + fillerWidth, v + topBorder + fillerHeight, rightBorder, bottomBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + canvasWidth, y + topBorder + canvasHeight, u + leftBorder + fillerWidth, v + topBorder + fillerHeight, rightBorder, bottomBorder, zLevel);
|
||||
|
||||
for (int i = 0; i < xPasses + (remainderWidth > 0 ? 1 : 0); i++)
|
||||
{
|
||||
// Top Border
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + (i * fillerWidth), y, u + leftBorder, v, (i == xPasses ? remainderWidth : fillerWidth), topBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + (i * fillerWidth), y, u + leftBorder, v, (i == xPasses ? remainderWidth : fillerWidth), topBorder, zLevel);
|
||||
// Bottom Border
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + (i * fillerWidth), y + topBorder + canvasHeight, u + leftBorder, v + topBorder + fillerHeight, (i == xPasses ? remainderWidth : fillerWidth), bottomBorder, zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + (i * fillerWidth), y + topBorder + canvasHeight, u + leftBorder, v + topBorder + fillerHeight, (i == xPasses ? remainderWidth : fillerWidth), bottomBorder, zLevel);
|
||||
|
||||
// Throw in some filler for good measure
|
||||
for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++)
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + (i * fillerWidth), y + topBorder + (j * fillerHeight), u + leftBorder, v + topBorder, (i == xPasses ? remainderWidth : fillerWidth), (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + (i * fillerWidth), y + topBorder + (j * fillerHeight), u + leftBorder, v + topBorder, (i == xPasses ? remainderWidth : fillerWidth), (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
}
|
||||
|
||||
// Side Borders
|
||||
for (int j = 0; j < yPasses + (remainderHeight > 0 ? 1 : 0); j++)
|
||||
{
|
||||
// Left Border
|
||||
drawTexturedModalRect(matrixStack, x, y + topBorder + (j * fillerHeight), u, v + topBorder, leftBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
drawTexturedModalRect(poseStack, x, y + topBorder + (j * fillerHeight), u, v + topBorder, leftBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
// Right Border
|
||||
drawTexturedModalRect(matrixStack, x + leftBorder + canvasWidth, y + topBorder + (j * fillerHeight), u + leftBorder + fillerWidth, v + topBorder, rightBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
drawTexturedModalRect(poseStack, x + leftBorder + canvasWidth, y + topBorder + (j * fillerHeight), u + leftBorder + fillerWidth, v + topBorder, rightBorder, (j == yPasses ? remainderHeight : fillerHeight), zLevel);
|
||||
}
|
||||
}
|
||||
|
||||
public static void drawTexturedModalRect(PoseStack matrixStack, int x, int y, int u, int v, int width, int height, float zLevel)
|
||||
public static void drawTexturedModalRect(PoseStack poseStack, int x, int y, int u, int v, int width, int height, float zLevel)
|
||||
{
|
||||
final float uScale = 1f / 0x100;
|
||||
final float vScale = 1f / 0x100;
|
||||
@@ -204,7 +204,7 @@ public class GuiUtils
|
||||
Tesselator tessellator = Tesselator.getInstance();
|
||||
BufferBuilder wr = tessellator.getBuilder();
|
||||
wr.begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX);
|
||||
Matrix4f matrix = matrixStack.last().pose();
|
||||
Matrix4f matrix = poseStack.last().pose();
|
||||
wr.vertex(matrix, x , y + height, zLevel).uv( u * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.vertex(matrix, x + width, y + height, zLevel).uv((u + width) * uScale, ((v + height) * vScale)).endVertex();
|
||||
wr.vertex(matrix, x + width, y , zLevel).uv((u + width) * uScale, ( v * vScale)).endVertex();
|
||||
@@ -242,12 +242,12 @@ public class GuiUtils
|
||||
RenderSystem.enableTexture();
|
||||
}
|
||||
|
||||
public static void drawInscribedRect(PoseStack mStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight)
|
||||
public static void drawInscribedRect(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight)
|
||||
{
|
||||
drawInscribedRect(mStack, x, y, boundsWidth, boundsHeight, rectWidth, rectHeight, true, true);
|
||||
drawInscribedRect(poseStack, x, y, boundsWidth, boundsHeight, rectWidth, rectHeight, true, true);
|
||||
}
|
||||
|
||||
public static void drawInscribedRect(PoseStack mStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY)
|
||||
public static void drawInscribedRect(PoseStack poseStack, int x, int y, int boundsWidth, int boundsHeight, int rectWidth, int rectHeight, boolean centerX, boolean centerY)
|
||||
{
|
||||
if (rectWidth * boundsHeight > rectHeight * boundsWidth) {
|
||||
int h = boundsHeight;
|
||||
@@ -259,6 +259,6 @@ public class GuiUtils
|
||||
if (centerX) x += (w - boundsWidth) / 2;
|
||||
}
|
||||
|
||||
GuiComponent.blit(mStack, x, y, boundsWidth, boundsHeight, 0.0f,0.0f, rectWidth, rectHeight, rectWidth, rectHeight);
|
||||
GuiComponent.blit(poseStack, x, y, boundsWidth, boundsHeight, 0.0f,0.0f, rectWidth, rectHeight, rectWidth, rectHeight);
|
||||
}
|
||||
}
|
||||
@@ -9,5 +9,5 @@ import com.mojang.blaze3d.vertex.PoseStack;
|
||||
|
||||
public interface IIngameOverlay
|
||||
{
|
||||
void render(ForgeIngameGui gui, PoseStack mStack, float partialTicks, int width, int height);
|
||||
void render(ForgeIngameGui gui, PoseStack poseStack, float partialTick, int width, int height);
|
||||
}
|
||||
@@ -80,17 +80,17 @@ public class LoadingErrorScreen extends ErrorScreen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
this.renderBackground(mStack);
|
||||
this.entryList.render(mStack, mouseX, mouseY, partialTicks);
|
||||
drawMultiLineCenteredString(mStack, font, this.modLoadErrors.isEmpty() ? warningHeader : errorHeader, this.width / 2, 10);
|
||||
this.renderables.forEach(button -> button.render(mStack, mouseX, mouseY, partialTicks));
|
||||
this.renderBackground(poseStack);
|
||||
this.entryList.render(poseStack, mouseX, mouseY, partialTick);
|
||||
drawMultiLineCenteredString(poseStack, font, this.modLoadErrors.isEmpty() ? warningHeader : errorHeader, this.width / 2, 10);
|
||||
this.renderables.forEach(button -> button.render(poseStack, mouseX, mouseY, partialTick));
|
||||
}
|
||||
|
||||
private void drawMultiLineCenteredString(PoseStack mStack, Font fr, Component str, int x, int y) {
|
||||
private void drawMultiLineCenteredString(PoseStack poseStack, Font fr, Component str, int x, int y) {
|
||||
for (FormattedCharSequence s : fr.split(str, this.width)) {
|
||||
fr.drawShadow(mStack, s, (float) (x - fr.width(s) / 2.0), y, 0xFFFFFF);
|
||||
fr.drawShadow(poseStack, s, (float) (x - fr.width(s) / 2.0), y, 0xFFFFFF);
|
||||
y+=fr.lineHeight;
|
||||
}
|
||||
}
|
||||
@@ -140,15 +140,15 @@ public class LoadingErrorScreen extends ErrorScreen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack pStack, int entryIdx, int top, int left, final int entryWidth, final int entryHeight, final int mouseX, final int mouseY, final boolean p_194999_5_, final float partialTicks) {
|
||||
public void render(PoseStack poseStack, int entryIdx, int top, int left, final int entryWidth, final int entryHeight, final int mouseX, final int mouseY, final boolean p_194999_5_, final float partialTick) {
|
||||
Font font = Minecraft.getInstance().font;
|
||||
final List<FormattedCharSequence> strings = font.split(message, LoadingEntryList.this.width);
|
||||
int y = top + 2;
|
||||
for (int i = 0; i < Math.min(strings.size(), 2); i++) {
|
||||
if (center)
|
||||
font.draw(pStack, strings.get(i), left + (width) - font.width(strings.get(i)) / 2F, y, 0xFFFFFF);
|
||||
font.draw(poseStack, strings.get(i), left + (width) - font.width(strings.get(i)) / 2F, y, 0xFFFFFF);
|
||||
else
|
||||
font.draw(pStack, strings.get(i), left + 5, y, 0xFFFFFF);
|
||||
font.draw(poseStack, strings.get(i), left + 5, y, 0xFFFFFF);
|
||||
y += font.lineHeight;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,9 +104,6 @@ public class ModListScreen extends Screen
|
||||
private boolean sorted = false;
|
||||
private SortType sortType = SortType.NORMAL;
|
||||
|
||||
/**
|
||||
* @param parentScreen
|
||||
*/
|
||||
public ModListScreen(Screen parentScreen)
|
||||
{
|
||||
super(new TranslatableComponent("fml.menu.mods.title"));
|
||||
@@ -177,7 +174,7 @@ public class ModListScreen extends Screen
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawPanel(PoseStack mStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY)
|
||||
protected void drawPanel(PoseStack poseStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY)
|
||||
{
|
||||
if (logoPath != null) {
|
||||
RenderSystem.setShader(GameRenderer::getPositionTexShader);
|
||||
@@ -186,7 +183,7 @@ public class ModListScreen extends Screen
|
||||
RenderSystem.setShaderTexture(0, logoPath);
|
||||
// Draw the logo image inscribed in a rectangle with width entryWidth (minus some padding) and height 50
|
||||
int headerHeight = 50;
|
||||
GuiUtils.drawInscribedRect(mStack, left + PADDING, relativeY, width - (PADDING * 2), headerHeight, logoDims.width, logoDims.height, false, true);
|
||||
GuiUtils.drawInscribedRect(poseStack, left + PADDING, relativeY, width - (PADDING * 2), headerHeight, logoDims.width, logoDims.height, false, true);
|
||||
relativeY += headerHeight + PADDING;
|
||||
}
|
||||
|
||||
@@ -195,7 +192,7 @@ public class ModListScreen extends Screen
|
||||
if (line != null)
|
||||
{
|
||||
RenderSystem.enableBlend();
|
||||
ModListScreen.this.font.drawShadow(mStack, line, left + PADDING, relativeY, 0xFFFFFF);
|
||||
ModListScreen.this.font.drawShadow(poseStack, line, left + PADDING, relativeY, 0xFFFFFF);
|
||||
RenderSystem.disableBlend();
|
||||
}
|
||||
relativeY += font.lineHeight;
|
||||
@@ -203,7 +200,7 @@ public class ModListScreen extends Screen
|
||||
|
||||
final Style component = findTextLine(mouseX, mouseY);
|
||||
if (component!=null) {
|
||||
ModListScreen.this.renderComponentHoverEffect(mStack, component, mouseX, mouseY);
|
||||
ModListScreen.this.renderComponentHoverEffect(poseStack, component, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,17 +360,17 @@ public class ModListScreen extends Screen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
this.modList.render(mStack, mouseX, mouseY, partialTicks);
|
||||
this.modList.render(poseStack, mouseX, mouseY, partialTick);
|
||||
if (this.modInfo != null)
|
||||
this.modInfo.render(mStack, mouseX, mouseY, partialTicks);
|
||||
this.modInfo.render(poseStack, mouseX, mouseY, partialTick);
|
||||
|
||||
Component text = new TranslatableComponent("fml.menu.mods.search");
|
||||
int x = modList.getLeft() + ((modList.getRight() - modList.getLeft()) / 2) - (getFontRenderer().width(text) / 2);
|
||||
this.search.render(mStack, mouseX , mouseY, partialTicks);
|
||||
super.render(mStack, mouseX, mouseY, partialTicks);
|
||||
getFontRenderer().draw(mStack, text.getVisualOrderText(), x, search.y - getFontRenderer().lineHeight, 0xFFFFFF);
|
||||
this.search.render(poseStack, mouseX , mouseY, partialTick);
|
||||
super.render(poseStack, mouseX, mouseY, partialTick);
|
||||
getFontRenderer().draw(poseStack, text.getVisualOrderText(), x, search.y - getFontRenderer().lineHeight, 0xFFFFFF);
|
||||
}
|
||||
|
||||
public Minecraft getMinecraftInstance()
|
||||
|
||||
@@ -49,9 +49,8 @@ public class NotificationModUpdateScreen extends Screen
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public void render(PoseStack mStack, int mouseX, int mouseY, float partialTicks)
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
if (showNotification == null || !showNotification.shouldDraw() || !FMLConfig.runVersionCheck())
|
||||
{
|
||||
@@ -65,7 +64,7 @@ public class NotificationModUpdateScreen extends Screen
|
||||
int w = modButton.getWidth();
|
||||
int h = modButton.getHeight();
|
||||
|
||||
blit(mStack, x + w - (h / 2 + 4), y + (h / 2 - 4), showNotification.getSheetOffset() * 8, (showNotification.isAnimated() && ((System.currentTimeMillis() / 800 & 1) == 1)) ? 8 : 0, 8, 8, 64, 16);
|
||||
blit(poseStack, x + w - (h / 2 + 4), y + (h / 2 - 4), showNotification.getSheetOffset() * 8, (showNotification.isAnimated() && ((System.currentTimeMillis() / 800 & 1) == 1)) ? 8 : 0, 8, 8, 64, 16);
|
||||
}
|
||||
|
||||
public static NotificationModUpdateScreen init(TitleScreen guiMainMenu, Button modButton)
|
||||
|
||||
@@ -159,7 +159,7 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
/**
|
||||
* Draws the background of the scroll panel. This runs AFTER Scissors are enabled.
|
||||
*/
|
||||
protected void drawBackground(PoseStack matrix, Tesselator tess, float partialTicks)
|
||||
protected void drawBackground(PoseStack matrix, Tesselator tess, float partialTick)
|
||||
{
|
||||
BufferBuilder worldr = tess.getBuilder();
|
||||
|
||||
@@ -185,7 +185,7 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
* Draw anything special on the screen. Scissor (RenderSystem.enableScissor) is enabled
|
||||
* for anything that is rendered outside the view box. Do not mess with Scissor unless you support this.
|
||||
*/
|
||||
protected abstract void drawPanel(PoseStack mStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY);
|
||||
protected abstract void drawPanel(PoseStack poseStack, int entryRight, int relativeY, Tesselator tess, int mouseX, int mouseY);
|
||||
|
||||
protected boolean clickPanel(double mouseX, double mouseY, int button) { return false; }
|
||||
|
||||
@@ -294,7 +294,7 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack matrix, int mouseX, int mouseY, float partialTicks)
|
||||
public void render(PoseStack matrix, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
Tesselator tess = Tesselator.getInstance();
|
||||
BufferBuilder worldr = tess.getBuilder();
|
||||
@@ -303,7 +303,7 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
RenderSystem.enableScissor((int)(left * scale), (int)(client.getWindow().getHeight() - (bottom * scale)),
|
||||
(int)(width * scale), (int)(height * scale));
|
||||
|
||||
this.drawBackground(matrix, tess, partialTicks);
|
||||
this.drawBackground(matrix, tess, partialTick);
|
||||
|
||||
int baseY = this.top + border - (int)this.scrollDistance;
|
||||
this.drawPanel(matrix, right, baseY, tess, mouseX, mouseY);
|
||||
@@ -365,9 +365,9 @@ public abstract class ScrollPanel extends AbstractContainerEventHandler implemen
|
||||
RenderSystem.disableScissor();
|
||||
}
|
||||
|
||||
protected void drawGradientRect(PoseStack mStack, int left, int top, int right, int bottom, int color1, int color2)
|
||||
protected void drawGradientRect(PoseStack poseStack, int left, int top, int right, int bottom, int color1, int color2)
|
||||
{
|
||||
GuiUtils.drawGradientRect(mStack.last().pose(), 0, left, top, right, bottom, color1, color2);
|
||||
GuiUtils.drawGradientRect(poseStack.last().pose(), 0, left, top, right, bottom, color1, color2);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,12 +33,12 @@ public class ExtendedButton extends Button
|
||||
* Draws this button to the screen.
|
||||
*/
|
||||
@Override
|
||||
public void renderButton(PoseStack mStack, int mouseX, int mouseY, float partial)
|
||||
public void renderButton(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
int k = this.getYImage(this.isHovered);
|
||||
GuiUtils.drawContinuousTexturedBox(mStack, WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(mStack, mc, mouseX, mouseY);
|
||||
GuiUtils.drawContinuousTexturedBox(poseStack, WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(poseStack, mc, mouseX, mouseY);
|
||||
|
||||
Component buttonText = this.getMessage();
|
||||
int strWidth = mc.font.width(buttonText);
|
||||
@@ -48,6 +48,6 @@ public class ExtendedButton extends Button
|
||||
//TODO, srg names make it hard to figure out how to append to an ITextProperties from this trim operation, wraping this in StringTextComponent is kinda dirty.
|
||||
buttonText = new TextComponent(mc.font.substrByWidth(buttonText, width - 6 - ellipsisWidth).getString() + "...");
|
||||
|
||||
drawCenteredString(mStack, mc.font, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, getFGColor());
|
||||
drawCenteredString(poseStack, mc.font, buttonText, this.x + this.width / 2, this.y + (this.height - 8) / 2, getFGColor());
|
||||
}
|
||||
}
|
||||
@@ -57,9 +57,9 @@ public class ModListWidget extends ObjectSelectionList<ModListWidget.ModEntry>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderBackground(PoseStack mStack)
|
||||
protected void renderBackground(PoseStack poseStack)
|
||||
{
|
||||
this.parent.renderBackground(mStack);
|
||||
this.parent.renderBackground(poseStack);
|
||||
}
|
||||
|
||||
public class ModEntry extends ObjectSelectionList.Entry<ModEntry> {
|
||||
@@ -77,22 +77,22 @@ public class ModListWidget extends ObjectSelectionList<ModListWidget.ModEntry>
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack pStack, int entryIdx, int top, int left, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean p_194999_5_, float partialTicks)
|
||||
public void render(PoseStack poseStack, int entryIdx, int top, int left, int entryWidth, int entryHeight, int mouseX, int mouseY, boolean p_194999_5_, float partialTick)
|
||||
{
|
||||
Component name = new TextComponent(stripControlCodes(modInfo.getDisplayName()));
|
||||
Component version = new TextComponent(stripControlCodes(MavenVersionStringHelper.artifactVersionToString(modInfo.getVersion())));
|
||||
VersionChecker.CheckResult vercheck = VersionChecker.getResult(modInfo);
|
||||
Font font = this.parent.getFontRenderer();
|
||||
font.draw(pStack, Language.getInstance().getVisualOrder(FormattedText.composite(font.substrByWidth(name, listWidth))), left + 3, top + 2, 0xFFFFFF);
|
||||
font.draw(pStack, Language.getInstance().getVisualOrder(FormattedText.composite(font.substrByWidth(version, listWidth))), left + 3, top + 2 + font.lineHeight, 0xCCCCCC);
|
||||
font.draw(poseStack, Language.getInstance().getVisualOrder(FormattedText.composite(font.substrByWidth(name, listWidth))), left + 3, top + 2, 0xFFFFFF);
|
||||
font.draw(poseStack, Language.getInstance().getVisualOrder(FormattedText.composite(font.substrByWidth(version, listWidth))), left + 3, top + 2 + font.lineHeight, 0xCCCCCC);
|
||||
if (vercheck.status().shouldDraw())
|
||||
{
|
||||
//TODO: Consider adding more icons for visualization
|
||||
RenderSystem.setShaderColor(1, 1, 1, 1);
|
||||
RenderSystem.setShaderTexture(0, VERSION_CHECK_ICONS);
|
||||
pStack.pushPose();
|
||||
GuiComponent.blit(pStack, getLeft() + width - 12, top + entryHeight / 4, vercheck.status().getSheetOffset() * 8, (vercheck.status().isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16);
|
||||
pStack.popPose();
|
||||
poseStack.pushPose();
|
||||
GuiComponent.blit(poseStack, getLeft() + width - 12, top + entryHeight / 4, vercheck.status().getSheetOffset() * 8, (vercheck.status().isAnimated() && ((System.currentTimeMillis() / 800 & 1)) == 1) ? 8 : 0, 8, 8, 64, 16);
|
||||
poseStack.popPose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public class Slider extends ExtendedButton
|
||||
* Fired when the mouse button is dragged. Equivalent of MouseListener.mouseDragged(MouseEvent e).
|
||||
*/
|
||||
@Override
|
||||
protected void renderBg(PoseStack mStack, Minecraft par1Minecraft, int par2, int par3)
|
||||
protected void renderBg(PoseStack poseStack, Minecraft minecraft, int par2, int par3)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
@@ -104,7 +104,7 @@ public class Slider extends ExtendedButton
|
||||
updateSlider();
|
||||
}
|
||||
|
||||
GuiUtils.drawContinuousTexturedBox(mStack, WIDGETS_LOCATION, this.x + (int)(this.sliderValue * (float)(this.width - 8)), this.y, 0, 66, 8, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
GuiUtils.drawContinuousTexturedBox(poseStack, WIDGETS_LOCATION, this.x + (int)(this.sliderValue * (float)(this.width - 8)), this.y, 0, 66, 8, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,15 +30,15 @@ public class UnicodeGlyphButton extends ExtendedButton
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(PoseStack mStack, int mouseX, int mouseY, float partial)
|
||||
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick)
|
||||
{
|
||||
if (this.visible)
|
||||
{
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
this.isHovered = mouseX >= this.x && mouseY >= this.y && mouseX < this.x + this.width && mouseY < this.y + this.height;
|
||||
int k = this.getYImage(this.isHovered);
|
||||
GuiUtils.drawContinuousTexturedBox(mStack, WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(mStack, mc, mouseX, mouseY);
|
||||
GuiUtils.drawContinuousTexturedBox(poseStack, WIDGETS_LOCATION, this.x, this.y, 0, 46 + k * 20, this.width, this.height, 200, 20, 2, 3, 2, 2, this.getBlitOffset());
|
||||
this.renderBg(poseStack, mc, mouseX, mouseY);
|
||||
|
||||
Component buttonText = this.createNarrationMessage();
|
||||
int glyphWidth = (int) (mc.font.width(glyph) * glyphScale);
|
||||
@@ -52,14 +52,14 @@ public class UnicodeGlyphButton extends ExtendedButton
|
||||
strWidth = mc.font.width(buttonText);
|
||||
totalWidth = glyphWidth + strWidth;
|
||||
|
||||
mStack.pushPose();
|
||||
mStack.scale(glyphScale, glyphScale, 1.0F);
|
||||
this.drawCenteredString(mStack, mc.font, new TextComponent(glyph),
|
||||
poseStack.pushPose();
|
||||
poseStack.scale(glyphScale, glyphScale, 1.0F);
|
||||
this.drawCenteredString(poseStack, mc.font, new TextComponent(glyph),
|
||||
(int) (((this.x + (this.width / 2) - (strWidth / 2)) / glyphScale) - (glyphWidth / (2 * glyphScale)) + 2),
|
||||
(int) (((this.y + ((this.height - 8) / glyphScale) / 2) - 1) / glyphScale), getFGColor());
|
||||
mStack.popPose();
|
||||
poseStack.popPose();
|
||||
|
||||
this.drawCenteredString(mStack, mc.font, buttonText, (int) (this.x + (this.width / 2) + (glyphWidth / glyphScale)),
|
||||
this.drawCenteredString(poseStack, mc.font, buttonText, (int) (this.x + (this.width / 2) + (glyphWidth / glyphScale)),
|
||||
this.y + (this.height - 8) / 2, getFGColor());
|
||||
|
||||
}
|
||||
|
||||
@@ -32,7 +32,6 @@ public class EarlyLoaderGUI {
|
||||
this.window = minecraft.getWindow();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
private void setupMatrix() {
|
||||
RenderSystem.clear(256, Minecraft.ON_OSX);
|
||||
GL11.glMatrixMode(5889);
|
||||
@@ -51,7 +50,6 @@ public class EarlyLoaderGUI {
|
||||
renderMessages();
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
void renderTick() {
|
||||
if (handledElsewhere) return;
|
||||
// int guiScale = window.calculateScale(0, false);
|
||||
@@ -115,7 +113,6 @@ public class EarlyLoaderGUI {
|
||||
renderMessage(memory, memorycolour, 1, 1.0f);
|
||||
}
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
void renderMessage(final String message, final float[] colour, int line, float alpha) {
|
||||
// GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
|
||||
// ByteBuffer charBuffer = MemoryUtil.memAlloc(message.length() * 270);
|
||||
|
||||
@@ -112,8 +112,8 @@ public abstract class BakedModelWrapper<T extends BakedModel> implements BakedMo
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IModelData getModelData(@Nonnull BlockAndTintGetter world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull IModelData tileData)
|
||||
public IModelData getModelData(@Nonnull BlockAndTintGetter level, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull IModelData modelData)
|
||||
{
|
||||
return originalModel.getModelData(world, pos, state, tileData);
|
||||
return originalModel.getModelData(level, pos, state, modelData);
|
||||
}
|
||||
}
|
||||
@@ -72,12 +72,12 @@ public class CompositeModel implements IDynamicBakedModel
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public IModelData getModelData(@Nonnull BlockAndTintGetter world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull IModelData tileData)
|
||||
public IModelData getModelData(@Nonnull BlockAndTintGetter level, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull IModelData modelData)
|
||||
{
|
||||
CompositeModelData composite = new CompositeModelData();
|
||||
for(Map.Entry<String, BakedModel> entry : bakedParts.entrySet())
|
||||
{
|
||||
composite.putSubmodelData(entry.getKey(), entry.getValue().getModelData(world, pos, state, ModelDataWrapper.wrap(tileData)));
|
||||
composite.putSubmodelData(entry.getKey(), entry.getValue().getModelData(level, pos, state, ModelDataWrapper.wrap(modelData)));
|
||||
}
|
||||
return composite;
|
||||
}
|
||||
|
||||
@@ -237,9 +237,9 @@ public final class DynamicBucketModel implements IModelGeometry<DynamicBucketMod
|
||||
}
|
||||
|
||||
@Override
|
||||
public BakedModel resolve(BakedModel originalModel, ItemStack stack, @Nullable ClientLevel world, @Nullable LivingEntity entity, int seed)
|
||||
public BakedModel resolve(BakedModel originalModel, ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int seed)
|
||||
{
|
||||
BakedModel overriden = nested.resolve(originalModel, stack, world, entity, seed);
|
||||
BakedModel overriden = nested.resolve(originalModel, stack, level, entity, seed);
|
||||
if (overriden != originalModel) return overriden;
|
||||
return FluidUtil.getFluidContained(stack)
|
||||
.map(fluidStack -> {
|
||||
|
||||
@@ -37,13 +37,13 @@ public class ModelDataManager
|
||||
|
||||
private static final Map<ChunkPos, Map<BlockPos, IModelData>> modelDataCache = new ConcurrentHashMap<>();
|
||||
|
||||
private static void cleanCaches(Level world)
|
||||
private static void cleanCaches(Level level)
|
||||
{
|
||||
Preconditions.checkNotNull(world, "World must not be null");
|
||||
Preconditions.checkArgument(world == Minecraft.getInstance().level, "Cannot use model data for a world other than the current client world");
|
||||
if (world != currentLevel.get())
|
||||
Preconditions.checkNotNull(level, "Level must not be null");
|
||||
Preconditions.checkArgument(level == Minecraft.getInstance().level, "Cannot use model data for a level other than the current client level");
|
||||
if (level != currentLevel.get())
|
||||
{
|
||||
currentLevel = new WeakReference<>(world);
|
||||
currentLevel = new WeakReference<>(level);
|
||||
needModelDataRefresh.clear();
|
||||
modelDataCache.clear();
|
||||
}
|
||||
@@ -52,16 +52,16 @@ public class ModelDataManager
|
||||
public static void requestModelDataRefresh(BlockEntity te)
|
||||
{
|
||||
Preconditions.checkNotNull(te, "Tile entity must not be null");
|
||||
Level world = te.getLevel();
|
||||
Level level = te.getLevel();
|
||||
|
||||
cleanCaches(world);
|
||||
cleanCaches(level);
|
||||
needModelDataRefresh.computeIfAbsent(new ChunkPos(te.getBlockPos()), $ -> Collections.synchronizedSet(new HashSet<>()))
|
||||
.add(te.getBlockPos());
|
||||
}
|
||||
|
||||
private static void refreshModelData(Level world, ChunkPos chunk)
|
||||
private static void refreshModelData(Level level, ChunkPos chunk)
|
||||
{
|
||||
cleanCaches(world);
|
||||
cleanCaches(level);
|
||||
Set<BlockPos> needUpdate = needModelDataRefresh.remove(chunk);
|
||||
|
||||
if (needUpdate != null)
|
||||
@@ -69,7 +69,7 @@ public class ModelDataManager
|
||||
Map<BlockPos, IModelData> data = modelDataCache.computeIfAbsent(chunk, $ -> new ConcurrentHashMap<>());
|
||||
for (BlockPos pos : needUpdate)
|
||||
{
|
||||
BlockEntity toUpdate = world.getBlockEntity(pos);
|
||||
BlockEntity toUpdate = level.getBlockEntity(pos);
|
||||
if (toUpdate != null && !toUpdate.isRemoved())
|
||||
{
|
||||
data.put(pos, toUpdate.getModelData());
|
||||
@@ -92,15 +92,15 @@ public class ModelDataManager
|
||||
modelDataCache.remove(chunk);
|
||||
}
|
||||
|
||||
public static @Nullable IModelData getModelData(Level world, BlockPos pos)
|
||||
public static @Nullable IModelData getModelData(Level level, BlockPos pos)
|
||||
{
|
||||
return getModelData(world, new ChunkPos(pos)).get(pos);
|
||||
return getModelData(level, new ChunkPos(pos)).get(pos);
|
||||
}
|
||||
|
||||
public static Map<BlockPos, IModelData> getModelData(Level world, ChunkPos pos)
|
||||
public static Map<BlockPos, IModelData> getModelData(Level level, ChunkPos pos)
|
||||
{
|
||||
Preconditions.checkArgument(world.isClientSide, "Cannot request model data for server world");
|
||||
refreshModelData(world, pos);
|
||||
Preconditions.checkArgument(level.isClientSide, "Cannot request model data for server level");
|
||||
refreshModelData(level, pos);
|
||||
return modelDataCache.getOrDefault(pos, Collections.emptyMap());
|
||||
}
|
||||
}
|
||||
@@ -156,9 +156,9 @@ public class PerspectiveMapWrapper implements IDynamicBakedModel
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BakedModel resolve(BakedModel model, ItemStack stack, @Nullable ClientLevel worldIn, @Nullable LivingEntity entityIn, int seed)
|
||||
public BakedModel resolve(BakedModel model, ItemStack stack, @Nullable ClientLevel level, @Nullable LivingEntity entity, int seed)
|
||||
{
|
||||
model = parent.getOverrides().resolve(parent, stack, worldIn, entityIn, seed);
|
||||
model = parent.getOverrides().resolve(parent, stack, level, entity, seed);
|
||||
return new PerspectiveMapWrapper(model, transforms);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ public class MultipartModelData implements IModelData
|
||||
{
|
||||
public static final ModelProperty<MultipartModelData> MULTIPART_DATA = new ModelProperty<>();
|
||||
|
||||
public static IModelData create(List<Pair<Predicate<BlockState>, BakedModel>> selectors, BlockAndTintGetter world, BlockPos pos, BlockState state, IModelData tileData)
|
||||
public static IModelData create(List<Pair<Predicate<BlockState>, BakedModel>> selectors, BlockAndTintGetter level, BlockPos pos, BlockState state, IModelData tileData)
|
||||
{
|
||||
MultipartModelData multipartData = new MultipartModelData(tileData);
|
||||
for (Pair<Predicate<BlockState>, BakedModel> selector : selectors)
|
||||
@@ -29,7 +29,7 @@ public class MultipartModelData implements IModelData
|
||||
if (selector.getLeft().test(state))
|
||||
{
|
||||
BakedModel part = selector.getRight();
|
||||
IModelData partData = part.getModelData(world, pos, state, tileData);
|
||||
IModelData partData = part.getModelData(level, pos, state, tileData);
|
||||
multipartData.setPartData(part, partData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ public class ModelBuilder<T extends ModelBuilder<T>> extends ModelFile {
|
||||
|
||||
/**
|
||||
* Use a custom loader instead of the vanilla elements.
|
||||
* @param customLoaderFactory
|
||||
* @param customLoaderFactory function that returns the custom loader to set, given this and the {@link #existingFileHelper}
|
||||
* @return the custom loader builder
|
||||
*/
|
||||
public <L extends CustomLoaderBuilder<T>> L customLoader(BiFunction<T, ExistingFileHelper, L> customLoaderFactory)
|
||||
|
||||
+11
-11
@@ -37,7 +37,7 @@ public class ForgeBlockModelRenderer extends ModelBlockRenderer
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean tesselateWithoutAO(BlockAndTintGetter world, BakedModel model, BlockState state, BlockPos pos, PoseStack matrixStack, VertexConsumer buffer, boolean checkSides, Random rand, long seed, int combinedOverlayIn, IModelData modelData)
|
||||
public boolean tesselateWithoutAO(BlockAndTintGetter level, BakedModel model, BlockState state, BlockPos pos, PoseStack poseStack, VertexConsumer buffer, boolean checkSides, Random rand, long seed, int packedOverlay, IModelData modelData)
|
||||
{
|
||||
if(ForgeConfig.CLIENT.experimentalForgeLightPipelineEnabled.get())
|
||||
{
|
||||
@@ -46,18 +46,18 @@ public class ForgeBlockModelRenderer extends ModelBlockRenderer
|
||||
|
||||
VertexLighterFlat lighter = lighterFlat.get();
|
||||
lighter.setParent(consumer);
|
||||
lighter.setTransform(matrixStack.last());
|
||||
lighter.setTransform(poseStack.last());
|
||||
|
||||
return render(lighter, world, model, state, pos, matrixStack, checkSides, rand, seed, modelData);
|
||||
return render(lighter, level, model, state, pos, poseStack, checkSides, rand, seed, modelData);
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.tesselateWithoutAO(world, model, state, pos, matrixStack, buffer, checkSides, rand, seed, combinedOverlayIn, modelData);
|
||||
return super.tesselateWithoutAO(level, model, state, pos, poseStack, buffer, checkSides, rand, seed, packedOverlay, modelData);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean tesselateWithAO(BlockAndTintGetter world, BakedModel model, BlockState state, BlockPos pos, PoseStack matrixStack, VertexConsumer buffer, boolean checkSides, Random rand, long seed, int combinedOverlayIn, IModelData modelData)
|
||||
public boolean tesselateWithAO(BlockAndTintGetter level, BakedModel model, BlockState state, BlockPos pos, PoseStack poseStack, VertexConsumer buffer, boolean checkSides, Random rand, long seed, int packedOverlay, IModelData modelData)
|
||||
{
|
||||
if(ForgeConfig.CLIENT.experimentalForgeLightPipelineEnabled.get())
|
||||
{
|
||||
@@ -66,19 +66,19 @@ public class ForgeBlockModelRenderer extends ModelBlockRenderer
|
||||
|
||||
VertexLighterSmoothAo lighter = lighterSmooth.get();
|
||||
lighter.setParent(consumer);
|
||||
lighter.setTransform(matrixStack.last());
|
||||
lighter.setTransform(poseStack.last());
|
||||
|
||||
return render(lighter, world, model, state, pos, matrixStack, checkSides, rand, seed, modelData);
|
||||
return render(lighter, level, model, state, pos, poseStack, checkSides, rand, seed, modelData);
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.tesselateWithAO(world, model, state, pos, matrixStack, buffer, checkSides, rand, seed, combinedOverlayIn, modelData);
|
||||
return super.tesselateWithAO(level, model, state, pos, poseStack, buffer, checkSides, rand, seed, packedOverlay, modelData);
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean render(VertexLighterFlat lighter, BlockAndTintGetter world, BakedModel model, BlockState state, BlockPos pos, PoseStack matrixStack, boolean checkSides, Random rand, long seed, IModelData modelData)
|
||||
public static boolean render(VertexLighterFlat lighter, BlockAndTintGetter level, BakedModel model, BlockState state, BlockPos pos, PoseStack poseStack, boolean checkSides, Random rand, long seed, IModelData modelData)
|
||||
{
|
||||
lighter.setWorld(world);
|
||||
lighter.setWorld(level);
|
||||
lighter.setState(state);
|
||||
lighter.setBlockPos(pos);
|
||||
boolean empty = true;
|
||||
@@ -99,7 +99,7 @@ public class ForgeBlockModelRenderer extends ModelBlockRenderer
|
||||
quads = model.getQuads(state, side, rand, modelData);
|
||||
if(!quads.isEmpty())
|
||||
{
|
||||
if(!checkSides || Block.shouldRenderFace(state, world, pos, side, pos.relative(side)))
|
||||
if(!checkSides || Block.shouldRenderFace(state, level, pos, side, pos.relative(side)))
|
||||
{
|
||||
if(empty) lighter.updateBlockInfo();
|
||||
empty = false;
|
||||
|
||||
@@ -295,9 +295,9 @@ public class VertexLighterFlat extends QuadGatheringTransformer
|
||||
this.diffuse = diffuse;
|
||||
}
|
||||
|
||||
public void setWorld(BlockAndTintGetter world)
|
||||
public void setWorld(BlockAndTintGetter level)
|
||||
{
|
||||
blockInfo.setLevel(world);
|
||||
blockInfo.setLevel(level);
|
||||
}
|
||||
|
||||
public void setState(BlockState state)
|
||||
|
||||
Reference in new issue
Block a user