diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 20c5aea98..d42d44336 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,11 +3,11 @@ metadata.format.version = "1.1" [versions] # Important dependencies -data = "1.19.4-rv2" +data = "1.20-rv2" adventure = "4.12.0" kotlin = "1.7.22" hydrazine = "1.7.2" -hephaistos = "2.5.3" +hephaistos = "2.6.0" jetbrainsAnnotations = "23.0.0" slf4j = "2.0.7" diff --git a/src/autogenerated/java/net/minestom/server/instance/block/Blocks.java b/src/autogenerated/java/net/minestom/server/instance/block/Blocks.java index 2d33dfaf2..de0c092cc 100644 --- a/src/autogenerated/java/net/minestom/server/instance/block/Blocks.java +++ b/src/autogenerated/java/net/minestom/server/instance/block/Blocks.java @@ -81,6 +81,8 @@ interface Blocks { Block GRAVEL = BlockImpl.get("minecraft:gravel"); + Block SUSPICIOUS_GRAVEL = BlockImpl.get("minecraft:suspicious_gravel"); + Block GOLD_ORE = BlockImpl.get("minecraft:gold_ore"); Block DEEPSLATE_GOLD_ORE = BlockImpl.get("minecraft:deepslate_gold_ore"); @@ -1201,6 +1203,10 @@ interface Blocks { Block TORCHFLOWER_CROP = BlockImpl.get("minecraft:torchflower_crop"); + Block PITCHER_CROP = BlockImpl.get("minecraft:pitcher_crop"); + + Block PITCHER_PLANT = BlockImpl.get("minecraft:pitcher_plant"); + Block BEETROOTS = BlockImpl.get("minecraft:beetroots"); Block DIRT_PATH = BlockImpl.get("minecraft:dirt_path"); @@ -1363,6 +1369,8 @@ interface Blocks { Block TURTLE_EGG = BlockImpl.get("minecraft:turtle_egg"); + Block SNIFFER_EGG = BlockImpl.get("minecraft:sniffer_egg"); + Block DEAD_TUBE_CORAL_BLOCK = BlockImpl.get("minecraft:dead_tube_coral_block"); Block DEAD_BRAIN_CORAL_BLOCK = BlockImpl.get("minecraft:dead_brain_coral_block"); @@ -1825,6 +1833,8 @@ interface Blocks { Block SCULK_SENSOR = BlockImpl.get("minecraft:sculk_sensor"); + Block CALIBRATED_SCULK_SENSOR = BlockImpl.get("minecraft:calibrated_sculk_sensor"); + Block SCULK = BlockImpl.get("minecraft:sculk"); Block SCULK_VEIN = BlockImpl.get("minecraft:sculk_vein"); diff --git a/src/autogenerated/java/net/minestom/server/item/Materials.java b/src/autogenerated/java/net/minestom/server/item/Materials.java index 393c87555..1641db010 100644 --- a/src/autogenerated/java/net/minestom/server/item/Materials.java +++ b/src/autogenerated/java/net/minestom/server/item/Materials.java @@ -97,6 +97,8 @@ interface Materials { Material SUSPICIOUS_SAND = MaterialImpl.get("minecraft:suspicious_sand"); + Material SUSPICIOUS_GRAVEL = MaterialImpl.get("minecraft:suspicious_gravel"); + Material RED_SAND = MaterialImpl.get("minecraft:red_sand"); Material GRAVEL = MaterialImpl.get("minecraft:gravel"); @@ -423,6 +425,8 @@ interface Materials { Material TORCHFLOWER = MaterialImpl.get("minecraft:torchflower"); + Material PITCHER_PLANT = MaterialImpl.get("minecraft:pitcher_plant"); + Material SPORE_BLOSSOM = MaterialImpl.get("minecraft:spore_blossom"); Material BROWN_MUSHROOM = MaterialImpl.get("minecraft:brown_mushroom"); @@ -1133,6 +1137,8 @@ interface Materials { Material TURTLE_EGG = MaterialImpl.get("minecraft:turtle_egg"); + Material SNIFFER_EGG = MaterialImpl.get("minecraft:sniffer_egg"); + Material DEAD_TUBE_CORAL_BLOCK = MaterialImpl.get("minecraft:dead_tube_coral_block"); Material DEAD_BRAIN_CORAL_BLOCK = MaterialImpl.get("minecraft:dead_brain_coral_block"); @@ -1307,6 +1313,8 @@ interface Materials { Material SCULK_SENSOR = MaterialImpl.get("minecraft:sculk_sensor"); + Material CALIBRATED_SCULK_SENSOR = MaterialImpl.get("minecraft:calibrated_sculk_sensor"); + Material TRIPWIRE_HOOK = MaterialImpl.get("minecraft:tripwire_hook"); Material TRAPPED_CHEST = MaterialImpl.get("minecraft:trapped_chest"); @@ -2211,6 +2219,8 @@ interface Materials { Material TORCHFLOWER_SEEDS = MaterialImpl.get("minecraft:torchflower_seeds"); + Material PITCHER_POD = MaterialImpl.get("minecraft:pitcher_pod"); + Material BEETROOT = MaterialImpl.get("minecraft:beetroot"); Material BEETROOT_SEEDS = MaterialImpl.get("minecraft:beetroot_seeds"); @@ -2265,6 +2275,8 @@ interface Materials { Material MUSIC_DISC_OTHERSIDE = MaterialImpl.get("minecraft:music_disc_otherside"); + Material MUSIC_DISC_RELIC = MaterialImpl.get("minecraft:music_disc_relic"); + Material MUSIC_DISC_5 = MaterialImpl.get("minecraft:music_disc_5"); Material MUSIC_DISC_PIGSTEP = MaterialImpl.get("minecraft:music_disc_pigstep"); @@ -2453,11 +2465,53 @@ interface Materials { Material SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE = MaterialImpl.get("minecraft:spire_armor_trim_smithing_template"); - Material POTTERY_SHARD_ARCHER = MaterialImpl.get("minecraft:pottery_shard_archer"); + Material WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE = MaterialImpl.get("minecraft:wayfinder_armor_trim_smithing_template"); - Material POTTERY_SHARD_PRIZE = MaterialImpl.get("minecraft:pottery_shard_prize"); + Material SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE = MaterialImpl.get("minecraft:shaper_armor_trim_smithing_template"); - Material POTTERY_SHARD_ARMS_UP = MaterialImpl.get("minecraft:pottery_shard_arms_up"); + Material SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE = MaterialImpl.get("minecraft:silence_armor_trim_smithing_template"); - Material POTTERY_SHARD_SKULL = MaterialImpl.get("minecraft:pottery_shard_skull"); + Material RAISER_ARMOR_TRIM_SMITHING_TEMPLATE = MaterialImpl.get("minecraft:raiser_armor_trim_smithing_template"); + + Material HOST_ARMOR_TRIM_SMITHING_TEMPLATE = MaterialImpl.get("minecraft:host_armor_trim_smithing_template"); + + Material ANGLER_POTTERY_SHERD = MaterialImpl.get("minecraft:angler_pottery_sherd"); + + Material ARCHER_POTTERY_SHERD = MaterialImpl.get("minecraft:archer_pottery_sherd"); + + Material ARMS_UP_POTTERY_SHERD = MaterialImpl.get("minecraft:arms_up_pottery_sherd"); + + Material BLADE_POTTERY_SHERD = MaterialImpl.get("minecraft:blade_pottery_sherd"); + + Material BREWER_POTTERY_SHERD = MaterialImpl.get("minecraft:brewer_pottery_sherd"); + + Material BURN_POTTERY_SHERD = MaterialImpl.get("minecraft:burn_pottery_sherd"); + + Material DANGER_POTTERY_SHERD = MaterialImpl.get("minecraft:danger_pottery_sherd"); + + Material EXPLORER_POTTERY_SHERD = MaterialImpl.get("minecraft:explorer_pottery_sherd"); + + Material FRIEND_POTTERY_SHERD = MaterialImpl.get("minecraft:friend_pottery_sherd"); + + Material HEART_POTTERY_SHERD = MaterialImpl.get("minecraft:heart_pottery_sherd"); + + Material HEARTBREAK_POTTERY_SHERD = MaterialImpl.get("minecraft:heartbreak_pottery_sherd"); + + Material HOWL_POTTERY_SHERD = MaterialImpl.get("minecraft:howl_pottery_sherd"); + + Material MINER_POTTERY_SHERD = MaterialImpl.get("minecraft:miner_pottery_sherd"); + + Material MOURNER_POTTERY_SHERD = MaterialImpl.get("minecraft:mourner_pottery_sherd"); + + Material PLENTY_POTTERY_SHERD = MaterialImpl.get("minecraft:plenty_pottery_sherd"); + + Material PRIZE_POTTERY_SHERD = MaterialImpl.get("minecraft:prize_pottery_sherd"); + + Material SHEAF_POTTERY_SHERD = MaterialImpl.get("minecraft:sheaf_pottery_sherd"); + + Material SHELTER_POTTERY_SHERD = MaterialImpl.get("minecraft:shelter_pottery_sherd"); + + Material SKULL_POTTERY_SHERD = MaterialImpl.get("minecraft:skull_pottery_sherd"); + + Material SNORT_POTTERY_SHERD = MaterialImpl.get("minecraft:snort_pottery_sherd"); } diff --git a/src/autogenerated/java/net/minestom/server/particle/Particles.java b/src/autogenerated/java/net/minestom/server/particle/Particles.java index 6ed9a37db..49657e36f 100644 --- a/src/autogenerated/java/net/minestom/server/particle/Particles.java +++ b/src/autogenerated/java/net/minestom/server/particle/Particles.java @@ -63,11 +63,7 @@ interface Particles { Particle FLAME = ParticleImpl.get("minecraft:flame"); - Particle DRIPPING_CHERRY_LEAVES = ParticleImpl.get("minecraft:dripping_cherry_leaves"); - - Particle FALLING_CHERRY_LEAVES = ParticleImpl.get("minecraft:falling_cherry_leaves"); - - Particle LANDING_CHERRY_LEAVES = ParticleImpl.get("minecraft:landing_cherry_leaves"); + Particle CHERRY_LEAVES = ParticleImpl.get("minecraft:cherry_leaves"); Particle SCULK_SOUL = ParticleImpl.get("minecraft:sculk_soul"); @@ -196,4 +192,6 @@ interface Particles { Particle SCRAPE = ParticleImpl.get("minecraft:scrape"); Particle SHRIEK = ParticleImpl.get("minecraft:shriek"); + + Particle EGG_CRACK = ParticleImpl.get("minecraft:egg_crack"); } diff --git a/src/autogenerated/java/net/minestom/server/sound/SoundEvents.java b/src/autogenerated/java/net/minestom/server/sound/SoundEvents.java index 22725cde9..c4e23657e 100644 --- a/src/autogenerated/java/net/minestom/server/sound/SoundEvents.java +++ b/src/autogenerated/java/net/minestom/server/sound/SoundEvents.java @@ -73,6 +73,8 @@ interface SoundEvents { SoundEvent BLOCK_AMETHYST_BLOCK_PLACE = SoundEventImpl.get("minecraft:block.amethyst_block.place"); + SoundEvent BLOCK_AMETHYST_BLOCK_RESONATE = SoundEventImpl.get("minecraft:block.amethyst_block.resonate"); + SoundEvent BLOCK_AMETHYST_BLOCK_STEP = SoundEventImpl.get("minecraft:block.amethyst_block.step"); SoundEvent BLOCK_AMETHYST_CLUSTER_BREAK = SoundEventImpl.get("minecraft:block.amethyst_cluster.break"); @@ -337,9 +339,15 @@ interface SoundEvents { SoundEvent BLOCK_BREWING_STAND_BREW = SoundEventImpl.get("minecraft:block.brewing_stand.brew"); - SoundEvent ITEM_BRUSH_BRUSHING = SoundEventImpl.get("minecraft:item.brush.brushing"); + SoundEvent ITEM_BRUSH_BRUSHING_GENERIC = SoundEventImpl.get("minecraft:item.brush.brushing.generic"); - SoundEvent ITEM_BRUSH_BRUSH_SAND_COMPLETED = SoundEventImpl.get("minecraft:item.brush.brush_sand_completed"); + SoundEvent ITEM_BRUSH_BRUSHING_SAND = SoundEventImpl.get("minecraft:item.brush.brushing.sand"); + + SoundEvent ITEM_BRUSH_BRUSHING_GRAVEL = SoundEventImpl.get("minecraft:item.brush.brushing.gravel"); + + SoundEvent ITEM_BRUSH_BRUSHING_SAND_COMPLETE = SoundEventImpl.get("minecraft:item.brush.brushing.sand.complete"); + + SoundEvent ITEM_BRUSH_BRUSHING_GRAVEL_COMPLETE = SoundEventImpl.get("minecraft:item.brush.brushing.gravel.complete"); SoundEvent BLOCK_BUBBLE_COLUMN_BUBBLE_POP = SoundEventImpl.get("minecraft:block.bubble_column.bubble_pop"); @@ -961,6 +969,16 @@ interface SoundEvents { SoundEvent BLOCK_SUSPICIOUS_SAND_FALL = SoundEventImpl.get("minecraft:block.suspicious_sand.fall"); + SoundEvent BLOCK_SUSPICIOUS_GRAVEL_BREAK = SoundEventImpl.get("minecraft:block.suspicious_gravel.break"); + + SoundEvent BLOCK_SUSPICIOUS_GRAVEL_STEP = SoundEventImpl.get("minecraft:block.suspicious_gravel.step"); + + SoundEvent BLOCK_SUSPICIOUS_GRAVEL_PLACE = SoundEventImpl.get("minecraft:block.suspicious_gravel.place"); + + SoundEvent BLOCK_SUSPICIOUS_GRAVEL_HIT = SoundEventImpl.get("minecraft:block.suspicious_gravel.hit"); + + SoundEvent BLOCK_SUSPICIOUS_GRAVEL_FALL = SoundEventImpl.get("minecraft:block.suspicious_gravel.fall"); + SoundEvent BLOCK_FROGLIGHT_BREAK = SoundEventImpl.get("minecraft:block.froglight.break"); SoundEvent BLOCK_FROGLIGHT_FALL = SoundEventImpl.get("minecraft:block.froglight.fall"); @@ -1589,6 +1607,8 @@ interface SoundEvents { SoundEvent MUSIC_DISC_OTHERSIDE = SoundEventImpl.get("minecraft:music_disc.otherside"); + SoundEvent MUSIC_DISC_RELIC = SoundEventImpl.get("minecraft:music_disc.relic"); + SoundEvent MUSIC_DRAGON = SoundEventImpl.get("minecraft:music.dragon"); SoundEvent MUSIC_END = SoundEventImpl.get("minecraft:music.end"); @@ -1613,7 +1633,7 @@ interface SoundEvents { SoundEvent MUSIC_OVERWORLD_SWAMP = SoundEventImpl.get("minecraft:music.overworld.swamp"); - SoundEvent MUSIC_OVERWORLD_JUNGLE_AND_FOREST = SoundEventImpl.get("minecraft:music.overworld.jungle_and_forest"); + SoundEvent MUSIC_OVERWORLD_FOREST = SoundEventImpl.get("minecraft:music.overworld.forest"); SoundEvent MUSIC_OVERWORLD_OLD_GROWTH_TAIGA = SoundEventImpl.get("minecraft:music.overworld.old_growth_taiga"); @@ -1633,6 +1653,18 @@ interface SoundEvents { SoundEvent MUSIC_NETHER_WARPED_FOREST = SoundEventImpl.get("minecraft:music.nether.warped_forest"); + SoundEvent MUSIC_OVERWORLD_FLOWER_FOREST = SoundEventImpl.get("minecraft:music.overworld.flower_forest"); + + SoundEvent MUSIC_OVERWORLD_DESERT = SoundEventImpl.get("minecraft:music.overworld.desert"); + + SoundEvent MUSIC_OVERWORLD_BADLANDS = SoundEventImpl.get("minecraft:music.overworld.badlands"); + + SoundEvent MUSIC_OVERWORLD_JUNGLE = SoundEventImpl.get("minecraft:music.overworld.jungle"); + + SoundEvent MUSIC_OVERWORLD_SPARSE_JUNGLE = SoundEventImpl.get("minecraft:music.overworld.sparse_jungle"); + + SoundEvent MUSIC_OVERWORLD_BAMBOO_JUNGLE = SoundEventImpl.get("minecraft:music.overworld.bamboo_jungle"); + SoundEvent MUSIC_UNDER_WATER = SoundEventImpl.get("minecraft:music.under_water"); SoundEvent BLOCK_NETHER_BRICKS_BREAK = SoundEventImpl.get("minecraft:block.nether_bricks.break"); @@ -2449,6 +2481,12 @@ interface SoundEvents { SoundEvent ENTITY_SNIFFER_HAPPY = SoundEventImpl.get("minecraft:entity.sniffer.happy"); + SoundEvent BLOCK_SNIFFER_EGG_PLOP = SoundEventImpl.get("minecraft:block.sniffer_egg.plop"); + + SoundEvent BLOCK_SNIFFER_EGG_CRACK = SoundEventImpl.get("minecraft:block.sniffer_egg.crack"); + + SoundEvent BLOCK_SNIFFER_EGG_HATCH = SoundEventImpl.get("minecraft:block.sniffer_egg.hatch"); + SoundEvent ENTITY_SNOWBALL_THROW = SoundEventImpl.get("minecraft:entity.snowball.throw"); SoundEvent BLOCK_SNOW_BREAK = SoundEventImpl.get("minecraft:block.snow.break"); @@ -2753,6 +2791,8 @@ interface SoundEvents { SoundEvent ENTITY_WARDEN_TENDRIL_CLICKS = SoundEventImpl.get("minecraft:entity.warden.tendril_clicks"); + SoundEvent BLOCK_SIGN_WAXED_INTERACT_FAIL = SoundEventImpl.get("minecraft:block.sign.waxed_interact_fail"); + SoundEvent BLOCK_WATER_AMBIENT = SoundEventImpl.get("minecraft:block.water.ambient"); SoundEvent WEATHER_RAIN = SoundEventImpl.get("minecraft:weather.rain"); diff --git a/src/main/java/net/minestom/server/MinecraftServer.java b/src/main/java/net/minestom/server/MinecraftServer.java index e014a66a6..20aafd266 100644 --- a/src/main/java/net/minestom/server/MinecraftServer.java +++ b/src/main/java/net/minestom/server/MinecraftServer.java @@ -45,8 +45,8 @@ public final class MinecraftServer { public static final ComponentLogger LOGGER = ComponentLogger.logger(MinecraftServer.class); - public static final String VERSION_NAME = "1.19.4"; - public static final int PROTOCOL_VERSION = 762; + public static final String VERSION_NAME = "1.20.1"; + public static final int PROTOCOL_VERSION = 763; // Threads public static final String THREAD_NAME_BENCHMARK = "Ms-Benchmark"; diff --git a/src/main/java/net/minestom/server/entity/Player.java b/src/main/java/net/minestom/server/entity/Player.java index 300009551..cc44bf52c 100644 --- a/src/main/java/net/minestom/server/entity/Player.java +++ b/src/main/java/net/minestom/server/entity/Player.java @@ -158,6 +158,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable, private final PlayerSettings settings; private float exp; private int level; + private int portalCooldown = 0; protected PlayerInventory inventory; private Inventory openInventory; @@ -281,7 +282,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable, final JoinGamePacket joinGamePacket = new JoinGamePacket(getEntityId(), false, gameMode, null, List.of(dimensionType.getName().asString()), NBT.Compound(registry), dimensionType.toString(), dimensionType.getName().asString(), 0, 0, MinecraftServer.getChunkViewDistance(), MinecraftServer.getChunkViewDistance(), - false, true, false, levelFlat, deathLocation); + false, true, false, levelFlat, deathLocation, portalCooldown); sendPacket(joinGamePacket); // Server brand name @@ -449,7 +450,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable, // #buildDeathScreenText can return null, check here if (deathText != null) { - sendPacket(new DeathCombatEventPacket(getEntityId(), -1, deathText)); + sendPacket(new DeathCombatEventPacket(getEntityId(), deathText)); } // #buildDeathMessage can return null, check here @@ -477,7 +478,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable, refreshHealth(); sendPacket(new RespawnPacket(getDimensionType().toString(), getDimensionType().getName().asString(), - 0, gameMode, gameMode, false, levelFlat, true, deathLocation)); + 0, gameMode, gameMode, false, levelFlat, true, deathLocation, portalCooldown)); PlayerRespawnEvent respawnEvent = new PlayerRespawnEvent(this); EventDispatcher.call(respawnEvent); @@ -1009,7 +1010,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable, final PlayerInfoUpdatePacket addPlayerPacket = getAddPlayerToList(); RespawnPacket respawnPacket = new RespawnPacket(getDimensionType().toString(), getDimensionType().getName().asString(), - 0, gameMode, gameMode, false, levelFlat, true, deathLocation); + 0, gameMode, gameMode, false, levelFlat, true, deathLocation, portalCooldown); sendPacket(removePlayerPacket); sendPacket(destroyEntitiesPacket); @@ -1249,6 +1250,14 @@ public class Player extends LivingEntity implements CommandSender, Localizable, sendPacket(new SetExperiencePacket(exp, level, 0)); } + public int getPortalCooldown() { + return portalCooldown; + } + + public void setPortalCooldown(int portalCooldown) { + this.portalCooldown = portalCooldown; + } + /** * Gets the player connection. *
@@ -1389,7 +1398,7 @@ public class Player extends LivingEntity implements CommandSender, Localizable,
"The dimension needs to be different than the current one!");
this.dimensionType = dimensionType;
sendPacket(new RespawnPacket(dimensionType.toString(), getDimensionType().getName().asString(),
- 0, gameMode, gameMode, false, levelFlat, true, deathLocation));
+ 0, gameMode, gameMode, false, levelFlat, true, deathLocation, portalCooldown));
refreshClientStateAfterRespawn();
}
diff --git a/src/main/java/net/minestom/server/instance/DynamicChunk.java b/src/main/java/net/minestom/server/instance/DynamicChunk.java
index a9db7d7cd..300a13299 100644
--- a/src/main/java/net/minestom/server/instance/DynamicChunk.java
+++ b/src/main/java/net/minestom/server/instance/DynamicChunk.java
@@ -246,10 +246,11 @@ public class DynamicChunk extends Chunk {
emptyBlockMask.set(index);
}
}
- return new LightData(true,
+ return new LightData(
skyMask, blockMask,
emptySkyMask, emptyBlockMask,
- skyLights, blockLights);
+ skyLights, blockLights
+ );
}
@Override
diff --git a/src/main/java/net/minestom/server/instance/LightingChunk.java b/src/main/java/net/minestom/server/instance/LightingChunk.java
index deaf68aa0..cd515d3fa 100644
--- a/src/main/java/net/minestom/server/instance/LightingChunk.java
+++ b/src/main/java/net/minestom/server/instance/LightingChunk.java
@@ -195,10 +195,11 @@ public class LightingChunk extends DynamicChunk {
sendNeighbours = false;
}
- return new LightData(true,
+ return new LightData(
skyMask, blockMask,
emptySkyMask, emptyBlockMask,
- skyLights, blockLights);
+ skyLights, blockLights
+ );
}
private static final Set