Merge remote-tracking branch 'origin/main'

This commit is contained in:
FlorianMichael 2024-01-15 18:50:43 +01:00
commit 0e3ab35615
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
4 changed files with 8 additions and 7 deletions

View File

@ -1,5 +1,5 @@
plugins { plugins {
id "fabric-loom" version "1.4-SNAPSHOT" id "fabric-loom" version "1.5-SNAPSHOT"
id "maven-publish" id "maven-publish"
} }

View File

@ -5,8 +5,8 @@ org.gradle.parallel=true
# Minecraft/Fabric # Minecraft/Fabric
minecraft_version=1.20.4 minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3 yarn_mappings=1.20.4+build.3
loader_version=0.15.3 loader_version=0.15.4
fabric_api_version=0.93.1+1.20.4 fabric_api_version=0.94.0+1.20.4
# Project Details # Project Details
mod_version=3.0.6 mod_version=3.0.6

View File

@ -60,7 +60,7 @@ public abstract class MixinMinecraftClient {
public ClientPlayerEntity player; public ClientPlayerEntity player;
@Shadow @Shadow
public int attackCooldown; protected int attackCooldown;
@Shadow @Shadow
@Final @Final

View File

@ -19,6 +19,7 @@
package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item; package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.item;
import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack;
import net.minecraft.item.CrossbowItem; import net.minecraft.item.CrossbowItem;
import net.minecraft.item.Item; import net.minecraft.item.Item;
@ -56,12 +57,12 @@ public abstract class MixinItem {
} }
} }
@Redirect(method = {"use", "finishUsing", "getUseAction", "getMaxUseTime"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item;isFood()Z")) @ModifyExpressionValue(method = {"use", "finishUsing", "getUseAction", "getMaxUseTime"}, at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item;isFood()Z"))
private boolean makeFoodInstantConsumable(Item instance) { private boolean makeFoodInstantConsumable(boolean original) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.b1_7tob1_7_3)) { if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.b1_7tob1_7_3)) {
return false; return false;
} }
return instance.isFood(); return original;
} }
} }