From f80a7b82cd42e9c7b09c0c132b1e0da3ff95cae4 Mon Sep 17 00:00:00 2001 From: Pyrofab Date: Mon, 27 Mar 2023 00:07:09 +0200 Subject: [PATCH] Update to 1.19.4 --- changelog.md | 5 +++++ gradle.properties | 16 ++++++++-------- .../mixin/ServerPlayNetworkHandlerMixin.java | 6 +++--- .../UpdateSelectedSlotC2SPacketAccessor.java | 4 ++-- .../mixin/UpdateSelectedSlotC2SPacketMixin.java | 4 ++-- .../locki/impl/mixin/client/InGameHudMixin.java | 12 ++++++------ 6 files changed, 26 insertions(+), 21 deletions(-) diff --git a/changelog.md b/changelog.md index 79291f2..e437646 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,8 @@ +------------------------------------------------------ +Version 0.10.0 +------------------------------------------------------ +Updated to 1.19.4 + ------------------------------------------------------ Version 0.9.1 ------------------------------------------------------ diff --git a/gradle.properties b/gradle.properties index a93c3f5..a160203 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,25 +3,25 @@ org.gradle.jvmargs=-Xmx3G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version = 1.19.3 - quilt_mappings = 23 - loader_version=0.18.1-beta.60 + minecraft_version = 1.19.4 + quilt_mappings = 7 + loader_version=0.18.6 # Mod Properties - mod_version = 0.9.1 + mod_version = 0.10.0 maven_group = io.github.ladysnake archives_base_name = locki # Dependencies - qsl_version = 4.0.0-beta.12 - quilted_fabric_api_version = 5.0.0-beta.6+0.74.0 + qsl_version = 5.0.0-beta.1 + quilted_fabric_api_version = 6.0.0-beta.2+0.76.0 cca_version = 5.1.0 fpa_version=0.2-SNAPSHOT # V1.2.12 backslot_version=4178145 cloth_config_version=9.0.94 modmenu_version=5.0.2 - elmendorf_version=0.9.1 + elmendorf_version=0.10.0 # Publishing owners = Ladysnake display_name = Locki @@ -29,7 +29,7 @@ org.gradle.jvmargs=-Xmx3G gpl_version = 3 curseforge_id = 483059 modrinth_id = qS8U15sj - curseforge_versions = 1.19.3 + curseforge_versions = 1.19.4 cf_requirements = qsl cf_embeddeds = cardinal-components release_type = beta diff --git a/src/main/java/io/github/ladysnake/locki/impl/mixin/ServerPlayNetworkHandlerMixin.java b/src/main/java/io/github/ladysnake/locki/impl/mixin/ServerPlayNetworkHandlerMixin.java index 620c7e9..f93738f 100644 --- a/src/main/java/io/github/ladysnake/locki/impl/mixin/ServerPlayNetworkHandlerMixin.java +++ b/src/main/java/io/github/ladysnake/locki/impl/mixin/ServerPlayNetworkHandlerMixin.java @@ -21,7 +21,7 @@ import io.github.ladysnake.locki.InventoryKeeper; import io.github.ladysnake.locki.impl.PlayerInventoryKeeper; import net.minecraft.network.packet.c2s.play.PlayerActionC2SPacket; -import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; +import net.minecraft.network.packet.c2s.play.SelectedSlotUpdateC2SPacket; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; import org.spongepowered.asm.mixin.Mixin; @@ -35,8 +35,8 @@ public abstract class ServerPlayNetworkHandlerMixin { @Shadow public ServerPlayerEntity player; - @Inject(method = "onUpdateSelectedSlot", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/UpdateSelectedSlotC2SPacket;getSelectedSlot()I", ordinal = 0)) - private void fixSelectedSlot(UpdateSelectedSlotC2SPacket packet, CallbackInfo ci) { + @Inject(method = "onSelectedSlotUpdate", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/packet/c2s/play/SelectedSlotUpdateC2SPacket;getSelectedSlot()I", ordinal = 0)) + private void fixSelectedSlot(SelectedSlotUpdateC2SPacket packet, CallbackInfo ci) { ((UpdateSelectedSlotC2SPacketAccessor) packet).locki$setSelectedSlot(PlayerInventoryKeeper.fixSelectedSlot(player, packet.getSelectedSlot())); } diff --git a/src/main/java/io/github/ladysnake/locki/impl/mixin/UpdateSelectedSlotC2SPacketAccessor.java b/src/main/java/io/github/ladysnake/locki/impl/mixin/UpdateSelectedSlotC2SPacketAccessor.java index 168c35e..b047421 100644 --- a/src/main/java/io/github/ladysnake/locki/impl/mixin/UpdateSelectedSlotC2SPacketAccessor.java +++ b/src/main/java/io/github/ladysnake/locki/impl/mixin/UpdateSelectedSlotC2SPacketAccessor.java @@ -17,11 +17,11 @@ */ package io.github.ladysnake.locki.impl.mixin; -import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; +import net.minecraft.network.packet.s2c.play.SelectedSlotUpdateS2CPacket; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.gen.Accessor; -@Mixin(UpdateSelectedSlotC2SPacket.class) +@Mixin(SelectedSlotUpdateS2CPacket.class) public interface UpdateSelectedSlotC2SPacketAccessor { @Accessor("selectedSlot") void locki$setSelectedSlot(int selectedSlot); diff --git a/src/main/java/io/github/ladysnake/locki/impl/mixin/UpdateSelectedSlotC2SPacketMixin.java b/src/main/java/io/github/ladysnake/locki/impl/mixin/UpdateSelectedSlotC2SPacketMixin.java index 004677c..09a159f 100644 --- a/src/main/java/io/github/ladysnake/locki/impl/mixin/UpdateSelectedSlotC2SPacketMixin.java +++ b/src/main/java/io/github/ladysnake/locki/impl/mixin/UpdateSelectedSlotC2SPacketMixin.java @@ -17,13 +17,13 @@ */ package io.github.ladysnake.locki.impl.mixin; -import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; +import net.minecraft.network.packet.s2c.play.SelectedSlotUpdateS2CPacket; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mutable; import org.spongepowered.asm.mixin.Shadow; -@Mixin(UpdateSelectedSlotC2SPacket.class) +@Mixin(SelectedSlotUpdateS2CPacket.class) public class UpdateSelectedSlotC2SPacketMixin { @SuppressWarnings("unused") // only there to make selectedSlot mutable - for use by the accessor @Shadow @Mutable @Final private int selectedSlot; diff --git a/src/main/java/io/github/ladysnake/locki/impl/mixin/client/InGameHudMixin.java b/src/main/java/io/github/ladysnake/locki/impl/mixin/client/InGameHudMixin.java index 7fa3c7d..b3ac521 100644 --- a/src/main/java/io/github/ladysnake/locki/impl/mixin/client/InGameHudMixin.java +++ b/src/main/java/io/github/ladysnake/locki/impl/mixin/client/InGameHudMixin.java @@ -110,7 +110,7 @@ private int cropHotbar_width(int width) { @ModifyArg( method = "renderHotbar", slice = @Slice( - from = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;defaultBlendFunc()V"), + from = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;pop()V"), to = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isEmpty()Z", ordinal = 1) ), at = @At(value = "INVOKE", target = "Lnet/minecraft/util/collection/DefaultedList;get(I)Ljava/lang/Object;") @@ -123,10 +123,10 @@ private int cancelLockedItemRender(int index) { @ModifyArg( method = "renderHotbar", slice = @Slice( - from = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;defaultBlendFunc()V"), + from = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;pop()V"), to = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isEmpty()Z", ordinal = 1) ), - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderHotbarItem(IIFLnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;I)V") + at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderHotbarItem(Lnet/minecraft/client/util/math/MatrixStack;IIFLnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;I)V") ) private ItemStack cancelLockedItemRender(ItemStack stack) { if (this.cancelNextItem) { @@ -138,11 +138,11 @@ private ItemStack cancelLockedItemRender(ItemStack stack) { @ModifyArg( method = "renderHotbar", slice = @Slice( - from = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;defaultBlendFunc()V"), + from = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;pop()V"), to = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;isEmpty()Z", ordinal = 1) ), - at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderHotbarItem(IIFLnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;I)V"), - index = 0 + at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/InGameHud;renderHotbarItem(Lnet/minecraft/client/util/math/MatrixStack;IIFLnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;I)V"), + index = 1 ) private int shiftMainHandItem(int x) { if (this.renderMainHandOnly && !this.cancelNextItem) {