This commit is contained in:
Nassim Jahnke 2022-03-24 18:44:53 +01:00
parent 3386431749
commit bd880b608f
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B
17 changed files with 22187 additions and 21810 deletions

View File

@ -103,5 +103,7 @@ public interface MappingData {
@Nullable Mappings getStatisticsMappings();
@Nullable Mappings getEnchantmentMappings();
@Nullable FullMappingData getArgumentTypeMappings();
}

View File

@ -51,6 +51,7 @@ public class MappingDataBase implements MappingData {
protected Mappings blockEntityMappings;
protected Mappings soundMappings;
protected Mappings statisticsMappings;
protected Mappings enchantmentMappings;
protected Map<RegistryType, List<TagData>> tags;
protected boolean loadItems = true;
@ -76,6 +77,7 @@ public class MappingDataBase implements MappingData {
blockEntityMappings = loadFromArray(oldMappings, newMappings, diffmapping, "blockentities");
soundMappings = loadFromArray(oldMappings, newMappings, diffmapping, "sounds");
statisticsMappings = loadFromArray(oldMappings, newMappings, diffmapping, "statistics");
enchantmentMappings = loadFromArray(oldMappings, newMappings, diffmapping, "enchantments");
Mappings argumentTypeMappings = loadFromArray(oldMappings, newMappings, diffmapping, "argumenttypes");
if (argumentTypeMappings != null) {
@ -198,6 +200,11 @@ public class MappingDataBase implements MappingData {
return statisticsMappings;
}
@Override
public @Nullable Mappings getEnchantmentMappings() {
return enchantmentMappings;
}
@Override
public @Nullable FullMappingData getArgumentTypeMappings() {
return argumentTypeMappings;

View File

@ -29,193 +29,195 @@ public enum Entity1_19Types implements EntityType {
ENTITY(-1),
AREA_EFFECT_CLOUD(0, ENTITY),
END_CRYSTAL(19, ENTITY),
EVOKER_FANGS(24, ENTITY),
EXPERIENCE_ORB(25, ENTITY),
EYE_OF_ENDER(26, ENTITY),
FALLING_BLOCK(27, ENTITY),
FIREWORK_ROCKET(28, ENTITY),
ITEM(42, ENTITY),
LLAMA_SPIT(48, ENTITY),
TNT(70, ENTITY),
SHULKER_BULLET(77, ENTITY),
FISHING_BOBBER(114, ENTITY),
END_CRYSTAL(20, ENTITY),
EVOKER_FANGS(25, ENTITY),
EXPERIENCE_ORB(26, ENTITY),
EYE_OF_ENDER(27, ENTITY),
FALLING_BLOCK(28, ENTITY),
FIREWORK_ROCKET(29, ENTITY),
ITEM(43, ENTITY),
LLAMA_SPIT(49, ENTITY),
TNT(71, ENTITY),
SHULKER_BULLET(78, ENTITY),
FISHING_BOBBER(116, ENTITY),
LIVINGENTITY(-1, ENTITY),
ARMOR_STAND(1, LIVINGENTITY),
MARKER(50, ENTITY),
PLAYER(113, LIVINGENTITY),
MARKER(51, ENTITY),
PLAYER(115, LIVINGENTITY),
ABSTRACT_INSENTIENT(-1, LIVINGENTITY),
ENDER_DRAGON(20, ABSTRACT_INSENTIENT),
ENDER_DRAGON(21, ABSTRACT_INSENTIENT),
BEE(5, ABSTRACT_INSENTIENT),
ABSTRACT_CREATURE(-1, ABSTRACT_INSENTIENT),
ABSTRACT_AGEABLE(-1, ABSTRACT_CREATURE),
VILLAGER(100, ABSTRACT_AGEABLE),
WANDERING_TRADER(102, ABSTRACT_AGEABLE),
VILLAGER(101, ABSTRACT_AGEABLE),
WANDERING_TRADER(103, ABSTRACT_AGEABLE),
// Animals
ABSTRACT_ANIMAL(-1, ABSTRACT_AGEABLE),
AXOLOTL(3, ABSTRACT_ANIMAL),
DOLPHIN(14, ABSTRACT_INSENTIENT),
CHICKEN(10, ABSTRACT_ANIMAL),
COW(12, ABSTRACT_ANIMAL),
MOOSHROOM(59, COW),
PANDA(62, ABSTRACT_INSENTIENT),
PIG(65, ABSTRACT_ANIMAL),
POLAR_BEAR(69, ABSTRACT_ANIMAL),
RABBIT(72, ABSTRACT_ANIMAL),
SHEEP(75, ABSTRACT_ANIMAL),
TURTLE(98, ABSTRACT_ANIMAL),
FOX(29, ABSTRACT_ANIMAL),
FROG(30, ABSTRACT_ANIMAL),
GOAT(35, ABSTRACT_ANIMAL),
DOLPHIN(15, ABSTRACT_INSENTIENT),
CHICKEN(11, ABSTRACT_ANIMAL),
COW(13, ABSTRACT_ANIMAL),
MOOSHROOM(60, COW),
PANDA(63, ABSTRACT_INSENTIENT),
PIG(66, ABSTRACT_ANIMAL),
POLAR_BEAR(70, ABSTRACT_ANIMAL),
RABBIT(73, ABSTRACT_ANIMAL),
SHEEP(76, ABSTRACT_ANIMAL),
TURTLE(99, ABSTRACT_ANIMAL),
FOX(30, ABSTRACT_ANIMAL),
FROG(31, ABSTRACT_ANIMAL),
GOAT(36, ABSTRACT_ANIMAL),
ABSTRACT_TAMEABLE_ANIMAL(-1, ABSTRACT_ANIMAL),
CAT(8, ABSTRACT_TAMEABLE_ANIMAL),
OCELOT(60, ABSTRACT_TAMEABLE_ANIMAL),
WOLF(107, ABSTRACT_TAMEABLE_ANIMAL),
CAT(9, ABSTRACT_TAMEABLE_ANIMAL),
OCELOT(61, ABSTRACT_TAMEABLE_ANIMAL),
WOLF(109, ABSTRACT_TAMEABLE_ANIMAL),
ABSTRACT_PARROT(-1, ABSTRACT_TAMEABLE_ANIMAL),
PARROT(63, ABSTRACT_PARROT),
PARROT(64, ABSTRACT_PARROT),
// Horses
ABSTRACT_HORSE(-1, ABSTRACT_ANIMAL),
CHESTED_HORSE(-1, ABSTRACT_HORSE),
DONKEY(15, CHESTED_HORSE),
MULE(58, CHESTED_HORSE),
LLAMA(47, CHESTED_HORSE),
TRADER_LLAMA(96, CHESTED_HORSE),
HORSE(38, ABSTRACT_HORSE),
SKELETON_HORSE(80, ABSTRACT_HORSE),
ZOMBIE_HORSE(110, ABSTRACT_HORSE),
DONKEY(16, CHESTED_HORSE),
MULE(59, CHESTED_HORSE),
LLAMA(48, CHESTED_HORSE),
TRADER_LLAMA(97, CHESTED_HORSE),
HORSE(39, ABSTRACT_HORSE),
SKELETON_HORSE(81, ABSTRACT_HORSE),
ZOMBIE_HORSE(112, ABSTRACT_HORSE),
// Golem
ABSTRACT_GOLEM(-1, ABSTRACT_CREATURE),
SNOW_GOLEM(83, ABSTRACT_GOLEM),
IRON_GOLEM(41, ABSTRACT_GOLEM),
SHULKER(76, ABSTRACT_GOLEM),
SNOW_GOLEM(84, ABSTRACT_GOLEM),
IRON_GOLEM(42, ABSTRACT_GOLEM),
SHULKER(77, ABSTRACT_GOLEM),
// Fish
ABSTRACT_FISHES(-1, ABSTRACT_CREATURE),
COD(11, ABSTRACT_FISHES),
PUFFERFISH(71, ABSTRACT_FISHES),
SALMON(74, ABSTRACT_FISHES),
TROPICAL_FISH(97, ABSTRACT_FISHES),
COD(12, ABSTRACT_FISHES),
PUFFERFISH(72, ABSTRACT_FISHES),
SALMON(75, ABSTRACT_FISHES),
TROPICAL_FISH(98, ABSTRACT_FISHES),
// Monsters
ABSTRACT_MONSTER(-1, ABSTRACT_CREATURE),
BLAZE(6, ABSTRACT_MONSTER),
CREEPER(13, ABSTRACT_MONSTER),
ENDERMITE(22, ABSTRACT_MONSTER),
ENDERMAN(21, ABSTRACT_MONSTER),
GIANT(32, ABSTRACT_MONSTER),
SILVERFISH(78, ABSTRACT_MONSTER),
VEX(99, ABSTRACT_MONSTER),
WITCH(103, ABSTRACT_MONSTER),
WITHER(104, ABSTRACT_MONSTER),
RAVAGER(73, ABSTRACT_MONSTER),
CREEPER(14, ABSTRACT_MONSTER),
ENDERMITE(23, ABSTRACT_MONSTER),
ENDERMAN(22, ABSTRACT_MONSTER),
GIANT(33, ABSTRACT_MONSTER),
SILVERFISH(79, ABSTRACT_MONSTER),
VEX(100, ABSTRACT_MONSTER),
WITCH(105, ABSTRACT_MONSTER),
WITHER(106, ABSTRACT_MONSTER),
RAVAGER(74, ABSTRACT_MONSTER),
ABSTRACT_PIGLIN(-1, ABSTRACT_MONSTER),
PIGLIN(66, ABSTRACT_PIGLIN),
PIGLIN_BRUTE(67, ABSTRACT_PIGLIN),
PIGLIN(67, ABSTRACT_PIGLIN),
PIGLIN_BRUTE(68, ABSTRACT_PIGLIN),
HOGLIN(37, ABSTRACT_ANIMAL),
STRIDER(89, ABSTRACT_ANIMAL),
TADPOLE(89, ABSTRACT_FISHES),
ZOGLIN(108, ABSTRACT_MONSTER),
HOGLIN(38, ABSTRACT_ANIMAL),
STRIDER(90, ABSTRACT_ANIMAL),
TADPOLE(90, ABSTRACT_FISHES),
ZOGLIN(110, ABSTRACT_MONSTER),
WARDEN(104, ABSTRACT_MONSTER),
// Illagers
ABSTRACT_ILLAGER_BASE(-1, ABSTRACT_MONSTER),
ABSTRACT_EVO_ILLU_ILLAGER(-1, ABSTRACT_ILLAGER_BASE),
EVOKER(23, ABSTRACT_EVO_ILLU_ILLAGER),
ILLUSIONER(40, ABSTRACT_EVO_ILLU_ILLAGER),
VINDICATOR(101, ABSTRACT_ILLAGER_BASE),
PILLAGER(68, ABSTRACT_ILLAGER_BASE),
EVOKER(24, ABSTRACT_EVO_ILLU_ILLAGER),
ILLUSIONER(41, ABSTRACT_EVO_ILLU_ILLAGER),
VINDICATOR(102, ABSTRACT_ILLAGER_BASE),
PILLAGER(69, ABSTRACT_ILLAGER_BASE),
// Skeletons
ABSTRACT_SKELETON(-1, ABSTRACT_MONSTER),
SKELETON(79, ABSTRACT_SKELETON),
STRAY(88, ABSTRACT_SKELETON),
WITHER_SKELETON(105, ABSTRACT_SKELETON),
SKELETON(80, ABSTRACT_SKELETON),
STRAY(89, ABSTRACT_SKELETON),
WITHER_SKELETON(107, ABSTRACT_SKELETON),
// Guardians
GUARDIAN(36, ABSTRACT_MONSTER),
ELDER_GUARDIAN(18, GUARDIAN),
GUARDIAN(37, ABSTRACT_MONSTER),
ELDER_GUARDIAN(19, GUARDIAN),
// Spiders
SPIDER(86, ABSTRACT_MONSTER),
CAVE_SPIDER(9, SPIDER),
SPIDER(87, ABSTRACT_MONSTER),
CAVE_SPIDER(10, SPIDER),
// Zombies
ZOMBIE(109, ABSTRACT_MONSTER),
DROWNED(17, ZOMBIE),
HUSK(39, ZOMBIE),
ZOMBIFIED_PIGLIN(112, ZOMBIE),
ZOMBIE_VILLAGER(111, ZOMBIE),
ZOMBIE(111, ABSTRACT_MONSTER),
DROWNED(18, ZOMBIE),
HUSK(40, ZOMBIE),
ZOMBIFIED_PIGLIN(114, ZOMBIE),
ZOMBIE_VILLAGER(113, ZOMBIE),
// Flying entities
ABSTRACT_FLYING(-1, ABSTRACT_INSENTIENT),
GHAST(31, ABSTRACT_FLYING),
PHANTOM(64, ABSTRACT_FLYING),
GHAST(32, ABSTRACT_FLYING),
PHANTOM(65, ABSTRACT_FLYING),
ABSTRACT_AMBIENT(-1, ABSTRACT_INSENTIENT),
BAT(4, ABSTRACT_AMBIENT),
ABSTRACT_WATERMOB(-1, ABSTRACT_INSENTIENT),
SQUID(87, ABSTRACT_WATERMOB),
GLOW_SQUID(34, SQUID),
SQUID(88, ABSTRACT_WATERMOB),
GLOW_SQUID(35, SQUID),
// Slimes
SLIME(81, ABSTRACT_INSENTIENT),
MAGMA_CUBE(49, SLIME),
SLIME(82, ABSTRACT_INSENTIENT),
MAGMA_CUBE(50, SLIME),
// Hangable objects
ABSTRACT_HANGING(-1, ENTITY),
LEASH_KNOT(45, ABSTRACT_HANGING),
ITEM_FRAME(43, ABSTRACT_HANGING),
GLOW_ITEM_FRAME(33, ITEM_FRAME),
PAINTING(61, ABSTRACT_HANGING),
LEASH_KNOT(46, ABSTRACT_HANGING),
ITEM_FRAME(44, ABSTRACT_HANGING),
GLOW_ITEM_FRAME(34, ITEM_FRAME),
PAINTING(62, ABSTRACT_HANGING),
ABSTRACT_LIGHTNING(-1, ENTITY),
LIGHTNING_BOLT(46, ABSTRACT_LIGHTNING),
LIGHTNING_BOLT(47, ABSTRACT_LIGHTNING),
// Arrows
ABSTRACT_ARROW(-1, ENTITY),
ARROW(2, ABSTRACT_ARROW),
SPECTRAL_ARROW(85, ABSTRACT_ARROW),
TRIDENT(95, ABSTRACT_ARROW),
SPECTRAL_ARROW(86, ABSTRACT_ARROW),
TRIDENT(96, ABSTRACT_ARROW),
// Fireballs
ABSTRACT_FIREBALL(-1, ENTITY),
DRAGON_FIREBALL(16, ABSTRACT_FIREBALL),
FIREBALL(44, ABSTRACT_FIREBALL),
SMALL_FIREBALL(82, ABSTRACT_FIREBALL),
WITHER_SKULL(106, ABSTRACT_FIREBALL),
DRAGON_FIREBALL(17, ABSTRACT_FIREBALL),
FIREBALL(45, ABSTRACT_FIREBALL),
SMALL_FIREBALL(83, ABSTRACT_FIREBALL),
WITHER_SKULL(108, ABSTRACT_FIREBALL),
// Projectiles
PROJECTILE_ABSTRACT(-1, ENTITY),
SNOWBALL(84, PROJECTILE_ABSTRACT),
ENDER_PEARL(92, PROJECTILE_ABSTRACT),
EGG(91, PROJECTILE_ABSTRACT),
POTION(94, PROJECTILE_ABSTRACT),
EXPERIENCE_BOTTLE(93, PROJECTILE_ABSTRACT),
SNOWBALL(85, PROJECTILE_ABSTRACT),
ENDER_PEARL(93, PROJECTILE_ABSTRACT),
EGG(92, PROJECTILE_ABSTRACT),
POTION(95, PROJECTILE_ABSTRACT),
EXPERIENCE_BOTTLE(94, PROJECTILE_ABSTRACT),
// Vehicles
MINECART_ABSTRACT(-1, ENTITY),
CHESTED_MINECART_ABSTRACT(-1, MINECART_ABSTRACT),
CHEST_MINECART(52, CHESTED_MINECART_ABSTRACT),
HOPPER_MINECART(55, CHESTED_MINECART_ABSTRACT),
MINECART(51, MINECART_ABSTRACT),
FURNACE_MINECART(54, MINECART_ABSTRACT),
COMMAND_BLOCK_MINECART(53, MINECART_ABSTRACT),
TNT_MINECART(57, MINECART_ABSTRACT),
SPAWNER_MINECART(56, MINECART_ABSTRACT),
BOAT(7, ENTITY);
CHEST_MINECART(53, CHESTED_MINECART_ABSTRACT),
HOPPER_MINECART(56, CHESTED_MINECART_ABSTRACT),
MINECART(52, MINECART_ABSTRACT),
FURNACE_MINECART(55, MINECART_ABSTRACT),
COMMAND_BLOCK_MINECART(54, MINECART_ABSTRACT),
TNT_MINECART(58, MINECART_ABSTRACT),
SPAWNER_MINECART(57, MINECART_ABSTRACT),
BOAT(7, ENTITY),
CHEST_BOAT(8, BOAT);
private static final EntityType[] TYPES;

View File

@ -80,7 +80,7 @@ public class ProtocolVersion {
public static final ProtocolVersion v1_17_1 = register(756, "1.17.1");
public static final ProtocolVersion v1_18 = register(757, "1.18/1.18.1", new VersionRange("1.18", 0, 1));
public static final ProtocolVersion v1_18_2 = register(758, "1.18.2");
public static final ProtocolVersion v1_19 = register(759, 74, "1.19");
public static final ProtocolVersion v1_19 = register(759, 75, "1.19");
public static final ProtocolVersion unknown = register(-1, "UNKNOWN");
public static ProtocolVersion register(int version, String name) {

View File

@ -47,7 +47,6 @@ public class MappingData extends MappingDataBase {
private final Map<String, String> translateMapping = new HashMap<>();
private final Map<String, String> mojangTranslation = new HashMap<>();
private final BiMap<String, String> channelMappings = HashBiMap.create(); // 1.12->1.13
private Mappings enchantmentMappings;
public MappingData() {
super("1.12", "1.13");
@ -59,9 +58,9 @@ public class MappingData extends MappingDataBase {
loadTags(itemTags, newMappings.getAsJsonObject("item_tags"));
loadTags(fluidTags, newMappings.getAsJsonObject("fluid_tags"));
loadEnchantments(oldEnchantmentsIds, oldMappings.getAsJsonObject("enchantments"));
loadEnchantments(oldEnchantmentsIds, oldMappings.getAsJsonObject("legacy_enchantments"));
enchantmentMappings = IntArrayMappings.builder().customEntrySize(72)
.unmapped(oldMappings.getAsJsonObject("enchantments")).mapped(newMappings.getAsJsonObject("enchantments")).build();
.unmapped(oldMappings.getAsJsonObject("legacy_enchantments")).mapped(newMappings.getAsJsonArray("enchantments")).build();
// Map minecraft:snow[layers=1] of 1.12 to minecraft:snow[layers=2] in 1.13
if (Via.getConfig().isSnowCollisionFix()) {
@ -196,8 +195,4 @@ public class MappingData extends MappingDataBase {
public BiMap<String, String> getChannelMappings() {
return channelMappings;
}
public Mappings getEnchantmentMappings() {
return enchantmentMappings;
}
}

View File

@ -26,105 +26,104 @@ public enum ClientboundPackets1_19 implements ClientboundPacketType {
SPAWN_MOB, // 0x02
SPAWN_PAINTING, // 0x03
SPAWN_PLAYER, // 0x04
ADD_VIBRATION_SIGNAL, // 0x05
ENTITY_ANIMATION, // 0x06
STATISTICS, // 0x07
BLOCK_CHANGED_ACK, // 0x08
BLOCK_BREAK_ANIMATION, // 0x09
BLOCK_ENTITY_DATA, // 0x0A
BLOCK_ACTION, // 0x0B
BLOCK_CHANGE, // 0x0C
BOSSBAR, // 0x0D
SERVER_DIFFICULTY, // 0x0E
CHAT_MESSAGE, // 0x0F
CLEAR_TITLES, // 0x10
TAB_COMPLETE, // 0x11
DECLARE_COMMANDS, // 0x12
CLOSE_WINDOW, // 0x13
WINDOW_ITEMS, // 0x14
WINDOW_PROPERTY, // 0x15
SET_SLOT, // 0x16
COOLDOWN, // 0x17
PLUGIN_MESSAGE, // 0x18
NAMED_SOUND, // 0x19
DISCONNECT, // 0x1A
ENTITY_STATUS, // 0x1B
EXPLOSION, // 0x1C
UNLOAD_CHUNK, // 0x1D
GAME_EVENT, // 0x1E
OPEN_HORSE_WINDOW, // 0x1F
WORLD_BORDER_INIT, // 0x20
KEEP_ALIVE, // 0x21
CHUNK_DATA, // 0x22
EFFECT, // 0x23
SPAWN_PARTICLE, // 0x24
UPDATE_LIGHT, // 0x25
JOIN_GAME, // 0x26
MAP_DATA, // 0x27
TRADE_LIST, // 0x28
ENTITY_POSITION, // 0x29
ENTITY_POSITION_AND_ROTATION, // 0x2A
ENTITY_ROTATION, // 0x2B
VEHICLE_MOVE, // 0x2C
OPEN_BOOK, // 0x2D
OPEN_WINDOW, // 0x2E
OPEN_SIGN_EDITOR, // 0x2F
PING, // 0x30
CRAFT_RECIPE_RESPONSE, // 0x31
PLAYER_ABILITIES, // 0x32
COMBAT_END, // 0x33
COMBAT_ENTER, // 0x34
COMBAT_KILL, // 0x35
PLAYER_INFO, // 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
ACTIONBAR, // 0x41
WORLD_BORDER_CENTER, // 0x42
WORLD_BORDER_LERP_SIZE, // 0x43
WORLD_BORDER_SIZE, // 0x44
WORLD_BORDER_WARNING_DELAY, // 0x45
WORLD_BORDER_WARNING_DISTANCE, // 0x46
CAMERA, // 0x47
HELD_ITEM_CHANGE, // 0x48
UPDATE_VIEW_POSITION, // 0x49
UPDATE_VIEW_DISTANCE, // 0x4A
SPAWN_POSITION, // 0x4B
DISPLAY_SCOREBOARD, // 0x4C
ENTITY_METADATA, // 0x4D
ATTACH_ENTITY, // 0x4E
ENTITY_VELOCITY, // 0x4F
ENTITY_EQUIPMENT, // 0x50
SET_EXPERIENCE, // 0x51
UPDATE_HEALTH, // 0x52
SCOREBOARD_OBJECTIVE, // 0x53
SET_PASSENGERS, // 0x54
TEAMS, // 0x55
UPDATE_SCORE, // 0x56
SET_SIMULATION_DISTANCE, // 0x57
TITLE_SUBTITLE, // 0x58
TIME_UPDATE, // 0x59
TITLE_TEXT, // 0x5A
TITLE_TIMES, // 0x5B
ENTITY_SOUND, // 0x5C
SOUND, // 0x5D
STOP_SOUND, // 0x5E
TAB_LIST, // 0x5F
NBT_QUERY, // 0x60
COLLECT_ITEM, // 0x61
ENTITY_TELEPORT, // 0x62
ADVANCEMENTS, // 0x63
ENTITY_PROPERTIES, // 0x64
ENTITY_EFFECT, // 0x65
DECLARE_RECIPES, // 0x66
TAGS; // 0x67
ENTITY_ANIMATION, // 0x05
STATISTICS, // 0x06
BLOCK_CHANGED_ACK, // 0x07
BLOCK_BREAK_ANIMATION, // 0x08
BLOCK_ENTITY_DATA, // 0x09
BLOCK_ACTION, // 0x0A
BLOCK_CHANGE, // 0x0B
BOSSBAR, // 0x0C
SERVER_DIFFICULTY, // 0x0D
CHAT_MESSAGE, // 0x0E
CLEAR_TITLES, // 0x0F
TAB_COMPLETE, // 0x10
DECLARE_COMMANDS, // 0x11
CLOSE_WINDOW, // 0x12
WINDOW_ITEMS, // 0x13
WINDOW_PROPERTY, // 0x14
SET_SLOT, // 0x15
COOLDOWN, // 0x16
PLUGIN_MESSAGE, // 0x17
NAMED_SOUND, // 0x18
DISCONNECT, // 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
COMBAT_END, // 0x32
COMBAT_ENTER, // 0x33
COMBAT_KILL, // 0x34
PLAYER_INFO, // 0x35
FACE_PLAYER, // 0x36
PLAYER_POSITION, // 0x37
UNLOCK_RECIPES, // 0x38
REMOVE_ENTITIES, // 0x39
REMOVE_ENTITY_EFFECT, // 0x3A
RESOURCE_PACK, // 0x3B
RESPAWN, // 0x3C
ENTITY_HEAD_LOOK, // 0x3D
MULTI_BLOCK_CHANGE, // 0x3E
SELECT_ADVANCEMENTS_TAB, // 0x3F
ACTIONBAR, // 0x40
WORLD_BORDER_CENTER, // 0x41
WORLD_BORDER_LERP_SIZE, // 0x42
WORLD_BORDER_SIZE, // 0x43
WORLD_BORDER_WARNING_DELAY, // 0x44
WORLD_BORDER_WARNING_DISTANCE, // 0x45
CAMERA, // 0x46
HELD_ITEM_CHANGE, // 0x47
UPDATE_VIEW_POSITION, // 0x48
UPDATE_VIEW_DISTANCE, // 0x49
SPAWN_POSITION, // 0x4A
DISPLAY_SCOREBOARD, // 0x4B
ENTITY_METADATA, // 0x4C
ATTACH_ENTITY, // 0x4D
ENTITY_VELOCITY, // 0x4E
ENTITY_EQUIPMENT, // 0x4F
SET_EXPERIENCE, // 0x50
UPDATE_HEALTH, // 0x51
SCOREBOARD_OBJECTIVE, // 0x52
SET_PASSENGERS, // 0x53
TEAMS, // 0x54
UPDATE_SCORE, // 0x55
SET_SIMULATION_DISTANCE, // 0x56
TITLE_SUBTITLE, // 0x57
TIME_UPDATE, // 0x58
TITLE_TEXT, // 0x59
TITLE_TIMES, // 0x5A
ENTITY_SOUND, // 0x5B
SOUND, // 0x5C
STOP_SOUND, // 0x5D
TAB_LIST, // 0x5E
NBT_QUERY, // 0x5F
COLLECT_ITEM, // 0x60
ENTITY_TELEPORT, // 0x61
ADVANCEMENTS, // 0x62
ENTITY_PROPERTIES, // 0x63
ENTITY_EFFECT, // 0x64
DECLARE_RECIPES, // 0x65
TAGS; // 0x66
@Override
public int getId() {

View File

@ -42,7 +42,7 @@ import com.viaversion.viaversion.rewriter.TagRewriter;
public final class Protocol1_19To1_18_2 extends AbstractProtocol<ClientboundPackets1_18, ClientboundPackets1_19, ServerboundPackets1_17, ServerboundPackets1_17> {
public static final MappingData MAPPINGS = new MappingDataBase("1.18", "1.19");
public static final MappingData MAPPINGS = new MappingDataBase("1.18", "1.19", true);
private final EntityPackets entityRewriter = new EntityPackets(this);
private final InventoryPackets itemRewriter = new InventoryPackets(this);
@ -59,7 +59,7 @@ public final class Protocol1_19To1_18_2 extends AbstractProtocol<ClientboundPack
itemRewriter.register();
WorldPackets.register(this);
//cancelClientbound(ClientboundPackets1_18.ADD_VIBRATION_SIGNAL); //TODO experimental snapshot
cancelClientbound(ClientboundPackets1_18.ADD_VIBRATION_SIGNAL);
final SoundRewriter soundRewriter = new SoundRewriter(this);
soundRewriter.registerSound(ClientboundPackets1_18.SOUND);

View File

@ -43,7 +43,7 @@ public final class EntityPackets extends EntityRewriter<Protocol1_19To1_18_2> {
registerMetadataRewriter(ClientboundPackets1_18.ENTITY_METADATA, Types1_18.METADATA_LIST, Types1_19.METADATA_LIST);
registerRemoveEntities(ClientboundPackets1_18.REMOVE_ENTITIES);
/*protocol.registerClientbound(ClientboundPackets1_18.ENTITY_EFFECT, new PacketRemapper() {
protocol.registerClientbound(ClientboundPackets1_18.ENTITY_EFFECT, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.VAR_INT); // Entity id
@ -53,7 +53,7 @@ public final class EntityPackets extends EntityRewriter<Protocol1_19To1_18_2> {
map(Type.BYTE); // Flags
create(Type.BOOLEAN, false); // No factor data
}
});*/ // TODO experimental snapshot
});
protocol.registerClientbound(ClientboundPackets1_18.JOIN_GAME, new PacketRemapper() {
@Override

View File

@ -61,6 +61,8 @@ public final class InventoryPackets extends ItemRewriter<Protocol1_19To1_18_2> {
registerClickWindow1_17_1(ServerboundPackets1_17.CLICK_WINDOW, Type.FLAT_VAR_INT_ITEM);
registerCreativeInvAction(ServerboundPackets1_17.CREATIVE_INVENTORY_ACTION, Type.FLAT_VAR_INT_ITEM);
registerWindowPropertyEnchantmentHandler(ClientboundPackets1_18.WINDOW_PROPERTY);
protocol.registerServerbound(ServerboundPackets1_17.PLAYER_DIGGING, new PacketRemapper() {
@Override
public void registerMap() {

View File

@ -58,7 +58,7 @@ public final class WorldPackets {
handler(wrapper -> {
final EntityTracker tracker = protocol.getEntityRewriter().tracker(wrapper.user());
final Chunk1_18Type chunkType = new Chunk1_18Type(tracker.currentWorldSectionHeight(),
MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().size()),
MathUtil.ceilLog2(protocol.getMappingData().getBlockStateMappings().mappedSize()),
MathUtil.ceilLog2(tracker.biomesSent()));
final Chunk chunk = wrapper.passthrough(chunkType);
for (final ChunkSection section : chunk.getSections()) {

View File

@ -17,6 +17,7 @@
*/
package com.viaversion.viaversion.rewriter;
import com.viaversion.viaversion.api.data.Mappings;
import com.viaversion.viaversion.api.data.ParticleMappings;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.protocol.Protocol;
@ -279,6 +280,23 @@ public abstract class ItemRewriter<T extends Protocol> extends RewriterBase<T> i
});
}
public void registerWindowPropertyEnchantmentHandler(ClientboundPacketType packetType) {
protocol.registerClientbound(packetType, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.UNSIGNED_BYTE); // Container id
handler(wrapper -> {
short property = wrapper.passthrough(Type.SHORT);
if (property >= 4 && property <= 6) { // Enchantment id
Mappings mappings = protocol.getMappingData().getEnchantmentMappings();
short enchantmentId = (short) mappings.getNewId(wrapper.read(Type.SHORT));
wrapper.write(Type.SHORT, enchantmentId);
}
});
}
});
}
// Not the very best place for this, but has to stay here until *everything* is abstracted
public void registerSpawnParticle(ClientboundPacketType packetType, Type<Item> itemType, Type<?> coordType) {
protocol.registerClientbound(packetType, new PacketRemapper() {

View File

@ -2378,7 +2378,7 @@
"25100329": "minecraft:zombie_pigman_spawn_egg",
"25100330": "minecraft:zombie_villager_spawn_egg"
},
"enchantments": {
"legacy_enchantments": {
"0": "minecraft:protection",
"1": "minecraft:fire_protection",
"2": "minecraft:feather_falling",

View File

@ -11301,42 +11301,42 @@
"weather.rain",
"weather.rain.above"
],
"enchantments": {
"0": "minecraft:protection",
"1": "minecraft:fire_protection",
"2": "minecraft:feather_falling",
"3": "minecraft:blast_protection",
"4": "minecraft:projectile_protection",
"5": "minecraft:respiration",
"6": "minecraft:aqua_affinity",
"7": "minecraft:thorns",
"8": "minecraft:depth_strider",
"9": "minecraft:frost_walker",
"10": "minecraft:binding_curse",
"11": "minecraft:sharpness",
"12": "minecraft:smite",
"13": "minecraft:bane_of_arthropods",
"14": "minecraft:knockback",
"15": "minecraft:fire_aspect",
"16": "minecraft:looting",
"17": "minecraft:sweeping",
"18": "minecraft:efficiency",
"19": "minecraft:silk_touch",
"20": "minecraft:unbreaking",
"21": "minecraft:fortune",
"22": "minecraft:power",
"23": "minecraft:punch",
"24": "minecraft:flame",
"25": "minecraft:infinity",
"26": "minecraft:luck_of_the_sea",
"27": "minecraft:lure",
"28": "minecraft:loyalty",
"29": "minecraft:impaling",
"30": "minecraft:riptide",
"31": "minecraft:channeling",
"32": "minecraft:mending",
"33": "minecraft:vanishing_curse"
},
"enchantments": [
"minecraft:protection",
"minecraft:fire_protection",
"minecraft:feather_falling",
"minecraft:blast_protection",
"minecraft:projectile_protection",
"minecraft:respiration",
"minecraft:aqua_affinity",
"minecraft:thorns",
"minecraft:depth_strider",
"minecraft:frost_walker",
"minecraft:binding_curse",
"minecraft:sharpness",
"minecraft:smite",
"minecraft:bane_of_arthropods",
"minecraft:knockback",
"minecraft:fire_aspect",
"minecraft:looting",
"minecraft:sweeping",
"minecraft:efficiency",
"minecraft:silk_touch",
"minecraft:unbreaking",
"minecraft:fortune",
"minecraft:power",
"minecraft:punch",
"minecraft:flame",
"minecraft:infinity",
"minecraft:luck_of_the_sea",
"minecraft:lure",
"minecraft:loyalty",
"minecraft:impaling",
"minecraft:riptide",
"minecraft:channeling",
"minecraft:mending",
"minecraft:vanishing_curse"
],
"statistics": [
"minecraft.leave_game",
"minecraft.play_one_minute",

View File

@ -23724,5 +23724,45 @@
"minecraft:uuid",
"minecraft:resource",
"minecraft:resource_or_tag"
],
"enchantments": [
"minecraft:protection",
"minecraft:fire_protection",
"minecraft:feather_falling",
"minecraft:blast_protection",
"minecraft:projectile_protection",
"minecraft:respiration",
"minecraft:aqua_affinity",
"minecraft:thorns",
"minecraft:depth_strider",
"minecraft:frost_walker",
"minecraft:binding_curse",
"minecraft:soul_speed",
"minecraft:sharpness",
"minecraft:smite",
"minecraft:bane_of_arthropods",
"minecraft:knockback",
"minecraft:fire_aspect",
"minecraft:looting",
"minecraft:sweeping",
"minecraft:efficiency",
"minecraft:silk_touch",
"minecraft:unbreaking",
"minecraft:fortune",
"minecraft:power",
"minecraft:punch",
"minecraft:flame",
"minecraft:infinity",
"minecraft:luck_of_the_sea",
"minecraft:lure",
"minecraft:loyalty",
"minecraft:impaling",
"minecraft:riptide",
"minecraft:channeling",
"minecraft:multishot",
"minecraft:quick_charge",
"minecraft:piercing",
"minecraft:mending",
"minecraft:vanishing_curse"
]
}

View File

@ -0,0 +1,116 @@
{
"blockstates": {
"148": "minecraft:oak_leaves[distance=1,persistent=true,waterlogged=false]",
"149": "minecraft:oak_leaves[distance=1,persistent=false,waterlogged=false]",
"150": "minecraft:oak_leaves[distance=2,persistent=true,waterlogged=false]",
"151": "minecraft:oak_leaves[distance=2,persistent=false,waterlogged=false]",
"152": "minecraft:oak_leaves[distance=3,persistent=true,waterlogged=false]",
"153": "minecraft:oak_leaves[distance=3,persistent=false,waterlogged=false]",
"154": "minecraft:oak_leaves[distance=4,persistent=true,waterlogged=false]",
"155": "minecraft:oak_leaves[distance=4,persistent=false,waterlogged=false]",
"156": "minecraft:oak_leaves[distance=5,persistent=true,waterlogged=false]",
"157": "minecraft:oak_leaves[distance=5,persistent=false,waterlogged=false]",
"158": "minecraft:oak_leaves[distance=6,persistent=true,waterlogged=false]",
"159": "minecraft:oak_leaves[distance=6,persistent=false,waterlogged=false]",
"160": "minecraft:oak_leaves[distance=7,persistent=true,waterlogged=false]",
"161": "minecraft:oak_leaves[distance=7,persistent=false,waterlogged=false]",
"162": "minecraft:spruce_leaves[distance=1,persistent=true,waterlogged=false]",
"163": "minecraft:spruce_leaves[distance=1,persistent=false,waterlogged=false]",
"164": "minecraft:spruce_leaves[distance=2,persistent=true,waterlogged=false]",
"165": "minecraft:spruce_leaves[distance=2,persistent=false,waterlogged=false]",
"166": "minecraft:spruce_leaves[distance=3,persistent=true,waterlogged=false]",
"167": "minecraft:spruce_leaves[distance=3,persistent=false,waterlogged=false]",
"168": "minecraft:spruce_leaves[distance=4,persistent=true,waterlogged=false]",
"169": "minecraft:spruce_leaves[distance=4,persistent=false,waterlogged=false]",
"170": "minecraft:spruce_leaves[distance=5,persistent=true,waterlogged=false]",
"171": "minecraft:spruce_leaves[distance=5,persistent=false,waterlogged=false]",
"172": "minecraft:spruce_leaves[distance=6,persistent=true,waterlogged=false]",
"173": "minecraft:spruce_leaves[distance=6,persistent=false,waterlogged=false]",
"174": "minecraft:spruce_leaves[distance=7,persistent=true,waterlogged=false]",
"175": "minecraft:spruce_leaves[distance=7,persistent=false,waterlogged=false]",
"176": "minecraft:birch_leaves[distance=1,persistent=true,waterlogged=false]",
"177": "minecraft:birch_leaves[distance=1,persistent=false,waterlogged=false]",
"178": "minecraft:birch_leaves[distance=2,persistent=true,waterlogged=false]",
"179": "minecraft:birch_leaves[distance=2,persistent=false,waterlogged=false]",
"180": "minecraft:birch_leaves[distance=3,persistent=true,waterlogged=false]",
"181": "minecraft:birch_leaves[distance=3,persistent=false,waterlogged=false]",
"182": "minecraft:birch_leaves[distance=4,persistent=true,waterlogged=false]",
"183": "minecraft:birch_leaves[distance=4,persistent=false,waterlogged=false]",
"184": "minecraft:birch_leaves[distance=5,persistent=true,waterlogged=false]",
"185": "minecraft:birch_leaves[distance=5,persistent=false,waterlogged=false]",
"186": "minecraft:birch_leaves[distance=6,persistent=true,waterlogged=false]",
"187": "minecraft:birch_leaves[distance=6,persistent=false,waterlogged=false]",
"188": "minecraft:birch_leaves[distance=7,persistent=true,waterlogged=false]",
"189": "minecraft:birch_leaves[distance=7,persistent=false,waterlogged=false]",
"190": "minecraft:jungle_leaves[distance=1,persistent=true,waterlogged=false]",
"191": "minecraft:jungle_leaves[distance=1,persistent=false,waterlogged=false]",
"192": "minecraft:jungle_leaves[distance=2,persistent=true,waterlogged=false]",
"193": "minecraft:jungle_leaves[distance=2,persistent=false,waterlogged=false]",
"194": "minecraft:jungle_leaves[distance=3,persistent=true,waterlogged=false]",
"195": "minecraft:jungle_leaves[distance=3,persistent=false,waterlogged=false]",
"196": "minecraft:jungle_leaves[distance=4,persistent=true,waterlogged=false]",
"197": "minecraft:jungle_leaves[distance=4,persistent=false,waterlogged=false]",
"198": "minecraft:jungle_leaves[distance=5,persistent=true,waterlogged=false]",
"199": "minecraft:jungle_leaves[distance=5,persistent=false,waterlogged=false]",
"200": "minecraft:jungle_leaves[distance=6,persistent=true,waterlogged=false]",
"201": "minecraft:jungle_leaves[distance=6,persistent=false,waterlogged=false]",
"202": "minecraft:jungle_leaves[distance=7,persistent=true,waterlogged=false]",
"203": "minecraft:jungle_leaves[distance=7,persistent=false,waterlogged=false]",
"204": "minecraft:acacia_leaves[distance=1,persistent=true,waterlogged=false]",
"205": "minecraft:acacia_leaves[distance=1,persistent=false,waterlogged=false]",
"206": "minecraft:acacia_leaves[distance=2,persistent=true,waterlogged=false]",
"207": "minecraft:acacia_leaves[distance=2,persistent=false,waterlogged=false]",
"208": "minecraft:acacia_leaves[distance=3,persistent=true,waterlogged=false]",
"209": "minecraft:acacia_leaves[distance=3,persistent=false,waterlogged=false]",
"210": "minecraft:acacia_leaves[distance=4,persistent=true,waterlogged=false]",
"211": "minecraft:acacia_leaves[distance=4,persistent=false,waterlogged=false]",
"212": "minecraft:acacia_leaves[distance=5,persistent=true,waterlogged=false]",
"213": "minecraft:acacia_leaves[distance=5,persistent=false,waterlogged=false]",
"214": "minecraft:acacia_leaves[distance=6,persistent=true,waterlogged=false]",
"215": "minecraft:acacia_leaves[distance=6,persistent=false,waterlogged=false]",
"216": "minecraft:acacia_leaves[distance=7,persistent=true,waterlogged=false]",
"217": "minecraft:acacia_leaves[distance=7,persistent=false,waterlogged=false]",
"218": "minecraft:dark_oak_leaves[distance=1,persistent=true,waterlogged=false]",
"219": "minecraft:dark_oak_leaves[distance=1,persistent=false,waterlogged=false]",
"220": "minecraft:dark_oak_leaves[distance=2,persistent=true,waterlogged=false]",
"221": "minecraft:dark_oak_leaves[distance=2,persistent=false,waterlogged=false]",
"222": "minecraft:dark_oak_leaves[distance=3,persistent=true,waterlogged=false]",
"223": "minecraft:dark_oak_leaves[distance=3,persistent=false,waterlogged=false]",
"224": "minecraft:dark_oak_leaves[distance=4,persistent=true,waterlogged=false]",
"225": "minecraft:dark_oak_leaves[distance=4,persistent=false,waterlogged=false]",
"226": "minecraft:dark_oak_leaves[distance=5,persistent=true,waterlogged=false]",
"227": "minecraft:dark_oak_leaves[distance=5,persistent=false,waterlogged=false]",
"228": "minecraft:dark_oak_leaves[distance=6,persistent=true,waterlogged=false]",
"229": "minecraft:dark_oak_leaves[distance=6,persistent=false,waterlogged=false]",
"230": "minecraft:dark_oak_leaves[distance=7,persistent=true,waterlogged=false]",
"231": "minecraft:dark_oak_leaves[distance=7,persistent=false,waterlogged=false]",
"232": "minecraft:azalea_leaves[distance=1,persistent=true,waterlogged=false]",
"233": "minecraft:azalea_leaves[distance=1,persistent=false,waterlogged=false]",
"234": "minecraft:azalea_leaves[distance=2,persistent=true,waterlogged=false]",
"235": "minecraft:azalea_leaves[distance=2,persistent=false,waterlogged=false]",
"236": "minecraft:azalea_leaves[distance=3,persistent=true,waterlogged=false]",
"237": "minecraft:azalea_leaves[distance=3,persistent=false,waterlogged=false]",
"238": "minecraft:azalea_leaves[distance=4,persistent=true,waterlogged=false]",
"239": "minecraft:azalea_leaves[distance=4,persistent=false,waterlogged=false]",
"240": "minecraft:azalea_leaves[distance=5,persistent=true,waterlogged=false]",
"241": "minecraft:azalea_leaves[distance=5,persistent=false,waterlogged=false]",
"242": "minecraft:azalea_leaves[distance=6,persistent=true,waterlogged=false]",
"243": "minecraft:azalea_leaves[distance=6,persistent=false,waterlogged=false]",
"244": "minecraft:azalea_leaves[distance=7,persistent=true,waterlogged=false]",
"245": "minecraft:azalea_leaves[distance=7,persistent=false,waterlogged=false]",
"246": "minecraft:flowering_azalea_leaves[distance=1,persistent=true,waterlogged=false]",
"247": "minecraft:flowering_azalea_leaves[distance=1,persistent=false,waterlogged=false]",
"248": "minecraft:flowering_azalea_leaves[distance=2,persistent=true,waterlogged=false]",
"249": "minecraft:flowering_azalea_leaves[distance=2,persistent=false,waterlogged=false]",
"250": "minecraft:flowering_azalea_leaves[distance=3,persistent=true,waterlogged=false]",
"251": "minecraft:flowering_azalea_leaves[distance=3,persistent=false,waterlogged=false]",
"252": "minecraft:flowering_azalea_leaves[distance=4,persistent=true,waterlogged=false]",
"253": "minecraft:flowering_azalea_leaves[distance=4,persistent=false,waterlogged=false]",
"254": "minecraft:flowering_azalea_leaves[distance=5,persistent=true,waterlogged=false]",
"255": "minecraft:flowering_azalea_leaves[distance=5,persistent=false,waterlogged=false]",
"256": "minecraft:flowering_azalea_leaves[distance=6,persistent=true,waterlogged=false]",
"257": "minecraft:flowering_azalea_leaves[distance=6,persistent=false,waterlogged=false]",
"258": "minecraft:flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false]",
"259": "minecraft:flowering_azalea_leaves[distance=7,persistent=false,waterlogged=false]"
}
}

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.3.0-22w11a-SNAPSHOT
projectVersion=4.3.0-22w12a-SNAPSHOT
# Gradle properties
org.gradle.daemon=true