1.19.3-pre3

This commit is contained in:
Nassim Jahnke 2022-11-29 17:24:25 +01:00
parent 8c0487fc05
commit 96631cee0c
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
8 changed files with 151 additions and 89 deletions

View File

@ -82,7 +82,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_18_2 = register(758, "1.18.2");
public static final ProtocolVersion v1_19 = register(759, "1.19");
public static final ProtocolVersion v1_19_1 = register(760, "1.19.1/2", new VersionRange("1.19", 1, 2));
public static final ProtocolVersion v1_19_3 = register(761, 110, "1.19.3");
public static final ProtocolVersion v1_19_3 = register(761, 111, "1.19.3");
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
public static ProtocolVersion register(int version, String name) {

View File

@ -96,6 +96,7 @@ public abstract class Type<T> implements ByteBufReader<T>, ByteBufWriter<T> {
public static final IntType INT = new IntType();
public static final FloatType FLOAT = new FloatType();
public static final FloatType.OptionalFloatType OPTIONAL_FLOAT = new FloatType.OptionalFloatType();
public static final DoubleType DOUBLE = new DoubleType();
public static final LongType LONG = new LongType();

View File

@ -22,6 +22,7 @@
*/
package com.viaversion.viaversion.api.type.types;
import com.viaversion.viaversion.api.type.OptionalType;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.TypeConverter;
import io.netty.buffer.ByteBuf;
@ -67,4 +68,11 @@ public class FloatType extends Type<Float> implements TypeConverter<Float> {
}
return (Float) o;
}
public static final class OptionalFloatType extends OptionalType<Float> {
public OptionalFloatType() {
super(Type.FLOAT);
}
}
}

View File

