Skip to content

Commit

Permalink
WIP: Update to Minecraft 1.21.2/1.21.3
Browse files Browse the repository at this point in the history
- Adapt to minor API changes.
- Update Gradle, Loom, FLoader/FAPI, Yarn.
  • Loading branch information
retrixe committed Dec 5, 2024
1 parent 405f5b3 commit 196a585
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ org.gradle.jvmargs=-Xmx1G
# To remap the mixin locations:
# gradlew migrateMappings --mappings "1.16.1+build.9"

minecraft_version=1.21.1
yarn_mappings=1.21.1+build.3
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
loader_version=0.16.9

#Fabric api
fabric_version=0.110.0+1.21.1
fabric_version=0.110.0+1.21.3

# Mod Properties
mod_version = 1.21.1-fabric-1
mod_version = 1.21.3-fabric-1
maven_group = net.torocraft
archives_base_name = torohealth
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import java.util.List;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.font.TextRenderer;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.BufferRenderer;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.VertexFormat;
Expand Down Expand Up @@ -91,7 +91,7 @@ public static void renderInWorld(MatrixStack matrix,
return;
}

RenderSystem.setShader(GameRenderer::getPositionColorProgram);
RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR);
RenderSystem.enableDepthTest();
RenderSystem.enableBlend();
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE,
Expand Down Expand Up @@ -193,7 +193,7 @@ private static void drawBar(Matrix4f matrix4f, double x, double y, float width,
float b = (color & 255) / 255.0F;

RenderSystem.setShaderColor(r, g, b, 1);
RenderSystem.setShader(GameRenderer::getPositionTexProgram);
RenderSystem.setShader(ShaderProgramKeys.POSITION_TEX);
RenderSystem.setShaderTexture(0, GUI_BARS_TEXTURES);
RenderSystem.enableBlend();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.MathHelper;
Expand Down Expand Up @@ -46,7 +46,7 @@ private static void renderParticle(MatrixStack matrix, VertexConsumerProvider ve
matrix.multiply(RotationAxis.POSITIVE_X.rotationDegrees(camera.getPitch()));
matrix.scale(-scaleToGui, -scaleToGui, scaleToGui);

RenderSystem.setShader(GameRenderer::getPositionColorProgram);
RenderSystem.setShader(ShaderProgramKeys.POSITION_COLOR);
RenderSystem.enableDepthTest();
RenderSystem.enableBlend();
RenderSystem.blendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_ONE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gl.ShaderProgramKeys;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.entity.LivingEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
Expand All @@ -27,7 +27,7 @@ public void draw(DrawContext drawContext, LivingEntity entity) {
int xOffset = 0;

RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShader(GameRenderer::getPositionTexProgram);
RenderSystem.setShader(ShaderProgramKeys.POSITION_TEX);
RenderSystem.enableBlend();

HealthBarRenderer.render(drawContext.getMatrices(), drawContext.getVertexConsumers(), entity, 63, 14, 130, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static boolean showHealthBar(Entity entity, MinecraftClient client) {
&& (!entity.isInvisibleTo(client.player)
|| entity.isGlowing()
|| entity.isOnFire()
|| entity instanceof CreeperEntity && ((CreeperEntity) entity).shouldRenderOverlay() // charged creeper
|| entity instanceof CreeperEntity && ((CreeperEntity) entity).isCharged() // charged creeper
|| StreamSupport.stream(living.getEquippedItems().spliterator(), false).anyMatch(is -> !is.isEmpty()))
&& entity != client.player
&& !entity.isSpectator();
Expand Down

0 comments on commit 196a585

Please sign in to comment.