mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-16 10:55:39 +01:00
Handle more 1.20.3->.5 changes
This commit is contained in:
parent
277f483b6a
commit
8f9ab00b94
@ -76,6 +76,11 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
||||
@Shadow
|
||||
public abstract void setClientPermissionLevel(int clientPermissionLevel);
|
||||
|
||||
@WrapWithCondition(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;jump()V"))
|
||||
private boolean dontJump(ClientPlayerEntity instance) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThan(ProtocolVersion.v1_20_5);
|
||||
}
|
||||
|
||||
@Redirect(method = "tickMovement", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/ClientPlayerEntity;hasVehicle()Z", ordinal = 0))
|
||||
private boolean removeVehicleRequirement(ClientPlayerEntity instance) {
|
||||
return ProtocolTranslator.getTargetVersion().newerThan(ProtocolVersion.v1_20) && instance.hasVehicle();
|
||||
|
@ -86,6 +86,20 @@ public abstract class MixinClientPlayNetworkHandler extends ClientCommonNetworkH
|
||||
return ProtocolTranslator.getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_20_5);
|
||||
}
|
||||
|
||||
@Inject(method = "onEnterReconfiguration", at = @At("HEAD"))
|
||||
private void disableAutoRead(EnterReconfigurationS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
this.connection.channel.config().setAutoRead(false);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "onEnterReconfiguration", at = @At("RETURN"))
|
||||
private void enableAutoRead(EnterReconfigurationS2CPacket packet, CallbackInfo ci) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
this.connection.channel.config().setAutoRead(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Redirect(method = "sendChatCommand", at = @At(value = "INVOKE", target = "Ljava/util/List;isEmpty()Z"))
|
||||
private boolean alwaysSignCommands(List<?> instance) {
|
||||
if (ProtocolTranslator.getTargetVersion().olderThanOrEqualTo(ProtocolVersion.v1_20_3)) {
|
||||
|
Loading…
Reference in New Issue
Block a user