@ -43,92 +43,91 @@ public enum ClientboundPackets1_19_3 implements ClientboundPacketType {
COOLDOWN, // 0x13
CUSTOM_CHAT_COMPLETIONS, // 0x14
PLUGIN_MESSAGE, // 0x15
NAMED_SOUND, // 0x16
DELETE_CHAT_MESSAGE, // 0x17
DISCONNECT, // 0x18
DISGUISED_CHAT, // 0x19
ENTITY_STATUS, // 0x1A
EXPLOSION, // 0x1B
UNLOAD_CHUNK, // 0x1C
GAME_EVENT, // 0x1D
OPEN_HORSE_WINDOW, // 0x1E
WORLD_BORDER_INIT, // 0x1F
KEEP_ALIVE, // 0x20
CHUNK_DATA, // 0x21
EFFECT, // 0x22
SPAWN_PARTICLE, // 0x23
UPDATE_LIGHT, // 0x24
JOIN_GAME, // 0x25
MAP_DATA, // 0x26
TRADE_LIST, // 0x27
ENTITY_POSITION, // 0x28
ENTITY_POSITION_AND_ROTATION, // 0x29
ENTITY_ROTATION, // 0x2A
VEHICLE_MOVE, // 0x2B
OPEN_BOOK, // 0x2C
OPEN_WINDOW, // 0x2D
OPEN_SIGN_EDITOR, // 0x2E
PING, // 0x2F
CRAFT_RECIPE_RESPONSE, // 0x30
PLAYER_ABILITIES, // 0x31
PLAYER_CHAT, // 0x32
COMBAT_END, // 0x33
COMBAT_ENTER, // 0x34
COMBAT_KILL, // 0x35
PLAYER_INFO_REMOVE, // 0x36
PLAYER_INFO_UPDATE, // 0x37
FACE_PLAYER, // 0x38
PLAYER_POSITION, // 0x39
UNLOCK_RECIPES, // 0x3A
REMOVE_ENTITIES, // 0x3B
REMOVE_ENTITY_EFFECT, // 0x3C
RESOURCE_PACK, // 0x3D
RESPAWN, // 0x3E
ENTITY_HEAD_LOOK, // 0x3F
MULTI_BLOCK_CHANGE, // 0x40
SELECT_ADVANCEMENTS_TAB, // 0x41
SERVER_DATA, // 0x42
ACTIONBAR, // 0x43
WORLD_BORDER_CENTER, // 0x44
WORLD_BORDER_LERP_SIZE, // 0x45
WORLD_BORDER_SIZE, // 0x46
WORLD_BORDER_WARNING_DELAY, // 0x47
WORLD_BORDER_WARNING_DISTANCE, // 0x48
CAMERA, // 0x49
HELD_ITEM_CHANGE, // 0x4A
UPDATE_VIEW_POSITION, // 0x4B
UPDATE_VIEW_DISTANCE, // 0x4C
SPAWN_POSITION, // 0x4D
DISPLAY_SCOREBOARD, // 0x4E
ENTITY_METADATA, // 0x4F
ATTACH_ENTITY, // 0x50
ENTITY_VELOCITY, // 0x51
ENTITY_EQUIPMENT, // 0x52
SET_EXPERIENCE, // 0x53
UPDATE_HEALTH, // 0x54
SCOREBOARD_OBJECTIVE, // 0x55
SET_PASSENGERS, // 0x56
TEAMS, // 0x57
UPDATE_SCORE, // 0x58
SET_SIMULATION_DISTANCE, // 0x59
TITLE_SUBTITLE, // 0x5A
TIME_UPDATE, // 0x5B
TITLE_TEXT, // 0x5C
TITLE_TIMES, // 0x5D
ENTITY_SOUND, // 0x5E
SOUND, // 0x5F
STOP_SOUND, // 0x60
SYSTEM_CHAT, // 0x61
TAB_LIST, // 0x62
NBT_QUERY, // 0x63
COLLECT_ITEM, // 0x64
ENTITY_TELEPORT, // 0x65
ADVANCEMENTS, // 0x66
ENTITY_PROPERTIES, // 0x67
UPDATE_ENABLED_FEATURES, // 0x68
ENTITY_EFFECT, // 0x69
DECLARE_RECIPES, // 0x6A
TAGS; // 0x6B
DELETE_CHAT_MESSAGE, // 0x16
DISCONNECT, // 0x17
DISGUISED_CHAT, // 0x18
ENTITY_STATUS, // 0x19
EXPLOSION, // 0x1A
UNLOAD_CHUNK, // 0x1B
GAME_EVENT, // 0x1C
OPEN_HORSE_WINDOW, // 0x1D
WORLD_BORDER_INIT, // 0x1E
KEEP_ALIVE, // 0x1F
CHUNK_DATA, // 0x20
EFFECT, // 0x21
SPAWN_PARTICLE, // 0x22
UPDATE_LIGHT, // 0x23
JOIN_GAME, // 0x24
MAP_DATA, // 0x25
TRADE_LIST, // 0x26
ENTITY_POSITION, // 0x27
ENTITY_POSITION_AND_ROTATION, // 0x28
ENTITY_ROTATION, // 0x29
VEHICLE_MOVE, // 0x2A
OPEN_BOOK, // 0x2B
OPEN_WINDOW, // 0x2C
OPEN_SIGN_EDITOR, // 0x2D
PING, // 0x2E
CRAFT_RECIPE_RESPONSE, // 0x2F
PLAYER_ABILITIES, // 0x30
PLAYER_CHAT, // 0x31
COMBAT_END, // 0x32
COMBAT_ENTER, // 0x33
COMBAT_KILL, // 0x34
PLAYER_INFO_REMOVE, // 0x35
PLAYER_INFO_UPDATE, // 0x36
FACE_PLAYER, // 0x37
PLAYER_POSITION, // 0x38
UNLOCK_RECIPES, // 0x39
REMOVE_ENTITIES, // 0x3A
REMOVE_ENTITY_EFFECT, // 0x3B
RESOURCE_PACK, // 0x3C
RESPAWN, // 0x3D
ENTITY_HEAD_LOOK, // 0x3E
MULTI_BLOCK_CHANGE, // 0x3F
SELECT_ADVANCEMENTS_TAB, // 0x40
SERVER_DATA, // 0x41
ACTIONBAR, // 0x42
WORLD_BORDER_CENTER, // 0x43
WORLD_BORDER_LERP_SIZE, // 0x44
WORLD_BORDER_SIZE, // 0x45
WORLD_BORDER_WARNING_DELAY, // 0x46
WORLD_BORDER_WARNING_DISTANCE, // 0x47
CAMERA, // 0x48
HELD_ITEM_CHANGE, // 0x49
UPDATE_VIEW_POSITION, // 0x4A
UPDATE_VIEW_DISTANCE, // 0x4B
SPAWN_POSITION, // 0x4C
DISPLAY_SCOREBOARD, // 0x4D
ENTITY_METADATA, // 0x4E
ATTACH_ENTITY, // 0x4F
ENTITY_VELOCITY, // 0x50
ENTITY_EQUIPMENT, // 0x51
SET_EXPERIENCE, // 0x52
UPDATE_HEALTH, // 0x53
SCOREBOARD_OBJECTIVE, // 0x54
SET_PASSENGERS, // 0x55
TEAMS, // 0x56
UPDATE_SCORE, // 0x57
SET_SIMULATION_DISTANCE, // 0x58
TITLE_SUBTITLE, // 0x59
TIME_UPDATE, // 0x5A
TITLE_TEXT, // 0x5B
TITLE_TIMES, // 0x5C
ENTITY_SOUND, // 0x5D
SOUND, // 0x5E
STOP_SOUND, // 0x5F
SYSTEM_CHAT, // 0x60
TAB_LIST, // 0x61
NBT_QUERY, // 0x62
COLLECT_ITEM, // 0x63
ENTITY_TELEPORT, // 0x64
ADVANCEMENTS, // 0x65
ENTITY_PROPERTIES, // 0x66
UPDATE_ENABLED_FEATURES, // 0x67
ENTITY_EFFECT, // 0x68
DECLARE_RECIPES, // 0x69
TAGS; // 0x6A
@Override
public int getId() {

View File

@ -76,8 +76,29 @@ public final class Protocol1_19_3To1_19_1 extends AbstractProtocol<ClientboundPa
itemRewriter.register();
final SoundRewriter soundRewriter = new SoundRewriter(this);
soundRewriter.registerSound(ClientboundPackets1_19_1.SOUND);
soundRewriter.registerSound(ClientboundPackets1_19_1.ENTITY_SOUND);
registerClientbound(ClientboundPackets1_19_1.SOUND, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Sound id
handler(soundRewriter.getSoundHandler());
handler(wrapper -> {
// 0 means a resource location will be written
final int soundId = wrapper.get(Type.VAR_INT, 0);
wrapper.set(Type.VAR_INT, 0, soundId + 1);
});
}
});
registerClientbound(ClientboundPackets1_19_1.NAMED_SOUND, ClientboundPackets1_19_3.SOUND, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
wrapper.write(Type.VAR_INT, 0);
wrapper.passthrough(Type.STRING); // Sound identifier
wrapper.write(Type.OPTIONAL_FLOAT, null); // No fixed range
});
}
});
new StatisticsRewriter(this).register(ClientboundPackets1_19_1.STATISTICS);

