Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to 1.21.2/3 #365

Merged
merged 1 commit into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ org.gradle.jvmargs=-Xmx4G
org.gradle.parallel=true
org.gradle.parallel.threads=2

minecraftVersion=1.21.1
fabricLoaderVersion=0.16.2
minecraftVersion=1.21.2
fabricLoaderVersion=0.16.9
qmBuild=0

modrinthId=QwxR6Gcd
curseforgeId=596224
githubProject=isXander/Debugify

# Libraries
fabricApiVersion=0.102.1+1.21.1
yaclVersion=3.5.0+1.21-fabric
modMenuVersion=11.0.1
fabricApiVersion=0.107.0+1.21.3
yaclVersion=3.6.1+1.21.2-fabric
modMenuVersion=12.0.0-beta.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-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;

public interface DebugifyLightProvider<T extends LivingEntity> {
default int modifyLightLevel(int lightLevel, T livingEntity, float f, float g, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider) {
public interface DebugifyLightProvider<S extends LivingEntityRenderState> {
default int modifyLightLevel(int lightLevel, S livingEntity, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider) {
return lightLevel;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.vehicle.AbstractBoat;
import net.minecraft.world.entity.vehicle.Boat;
import net.minecraft.world.level.Level;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
Expand All @@ -12,7 +13,7 @@
import org.spongepowered.asm.mixin.injection.At;

@BugFix(id = "MC-108948", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(Boat.class)
@Mixin(AbstractBoat.class)
public abstract class BoatMixin extends Entity {
public BoatMixin(EntityType<?> type, Level world) {
super(type, world);
Expand All @@ -22,7 +23,7 @@ public BoatMixin(EntityType<?> type, Level world) {
* when the boat is being handled by client, and the player isn't controlling it,
* it's movement is not calculated. creating de-sync between client and server.
*/
@ModifyExpressionValue(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/vehicle/Boat;isControlledByLocalInstance()Z"))
@ModifyExpressionValue(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/vehicle/AbstractBoat;isControlledByLocalInstance()Z"))
private boolean shouldUpdateVelocity(boolean isLogicalSideForUpdatingMovement) {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
@BugFix(id = "MC-111516", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(PlayerRenderer.class)
public final class PlayerRendererMixin {
@ModifyArg(method = "setupRotations(Lnet/minecraft/client/player/AbstractClientPlayer;Lcom/mojang/blaze3d/vertex/PoseStack;FFFF)V", at = @At(value = "INVOKE", target = "java/lang/Math.acos(D)D"))
private double clampAcos(double a) {
@ModifyArg(method = "extractFlightData", at = @At(value = "INVOKE", target = "java/lang/Math.acos(D)D"))
private static double clampAcos(double a) {
return Math.min(a, 1.0);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.isxander.debugify.client.mixins.basic.mc116379;

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.client.renderer.entity.FishingHookRenderer;
Expand All @@ -15,7 +16,7 @@
@BugFix(id = "MC-116379", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(FishingHookRenderer.class)
public class FishingHookRendererMixin {
@ModifyVariable(method = "render(Lnet/minecraft/world/entity/projectile/FishingHook;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At("STORE"), ordinal = 2)
@ModifyExpressionValue(method = "extractRenderState(Lnet/minecraft/world/entity/projectile/FishingHook;Lnet/minecraft/client/renderer/entity/state/FishingHookRenderState;F)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;getAttackAnim(F)F"))
private float modifyHandSwingProgress(float handSwingProgress, FishingHook bobber) {
Player player = bobber.getPlayerOwner();
int j = player.getMainArm() == HumanoidArm.RIGHT ? 1 : -1;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package dev.isxander.debugify.client.mixins.basic.mc122477;

import com.mojang.blaze3d.TracyFrameCapture;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import dev.isxander.debugify.client.helpers.mc122477.KeyboardPollCounter;
Expand All @@ -14,7 +15,7 @@
@Mixin(value = RenderSystem.class, priority = 1100, remap = false) // higher priority to improve compatibility with VulkanMod
public class RenderSystemMixin {
@Inject(method = "flipFrame", at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;pollEvents()V"))
private static void onPollEvents(long window, CallbackInfo ci) {
private static void onPollEvents(long l, TracyFrameCapture tracyFrameCapture, CallbackInfo ci) {
KeyboardPollCounter.poll();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import com.mojang.blaze3d.vertex.PoseStack;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.ClientLevel;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.state.ArmorStandRenderState;
import org.spongepowered.asm.mixin.Mixin;

import java.util.stream.IntStream;
Expand All @@ -16,7 +20,10 @@

@BugFix(id = "MC-197260", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(ArmorStandRenderer.class)
public abstract class ArmorStandRendererMixin extends LivingEntityRendererMixin<ArmorStand, ArmorStandArmorModel> {
public abstract class ArmorStandRendererMixin extends LivingEntityRendererMixin<ArmorStand, ArmorStandRenderState, ArmorStandArmorModel> {
protected ArmorStandRendererMixin(EntityRendererProvider.Context context) {
super(context);
}

/**
* Overrides the light level passed to the renderer, with the maximum of:
Expand All @@ -28,11 +35,14 @@ public abstract class ArmorStandRendererMixin extends LivingEntityRendererMixin<
* </ul>
*/
@Override
public int modifyLightLevel(int providedLightLevel, ArmorStand livingEntity, float f, float g, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider) {
public int modifyLightLevel(int providedLightLevel, ArmorStandRenderState livingEntity, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider) {
BlockPos mainPos = BlockPos.containing(livingEntity.x, livingEntity.y, livingEntity.z);
ClientLevel level = Minecraft.getInstance().level;

return Math.max(providedLightLevel, IntStream.of(-1, 2, 3)
.map(operand -> {
BlockPos pos = livingEntity.blockPosition().offset(0, operand, 0);
return LightTexture.pack(livingEntity.level().getBrightness(LightLayer.BLOCK, pos), livingEntity.level().getBrightness(LightLayer.SKY, pos));
BlockPos pos = mainPos.offset(0, operand, 0);
return LightTexture.pack(level.getBrightness(LightLayer.BLOCK, pos), level.getBrightness(LightLayer.SKY, pos));
})
.max().orElse(providedLightLevel)
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
package dev.isxander.debugify.client.mixins.basic.mc197260;

import com.mojang.blaze3d.vertex.PoseStack;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.client.model.EntityModel;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.EntityRenderer;
import net.minecraft.client.renderer.entity.EntityRendererProvider;
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
import net.minecraft.client.renderer.entity.RenderLayerParent;
import net.minecraft.client.renderer.entity.state.LivingEntityRenderState;
import net.minecraft.world.entity.LivingEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import dev.isxander.debugify.client.helpers.mc197260.DebugifyLightProvider;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;

@BugFix(id = "MC-197260", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(LivingEntityRenderer.class)
public class LivingEntityRendererMixin<T extends LivingEntity, M extends EntityModel<T>> implements DebugifyLightProvider<T> {
@ModifyVariable(method = "render(Lnet/minecraft/world/entity/LivingEntity;FFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At("HEAD"), ordinal = 0, argsOnly = true)
private int modifyProvidedLightLevel(int lightLevel, T livingEntity, float f, float g, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider, int i) {
return modifyLightLevel(lightLevel, livingEntity, f, g, matrixStack, vertexConsumerProvider);
public abstract class LivingEntityRendererMixin<T extends LivingEntity, S extends LivingEntityRenderState, M extends EntityModel<? super S>> extends EntityRenderer<T, S> implements RenderLayerParent<S, M>, DebugifyLightProvider<S> {
protected LivingEntityRendererMixin(EntityRendererProvider.Context context) {
super(context);
}

@ModifyVariable(method = "render(Lnet/minecraft/client/renderer/entity/state/LivingEntityRenderState;Lcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;I)V", at = @At("HEAD"), index = 4, argsOnly = true)
private int modifyProvidedLightLevel(int lightLevel, S livingEntityRenderState, PoseStack matrixStack, MultiBufferSource vertexConsumerProvider) {
return modifyLightLevel(lightLevel, livingEntityRenderState, matrixStack, vertexConsumerProvider);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class GuiMixin {
@Shadow @Final private Minecraft minecraft;

@ModifyExpressionValue(method = "renderCameraOverlays", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;is(Lnet/minecraft/world/item/Item;)Z"))
@ModifyExpressionValue(method = "renderCameraOverlays", at = @At(value = "INVOKE", target = "Ljava/util/Optional;isPresent()Z"))
private boolean shouldRenderPumpkinOverlay(boolean pumpkinOnHead) {
return pumpkinOnHead && !minecraft.player.isSpectator();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package dev.isxander.debugify.client.mixins.basic.mc217716;

import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.renderer.GameRenderer;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import org.spongepowered.asm.mixin.Final;
Expand All @@ -17,8 +15,8 @@
public class GameRendererMixin {
@Shadow @Final Minecraft minecraft;

@WrapWithCondition(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/renderer/GameRenderer;renderConfusionOverlay(Lnet/minecraft/client/gui/GuiGraphics;F)V"))
private boolean shouldShowNauseaOverlay(GameRenderer instance, GuiGraphics guiGraphics, float f) {
return !minecraft.player.isSpectator();
@ModifyExpressionValue(method = "renderLevel", at = @At(value = "INVOKE", target = "Ljava/lang/Double;floatValue()F"))
private float shouldShowNauseaOverlay(float original) {
return minecraft.player.isSpectator() ? 0.0f : original;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.player.AbstractClientPlayer;
import net.minecraft.client.renderer.entity.player.PlayerRenderer;
import net.minecraft.client.renderer.entity.state.PlayerRenderState;
import net.minecraft.world.InteractionHand;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@BugFix(id = "MC-227169", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(PlayerRenderer.class)
public class PlayerRendererMixin {
@ModifyExpressionValue(method = "getArmPose", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/CrossbowItem;isCharged(Lnet/minecraft/world/item/ItemStack;)Z"))
private static boolean shouldUseCrossbowPose(boolean crossbowCharged, AbstractClientPlayer player, InteractionHand hand) {
@ModifyExpressionValue(method = "extractHandState", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/CrossbowItem;isCharged(Lnet/minecraft/world/item/ItemStack;)Z"))
private boolean shouldUseCrossbowPose(boolean crossbowCharged, AbstractClientPlayer player, PlayerRenderState.HandState handState, InteractionHand hand) {
Minecraft client = Minecraft.getInstance();
return crossbowCharged && (hand == InteractionHand.MAIN_HAND || client.cameraEntity != player || !client.options.getCameraType().isFirstPerson());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.entity.decoration.ArmorStand;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -17,14 +18,14 @@ public abstract class ArmorStandMixin {
@Shadow protected abstract void showBreakingParticles();

@Inject(
method = "hurt",
method = "hurtServer",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/entity/decoration/ArmorStand;brokenByAnything(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/damagesource/DamageSource;)V",
ordinal = 0
)
)
private void breakParticlesExplosion(DamageSource source, float amount, CallbackInfoReturnable<Boolean> cir) {
private void breakParticlesExplosion(ServerLevel serverLevel, DamageSource damageSource, float f, CallbackInfoReturnable<Boolean> cir) {
this.showBreakingParticles();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@BugFix(id = "MC-155509", category = FixCategory.BASIC, env = BugFix.Env.SERVER)
@Mixin(Pufferfish.class)
public class PufferfishMixin {
@ModifyExpressionValue(method = "playerTouch", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;hurt(Lnet/minecraft/world/damagesource/DamageSource;F)Z"))
@ModifyExpressionValue(method = "playerTouch", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;hurtServer(Lnet/minecraft/server/level/ServerLevel;Lnet/minecraft/world/damagesource/DamageSource;F)Z"))
private boolean shouldStingPlayer(boolean damaged) {
return damaged && ((Pufferfish)(Object) this).isAlive();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
@BugFix(id = "MC-200418", category = FixCategory.BASIC, env = BugFix.Env.SERVER)
@Mixin(ZombieVillager.class)
public class ZombieVillagerMixin {
@Inject(method = "finishConversion", at = @At("RETURN"))
private void dismountIfJockey(ServerLevel world, CallbackInfo ci, @Local(ordinal = 0) Villager villager) {
@Inject(method = "method_63659", at = @At("RETURN"))
private void dismountIfJockey(ServerLevel serverLevel, Villager villager, CallbackInfo ci) {
if (villager.isPassenger() && villager.getVehicle() instanceof Chicken && villager.isBaby()) {
villager.removeVehicle();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.core.BlockPos;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.ItemInteractionResult;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
Expand All @@ -21,7 +21,7 @@
@Mixin(FlowerPotBlock.class)
public class FlowerPotBlockMixin {
@Inject(method = "useItemOn", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;awardStat(Lnet/minecraft/resources/ResourceLocation;)V"))
private void onIncrementPottedPlantStat(ItemStack itemStack, BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult blockHitResult, CallbackInfoReturnable<ItemInteractionResult> cir) {
private void onIncrementPottedPlantStat(ItemStack itemStack, BlockState blockState, Level level, BlockPos blockPos, Player player, InteractionHand hand, BlockHitResult blockHitResult, CallbackInfoReturnable<InteractionResult> cir) {
player.awardStat(Stats.ITEM_USED.get(player.getItemInHand(hand).getItem()));
}
}
5 changes: 4 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@
"accessWidener": "debugify.accesswidener",
"depends": {
"fabricloader": ">=0.14.0",
"minecraft": "1.21.1",
"minecraft": [
"1.21.2",
"1.21.3"
],
"java": ">=21",
"fabric-resource-loader-v0": "*"
},
Expand Down
Loading