mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-02 14:38:26 +01:00
upgrade: 1.20.4 data, most missing packets
(cherry picked from commit dc6a6089f1
)
This commit is contained in:
parent
6416e8e441
commit
5de3436c71
@ -3,8 +3,7 @@ metadata.format.version = "1.1"
|
||||
[versions]
|
||||
|
||||
# Important dependencies
|
||||
data = "1.20.2-rv1"
|
||||
#data = "1.20.4-rv1"
|
||||
data = "1.20.4-rv1"
|
||||
adventure = "4.15.0"
|
||||
kotlin = "1.7.22"
|
||||
dependencyGetter = "v1.0.1"
|
||||
|
@ -25,6 +25,8 @@ interface EntityTypes {
|
||||
|
||||
EntityType BOAT = EntityTypeImpl.get("minecraft:boat");
|
||||
|
||||
EntityType BREEZE = EntityTypeImpl.get("minecraft:breeze");
|
||||
|
||||
EntityType CAMEL = EntityTypeImpl.get("minecraft:camel");
|
||||
|
||||
EntityType CAT = EntityTypeImpl.get("minecraft:cat");
|
||||
@ -229,6 +231,8 @@ interface EntityTypes {
|
||||
|
||||
EntityType WARDEN = EntityTypeImpl.get("minecraft:warden");
|
||||
|
||||
EntityType WIND_CHARGE = EntityTypeImpl.get("minecraft:wind_charge");
|
||||
|
||||
EntityType WITCH = EntityTypeImpl.get("minecraft:witch");
|
||||
|
||||
EntityType WITHER = EntityTypeImpl.get("minecraft:wither");
|
||||
|
@ -251,7 +251,7 @@ interface Blocks {
|
||||
|
||||
Block COBWEB = BlockImpl.get("minecraft:cobweb");
|
||||
|
||||
Block GRASS = BlockImpl.get("minecraft:grass");
|
||||
Block SHORT_GRASS = BlockImpl.get("minecraft:short_grass");
|
||||
|
||||
Block FERN = BlockImpl.get("minecraft:fern");
|
||||
|
||||
@ -515,8 +515,6 @@ interface Blocks {
|
||||
|
||||
Block OAK_FENCE = BlockImpl.get("minecraft:oak_fence");
|
||||
|
||||
Block PUMPKIN = BlockImpl.get("minecraft:pumpkin");
|
||||
|
||||
Block NETHERRACK = BlockImpl.get("minecraft:netherrack");
|
||||
|
||||
Block SOUL_SAND = BlockImpl.get("minecraft:soul_sand");
|
||||
@ -629,6 +627,8 @@ interface Blocks {
|
||||
|
||||
Block GLASS_PANE = BlockImpl.get("minecraft:glass_pane");
|
||||
|
||||
Block PUMPKIN = BlockImpl.get("minecraft:pumpkin");
|
||||
|
||||
Block MELON = BlockImpl.get("minecraft:melon");
|
||||
|
||||
Block ATTACHED_PUMPKIN_STEM = BlockImpl.get("minecraft:attached_pumpkin_stem");
|
||||
@ -1825,6 +1825,32 @@ interface Blocks {
|
||||
|
||||
Block TUFF = BlockImpl.get("minecraft:tuff");
|
||||
|
||||
Block TUFF_SLAB = BlockImpl.get("minecraft:tuff_slab");
|
||||
|
||||
Block TUFF_STAIRS = BlockImpl.get("minecraft:tuff_stairs");
|
||||
|
||||
Block TUFF_WALL = BlockImpl.get("minecraft:tuff_wall");
|
||||
|
||||
Block POLISHED_TUFF = BlockImpl.get("minecraft:polished_tuff");
|
||||
|
||||
Block POLISHED_TUFF_SLAB = BlockImpl.get("minecraft:polished_tuff_slab");
|
||||
|
||||
Block POLISHED_TUFF_STAIRS = BlockImpl.get("minecraft:polished_tuff_stairs");
|
||||
|
||||
Block POLISHED_TUFF_WALL = BlockImpl.get("minecraft:polished_tuff_wall");
|
||||
|
||||
Block CHISELED_TUFF = BlockImpl.get("minecraft:chiseled_tuff");
|
||||
|
||||
Block TUFF_BRICKS = BlockImpl.get("minecraft:tuff_bricks");
|
||||
|
||||
Block TUFF_BRICK_SLAB = BlockImpl.get("minecraft:tuff_brick_slab");
|
||||
|
||||
Block TUFF_BRICK_STAIRS = BlockImpl.get("minecraft:tuff_brick_stairs");
|
||||
|
||||
Block TUFF_BRICK_WALL = BlockImpl.get("minecraft:tuff_brick_wall");
|
||||
|
||||
Block CHISELED_TUFF_BRICKS = BlockImpl.get("minecraft:chiseled_tuff_bricks");
|
||||
|
||||
Block CALCITE = BlockImpl.get("minecraft:calcite");
|
||||
|
||||
Block TINTED_GLASS = BlockImpl.get("minecraft:tinted_glass");
|
||||
@ -1843,13 +1869,13 @@ interface Blocks {
|
||||
|
||||
Block SCULK_SHRIEKER = BlockImpl.get("minecraft:sculk_shrieker");
|
||||
|
||||
Block OXIDIZED_COPPER = BlockImpl.get("minecraft:oxidized_copper");
|
||||
|
||||
Block WEATHERED_COPPER = BlockImpl.get("minecraft:weathered_copper");
|
||||
Block COPPER_BLOCK = BlockImpl.get("minecraft:copper_block");
|
||||
|
||||
Block EXPOSED_COPPER = BlockImpl.get("minecraft:exposed_copper");
|
||||
|
||||
Block COPPER_BLOCK = BlockImpl.get("minecraft:copper_block");
|
||||
Block WEATHERED_COPPER = BlockImpl.get("minecraft:weathered_copper");
|
||||
|
||||
Block OXIDIZED_COPPER = BlockImpl.get("minecraft:oxidized_copper");
|
||||
|
||||
Block COPPER_ORE = BlockImpl.get("minecraft:copper_ore");
|
||||
|
||||
@ -1863,6 +1889,22 @@ interface Blocks {
|
||||
|
||||
Block CUT_COPPER = BlockImpl.get("minecraft:cut_copper");
|
||||
|
||||
Block OXIDIZED_CHISELED_COPPER = BlockImpl.get("minecraft:oxidized_chiseled_copper");
|
||||
|
||||
Block WEATHERED_CHISELED_COPPER = BlockImpl.get("minecraft:weathered_chiseled_copper");
|
||||
|
||||
Block EXPOSED_CHISELED_COPPER = BlockImpl.get("minecraft:exposed_chiseled_copper");
|
||||
|
||||
Block CHISELED_COPPER = BlockImpl.get("minecraft:chiseled_copper");
|
||||
|
||||
Block WAXED_OXIDIZED_CHISELED_COPPER = BlockImpl.get("minecraft:waxed_oxidized_chiseled_copper");
|
||||
|
||||
Block WAXED_WEATHERED_CHISELED_COPPER = BlockImpl.get("minecraft:waxed_weathered_chiseled_copper");
|
||||
|
||||
Block WAXED_EXPOSED_CHISELED_COPPER = BlockImpl.get("minecraft:waxed_exposed_chiseled_copper");
|
||||
|
||||
Block WAXED_CHISELED_COPPER = BlockImpl.get("minecraft:waxed_chiseled_copper");
|
||||
|
||||
Block OXIDIZED_CUT_COPPER_STAIRS = BlockImpl.get("minecraft:oxidized_cut_copper_stairs");
|
||||
|
||||
Block WEATHERED_CUT_COPPER_STAIRS = BlockImpl.get("minecraft:weathered_cut_copper_stairs");
|
||||
@ -1911,6 +1953,70 @@ interface Blocks {
|
||||
|
||||
Block WAXED_CUT_COPPER_SLAB = BlockImpl.get("minecraft:waxed_cut_copper_slab");
|
||||
|
||||
Block COPPER_DOOR = BlockImpl.get("minecraft:copper_door");
|
||||
|
||||
Block EXPOSED_COPPER_DOOR = BlockImpl.get("minecraft:exposed_copper_door");
|
||||
|
||||
Block OXIDIZED_COPPER_DOOR = BlockImpl.get("minecraft:oxidized_copper_door");
|
||||
|
||||
Block WEATHERED_COPPER_DOOR = BlockImpl.get("minecraft:weathered_copper_door");
|
||||
|
||||
Block WAXED_COPPER_DOOR = BlockImpl.get("minecraft:waxed_copper_door");
|
||||
|
||||
Block WAXED_EXPOSED_COPPER_DOOR = BlockImpl.get("minecraft:waxed_exposed_copper_door");
|
||||
|
||||
Block WAXED_OXIDIZED_COPPER_DOOR = BlockImpl.get("minecraft:waxed_oxidized_copper_door");
|
||||
|
||||
Block WAXED_WEATHERED_COPPER_DOOR = BlockImpl.get("minecraft:waxed_weathered_copper_door");
|
||||
|
||||
Block COPPER_TRAPDOOR = BlockImpl.get("minecraft:copper_trapdoor");
|
||||
|
||||
Block EXPOSED_COPPER_TRAPDOOR = BlockImpl.get("minecraft:exposed_copper_trapdoor");
|
||||
|
||||
Block OXIDIZED_COPPER_TRAPDOOR = BlockImpl.get("minecraft:oxidized_copper_trapdoor");
|
||||
|
||||
Block WEATHERED_COPPER_TRAPDOOR = BlockImpl.get("minecraft:weathered_copper_trapdoor");
|
||||
|
||||
Block WAXED_COPPER_TRAPDOOR = BlockImpl.get("minecraft:waxed_copper_trapdoor");
|
||||
|
||||
Block WAXED_EXPOSED_COPPER_TRAPDOOR = BlockImpl.get("minecraft:waxed_exposed_copper_trapdoor");
|
||||
|
||||
Block WAXED_OXIDIZED_COPPER_TRAPDOOR = BlockImpl.get("minecraft:waxed_oxidized_copper_trapdoor");
|
||||
|
||||
Block WAXED_WEATHERED_COPPER_TRAPDOOR = BlockImpl.get("minecraft:waxed_weathered_copper_trapdoor");
|
||||
|
||||
Block COPPER_GRATE = BlockImpl.get("minecraft:copper_grate");
|
||||
|
||||
Block EXPOSED_COPPER_GRATE = BlockImpl.get("minecraft:exposed_copper_grate");
|
||||
|
||||
Block WEATHERED_COPPER_GRATE = BlockImpl.get("minecraft:weathered_copper_grate");
|
||||
|
||||
Block OXIDIZED_COPPER_GRATE = BlockImpl.get("minecraft:oxidized_copper_grate");
|
||||
|
||||
Block WAXED_COPPER_GRATE = BlockImpl.get("minecraft:waxed_copper_grate");
|
||||
|
||||
Block WAXED_EXPOSED_COPPER_GRATE = BlockImpl.get("minecraft:waxed_exposed_copper_grate");
|
||||
|
||||
Block WAXED_WEATHERED_COPPER_GRATE = BlockImpl.get("minecraft:waxed_weathered_copper_grate");
|
||||
|
||||
Block WAXED_OXIDIZED_COPPER_GRATE = BlockImpl.get("minecraft:waxed_oxidized_copper_grate");
|
||||
|
||||
Block COPPER_BULB = BlockImpl.get("minecraft:copper_bulb");
|
||||
|
||||
Block EXPOSED_COPPER_BULB = BlockImpl.get("minecraft:exposed_copper_bulb");
|
||||
|
||||
Block WEATHERED_COPPER_BULB = BlockImpl.get("minecraft:weathered_copper_bulb");
|
||||
|
||||
Block OXIDIZED_COPPER_BULB = BlockImpl.get("minecraft:oxidized_copper_bulb");
|
||||
|
||||
Block WAXED_COPPER_BULB = BlockImpl.get("minecraft:waxed_copper_bulb");
|
||||
|
||||
Block WAXED_EXPOSED_COPPER_BULB = BlockImpl.get("minecraft:waxed_exposed_copper_bulb");
|
||||
|
||||
Block WAXED_WEATHERED_COPPER_BULB = BlockImpl.get("minecraft:waxed_weathered_copper_bulb");
|
||||
|
||||
Block WAXED_OXIDIZED_COPPER_BULB = BlockImpl.get("minecraft:waxed_oxidized_copper_bulb");
|
||||
|
||||
Block LIGHTNING_ROD = BlockImpl.get("minecraft:lightning_rod");
|
||||
|
||||
Block POINTED_DRIPSTONE = BlockImpl.get("minecraft:pointed_dripstone");
|
||||
@ -2010,4 +2116,8 @@ interface Blocks {
|
||||
Block REINFORCED_DEEPSLATE = BlockImpl.get("minecraft:reinforced_deepslate");
|
||||
|
||||
Block DECORATED_POT = BlockImpl.get("minecraft:decorated_pot");
|
||||
|
||||
Block CRAFTER = BlockImpl.get("minecraft:crafter");
|
||||
|
||||
Block TRIAL_SPAWNER = BlockImpl.get("minecraft:trial_spawner");
|
||||
}
|
||||
|
@ -31,6 +31,32 @@ interface Materials {
|
||||
|
||||
Material TUFF = MaterialImpl.get("minecraft:tuff");
|
||||
|
||||
Material TUFF_SLAB = MaterialImpl.get("minecraft:tuff_slab");
|
||||
|
||||
Material TUFF_STAIRS = MaterialImpl.get("minecraft:tuff_stairs");
|
||||
|
||||
Material TUFF_WALL = MaterialImpl.get("minecraft:tuff_wall");
|
||||
|
||||
Material CHISELED_TUFF = MaterialImpl.get("minecraft:chiseled_tuff");
|
||||
|
||||
Material POLISHED_TUFF = MaterialImpl.get("minecraft:polished_tuff");
|
||||
|
||||
Material POLISHED_TUFF_SLAB = MaterialImpl.get("minecraft:polished_tuff_slab");
|
||||
|
||||
Material POLISHED_TUFF_STAIRS = MaterialImpl.get("minecraft:polished_tuff_stairs");
|
||||
|
||||
Material POLISHED_TUFF_WALL = MaterialImpl.get("minecraft:polished_tuff_wall");
|
||||
|
||||
Material TUFF_BRICKS = MaterialImpl.get("minecraft:tuff_bricks");
|
||||
|
||||
Material TUFF_BRICK_SLAB = MaterialImpl.get("minecraft:tuff_brick_slab");
|
||||
|
||||
Material TUFF_BRICK_STAIRS = MaterialImpl.get("minecraft:tuff_brick_stairs");
|
||||
|
||||
Material TUFF_BRICK_WALL = MaterialImpl.get("minecraft:tuff_brick_wall");
|
||||
|
||||
Material CHISELED_TUFF_BRICKS = MaterialImpl.get("minecraft:chiseled_tuff_bricks");
|
||||
|
||||
Material DRIPSTONE_BLOCK = MaterialImpl.get("minecraft:dripstone_block");
|
||||
|
||||
Material GRASS_BLOCK = MaterialImpl.get("minecraft:grass_block");
|
||||
@ -169,6 +195,14 @@ interface Materials {
|
||||
|
||||
Material OXIDIZED_COPPER = MaterialImpl.get("minecraft:oxidized_copper");
|
||||
|
||||
Material CHISELED_COPPER = MaterialImpl.get("minecraft:chiseled_copper");
|
||||
|
||||
Material EXPOSED_CHISELED_COPPER = MaterialImpl.get("minecraft:exposed_chiseled_copper");
|
||||
|
||||
Material WEATHERED_CHISELED_COPPER = MaterialImpl.get("minecraft:weathered_chiseled_copper");
|
||||
|
||||
Material OXIDIZED_CHISELED_COPPER = MaterialImpl.get("minecraft:oxidized_chiseled_copper");
|
||||
|
||||
Material CUT_COPPER = MaterialImpl.get("minecraft:cut_copper");
|
||||
|
||||
Material EXPOSED_CUT_COPPER = MaterialImpl.get("minecraft:exposed_cut_copper");
|
||||
@ -201,6 +235,14 @@ interface Materials {
|
||||
|
||||
Material WAXED_OXIDIZED_COPPER = MaterialImpl.get("minecraft:waxed_oxidized_copper");
|
||||
|
||||
Material WAXED_CHISELED_COPPER = MaterialImpl.get("minecraft:waxed_chiseled_copper");
|
||||
|
||||
Material WAXED_EXPOSED_CHISELED_COPPER = MaterialImpl.get("minecraft:waxed_exposed_chiseled_copper");
|
||||
|
||||
Material WAXED_WEATHERED_CHISELED_COPPER = MaterialImpl.get("minecraft:waxed_weathered_chiseled_copper");
|
||||
|
||||
Material WAXED_OXIDIZED_CHISELED_COPPER = MaterialImpl.get("minecraft:waxed_oxidized_chiseled_copper");
|
||||
|
||||
Material WAXED_CUT_COPPER = MaterialImpl.get("minecraft:waxed_cut_copper");
|
||||
|
||||
Material WAXED_EXPOSED_CUT_COPPER = MaterialImpl.get("minecraft:waxed_exposed_cut_copper");
|
||||
@ -351,7 +393,7 @@ interface Materials {
|
||||
|
||||
Material COBWEB = MaterialImpl.get("minecraft:cobweb");
|
||||
|
||||
Material GRASS = MaterialImpl.get("minecraft:grass");
|
||||
Material SHORT_GRASS = MaterialImpl.get("minecraft:short_grass");
|
||||
|
||||
Material FERN = MaterialImpl.get("minecraft:fern");
|
||||
|
||||
@ -1405,6 +1447,22 @@ interface Materials {
|
||||
|
||||
Material WARPED_DOOR = MaterialImpl.get("minecraft:warped_door");
|
||||
|
||||
Material COPPER_DOOR = MaterialImpl.get("minecraft:copper_door");
|
||||
|
||||
Material EXPOSED_COPPER_DOOR = MaterialImpl.get("minecraft:exposed_copper_door");
|
||||
|
||||
Material WEATHERED_COPPER_DOOR = MaterialImpl.get("minecraft:weathered_copper_door");
|
||||
|
||||
Material OXIDIZED_COPPER_DOOR = MaterialImpl.get("minecraft:oxidized_copper_door");
|
||||
|
||||
Material WAXED_COPPER_DOOR = MaterialImpl.get("minecraft:waxed_copper_door");
|
||||
|
||||
Material WAXED_EXPOSED_COPPER_DOOR = MaterialImpl.get("minecraft:waxed_exposed_copper_door");
|
||||
|
||||
Material WAXED_WEATHERED_COPPER_DOOR = MaterialImpl.get("minecraft:waxed_weathered_copper_door");
|
||||
|
||||
Material WAXED_OXIDIZED_COPPER_DOOR = MaterialImpl.get("minecraft:waxed_oxidized_copper_door");
|
||||
|
||||
Material IRON_TRAPDOOR = MaterialImpl.get("minecraft:iron_trapdoor");
|
||||
|
||||
Material OAK_TRAPDOOR = MaterialImpl.get("minecraft:oak_trapdoor");
|
||||
@ -1429,6 +1487,22 @@ interface Materials {
|
||||
|
||||
Material WARPED_TRAPDOOR = MaterialImpl.get("minecraft:warped_trapdoor");
|
||||
|
||||
Material COPPER_TRAPDOOR = MaterialImpl.get("minecraft:copper_trapdoor");
|
||||
|
||||
Material EXPOSED_COPPER_TRAPDOOR = MaterialImpl.get("minecraft:exposed_copper_trapdoor");
|
||||
|
||||
Material WEATHERED_COPPER_TRAPDOOR = MaterialImpl.get("minecraft:weathered_copper_trapdoor");
|
||||
|
||||
Material OXIDIZED_COPPER_TRAPDOOR = MaterialImpl.get("minecraft:oxidized_copper_trapdoor");
|
||||
|
||||
Material WAXED_COPPER_TRAPDOOR = MaterialImpl.get("minecraft:waxed_copper_trapdoor");
|
||||
|
||||
Material WAXED_EXPOSED_COPPER_TRAPDOOR = MaterialImpl.get("minecraft:waxed_exposed_copper_trapdoor");
|
||||
|
||||
Material WAXED_WEATHERED_COPPER_TRAPDOOR = MaterialImpl.get("minecraft:waxed_weathered_copper_trapdoor");
|
||||
|
||||
Material WAXED_OXIDIZED_COPPER_TRAPDOOR = MaterialImpl.get("minecraft:waxed_oxidized_copper_trapdoor");
|
||||
|
||||
Material OAK_FENCE_GATE = MaterialImpl.get("minecraft:oak_fence_gate");
|
||||
|
||||
Material SPRUCE_FENCE_GATE = MaterialImpl.get("minecraft:spruce_fence_gate");
|
||||
@ -1887,6 +1961,8 @@ interface Materials {
|
||||
|
||||
Material COOKIE = MaterialImpl.get("minecraft:cookie");
|
||||
|
||||
Material CRAFTER = MaterialImpl.get("minecraft:crafter");
|
||||
|
||||
Material FILLED_MAP = MaterialImpl.get("minecraft:filled_map");
|
||||
|
||||
Material SHEARS = MaterialImpl.get("minecraft:shears");
|
||||
@ -1949,6 +2025,8 @@ interface Materials {
|
||||
|
||||
Material BLAZE_SPAWN_EGG = MaterialImpl.get("minecraft:blaze_spawn_egg");
|
||||
|
||||
Material BREEZE_SPAWN_EGG = MaterialImpl.get("minecraft:breeze_spawn_egg");
|
||||
|
||||
Material CAT_SPAWN_EGG = MaterialImpl.get("minecraft:cat_spawn_egg");
|
||||
|
||||
Material CAMEL_SPAWN_EGG = MaterialImpl.get("minecraft:camel_spawn_egg");
|
||||
@ -2514,4 +2592,40 @@ interface Materials {
|
||||
Material SKULL_POTTERY_SHERD = MaterialImpl.get("minecraft:skull_pottery_sherd");
|
||||
|
||||
Material SNORT_POTTERY_SHERD = MaterialImpl.get("minecraft:snort_pottery_sherd");
|
||||
|
||||
Material COPPER_GRATE = MaterialImpl.get("minecraft:copper_grate");
|
||||
|
||||
Material EXPOSED_COPPER_GRATE = MaterialImpl.get("minecraft:exposed_copper_grate");
|
||||
|
||||
Material WEATHERED_COPPER_GRATE = MaterialImpl.get("minecraft:weathered_copper_grate");
|
||||
|
||||
Material OXIDIZED_COPPER_GRATE = MaterialImpl.get("minecraft:oxidized_copper_grate");
|
||||
|
||||
Material WAXED_COPPER_GRATE = MaterialImpl.get("minecraft:waxed_copper_grate");
|
||||
|
||||
Material WAXED_EXPOSED_COPPER_GRATE = MaterialImpl.get("minecraft:waxed_exposed_copper_grate");
|
||||
|
||||
Material WAXED_WEATHERED_COPPER_GRATE = MaterialImpl.get("minecraft:waxed_weathered_copper_grate");
|
||||
|
||||
Material WAXED_OXIDIZED_COPPER_GRATE = MaterialImpl.get("minecraft:waxed_oxidized_copper_grate");
|
||||
|
||||
Material COPPER_BULB = MaterialImpl.get("minecraft:copper_bulb");
|
||||
|
||||
Material EXPOSED_COPPER_BULB = MaterialImpl.get("minecraft:exposed_copper_bulb");
|
||||
|
||||
Material WEATHERED_COPPER_BULB = MaterialImpl.get("minecraft:weathered_copper_bulb");
|
||||
|
||||
Material OXIDIZED_COPPER_BULB = MaterialImpl.get("minecraft:oxidized_copper_bulb");
|
||||
|
||||
Material WAXED_COPPER_BULB = MaterialImpl.get("minecraft:waxed_copper_bulb");
|
||||
|
||||
Material WAXED_EXPOSED_COPPER_BULB = MaterialImpl.get("minecraft:waxed_exposed_copper_bulb");
|
||||
|
||||
Material WAXED_WEATHERED_COPPER_BULB = MaterialImpl.get("minecraft:waxed_weathered_copper_bulb");
|
||||
|
||||
Material WAXED_OXIDIZED_COPPER_BULB = MaterialImpl.get("minecraft:waxed_oxidized_copper_bulb");
|
||||
|
||||
Material TRIAL_SPAWNER = MaterialImpl.get("minecraft:trial_spawner");
|
||||
|
||||
Material TRIAL_KEY = MaterialImpl.get("minecraft:trial_key");
|
||||
}
|
||||
|
@ -53,6 +53,10 @@ interface Particles {
|
||||
|
||||
Particle EXPLOSION = ParticleImpl.get("minecraft:explosion");
|
||||
|
||||
Particle GUST = ParticleImpl.get("minecraft:gust");
|
||||
|
||||
Particle GUST_EMITTER = ParticleImpl.get("minecraft:gust_emitter");
|
||||
|
||||
Particle SONIC_BOOM = ParticleImpl.get("minecraft:sonic_boom");
|
||||
|
||||
Particle FALLING_DUST = ParticleImpl.get("minecraft:falling_dust");
|
||||
@ -109,6 +113,8 @@ interface Particles {
|
||||
|
||||
Particle SMOKE = ParticleImpl.get("minecraft:smoke");
|
||||
|
||||
Particle WHITE_SMOKE = ParticleImpl.get("minecraft:white_smoke");
|
||||
|
||||
Particle SNEEZE = ParticleImpl.get("minecraft:sneeze");
|
||||
|
||||
Particle SPIT = ParticleImpl.get("minecraft:spit");
|
||||
@ -194,4 +200,10 @@ interface Particles {
|
||||
Particle SHRIEK = ParticleImpl.get("minecraft:shriek");
|
||||
|
||||
Particle EGG_CRACK = ParticleImpl.get("minecraft:egg_crack");
|
||||
|
||||
Particle DUST_PLUME = ParticleImpl.get("minecraft:dust_plume");
|
||||
|
||||
Particle GUST_DUST = ParticleImpl.get("minecraft:gust_dust");
|
||||
|
||||
Particle TRIAL_SPAWNER_DETECTION = ParticleImpl.get("minecraft:trial_spawner_detection");
|
||||
}
|
||||
|
@ -337,6 +337,24 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent ITEM_BOTTLE_FILL_DRAGONBREATH = SoundEventImpl.get("minecraft:item.bottle.fill_dragonbreath");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_INHALE = SoundEventImpl.get("minecraft:entity.breeze.inhale");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_IDLE_GROUND = SoundEventImpl.get("minecraft:entity.breeze.idle_ground");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_IDLE_AIR = SoundEventImpl.get("minecraft:entity.breeze.idle_air");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_SHOOT = SoundEventImpl.get("minecraft:entity.breeze.shoot");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_JUMP = SoundEventImpl.get("minecraft:entity.breeze.jump");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_LAND = SoundEventImpl.get("minecraft:entity.breeze.land");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_SLIDE = SoundEventImpl.get("minecraft:entity.breeze.slide");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_DEATH = SoundEventImpl.get("minecraft:entity.breeze.death");
|
||||
|
||||
SoundEvent ENTITY_BREEZE_HURT = SoundEventImpl.get("minecraft:entity.breeze.hurt");
|
||||
|
||||
SoundEvent BLOCK_BREWING_STAND_BREW = SoundEventImpl.get("minecraft:block.brewing_stand.brew");
|
||||
|
||||
SoundEvent ITEM_BRUSH_BRUSHING_GENERIC = SoundEventImpl.get("minecraft:item.brush.brushing.generic");
|
||||
@ -607,6 +625,20 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent BLOCK_CONDUIT_DEACTIVATE = SoundEventImpl.get("minecraft:block.conduit.deactivate");
|
||||
|
||||
SoundEvent BLOCK_COPPER_BULB_BREAK = SoundEventImpl.get("minecraft:block.copper_bulb.break");
|
||||
|
||||
SoundEvent BLOCK_COPPER_BULB_STEP = SoundEventImpl.get("minecraft:block.copper_bulb.step");
|
||||
|
||||
SoundEvent BLOCK_COPPER_BULB_PLACE = SoundEventImpl.get("minecraft:block.copper_bulb.place");
|
||||
|
||||
SoundEvent BLOCK_COPPER_BULB_HIT = SoundEventImpl.get("minecraft:block.copper_bulb.hit");
|
||||
|
||||
SoundEvent BLOCK_COPPER_BULB_FALL = SoundEventImpl.get("minecraft:block.copper_bulb.fall");
|
||||
|
||||
SoundEvent BLOCK_COPPER_BULB_TURN_ON = SoundEventImpl.get("minecraft:block.copper_bulb.turn_on");
|
||||
|
||||
SoundEvent BLOCK_COPPER_BULB_TURN_OFF = SoundEventImpl.get("minecraft:block.copper_bulb.turn_off");
|
||||
|
||||
SoundEvent BLOCK_COPPER_BREAK = SoundEventImpl.get("minecraft:block.copper.break");
|
||||
|
||||
SoundEvent BLOCK_COPPER_STEP = SoundEventImpl.get("minecraft:block.copper.step");
|
||||
@ -617,6 +649,24 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent BLOCK_COPPER_FALL = SoundEventImpl.get("minecraft:block.copper.fall");
|
||||
|
||||
SoundEvent BLOCK_COPPER_DOOR_CLOSE = SoundEventImpl.get("minecraft:block.copper_door.close");
|
||||
|
||||
SoundEvent BLOCK_COPPER_DOOR_OPEN = SoundEventImpl.get("minecraft:block.copper_door.open");
|
||||
|
||||
SoundEvent BLOCK_COPPER_GRATE_BREAK = SoundEventImpl.get("minecraft:block.copper_grate.break");
|
||||
|
||||
SoundEvent BLOCK_COPPER_GRATE_STEP = SoundEventImpl.get("minecraft:block.copper_grate.step");
|
||||
|
||||
SoundEvent BLOCK_COPPER_GRATE_PLACE = SoundEventImpl.get("minecraft:block.copper_grate.place");
|
||||
|
||||
SoundEvent BLOCK_COPPER_GRATE_HIT = SoundEventImpl.get("minecraft:block.copper_grate.hit");
|
||||
|
||||
SoundEvent BLOCK_COPPER_GRATE_FALL = SoundEventImpl.get("minecraft:block.copper_grate.fall");
|
||||
|
||||
SoundEvent BLOCK_COPPER_TRAPDOOR_CLOSE = SoundEventImpl.get("minecraft:block.copper_trapdoor.close");
|
||||
|
||||
SoundEvent BLOCK_COPPER_TRAPDOOR_OPEN = SoundEventImpl.get("minecraft:block.copper_trapdoor.open");
|
||||
|
||||
SoundEvent BLOCK_CORAL_BLOCK_BREAK = SoundEventImpl.get("minecraft:block.coral_block.break");
|
||||
|
||||
SoundEvent BLOCK_CORAL_BLOCK_FALL = SoundEventImpl.get("minecraft:block.coral_block.fall");
|
||||
@ -637,6 +687,10 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent ENTITY_COW_STEP = SoundEventImpl.get("minecraft:entity.cow.step");
|
||||
|
||||
SoundEvent BLOCK_CRAFTER_CRAFT = SoundEventImpl.get("minecraft:block.crafter.craft");
|
||||
|
||||
SoundEvent BLOCK_CRAFTER_FAIL = SoundEventImpl.get("minecraft:block.crafter.fail");
|
||||
|
||||
SoundEvent ENTITY_CREEPER_DEATH = SoundEventImpl.get("minecraft:entity.creeper.death");
|
||||
|
||||
SoundEvent ENTITY_CREEPER_HURT = SoundEventImpl.get("minecraft:entity.creeper.hurt");
|
||||
@ -669,6 +723,10 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent BLOCK_DECORATED_POT_HIT = SoundEventImpl.get("minecraft:block.decorated_pot.hit");
|
||||
|
||||
SoundEvent BLOCK_DECORATED_POT_INSERT = SoundEventImpl.get("minecraft:block.decorated_pot.insert");
|
||||
|
||||
SoundEvent BLOCK_DECORATED_POT_INSERT_FAIL = SoundEventImpl.get("minecraft:block.decorated_pot.insert_fail");
|
||||
|
||||
SoundEvent BLOCK_DECORATED_POT_STEP = SoundEventImpl.get("minecraft:block.decorated_pot.step");
|
||||
|
||||
SoundEvent BLOCK_DECORATED_POT_PLACE = SoundEventImpl.get("minecraft:block.decorated_pot.place");
|
||||
@ -1223,6 +1281,28 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent BLOCK_BAMBOO_WOOD_HANGING_SIGN_PLACE = SoundEventImpl.get("minecraft:block.bamboo_wood_hanging_sign.place");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_BREAK = SoundEventImpl.get("minecraft:block.trial_spawner.break");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_STEP = SoundEventImpl.get("minecraft:block.trial_spawner.step");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_PLACE = SoundEventImpl.get("minecraft:block.trial_spawner.place");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_HIT = SoundEventImpl.get("minecraft:block.trial_spawner.hit");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_FALL = SoundEventImpl.get("minecraft:block.trial_spawner.fall");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_SPAWN_MOB = SoundEventImpl.get("minecraft:block.trial_spawner.spawn_mob");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_DETECT_PLAYER = SoundEventImpl.get("minecraft:block.trial_spawner.detect_player");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_AMBIENT = SoundEventImpl.get("minecraft:block.trial_spawner.ambient");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_OPEN_SHUTTER = SoundEventImpl.get("minecraft:block.trial_spawner.open_shutter");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_CLOSE_SHUTTER = SoundEventImpl.get("minecraft:block.trial_spawner.close_shutter");
|
||||
|
||||
SoundEvent BLOCK_TRIAL_SPAWNER_EJECT_ITEM = SoundEventImpl.get("minecraft:block.trial_spawner.eject_item");
|
||||
|
||||
SoundEvent ITEM_HOE_TILL = SoundEventImpl.get("minecraft:item.hoe.till");
|
||||
|
||||
SoundEvent ENTITY_HOGLIN_AMBIENT = SoundEventImpl.get("minecraft:entity.hoglin.ambient");
|
||||
@ -1891,6 +1971,8 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent ENTITY_PARROT_IMITATE_BLAZE = SoundEventImpl.get("minecraft:entity.parrot.imitate.blaze");
|
||||
|
||||
SoundEvent ENTITY_PARROT_IMITATE_BREEZE = SoundEventImpl.get("minecraft:entity.parrot.imitate.breeze");
|
||||
|
||||
SoundEvent ENTITY_PARROT_IMITATE_CREEPER = SoundEventImpl.get("minecraft:entity.parrot.imitate.creeper");
|
||||
|
||||
SoundEvent ENTITY_PARROT_IMITATE_DROWNED = SoundEventImpl.get("minecraft:entity.parrot.imitate.drowned");
|
||||
@ -2063,6 +2145,8 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent ENTITY_PLAYER_SWIM = SoundEventImpl.get("minecraft:entity.player.swim");
|
||||
|
||||
SoundEvent ENTITY_PLAYER_TELEPORT = SoundEventImpl.get("minecraft:entity.player.teleport");
|
||||
|
||||
SoundEvent ENTITY_POLAR_BEAR_AMBIENT = SoundEventImpl.get("minecraft:entity.polar_bear.ambient");
|
||||
|
||||
SoundEvent ENTITY_POLAR_BEAR_AMBIENT_BABY = SoundEventImpl.get("minecraft:entity.polar_bear.ambient_baby");
|
||||
@ -2521,6 +2605,18 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent ENTITY_SPLASH_POTION_THROW = SoundEventImpl.get("minecraft:entity.splash_potion.throw");
|
||||
|
||||
SoundEvent BLOCK_SPONGE_BREAK = SoundEventImpl.get("minecraft:block.sponge.break");
|
||||
|
||||
SoundEvent BLOCK_SPONGE_FALL = SoundEventImpl.get("minecraft:block.sponge.fall");
|
||||
|
||||
SoundEvent BLOCK_SPONGE_HIT = SoundEventImpl.get("minecraft:block.sponge.hit");
|
||||
|
||||
SoundEvent BLOCK_SPONGE_PLACE = SoundEventImpl.get("minecraft:block.sponge.place");
|
||||
|
||||
SoundEvent BLOCK_SPONGE_STEP = SoundEventImpl.get("minecraft:block.sponge.step");
|
||||
|
||||
SoundEvent BLOCK_SPONGE_ABSORB = SoundEventImpl.get("minecraft:block.sponge.absorb");
|
||||
|
||||
SoundEvent ITEM_SPYGLASS_USE = SoundEventImpl.get("minecraft:item.spyglass.use");
|
||||
|
||||
SoundEvent ITEM_SPYGLASS_STOP_USING = SoundEventImpl.get("minecraft:item.spyglass.stop_using");
|
||||
@ -2621,6 +2717,26 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent BLOCK_TUFF_FALL = SoundEventImpl.get("minecraft:block.tuff.fall");
|
||||
|
||||
SoundEvent BLOCK_TUFF_BRICKS_BREAK = SoundEventImpl.get("minecraft:block.tuff_bricks.break");
|
||||
|
||||
SoundEvent BLOCK_TUFF_BRICKS_FALL = SoundEventImpl.get("minecraft:block.tuff_bricks.fall");
|
||||
|
||||
SoundEvent BLOCK_TUFF_BRICKS_HIT = SoundEventImpl.get("minecraft:block.tuff_bricks.hit");
|
||||
|
||||
SoundEvent BLOCK_TUFF_BRICKS_PLACE = SoundEventImpl.get("minecraft:block.tuff_bricks.place");
|
||||
|
||||
SoundEvent BLOCK_TUFF_BRICKS_STEP = SoundEventImpl.get("minecraft:block.tuff_bricks.step");
|
||||
|
||||
SoundEvent BLOCK_POLISHED_TUFF_BREAK = SoundEventImpl.get("minecraft:block.polished_tuff.break");
|
||||
|
||||
SoundEvent BLOCK_POLISHED_TUFF_FALL = SoundEventImpl.get("minecraft:block.polished_tuff.fall");
|
||||
|
||||
SoundEvent BLOCK_POLISHED_TUFF_HIT = SoundEventImpl.get("minecraft:block.polished_tuff.hit");
|
||||
|
||||
SoundEvent BLOCK_POLISHED_TUFF_PLACE = SoundEventImpl.get("minecraft:block.polished_tuff.place");
|
||||
|
||||
SoundEvent BLOCK_POLISHED_TUFF_STEP = SoundEventImpl.get("minecraft:block.polished_tuff.step");
|
||||
|
||||
SoundEvent ENTITY_TURTLE_AMBIENT_LAND = SoundEventImpl.get("minecraft:entity.turtle.ambient_land");
|
||||
|
||||
SoundEvent ENTITY_TURTLE_DEATH = SoundEventImpl.get("minecraft:entity.turtle.death");
|
||||
@ -2791,6 +2907,8 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent ENTITY_WARDEN_TENDRIL_CLICKS = SoundEventImpl.get("minecraft:entity.warden.tendril_clicks");
|
||||
|
||||
SoundEvent BLOCK_HANGING_SIGN_WAXED_INTERACT_FAIL = SoundEventImpl.get("minecraft:block.hanging_sign.waxed_interact_fail");
|
||||
|
||||
SoundEvent BLOCK_SIGN_WAXED_INTERACT_FAIL = SoundEventImpl.get("minecraft:block.sign.waxed_interact_fail");
|
||||
|
||||
SoundEvent BLOCK_WATER_AMBIENT = SoundEventImpl.get("minecraft:block.water.ambient");
|
||||
@ -2809,6 +2927,18 @@ interface SoundEvents {
|
||||
|
||||
SoundEvent BLOCK_WET_GRASS_STEP = SoundEventImpl.get("minecraft:block.wet_grass.step");
|
||||
|
||||
SoundEvent BLOCK_WET_SPONGE_BREAK = SoundEventImpl.get("minecraft:block.wet_sponge.break");
|
||||
|
||||
SoundEvent BLOCK_WET_SPONGE_FALL = SoundEventImpl.get("minecraft:block.wet_sponge.fall");
|
||||
|
||||
SoundEvent BLOCK_WET_SPONGE_HIT = SoundEventImpl.get("minecraft:block.wet_sponge.hit");
|
||||
|
||||
SoundEvent BLOCK_WET_SPONGE_PLACE = SoundEventImpl.get("minecraft:block.wet_sponge.place");
|
||||
|
||||
SoundEvent BLOCK_WET_SPONGE_STEP = SoundEventImpl.get("minecraft:block.wet_sponge.step");
|
||||
|
||||
SoundEvent ENTITY_GENERIC_WIND_BURST = SoundEventImpl.get("minecraft:entity.generic.wind_burst");
|
||||
|
||||
SoundEvent ENTITY_WITCH_AMBIENT = SoundEventImpl.get("minecraft:entity.witch.ambient");
|
||||
|
||||
SoundEvent ENTITY_WITCH_CELEBRATE = SoundEventImpl.get("minecraft:entity.witch.celebrate");
|
||||
|
@ -23,8 +23,6 @@ import net.minestom.server.adventure.Localizable;
|
||||
import net.minestom.server.adventure.audience.Audiences;
|
||||
import net.minestom.server.attribute.Attribute;
|
||||
import net.minestom.server.collision.BoundingBox;
|
||||
import net.minestom.server.collision.CollisionUtils;
|
||||
import net.minestom.server.collision.PhysicsResult;
|
||||
import net.minestom.server.command.CommandSender;
|
||||
import net.minestom.server.coordinate.Point;
|
||||
import net.minestom.server.coordinate.Pos;
|
||||
@ -32,7 +30,6 @@ import net.minestom.server.coordinate.Vec;
|
||||
import net.minestom.server.effects.Effects;
|
||||
import net.minestom.server.entity.damage.DamageType;
|
||||
import net.minestom.server.entity.fakeplayer.FakePlayer;
|
||||
import net.minestom.server.entity.metadata.LivingEntityMeta;
|
||||
import net.minestom.server.entity.metadata.PlayerMeta;
|
||||
import net.minestom.server.entity.vehicle.PlayerVehicleInformation;
|
||||
import net.minestom.server.event.EventDispatcher;
|
||||
@ -1224,7 +1221,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
|
||||
* @param resourcePack the resource pack
|
||||
*/
|
||||
public void setResourcePack(@NotNull ResourcePack resourcePack) {
|
||||
sendPacket(new ResourcePackSendPacket(resourcePack));
|
||||
sendPacket(new ResourcePackPushPacket(resourcePack));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -12,6 +12,7 @@ public enum InventoryType {
|
||||
CHEST_5_ROW(45),
|
||||
CHEST_6_ROW(54),
|
||||
WINDOW_3X3(9),
|
||||
CRAFTER_3X3(9),
|
||||
ANVIL(3),
|
||||
BEACON(1),
|
||||
BLAST_FURNACE(3),
|
||||
|
@ -48,6 +48,7 @@ public final class NetworkBuffer {
|
||||
public static final Type<NBT> NBT = NetworkBufferTypes.NBT;
|
||||
public static final Type<Point> BLOCK_POSITION = NetworkBufferTypes.BLOCK_POSITION;
|
||||
public static final Type<Component> COMPONENT = NetworkBufferTypes.COMPONENT;
|
||||
public static final Type<Component> JSON_COMPONENT = NetworkBufferTypes.JSON_COMPONENT;
|
||||
public static final Type<UUID> UUID = NetworkBufferTypes.UUID;
|
||||
public static final Type<@Nullable ItemStack> ITEM = NetworkBufferTypes.ITEM;
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
package net.minestom.server.network;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
|
||||
import net.minestom.server.adventure.serializer.nbt.NbtComponentSerializer;
|
||||
import net.minestom.server.coordinate.Point;
|
||||
import net.minestom.server.coordinate.Vec;
|
||||
@ -301,6 +302,16 @@ final class NetworkBufferTypes {
|
||||
final NBT nbt = buffer.read(NBT);
|
||||
return NbtComponentSerializer.nbt().deserialize(nbt);
|
||||
});
|
||||
static final TypeImpl<Component> JSON_COMPONENT = new TypeImpl<>(Component.class,
|
||||
(buffer, value) -> {
|
||||
final String json = GsonComponentSerializer.gson().serialize(value);
|
||||
buffer.write(STRING, json);
|
||||
return -1;
|
||||
},
|
||||
buffer -> {
|
||||
final String json = buffer.read(STRING);
|
||||
return GsonComponentSerializer.gson().deserialize(json);
|
||||
});
|
||||
static final TypeImpl<UUID> UUID = new TypeImpl<>(UUID.class,
|
||||
(buffer, value) -> {
|
||||
buffer.write(LONG, value.getMostSignificantBits());
|
||||
|
@ -104,7 +104,7 @@ public sealed class ClientPacketsHandler permits ClientPacketsHandler.Status, Cl
|
||||
register(nextId(), ClientClickWindowButtonPacket::new);
|
||||
register(nextId(), ClientClickWindowPacket::new);
|
||||
register(nextId(), ClientCloseWindowPacket::new);
|
||||
nextId(); // window slot state
|
||||
register(nextId(), ClientWindowSlotStatePacket::new);
|
||||
register(nextId(), ClientPluginMessagePacket::new);
|
||||
register(nextId(), ClientEditBookPacket::new);
|
||||
register(nextId(), ClientQueryEntityNbtPacket::new);
|
||||
|
@ -5,13 +5,19 @@ import net.minestom.server.network.packet.client.ClientPacket;
|
||||
import net.minestom.server.resourcepack.ResourcePackStatus;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public record ClientResourcePackStatusPacket(@NotNull ResourcePackStatus status) implements ClientPacket {
|
||||
import java.util.UUID;
|
||||
|
||||
public record ClientResourcePackStatusPacket(
|
||||
@NotNull UUID id,
|
||||
@NotNull ResourcePackStatus status
|
||||
) implements ClientPacket {
|
||||
public ClientResourcePackStatusPacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.readEnum(ResourcePackStatus.class));
|
||||
this(reader.read(NetworkBuffer.UUID), reader.readEnum(ResourcePackStatus.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.write(NetworkBuffer.UUID, id);
|
||||
writer.writeEnum(ResourcePackStatus.class, status);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,23 @@
|
||||
package net.minestom.server.network.packet.client.play;
|
||||
|
||||
import net.minestom.server.network.NetworkBuffer;
|
||||
import net.minestom.server.network.packet.client.ClientPacket;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.minestom.server.network.NetworkBuffer.BOOLEAN;
|
||||
import static net.minestom.server.network.NetworkBuffer.VAR_INT;
|
||||
|
||||
// This is the packet sent when you toggle a slot in a crafter UI
|
||||
public record ClientWindowSlotStatePacket(int slot, int windowId, boolean newState) implements ClientPacket {
|
||||
|
||||
public ClientWindowSlotStatePacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.read(VAR_INT), reader.read(VAR_INT), reader.read(BOOLEAN));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.write(VAR_INT, slot);
|
||||
writer.write(VAR_INT, windowId);
|
||||
writer.write(BOOLEAN, newState);
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package net.minestom.server.network.packet.server.common;
|
||||
|
||||
import net.minestom.server.network.ConnectionState;
|
||||
import net.minestom.server.network.NetworkBuffer;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
import net.minestom.server.utils.PacketUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public record ResourcePackPopPacket(@Nullable UUID id) implements ServerPacket {
|
||||
|
||||
public ResourcePackPopPacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.readOptional(NetworkBuffer.UUID));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.writeOptional(NetworkBuffer.UUID, id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId(@NotNull ConnectionState state) {
|
||||
return switch (state) {
|
||||
case CONFIGURATION -> ServerPacketIdentifier.CONFIGURATION_RESOURCE_PACK_POP_PACKET;
|
||||
case PLAY -> ServerPacketIdentifier.RESOURCE_PACK_POP;
|
||||
default -> PacketUtils.invalidPacketState(getClass(), state, ConnectionState.CONFIGURATION, ConnectionState.PLAY);
|
||||
};
|
||||
}
|
||||
}
|
@ -13,44 +13,42 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
import static net.minestom.server.network.NetworkBuffer.*;
|
||||
|
||||
public record ResourcePackSendPacket(
|
||||
public record ResourcePackPushPacket(
|
||||
@NotNull UUID id,
|
||||
@NotNull String url,
|
||||
@NotNull String hash,
|
||||
boolean forced,
|
||||
@Nullable Component prompt
|
||||
) implements ComponentHoldingServerPacket {
|
||||
public ResourcePackSendPacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.read(STRING), reader.read(STRING), reader.read(BOOLEAN),
|
||||
reader.read(BOOLEAN) ? reader.read(COMPONENT) : null);
|
||||
public ResourcePackPushPacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.read(UUID), reader.read(STRING), reader.read(STRING),
|
||||
reader.read(BOOLEAN), reader.readOptional(COMPONENT));
|
||||
}
|
||||
|
||||
public ResourcePackSendPacket(@NotNull ResourcePack resourcePack) {
|
||||
this(resourcePack.getUrl(), resourcePack.getHash(), resourcePack.isForced(),
|
||||
resourcePack.getPrompt());
|
||||
public ResourcePackPushPacket(@NotNull ResourcePack resourcePack) {
|
||||
this(resourcePack.getId(), resourcePack.getUrl(), resourcePack.getHash(),
|
||||
resourcePack.isForced(), resourcePack.getPrompt());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.write(UUID, id);
|
||||
writer.write(STRING, url);
|
||||
writer.write(STRING, hash);
|
||||
writer.write(BOOLEAN, forced);
|
||||
if (prompt != null) {
|
||||
writer.write(BOOLEAN, true);
|
||||
writer.write(COMPONENT, prompt);
|
||||
} else {
|
||||
writer.write(BOOLEAN, false);
|
||||
}
|
||||
writer.writeOptional(COMPONENT, prompt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId(@NotNull ConnectionState state) {
|
||||
return switch (state) {
|
||||
// case CONFIGURATION -> ServerPacketIdentifier.CONFIGURATION_RESOURCE_PACK_SEND;
|
||||
// case PLAY -> ServerPacketIdentifier.RESOURCE_PACK_SEND;
|
||||
case CONFIGURATION -> ServerPacketIdentifier.CONFIGURATION_RESOURCE_PACK_PUSH_PACKET;
|
||||
case PLAY -> ServerPacketIdentifier.RESOURCE_PACK_PUSH;
|
||||
default -> PacketUtils.invalidPacketState(getClass(), state, ConnectionState.CONFIGURATION, ConnectionState.PLAY);
|
||||
};
|
||||
}
|
||||
@ -62,6 +60,6 @@ public record ResourcePackSendPacket(
|
||||
|
||||
@Override
|
||||
public @NotNull ServerPacket copyWithOperator(@NotNull UnaryOperator<Component> operator) {
|
||||
return new ResourcePackSendPacket(this.url, this.hash, this.forced, operator.apply(this.prompt));
|
||||
return new ResourcePackPushPacket(this.id, this.url, this.hash, this.forced, operator.apply(this.prompt));
|
||||
}
|
||||
}
|
@ -12,16 +12,16 @@ import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.function.UnaryOperator;
|
||||
|
||||
import static net.minestom.server.network.NetworkBuffer.COMPONENT;
|
||||
import static net.minestom.server.network.NetworkBuffer.JSON_COMPONENT;
|
||||
|
||||
public record LoginDisconnectPacket(@NotNull Component kickMessage) implements ComponentHoldingServerPacket {
|
||||
public LoginDisconnectPacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.read(COMPONENT));
|
||||
this(reader.read(JSON_COMPONENT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.write(COMPONENT, kickMessage);
|
||||
writer.write(JSON_COMPONENT, kickMessage);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -0,0 +1,32 @@
|
||||
package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.minestom.server.network.ConnectionState;
|
||||
import net.minestom.server.network.NetworkBuffer;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
import net.minestom.server.utils.PacketUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static net.minestom.server.network.NetworkBuffer.STRING;
|
||||
|
||||
public record ResetScorePacket(@NotNull String owner, @Nullable String objective) implements ServerPacket {
|
||||
|
||||
public ResetScorePacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.read(STRING), reader.readOptional(STRING));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.write(STRING, owner);
|
||||
writer.writeOptional(STRING, objective);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId(@NotNull ConnectionState state) {
|
||||
return switch (state) {
|
||||
case PLAY -> ServerPacketIdentifier.RESET_SCORE;
|
||||
default -> PacketUtils.invalidPacketState(getClass(), state, ConnectionState.PLAY);
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.minestom.server.network.ConnectionState;
|
||||
import net.minestom.server.network.NetworkBuffer;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
import net.minestom.server.utils.PacketUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.minestom.server.network.NetworkBuffer.*;
|
||||
|
||||
public record TickStatePacket(float tickRate, boolean isFrozen) implements ServerPacket {
|
||||
|
||||
public TickStatePacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.read(FLOAT), reader.read(BOOLEAN));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.write(FLOAT, tickRate);
|
||||
writer.write(BOOLEAN, isFrozen);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId(@NotNull ConnectionState state) {
|
||||
return switch (state) {
|
||||
case PLAY -> ServerPacketIdentifier.TICK_STATE;
|
||||
default -> PacketUtils.invalidPacketState(getClass(), state, ConnectionState.PLAY);
|
||||
};
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.minestom.server.network.ConnectionState;
|
||||
import net.minestom.server.network.NetworkBuffer;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
import net.minestom.server.utils.PacketUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static net.minestom.server.network.NetworkBuffer.VAR_INT;
|
||||
|
||||
public record TickStepPacket(int steps) implements ServerPacket {
|
||||
|
||||
public TickStepPacket(@NotNull NetworkBuffer reader) {
|
||||
this(reader.read(VAR_INT));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.write(VAR_INT, steps);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getId(@NotNull ConnectionState state) {
|
||||
return switch (state) {
|
||||
case PLAY -> ServerPacketIdentifier.TICK_STEP;
|
||||
default -> PacketUtils.invalidPacketState(getClass(), state, ConnectionState.PLAY);
|
||||
};
|
||||
}
|
||||
}
|
@ -1,38 +1,39 @@
|
||||
package net.minestom.server.network.packet.server.play;
|
||||
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.minestom.server.network.ConnectionState;
|
||||
import net.minestom.server.network.NetworkBuffer;
|
||||
import net.minestom.server.network.packet.server.ServerPacket;
|
||||
import net.minestom.server.network.packet.server.ServerPacketIdentifier;
|
||||
import net.minestom.server.utils.PacketUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import static net.minestom.server.network.NetworkBuffer.*;
|
||||
|
||||
public record UpdateScorePacket(@NotNull String entityName, byte action,
|
||||
@NotNull String objectiveName, int value) implements ServerPacket {
|
||||
// public record ClientboundSetScorePacket(String owner, String objectiveName,
|
||||
// int score, @Nullable Component display, @Nullable NumberFormat numberFormat) implements Packet<ClientGamePacketListener>
|
||||
//{
|
||||
|
||||
public record UpdateScorePacket(
|
||||
@NotNull String entityName,
|
||||
@NotNull String objectiveName,
|
||||
int score,
|
||||
@Nullable Component displayName,
|
||||
@Nullable NumberFormat numberFormat
|
||||
) implements ServerPacket {
|
||||
public UpdateScorePacket(@NotNull NetworkBuffer reader) {
|
||||
this(read(reader));
|
||||
}
|
||||
|
||||
private UpdateScorePacket(UpdateScorePacket packet) {
|
||||
this(packet.entityName, packet.action, packet.objectiveName, packet.value);
|
||||
}
|
||||
|
||||
private static UpdateScorePacket read(@NotNull NetworkBuffer reader) {
|
||||
var entityName = reader.read(STRING);
|
||||
var action = reader.read(BYTE);
|
||||
var objectiveName = reader.read(STRING);
|
||||
var value = action != 1 ? reader.read(VAR_INT) : 0;
|
||||
return new UpdateScorePacket(entityName, action, objectiveName, value);
|
||||
this(reader.read(STRING), reader.read(STRING), reader.read(VAR_INT),
|
||||
reader.readOptional(COMPONENT), new NumberFormat(reader));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
writer.write(STRING, entityName);
|
||||
writer.write(BYTE, action);
|
||||
writer.write(STRING, objectiveName);
|
||||
if (action != 1) writer.write(VAR_INT, value);
|
||||
writer.write(VAR_INT, score);
|
||||
writer.writeOptional(COMPONENT, displayName);
|
||||
writer.writeOptional(numberFormat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -42,4 +43,17 @@ public record UpdateScorePacket(@NotNull String entityName, byte action,
|
||||
default -> PacketUtils.invalidPacketState(getClass(), state, ConnectionState.PLAY);
|
||||
};
|
||||
}
|
||||
|
||||
public record NumberFormat() implements Writer {
|
||||
|
||||
public NumberFormat(@NotNull NetworkBuffer reader) {
|
||||
this();
|
||||
throw new UnsupportedOperationException("TODO");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(@NotNull NetworkBuffer writer) {
|
||||
throw new UnsupportedOperationException("TODO");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,17 +5,21 @@ import net.minestom.server.entity.Player;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* Represents a resource pack which can be sent with {@link Player#setResourcePack(ResourcePack)}.
|
||||
*/
|
||||
public class ResourcePack {
|
||||
|
||||
private final UUID id;
|
||||
private final String url;
|
||||
private final String hash;
|
||||
private final boolean forced;
|
||||
private final Component prompt;
|
||||
|
||||
private ResourcePack(@NotNull String url, @Nullable String hash, boolean forced, @Nullable Component prompt) {
|
||||
private ResourcePack(@NotNull UUID id, @NotNull String url, @Nullable String hash, boolean forced, @Nullable Component prompt) {
|
||||
this.id = id;
|
||||
this.url = url;
|
||||
// Optional, set to empty if null
|
||||
this.hash = hash == null ? "" : hash;
|
||||
@ -23,20 +27,24 @@ public class ResourcePack {
|
||||
this.prompt = prompt;
|
||||
}
|
||||
|
||||
public static ResourcePack optional(@NotNull String url, @Nullable String hash, @Nullable Component prompt) {
|
||||
return new ResourcePack(url, hash, false, prompt);
|
||||
public static ResourcePack optional(@NotNull UUID id, @NotNull String url, @Nullable String hash, @Nullable Component prompt) {
|
||||
return new ResourcePack(id, url, hash, false, prompt);
|
||||
}
|
||||
|
||||
public static ResourcePack optional(@NotNull String url, @Nullable String hash) {
|
||||
return optional(url, hash, null);
|
||||
public static ResourcePack optional(@NotNull UUID id, @NotNull String url, @Nullable String hash) {
|
||||
return optional(id, url, hash, null);
|
||||
}
|
||||
|
||||
public static ResourcePack forced(@NotNull String url, @Nullable String hash, @Nullable Component prompt) {
|
||||
return new ResourcePack(url, hash, true, prompt);
|
||||
public static ResourcePack forced(@NotNull UUID id, @NotNull String url, @Nullable String hash, @Nullable Component prompt) {
|
||||
return new ResourcePack(id, url, hash, true, prompt);
|
||||
}
|
||||
|
||||
public static ResourcePack forced(@NotNull String url, @Nullable String hash) {
|
||||
return forced(url, hash, null);
|
||||
public static ResourcePack forced(@NotNull UUID id, @NotNull String url, @Nullable String hash) {
|
||||
return forced(id, url, hash, null);
|
||||
}
|
||||
|
||||
public @NotNull UUID getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,4 +75,5 @@ public class ResourcePack {
|
||||
public @Nullable Component getPrompt() {
|
||||
return prompt;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user