View File

@ -48,6 +48,33 @@ public class SoundRewriter {
});
}
// Different to entity sounds now
public void register1_19_3Sound(ClientboundPacketType packetType) {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
handler(wrapper -> {
int soundId = wrapper.read(Type.VAR_INT);
if (soundId == 0) {
// Is followed by the resource loation
wrapper.write(Type.VAR_INT, 0);
return;
}
// The id needs to be normalized
soundId--;
final int mappedId = idRewriter.rewrite(soundId);
if (mappedId == -1) {
wrapper.cancel();
return;
}
wrapper.write(Type.VAR_INT, mappedId + 1);
});
}
});
}
public PacketHandler getSoundHandler() {
return wrapper -> {
int soundId = wrapper.get(Type.VAR_INT, 0);

View File

@ -26245,6 +26245,12 @@
"block.note_block.didgeridoo",
"block.note_block.bit",
"block.note_block.banjo",
"block.note_block.imitate.zombie",
"block.note_block.imitate.skeleton",
"block.note_block.imitate.creeper",
"block.note_block.imitate.ender_dragon",
"block.note_block.imitate.wither_skeleton",
"block.note_block.imitate.piglin",
"entity.ocelot.hurt",
"entity.ocelot.ambient",
"entity.ocelot.death",

View File

@ -1,5 +1,5 @@
# Project properties - we put these here so they can be modified without causing a recompile of the build scripts
projectVersion=4.5.0-1.19.3-pre2-SNAPSHOT
projectVersion=4.5.0-1.19.3-pre3-SNAPSHOT
# Gradle properties
org.gradle.daemon=true