Skip to content

Commit

Permalink
1.21.4 update (#5030)
Browse files Browse the repository at this point in the history
  • Loading branch information
Big-Iron-Cheems authored Jan 6, 2025
1 parent 66d0c69 commit 2a853b2
Show file tree
Hide file tree
Showing 37 changed files with 578 additions and 649 deletions.
7 changes: 4 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "fabric-loom" version "1.8-SNAPSHOT"
id "fabric-loom" version "1.9-SNAPSHOT"
id "maven-publish"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "com.gradleup.shadow" version "8.3.5"
}

base {
Expand Down Expand Up @@ -60,7 +60,8 @@ dependencies {
modCompileOnly("maven.modrinth:sodium:${project.sodium_version}") { transitive = false }
modCompileOnly("maven.modrinth:lithium:${project.lithium_version}") { transitive = false }
modCompileOnly("maven.modrinth:iris:${project.iris_version}") { transitive = false }
modCompileOnly("de.florianmichael:ViaFabricPlus:${project.viafabricplus_version}") { transitive = false }
modCompileOnly("com.viaversion:viafabricplus:${project.viafabricplus_version}") { transitive = false }
modCompileOnly("com.viaversion:viafabricplus-api:${project.viafabricplus_version}") { transitive = false }

// Baritone (https://github.com/MeteorDevelopment/baritone)
modCompileOnly "meteordevelopment:baritone:${project.baritone_version}-SNAPSHOT"
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
org.gradle.jvmargs=-Xmx2G

# Fabric (https://fabricmc.net/develop)
minecraft_version=1.21.3
yarn_mappings=1.21.3+build.2
minecraft_version=1.21.4
yarn_mappings=1.21.4+build.7
loader_version=0.16.9
fapi_version=0.108.0+1.21.3
fapi_version=0.114.0+1.21.4

# Mod Properties
mod_version=0.6.0
Expand All @@ -14,16 +14,16 @@ archives_base_name=meteor-client
# Dependency Versions

# Baritone (https://github.com/MeteorDevelopment/baritone)
baritone_version=1.21.3
baritone_version=1.21.4

# Sodium (https://github.com/CaffeineMC/sodium-fabric)
sodium_version=mc1.21.3-0.6.0-fabric
sodium_version=mc1.21.4-0.6.6-fabric

# Lithium (https://github.com/CaffeineMC/lithium-fabric)
lithium_version=mc1.21.3-0.14.2-fabric
lithium_version=mc1.21.4-0.14.3-fabric

# Iris (https://github.com/IrisShaders/Iris)
iris_version=1.8.0+1.21.3-fabric
iris_version=1.8.5+1.21.4-fabric

# Orbit (https://github.com/MeteorDevelopment/orbit)
orbit_version=0.2.4
Expand All @@ -41,7 +41,7 @@ reflections_version=0.10.2
netty_version=4.1.90.Final

# ViaFabricPlus (https://github.com/ViaVersion/ViaFabricPlus)
viafabricplus_version=3.5.1
viafabricplus_version=4.0.0

# WaybackAuthLib (https://github.com/FlorianMichael/WaybackAuthLib)
waybackauthlib_version=1.0.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
.then(argument("direction", DirectionArgumentType.create())
.executes(context -> {
mc.player.setPitch(context.getArgument("direction", Direction.class).getVector().getY() * -90);
mc.player.setYaw(context.getArgument("direction", Direction.class).asRotation());
mc.player.setYaw(context.getArgument("direction", Direction.class).getPositiveHorizontalDegrees());

return SINGLE_SUCCESS;
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public void build(LiteralArgumentBuilder<CommandSource> builder) {
// Vehicle version
// For each 10 blocks, send a vehicle move packet with no delta
for (int packetNumber = 0; packetNumber < (packetsRequired - 1); packetNumber++) {
mc.player.networkHandler.sendPacket(new VehicleMoveC2SPacket(mc.player.getVehicle()));
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
}
// Now send the final vehicle move packet
mc.player.getVehicle().setPosition(mc.player.getVehicle().getX(), mc.player.getVehicle().getY() + blocks, mc.player.getVehicle().getZ());
mc.player.networkHandler.sendPacket(new VehicleMoveC2SPacket(mc.player.getVehicle()));
mc.player.networkHandler.sendPacket(VehicleMoveC2SPacket.fromVehicle(mc.player.getVehicle()));
} else {
// No vehicle version
// For each 10 blocks, send a player move packet with no delta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

import meteordevelopment.meteorclient.events.Cancellable;
import meteordevelopment.meteorclient.mixininterface.IEntityRenderState;
import net.minecraft.client.item.ItemModelManager;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.state.ItemEntityRenderState;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.ItemEntity;

Expand All @@ -22,17 +22,17 @@ public class RenderItemEntityEvent extends Cancellable {
public MatrixStack matrixStack;
public VertexConsumerProvider vertexConsumerProvider;
public int light;
public ItemRenderer itemRenderer;
public ItemModelManager itemModelManager;

public static RenderItemEntityEvent get(ItemEntityRenderState renderState, float tickDelta, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, ItemRenderer itemRenderer) {
public static RenderItemEntityEvent get(ItemEntityRenderState renderState, float tickDelta, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, ItemModelManager itemModelManager) {
INSTANCE.setCancelled(false);
INSTANCE.itemEntity = (ItemEntity) ((IEntityRenderState) renderState).meteor$getEntity();
INSTANCE.renderState = renderState;
INSTANCE.tickDelta = tickDelta;
INSTANCE.matrixStack = matrixStack;
INSTANCE.vertexConsumerProvider = vertexConsumerProvider;
INSTANCE.light = light;
INSTANCE.itemRenderer = itemRenderer;
INSTANCE.itemModelManager = itemModelManager;
return INSTANCE;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
import net.minecraft.client.render.block.entity.SignBlockEntityRenderer;
import net.minecraft.client.render.block.entity.AbstractSignBlockEntityRenderer;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(SignBlockEntityRenderer.class)
public abstract class SignBlockEntityRendererMixin {
@Mixin(AbstractSignBlockEntityRenderer.class)
public abstract class AbstractSignBlockEntityRendererMixin {
@ModifyExpressionValue(method = "renderText", at = @At(value = "CONSTANT", args = {"intValue=4", "ordinal=1"}))
private int loopTextLengthProxy(int i) {
if (Modules.get().get(NoRender.class).noSignText()) return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@

package meteordevelopment.meteorclient.mixin;

import com.llamalad7.mixinextras.sugar.Local;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.NoRender;
import net.minecraft.block.BannerBlock;
import net.minecraft.block.BlockState;
import net.minecraft.block.WallBannerBlock;
import net.minecraft.block.entity.BannerBlockEntity;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.block.entity.BannerBlockEntityRenderer;
import net.minecraft.client.render.block.entity.model.BannerBlockModel;
import net.minecraft.client.render.model.ModelBaker;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.RotationAxis;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
Expand All @@ -29,63 +25,30 @@

@Mixin(BannerBlockEntityRenderer.class)
public abstract class BannerBlockEntityRendererMixin {

@Final
@Shadow private ModelPart pillar;
@Final
@Shadow private ModelPart crossbar;
@Shadow
public abstract void render(BannerBlockEntity bannerBlockEntity, float f, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j);

@Inject(method = "render(Lnet/minecraft/block/entity/BannerBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", at = @At("HEAD"), cancellable = true)
private void render(BannerBlockEntity bannerBlockEntity, float f, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j, CallbackInfo ci) {
if (bannerBlockEntity.getWorld() != null) { //Don't modify banners in item form
NoRender.BannerRenderMode renderMode = Modules.get().get(NoRender.class).getBannerRenderMode();
if (renderMode == NoRender.BannerRenderMode.None) ci.cancel();
else if (renderMode == NoRender.BannerRenderMode.Pillar) {
BlockState blockState = bannerBlockEntity.getCachedState();
if (blockState.getBlock() instanceof BannerBlock) { //Floor banner
this.pillar.visible = true;
this.crossbar.visible = false;
renderPillar(bannerBlockEntity, matrixStack, vertexConsumerProvider, i, j);
}
else { //Wall banner
this.pillar.visible = false;
this.crossbar.visible = true;
renderCrossbar(bannerBlockEntity, matrixStack, vertexConsumerProvider, i, j);
}
ci.cancel();
}
}
private void injectRender1(BannerBlockEntity bannerBlockEntity, float tickDelta, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, CallbackInfo ci) {
if (Modules.get().get(NoRender.class).getBannerRenderMode() == NoRender.BannerRenderMode.None) ci.cancel();
}

@Unique
private void renderPillar(BannerBlockEntity bannerBlockEntity, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j) {
matrixStack.push();
BlockState blockState = bannerBlockEntity.getCachedState();
matrixStack.translate(0.5D, 0.5D, 0.5D);
float h = (-(Integer)blockState.get(BannerBlock.ROTATION) * 360) / 16.0F;
matrixStack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(h));
matrixStack.push();
matrixStack.scale(0.6666667F, -0.6666667F, -0.6666667F);
VertexConsumer vertexConsumer = ModelBaker.BANNER_BASE.getVertexConsumer(vertexConsumerProvider, RenderLayer::getEntitySolid);
this.pillar.render(matrixStack, vertexConsumer, i, j);
matrixStack.pop();
matrixStack.pop();
@Inject(method = "render(Lnet/minecraft/block/entity/BannerBlockEntity;FLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;II)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/block/entity/BannerBlockEntityRenderer;render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IIFLnet/minecraft/client/render/block/entity/model/BannerBlockModel;Lnet/minecraft/client/render/block/entity/model/BannerFlagBlockModel;FLnet/minecraft/util/DyeColor;Lnet/minecraft/component/type/BannerPatternsComponent;)V"), cancellable = true)
private void injectRender2(BannerBlockEntity bannerBlockEntity, float tickDelta, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, CallbackInfo ci,
@Local(ordinal = 1) float rotation, @Local BannerBlockModel bannerBlockModel) {
if (Modules.get().get(NoRender.class).getBannerRenderMode() == NoRender.BannerRenderMode.Pillar) {
renderPillar(matrixStack, vertexConsumerProvider, light, overlay, rotation, bannerBlockModel);
ci.cancel();
}
}

@Unique
private void renderCrossbar(BannerBlockEntity bannerBlockEntity, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i, int j) {
matrixStack.push();
BlockState blockState = bannerBlockEntity.getCachedState();
matrixStack.translate(0.5D, -0.1666666716337204D, 0.5D);
float h = -blockState.get(WallBannerBlock.FACING).asRotation();
matrixStack.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(h));
matrixStack.translate(0.0D, -0.3125D, -0.4375D);
matrixStack.push();
matrixStack.scale(0.6666667F, -0.6666667F, -0.6666667F);
VertexConsumer vertexConsumer = ModelBaker.BANNER_BASE.getVertexConsumer(vertexConsumerProvider, RenderLayer::getEntitySolid);
this.crossbar.render(matrixStack, vertexConsumer, i, j);
matrixStack.pop();
matrixStack.pop();
private static void renderPillar(MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay, float rotation, BannerBlockModel model) {
matrices.push();
matrices.translate(0.5F, 0.0F, 0.5F);
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(rotation));
matrices.scale(0.6666667F, -0.6666667F, -0.6666667F);
model.render(matrices, ModelBaker.BANNER_BASE.getVertexConsumer(vertexConsumers, RenderLayer::getEntitySolid), light, overlay);
matrices.pop();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* This file is part of the Meteor Client distribution (https://github.com/MeteorDevelopment/meteor-client).
* Copyright (c) Meteor Development.
*/

package meteordevelopment.meteorclient.mixin;

import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.world.Ambience;
import net.minecraft.client.color.block.BlockColorProvider;
import net.minecraft.client.color.block.BlockColors;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyArg;

@Mixin(BlockColors.class)
public abstract class BlockColorsMixin {
// Ambience - Custom Foliage Color

@ModifyArg(
method = "create",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/color/block/BlockColors;registerColorProvider(Lnet/minecraft/client/color/block/BlockColorProvider;[Lnet/minecraft/block/Block;)V",
ordinal = 3
),
index = 0
)
private static BlockColorProvider modifySpruceLeavesColor(BlockColorProvider provider) {
return (state, world, pos, tintIndex) -> getModifiedColor(-10380959);
}

@ModifyArg(
method = "create",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/color/block/BlockColors;registerColorProvider(Lnet/minecraft/client/color/block/BlockColorProvider;[Lnet/minecraft/block/Block;)V",
ordinal = 4
),
index = 0
)
private static BlockColorProvider modifyBirchLeavesColor(BlockColorProvider provider) {
return (state, world, pos, tintIndex) -> getModifiedColor(-8345771);
}

@Unique
private static int getModifiedColor(int original) {
if (Modules.get() == null) return original;

Ambience ambience = Modules.get().get(Ambience.class);
if (ambience.isActive() && ambience.customFoliageColor.get()) {
return ambience.foliageColor.get().getPacked();
}

return original;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,23 @@ private void onGetSkyProperties(CallbackInfoReturnable<DimensionEffects> info) {
* @author Walaryne
*/
@Inject(method = "getSkyColor", at = @At("HEAD"), cancellable = true)
private void onGetSkyColor(Vec3d cameraPos, float tickDelta, CallbackInfoReturnable<Vec3d> info) {
private void onGetSkyColor(Vec3d cameraPos, float tickDelta, CallbackInfoReturnable<Integer> cir) {
Ambience ambience = Modules.get().get(Ambience.class);

if (ambience.isActive() && ambience.customSkyColor.get()) {
info.setReturnValue(ambience.skyColor().getVec3d());
cir.setReturnValue(ambience.skyColor().getPacked());
}
}

/**
* @author Walaryne
*/
@Inject(method = "getCloudsColor", at = @At("HEAD"), cancellable = true)
private void onGetCloudsColor(float tickDelta, CallbackInfoReturnable<Vec3d> info) {
private void onGetCloudsColor(float tickDelta, CallbackInfoReturnable<Integer> info) {
Ambience ambience = Modules.get().get(Ambience.class);

if (ambience.isActive() && ambience.customCloudColor.get()) {
info.setReturnValue(ambience.cloudColor.get().getVec3d());
info.setReturnValue(ambience.cloudColor.get().getPacked());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import meteordevelopment.meteorclient.systems.modules.Modules;
import meteordevelopment.meteorclient.systems.modules.render.Freecam;
import net.minecraft.client.item.CompassAnglePredicateProvider;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.item.property.numeric.CompassState;
import net.minecraft.entity.Entity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
Expand All @@ -19,16 +19,16 @@

import static meteordevelopment.meteorclient.MeteorClient.mc;

@Mixin(CompassAnglePredicateProvider.class)
public abstract class CompassAnglePredicateProviderMixin {
@Mixin(CompassState.class)
public abstract class CompassStateMixin {
@ModifyExpressionValue(method = "getBodyYaw", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;getBodyYaw()F"))
private float callLivingEntityGetYaw(float original) {
private static float callLivingEntityGetYaw(float original) {
if (Modules.get().isActive(Freecam.class)) return mc.gameRenderer.getCamera().getYaw();
return original;
}

@ModifyReturnValue(method = "getAngleTo(Lnet/minecraft/entity/Entity;Lnet/minecraft/util/math/BlockPos;)D", at = @At("RETURN"))
private double modifyGetAngleTo(double original, Entity entity, BlockPos pos) {
private static double modifyGetAngleTo(double original, Entity entity, BlockPos pos) {
if (Modules.get().isActive(Freecam.class)) {
Vec3d vec3d = Vec3d.ofCenter(pos);
Camera camera = mc.gameRenderer.getCamera();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

@Mixin(value = {FireworksSparkParticle.Explosion.class, FireworksSparkParticle.Flash.class})
public abstract class FireworksSparkParticleSubMixin {
@Inject(method = "buildGeometry", at = @At("HEAD"), cancellable = true)
@Inject(method = "render", at = @At("HEAD"), cancellable = true)
private void buildExplosionGeometry(VertexConsumer vertexConsumer, Camera camera, float tickDelta, CallbackInfo info) {
if (Modules.get().get(NoRender.class).noFireworkExplosions()) info.cancel();
}
Expand Down
Loading

0 comments on commit 2a853b2

Please sign in to comment.