This commit is contained in:
Nassim Jahnke 2023-02-22 18:54:41 +01:00
parent 70c21e995c
commit aae59658ec
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
5 changed files with 36 additions and 10 deletions

View File

@ -5,7 +5,7 @@ plugins {
allprojects {
group = "com.viaversion"
version = "4.6.0-23w07a-SNAPSHOT"
version = "4.6.0-23w08a-SNAPSHOT"
description = "Allow older clients to join newer server versions."
}

View File

@ -75,14 +75,22 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol<ClientboundP
new CommandRewriter<ClientboundPackets1_19_4>(this) {
@Override
public void handleArgument(final PacketWrapper wrapper, final String argumentType) throws Exception {
if (argumentType.equals("minecraft:time")) {
switch (argumentType) {
case "minecraft:heightmap":
wrapper.write(Type.VAR_INT, 0);
break;
case "minecraft:time":
wrapper.read(Type.INT); // Minimum
} else if (argumentType.equals("minecraft:resource") || argumentType.equals("minecraft:resource_or_tag")) {
break;
case "minecraft:resource":
case "minecraft:resource_or_tag":
final String resource = wrapper.read(Type.STRING);
// Replace damage types with... something
wrapper.write(Type.STRING, resource.equals("minecraft:damage_type") ? "minecraft:mob_effect" : resource);
} else {
break;
default:
super.handleArgument(wrapper, argumentType);
break;
}
}
}.registerDeclareCommands1_19(ClientboundPackets1_19_4.DECLARE_COMMANDS);
@ -101,6 +109,7 @@ public final class Protocol1_19_3To1_19_4 extends BackwardsProtocol<ClientboundP
});
cancelClientbound(ClientboundPackets1_19_4.BUNDLE);
cancelClientbound(ClientboundPackets1_19_4.CHUNK_BIOMES); // We definitely do not want to cache every single chunk just to resent them with new biomes
}
@Override

View File

@ -78,6 +78,20 @@ public final class EntityPackets1_19_4 extends EntityRewriter<ClientboundPackets
}
});
protocol.registerClientbound(ClientboundPackets1_19_4.PLAYER_POSITION, new PacketHandlers() {
@Override
protected void register() {
map(Type.DOUBLE); // X
map(Type.DOUBLE); // Y
map(Type.DOUBLE); // Z
map(Type.FLOAT); // Yaw
map(Type.FLOAT); // Pitch
map(Type.UNSIGNED_BYTE); // Relative arguments
map(Type.VAR_INT); // Id
create(Type.BOOLEAN, false); // Dismount vehicle
}
});
protocol.registerClientbound(ClientboundPackets1_19_4.DAMAGE_EVENT, ClientboundPackets1_19_3.ENTITY_STATUS, new PacketHandlers() {
@Override
public void register() {

View File

@ -272,5 +272,8 @@
},
"entitynames": {
"sniffer": "Sniffer"
},
"argumenttypes": {
"minecraft:heightmap": "brigadier:string"
}
}

View File

@ -3,7 +3,7 @@ metadata.format.version = "1.1"
[versions]
# ViaVersion
viaver = "4.6.0-23w07a-SNAPSHOT"
viaver = "4.6.0-23w08a-SNAPSHOT"
# Common provided
netty = "4.0.20.Final"