Skip to content

Commit

Permalink
1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
isXander committed Apr 23, 2024
1 parent 0e10435 commit bc36209
Show file tree
Hide file tree
Showing 24 changed files with 95 additions and 126 deletions.
3 changes: 2 additions & 1 deletion PATCHED.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
| Basic | [MC-30391](https://bugs.mojang.com/browse/MC-30391) | Chickens, blazes and the wither emit particles when landing from a height, despite falling slowly |
| Gameplay | [MC-31819](https://bugs.mojang.com/browse/MC-31819) | Hunger saturation depletes on Peaceful |
| Basic | [MC-69216](https://bugs.mojang.com/browse/MC-69216) | Switching to spectator mode while fishing keeps rod cast |
| Basic | [MC-72151](https://bugs.mojang.com/browse/MC-72151) | Snow Golem's snowballs damage wolves instead of pushing them |
| Basic | [MC-81773](https://bugs.mojang.com/browse/MC-81773) | Bows and tridents drawn in survival/creative/adventure mode can be released in spectator mode |
| Basic | [MC-88371](https://bugs.mojang.com/browse/MC-88371) | Ender Dragon flies down in the void when the exit portal is destroyed |
| Basic | [MC-89146](https://bugs.mojang.com/browse/MC-89146) | Pistons forget update when being reloaded |
Expand Down Expand Up @@ -96,3 +95,5 @@ Bugs that this mod has patched but has been superseded by a vanilla update.
| [MC-121772](https://bugs.mojang.com/browse/MC-121772) | Can't scroll while holding SHIFT on macOS | 23w31a |
| [MC-140646](https://bugs.mojang.com/browse/MC-140646) | Text fields don't scroll while selecting text with Shift | 23w31a |
| [MC-90084](https://bugs.mojang.com/browse/MC-90084) | When sitting in boats and boats with chest mobs legs penetrate the hull | 23w31a |
| [MC-72151](https://bugs.mojang.com/browse/MC-72151) | Snow Golem's snowballs damage wolves instead of pushing them | 24w06a |

10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import ru.vyarus.gradle.plugin.python.task.PythonTask
plugins {
java

id("fabric-loom") version "1.4.+"
id("fabric-loom") version "1.6.+"

id("com.modrinth.minotaur") version "2.7.+"
id("me.hypherionmc.cursegradle") version "2.+"
Expand All @@ -18,7 +18,7 @@ plugins {
}

group = "dev.isxander"
version = "1.20.4+1.1"
version = "1.20.5+1.0"

loom {
splitEnvironmentSourceSets()
Expand Down Expand Up @@ -94,7 +94,7 @@ dependencies {
modImplementation(fabricApi.module("fabric-resource-loader-v0", fabricApiVersion))
modRuntimeOnly("net.fabricmc.fabric-api:fabric-api:$fabricApiVersion")

"modClientImplementation"("dev.isxander.yacl:yet-another-config-lib-fabric:$yaclVersion") { exclude(module = "fabric-loader") }
"modClientImplementation"("dev.isxander:yet-another-config-lib:$yaclVersion") { exclude(module = "fabric-loader") }
"modClientImplementation"("com.terraformersmc:modmenu:$modMenuVersion") { exclude(module = "fabric-loader") }

"gametestImplementation"(sourceSets.main.get().output)
Expand All @@ -104,7 +104,7 @@ dependencies {

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
options.release.set(21)
}

java {
Expand Down Expand Up @@ -177,7 +177,7 @@ if (hasProperty("curseforge.token")) {
addGameVersion(minecraftVersion)
addGameVersion("Fabric")
addGameVersion("Quilt")
addGameVersion("Java 17")
addGameVersion("Java 21")

relations(closureOf<me.hypherionmc.cursegradle.CurseRelation> {
requiredDependency("yacl")
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ org.gradle.jvmargs=-Xmx4G
org.gradle.parallel=true
org.gradle.parallel.threads=2

minecraftVersion=1.20.4
fabricLoaderVersion=0.15.2
minecraftVersion=1.20.5
fabricLoaderVersion=0.15.10
qmBuild=0

# Libraries
fabricApiVersion=0.91.3+1.20.4
yaclVersion=3.3.1+1.20.4
modMenuVersion=9.0.0-pre.1
fabricApiVersion=0.97.2+1.20.5
yaclVersion=3.4.0+1.20.5-fabric
modMenuVersion=10.0.0-alpha.3
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.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@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;FFF)V", at = @At(value = "INVOKE", target = "java/lang/Math.acos(D)D"))
@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) {
return Math.min(a, 1.0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@BugFix(id = "MC-116379", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(FishingHookRenderer.class)
public class FishingHookRendererMixin {
@ModifyVariable(method = "render", at = @At("STORE"), ordinal = 2)
@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)
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
@@ -0,0 +1,12 @@
package dev.isxander.debugify.client.mixins.basic.mc176559;

import net.minecraft.core.component.PatchedDataComponentMap;
import net.minecraft.world.item.ItemStack;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

@Mixin(ItemStack.class)
public interface ItemStackAccessor {
@Accessor
PatchedDataComponentMap getComponents();
}
Original file line number Diff line number Diff line change
@@ -1,72 +1,47 @@
package dev.isxander.debugify.client.mixins.basic.mc176559;

import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import org.spongepowered.asm.mixin.Final;
import net.minecraft.core.component.PatchedDataComponentMap;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.Slice;

import java.util.HashSet;
import java.util.Objects;
import java.util.Set;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.MultiPlayerGameMode;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.item.ItemStack;

@BugFix(id = "MC-176559", category = FixCategory.BASIC, env = BugFix.Env.CLIENT, modConflicts = "fabric-api")
@Mixin(MultiPlayerGameMode.class)
@BugFix(id = "MC-176559", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(value = MultiPlayerGameMode.class, priority = 1010)
public class MultiPlayerGameModeMixin {
@Shadow private ItemStack destroyingItem;

@Shadow @Final private Minecraft minecraft;

@Redirect(method = "sameDestroyTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;isSameItemSameTags(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemStack;)Z"))
private boolean isSameItem(ItemStack itemStack, ItemStack itemStack2) {
return !canCauseBlockBreakReset(destroyingItem, minecraft.player.getMainHandItem());
// Fabric API also redirects here. WrapOperation is compatible
@WrapOperation(method = "sameDestroyTarget", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/item/ItemStack;isSameItemSameComponents(Lnet/minecraft/world/item/ItemStack;Lnet/minecraft/world/item/ItemStack;)Z"))
private boolean isSameItem(ItemStack mainHandItem, ItemStack destroyingItem, Operation<Boolean> original) {
return isSameItemSameComponentsIgnoringDurability(mainHandItem, destroyingItem);
}

/**
* Taken from <a href="https://github.com/MinecraftForge/MinecraftForge/blob/9d74a3520fa9d47db27fed74dcdd462956dd90ec/src/main/java/net/minecraftforge/common/extensions/IForgeItem.java">MinecraftForge</a>
* under LGPLv2.1 license
* <br>
* It has been adapted into a mixin with yarn mappings for use in fabric
*
* @author BlueAgent
*/
private boolean canCauseBlockBreakReset(ItemStack oldStack, ItemStack newStack) {
try {
if (!newStack.is(oldStack.getItem()))
return true;

if (!newStack.isDamageableItem() || !oldStack.isDamageableItem())
return !ItemStack.isSameItemSameTags(newStack, oldStack);

CompoundTag newTag = newStack.getTag();
CompoundTag oldTag = oldStack.getTag();

if (newTag == null || oldTag == null)
return !(newTag == null && oldTag == null);

Set<String> newKeys = new HashSet<>(newTag.getAllKeys());
Set<String> oldKeys = new HashSet<>(oldTag.getAllKeys());

newKeys.remove(ItemStack.TAG_DAMAGE);
oldKeys.remove(ItemStack.TAG_DAMAGE);

if (!newKeys.equals(oldKeys))
return true;

return !newKeys.stream().allMatch(key -> Objects.equals(newTag.get(key), oldTag.get(key)));
} catch (Throwable t) {
t.printStackTrace();
@Unique
private boolean isSameItemSameComponentsIgnoringDurability(ItemStack stack1, ItemStack stack2) {
if (!stack1.is(stack2.getItem())) {
return false;
} else if (stack1.isEmpty() && stack2.isEmpty()) {
return true;
} else {
int damage1 = stack1.getDamageValue();
int damage2 = stack2.getDamageValue();
stack1.setDamageValue(0);
stack2.setDamageValue(0);

PatchedDataComponentMap components1 = ((ItemStackAccessor) (Object) stack1).getComponents();
PatchedDataComponentMap components2 = ((ItemStackAccessor) (Object) stack2).getComponents();
boolean comparison = Objects.equals(components1, components2);

stack1.setDamageValue(damage1);
stack2.setDamageValue(damage2);

return comparison;
}

}
}
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 = "render", 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 = "Lnet/minecraft/world/item/ItemStack;is(Lnet/minecraft/world/item/Item;)Z"))
private boolean shouldRenderPumpkinOverlay(boolean pumpkinOnHead) {
return pumpkinOnHead && !minecraft.player.isSpectator();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
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 @@ -13,10 +15,10 @@
@BugFix(id = "MC-217716", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(GameRenderer.class)
public class GameRendererMixin {
@Shadow @Final private Minecraft minecraft;
@Shadow @Final Minecraft minecraft;

@ModifyExpressionValue(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;hasEffect(Lnet/minecraft/world/effect/MobEffect;)Z"))
private boolean shouldShowNauseaOverlay(boolean hasNausea) {
return hasNausea && !minecraft.player.isSpectator();
@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();
}
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package dev.isxander.debugify.client.mixins.basic.mc4490;

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;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Constant;
import org.spongepowered.asm.mixin.injection.ModifyConstant;

@BugFix(id = "MC-4490", category = FixCategory.BASIC, env = BugFix.Env.CLIENT)
@Mixin(FishingHookRenderer.class)
public class FishingHookRendererMixin {
@ModifyConstant(method = "render", constant = @Constant(floatValue = -0.1875F))
@ModifyExpressionValue(method = "getPlayerHandPos", at = @At(value = "CONSTANT", args = "floatValue=-0.1875"))
private float renderSneakOffset(float constant) {
return -0.2875F;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.inventory.Slot;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
Expand Down Expand Up @@ -37,6 +38,7 @@ private void dropWithMouse(double mouseX, double mouseY, int button, CallbackInf
}
}

@Unique
private boolean mouseInventoryClose(int button) {
if (minecraft.options.keyInventory.matchesMouse(button)) {
onClose();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package dev.isxander.debugify.client.mixins.basic.mc90683;

import com.llamalad7.mixinextras.injector.WrapWithCondition;
import com.llamalad7.mixinextras.injector.v2.WrapWithCondition;
import dev.isxander.debugify.fixes.BugFix;
import dev.isxander.debugify.fixes.FixCategory;
import net.minecraft.client.multiplayer.ClientPacketListener;
Expand Down
3 changes: 3 additions & 0 deletions src/client/resources/debugify.client.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,8 @@
"basic.mc93384.LivingEntityMixin",
"gameplay.mc12829.LivingEntityMixin",
"gameplay.mc12829.PlayerMixin"
],
"mixins": [
"basic.mc176559.ItemStackAccessor"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public ServerPlayerMixin(Level world, BlockPos pos, float yaw, GameProfile gameP
@Inject(method = "teleportTo(Lnet/minecraft/server/level/ServerLevel;DDDFF)V", at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/server/players/PlayerList;sendAllPlayerInfo(Lnet/minecraft/server/level/ServerPlayer;)V"))
public void afterCrossDimensionalTeleport(CallbackInfo cb) {
for (MobEffectInstance eff : getActiveEffects()) {
connection.send(new ClientboundUpdateMobEffectPacket(this.getId(), eff));
connection.send(new ClientboundUpdateMobEffectPacket(this.getId(), eff, false));
}

this.connection.send(new ClientboundSetExperiencePacket(experienceProgress, totalExperience, experienceLevel));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

@BugFix(id = "MC-179072", category = FixCategory.BASIC, env = BugFix.Env.SERVER)
@Mixin(SwellGoal.class)
public class SwellMixin {
public class SwellGoalMixin {
@Shadow private @Nullable LivingEntity target;

@ModifyExpressionValue(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/ai/sensing/Sensing;hasLineOfSight(Lnet/minecraft/world/entity/Entity;)Z"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import net.minecraft.core.BlockPos;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.ItemInteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.FlowerPotBlock;
import net.minecraft.world.level.block.state.BlockState;
Expand All @@ -19,8 +20,8 @@
@BugFix(id = "MC-231743", category = FixCategory.BASIC, env = BugFix.Env.SERVER)
@Mixin(FlowerPotBlock.class)
public class FlowerPotBlockMixin {
@Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/player/Player;awardStat(Lnet/minecraft/resources/ResourceLocation;)V"))
private void onIncrementPottedPlantStat(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit, CallbackInfoReturnable<InteractionResult> cir) {
@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) {
player.awardStat(Stats.ITEM_USED.get(player.getItemInHand(hand).getItem()));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
@BugFix(id = "MC-30391", category = FixCategory.BASIC, env = BugFix.Env.SERVER)
@Mixin(LivingEntity.class)
public class LivingEntityMixin {
@ModifyExpressionValue(method = "checkFallDamage", at = @At(value = "FIELD", target = "Lnet/minecraft/world/level/Level;isClientSide:Z", ordinal = 1))
private boolean shouldntSpawnParticles(boolean isClient) {
@ModifyExpressionValue(method = "checkFallDamage", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/block/state/BlockState;isAir()Z"))
private boolean shouldntSpawnParticles(boolean isAir) {
LivingEntity self = (LivingEntity) (Object) this;
return isClient || self instanceof Chicken || self instanceof Blaze || self instanceof WitherBoss;
return isAir || self instanceof Chicken || self instanceof Blaze || self instanceof WitherBoss;
}
}

This file was deleted.

Loading

0 comments on commit bc36209

Please sign in to comment.