Skip to content

Commit

Permalink
private
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Dec 7, 2024
1 parent 86f1b97 commit 0497870
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected MixinMooshroomEntity(EntityType<? extends AnimalEntity> 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<ActionResult> cir) {
private void checkForItemTags(PlayerEntity player, Hand hand, CallbackInfoReturnable<ActionResult> cir) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) {
final ItemStack itemStack = player.getStackInHand(hand);
if (!itemStack.isIn(ItemTags.SMALL_FLOWERS)) {
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ protected MixinPlayerEntity(EntityType<? extends LivingEntity> entityType, World
}

@Inject(method = "isClimbing", at = @At("HEAD"), cancellable = true)
public void allowClimbingWhileFlying(CallbackInfoReturnable<Boolean> cir) {
private void allowClimbingWhileFlying(CallbackInfoReturnable<Boolean> 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<Boolean> cir) {
private void alwaysLoadPlayer(CallbackInfoReturnable<Boolean> cir) {
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_21_2)) {
cir.setReturnValue(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 0497870

Please sign in to comment.