mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-12-22 16:48:25 +01:00
private
This commit is contained in:
parent
86f1b97108
commit
0497870f07
@ -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();
|
||||
|
@ -45,7 +45,7 @@ public abstract class MixinMooshroomEntity extends AnimalEntity {
|
||||
}
|
||||
|
||||
@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)) {
|
||||
@ -55,7 +55,7 @@ public abstract class MixinMooshroomEntity extends AnimalEntity {
|
||||
}
|
||||
|
||||
@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 {
|
||||
|
@ -83,14 +83,14 @@ public abstract class MixinPlayerEntity extends LivingEntity {
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
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 {
|
||||
|
@ -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 {
|
||||
|
@ -105,7 +105,7 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
|
||||
}
|
||||
|
||||
@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;
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user