From 0497870f07ceff18feb3ee1b41edbb4a61861c0c Mon Sep 17 00:00:00 2001 From: FlorianMichael Date: Sat, 7 Dec 2024 01:39:22 +0100 Subject: [PATCH] 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 27323882d..c17dcc5ad 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 7931a9203..f6bfc8ac1 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 af33218ff..05619810c 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 0d9ffde0f..aeb7df01a 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 16adb267c..555c3d7c1 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 d4057c476..6d1e439ce 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 550a099ff..793ae4c42 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();