From 6d4fbbd70a47cfebcdbc5568c465f52aa60a7cd7 Mon Sep 17 00:00:00 2001 From: lowercasebtw <126462578+lowercasebtw@users.noreply.github.com> Date: Fri, 6 Dec 2024 19:28:27 -0500 Subject: [PATCH 1/4] Add toggle for bubble pop sound/icons (#646) * Add toggle for bubble pop sound/icons * Don't apply these settings by default, instead use boolean setting --- .../minecraft/screen/hud/MixinInGameHud.java | 19 +++++++++++++++++++ .../settings/impl/VisualSettings.java | 5 ++++- .../assets/viafabricplus/lang/en_us.json | 2 ++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/hud/MixinInGameHud.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/hud/MixinInGameHud.java index 49ce6ddd..93a97120 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/hud/MixinInGameHud.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/screen/hud/MixinInGameHud.java @@ -20,12 +20,17 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.screen.hud; import com.llamalad7.mixinextras.injector.ModifyExpressionValue; +import com.llamalad7.mixinextras.injector.v2.WrapWithCondition; import com.llamalad7.mixinextras.sugar.Local; import de.florianmichael.viafabricplus.settings.impl.VisualSettings; import net.minecraft.client.MinecraftClient; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.hud.InGameHud; import net.minecraft.client.option.Perspective; +import net.minecraft.client.render.RenderLayer; import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.util.Identifier; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; @@ -37,12 +42,26 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.invoke.arg.Args; +import java.util.function.Function; + @Mixin(InGameHud.class) public abstract class MixinInGameHud { @Unique private static final int viaFabricPlus$ARMOR_ICON_WIDTH = 8; + @Inject(method = "playBurstSound", at = @At("HEAD"), cancellable = true) + private void disableBubblePopSound(int bubble, PlayerEntity player, int burstBubbles, CallbackInfo ci) { + if (VisualSettings.global().removeBubblePopSound.getValue()) { + ci.cancel(); + } + } + + @WrapWithCondition(method = "renderAirBubbles", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/DrawContext;drawGuiTexture(Ljava/util/function/Function;Lnet/minecraft/util/Identifier;IIII)V", ordinal = 2)) + private boolean disableEmptyBubbles(DrawContext instance, Function renderLayers, Identifier sprite, int x, int y, int width, int height) { + return !VisualSettings.global().hideEmptyBubbleIcons.getValue(); + } + @Redirect(method = "renderCrosshair", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/Perspective;isFirstPerson()Z")) private boolean alwaysRenderCrosshair(Perspective instance) { if (VisualSettings.global().alwaysRenderCrosshair.isEnabled()) { diff --git a/src/main/java/de/florianmichael/viafabricplus/settings/impl/VisualSettings.java b/src/main/java/de/florianmichael/viafabricplus/settings/impl/VisualSettings.java index 849708e4..5230a2ab 100644 --- a/src/main/java/de/florianmichael/viafabricplus/settings/impl/VisualSettings.java +++ b/src/main/java/de/florianmichael/viafabricplus/settings/impl/VisualSettings.java @@ -40,7 +40,6 @@ public class VisualSettings extends SettingGroup { Text.translatable("base.viafabricplus.off") ); public final BooleanSetting filterNonExistingGlyphs = new BooleanSetting(this, Text.translatable("visual_settings.viafabricplus.filter_non_existing_glyphs"), true) { - @Override public void onValueChanged() { final MinecraftClient client = MinecraftClient.getInstance(); @@ -54,6 +53,10 @@ public void onValueChanged() { }; public final BooleanSetting hideModernJigsawScreenFeatures = new BooleanSetting(this, Text.translatable("visual_settings.viafabricplus.hide_modern_jigsaw_screen_features"), true); + public final BooleanSetting removeBubblePopSound = new BooleanSetting(this, Text.translatable("visual_settings.viafabricplus.remove_bubble_pop_sound"), false); + + public final BooleanSetting hideEmptyBubbleIcons = new BooleanSetting(this, Text.translatable("visual_settings.viafabricplus.hide_empty_bubble_icons"), false); + // 1.21 -> 1.20.5 public final VersionedBooleanSetting hideDownloadTerrainScreenTransitionEffects = new VersionedBooleanSetting(this, Text.translatable("visual_settings.viafabricplus.hide_download_terrain_screen_transition_effects"), VersionRange.andOlder(ProtocolVersion.v1_20_5)); diff --git a/src/main/resources/assets/viafabricplus/lang/en_us.json b/src/main/resources/assets/viafabricplus/lang/en_us.json index 6baea619..a501739e 100644 --- a/src/main/resources/assets/viafabricplus/lang/en_us.json +++ b/src/main/resources/assets/viafabricplus/lang/en_us.json @@ -86,6 +86,8 @@ "visual_settings.viafabricplus.change_game_menu_screen_layout": "Change game menu screen layout", "visual_settings.viafabricplus.disable_secure_chat_warning": "Disable Secure Chat warning", "visual_settings.viafabricplus.hide_signature_indicator": "Hide signature indicator", + "visual_settings.viafabricplus.remove_bubble_pop_sound": "Remove bubble pop sound", + "visual_settings.viafabricplus.hide_empty_bubble_icons": "Hide empty bubble icons", "visual_settings.viafabricplus.hide_download_terrain_screen_transition_effects": "Hide download terrain screen transition effects", "visual_settings.viafabricplus.replace_petrified_oak_slab": "Replace petrified oak slab texture with the 'unknown' texture", "visual_settings.viafabricplus.always_render_crosshair": "Always render crosshair", From 9599b64ff721f32d8a8ca9be4c136648da0efa82 Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Sat, 7 Dec 2024 01:34:39 +0100 Subject: [PATCH 2/4] Invert operation --- .../viafabricplus/fixes/versioned/ItemPick1_21_3.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/fixes/versioned/ItemPick1_21_3.java b/src/main/java/de/florianmichael/viafabricplus/fixes/versioned/ItemPick1_21_3.java index 4efc5b2d..868f1897 100644 --- a/src/main/java/de/florianmichael/viafabricplus/fixes/versioned/ItemPick1_21_3.java +++ b/src/main/java/de/florianmichael/viafabricplus/fixes/versioned/ItemPick1_21_3.java @@ -88,7 +88,10 @@ public static void doItemPick(final MinecraftClient client) { addBlockEntityNbt(itemStack, blockEntity, client.world.getRegistryManager()); } } - } else if (crosshairTarget.getType() == HitResult.Type.ENTITY && creativeMode) { + } else { + if (crosshairTarget.getType() != HitResult.Type.ENTITY || !creativeMode) { + return; + } final Entity entity = ((EntityHitResult) crosshairTarget).getEntity(); itemStack = entity.getPickBlockStack(); if (itemStack == null) { From 86f1b9710892f35ee5826c6a8ebe4be38d110f3d Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Sat, 7 Dec 2024 01:36:24 +0100 Subject: [PATCH 3/4] Restore old interaction behaviour with mooshroom in <= 1.21.3 --- .../viafabricplus/ViaFabricPlus.java | 7 -- .../entity/MixinMooshroomEntity.java | 66 +++++++++++++++++++ src/main/resources/viafabricplus.mixins.json | 3 +- 3 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinMooshroomEntity.java diff --git a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java index ed6b9b09..c4603f7b 100644 --- a/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java +++ b/src/main/java/de/florianmichael/viafabricplus/ViaFabricPlus.java @@ -33,13 +33,6 @@ import java.util.concurrent.CompletableFuture; /* - * TODO | Port 1.21.4 - * - PlayerEntity#tick -> hasVehicle check at the top - * - Entity#move - * - LivingEntity#baseTick - * - NameTagItem use - * - MooshroomEntity interaction changes relevant? - * * TODO | Port 1.21.3 * - VehicleMovePacket handling now has distance check in ClientPlayNetworkHandler * - Illusioner/Sniffer don't override visibility bounding box anymore diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinMooshroomEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinMooshroomEntity.java new file mode 100644 index 00000000..7931a920 --- /dev/null +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinMooshroomEntity.java @@ -0,0 +1,66 @@ +/* + * This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus + * Copyright (C) 2021-2024 FlorianMichael/EnZaXD and RK_01/RaphiMC + * Copyright (C) 2023-2024 contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft.entity; + +import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import de.florianmichael.viafabricplus.protocoltranslator.ProtocolTranslator; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.passive.AnimalEntity; +import net.minecraft.entity.passive.CowEntity; +import net.minecraft.entity.passive.MooshroomEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.registry.tag.ItemTags; +import net.minecraft.util.ActionResult; +import net.minecraft.util.Hand; +import net.minecraft.world.World; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(MooshroomEntity.class) +public abstract class MixinMooshroomEntity extends AnimalEntity { + + protected MixinMooshroomEntity(EntityType entityType, World world) { + super(entityType, world); + } + + @Inject(method = "interactMob", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/MooshroomEntity;getStewEffectFrom(Lnet/minecraft/item/ItemStack;)Ljava/util/Optional;"), cancellable = true) + public void checkForItemTags(PlayerEntity player, Hand hand, CallbackInfoReturnable cir) { + if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { + final ItemStack itemStack = player.getStackInHand(hand); + if (!itemStack.isIn(ItemTags.SMALL_FLOWERS)) { + cir.setReturnValue(super.interactMob(player, hand)); + } + } + } + + @Redirect(method = "interactMob", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/CowEntity;interactMob(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;", ordinal = 0)) + public ActionResult directPass(CowEntity instance, PlayerEntity player, Hand hand) { + if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { + return ActionResult.PASS; + } else { + return instance.interactMob(player, hand); + } + } + +} diff --git a/src/main/resources/viafabricplus.mixins.json b/src/main/resources/viafabricplus.mixins.json index 4aa9a889..22ebeac8 100644 --- a/src/main/resources/viafabricplus.mixins.json +++ b/src/main/resources/viafabricplus.mixins.json @@ -129,6 +129,7 @@ "fixes.minecraft.item.MixinBowItem", "fixes.minecraft.item.MixinBrushItem", "fixes.minecraft.item.MixinBucketItem", + "fixes.minecraft.item.MixinBundleItem", "fixes.minecraft.item.MixinDrawContext", "fixes.minecraft.item.MixinEnderEyeItem", "fixes.minecraft.item.MixinEnderPearlItem", @@ -219,7 +220,7 @@ "viabedrock.MixinJoinPackets", "vialegacy.MixinExtensionProtocolMetadataStorage", "vialegacy.MixinViaLegacyConfig", - "fixes.minecraft.item.MixinBundleItem" + "fixes.minecraft.entity.MixinMooshroomEntity" ], "injectors": { "defaultRequire": 1 From 0497870f07ceff18feb3ee1b41edbb4a61861c0c Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Sat, 7 Dec 2024 01:39:22 +0100 Subject: [PATCH 4/4] private --- .../injection/mixin/fixes/minecraft/MixinMinecraftClient.java | 2 +- .../mixin/fixes/minecraft/entity/MixinMooshroomEntity.java | 4 ++-- .../mixin/fixes/minecraft/entity/MixinPlayerEntity.java | 4 ++-- .../injection/mixin/fixes/minecraft/item/MixinBundleItem.java | 2 +- .../mixin/fixes/minecraft/item/MixinItemRenderer.java | 2 +- .../minecraft/network/MixinClientPlayNetworkHandler.java | 2 +- .../network/MixinClientPlayerInteractionManager.java | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinMinecraftClient.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinMinecraftClient.java index 27323882..c17dcc5a 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinMinecraftClient.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinMinecraftClient.java @@ -68,7 +68,7 @@ public abstract class MixinMinecraftClient { public Keyboard keyboard; @Inject(method = "doItemPick", at = @At("HEAD"), cancellable = true) - public void pickItemClientside(CallbackInfo ci) { + private void pickItemClientside(CallbackInfo ci) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { ItemPick1_21_3.doItemPick((MinecraftClient) (Object) this); ci.cancel(); diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinMooshroomEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinMooshroomEntity.java index 7931a920..f6bfc8ac 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinMooshroomEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinMooshroomEntity.java @@ -45,7 +45,7 @@ protected MixinMooshroomEntity(EntityType entityType, Wo } @Inject(method = "interactMob", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/MooshroomEntity;getStewEffectFrom(Lnet/minecraft/item/ItemStack;)Ljava/util/Optional;"), cancellable = true) - public void checkForItemTags(PlayerEntity player, Hand hand, CallbackInfoReturnable cir) { + private void checkForItemTags(PlayerEntity player, Hand hand, CallbackInfoReturnable cir) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { final ItemStack itemStack = player.getStackInHand(hand); if (!itemStack.isIn(ItemTags.SMALL_FLOWERS)) { @@ -55,7 +55,7 @@ public void checkForItemTags(PlayerEntity player, Hand hand, CallbackInfoReturna } @Redirect(method = "interactMob", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/passive/CowEntity;interactMob(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/util/Hand;)Lnet/minecraft/util/ActionResult;", ordinal = 0)) - public ActionResult directPass(CowEntity instance, PlayerEntity player, Hand hand) { + private ActionResult directPass(CowEntity instance, PlayerEntity player, Hand hand) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { return ActionResult.PASS; } else { diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java index af33218f..05619810 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinPlayerEntity.java @@ -83,14 +83,14 @@ protected MixinPlayerEntity(EntityType entityType, World } @Inject(method = "isClimbing", at = @At("HEAD"), cancellable = true) - public void allowClimbingWhileFlying(CallbackInfoReturnable cir) { + private void allowClimbingWhileFlying(CallbackInfoReturnable cir) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { cir.setReturnValue(super.isClimbing()); } } @Inject(method = "isLoaded", at = @At("HEAD"), cancellable = true) - public void alwaysLoadPlayer(CallbackInfoReturnable cir) { + private void alwaysLoadPlayer(CallbackInfoReturnable cir) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { cir.setReturnValue(true); } diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinBundleItem.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinBundleItem.java index 0d9ffde0..aeb7df01 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinBundleItem.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinBundleItem.java @@ -31,7 +31,7 @@ public abstract class MixinBundleItem { @Redirect(method = "use", at = @At(value = "FIELD", target = "Lnet/minecraft/util/ActionResult;SUCCESS:Lnet/minecraft/util/ActionResult$Success;")) - public ActionResult.Success dontSwing() { + private ActionResult.Success dontSwing() { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { return ActionResult.CONSUME; } else { diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemRenderer.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemRenderer.java index 16adb267..555c3d7c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemRenderer.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/item/MixinItemRenderer.java @@ -38,7 +38,7 @@ public abstract class MixinItemRenderer { @Redirect(method = "update(Lnet/minecraft/client/render/item/ItemRenderState;Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/ModelTransformationMode;Lnet/minecraft/world/World;Lnet/minecraft/entity/LivingEntity;I)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;get(Lnet/minecraft/component/ComponentType;)Ljava/lang/Object;")) - public Object removeModel(ItemStack instance, ComponentType componentType) { + private Object removeModel(ItemStack instance, ComponentType componentType) { if (VisualSettings.global().replacePetrifiedOakSlab.isEnabled() && instance.isOf(Items.PETRIFIED_OAK_SLAB)) { return viaFabricPlus$missingIdentifier; } else { diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayNetworkHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayNetworkHandler.java index d4057c47..6d1e439c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayNetworkHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayNetworkHandler.java @@ -105,7 +105,7 @@ private boolean changePacketOrder(ClientConnection instance, Packet packet) { } @Inject(method = "onPlayerPositionLook", at = @At("RETURN")) - public void changePacketOrder(PlayerPositionLookS2CPacket packet, CallbackInfo ci) { + private void changePacketOrder(PlayerPositionLookS2CPacket packet, CallbackInfo ci) { if (viaFabricPlus$teleportConfirmPacket != null) { this.connection.send(viaFabricPlus$teleportConfirmPacket); viaFabricPlus$teleportConfirmPacket = null; diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayerInteractionManager.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayerInteractionManager.java index 550a099f..793ae4c4 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayerInteractionManager.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/network/MixinClientPlayerInteractionManager.java @@ -113,7 +113,7 @@ public abstract class MixinClientPlayerInteractionManager implements IClientPlay private final ClientPlayerInteractionManager1_18_2 viaFabricPlus$1_18_2InteractionManager = new ClientPlayerInteractionManager1_18_2(); @Inject(method = {"pickItemFromBlock", "pickItemFromEntity"}, at = @At("HEAD"), cancellable = true) - public void pickItemClientside(CallbackInfo ci) { + private void pickItemClientside(CallbackInfo ci) { if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) { ViaFabricPlus.global().getLogger().error("Directly calling pickItemFromBlock or pickItemFromEntity is not supported in <=1.21.3. Use MinecraftClient#doItemPick instead."); ci.cancel();