diff --git a/src/main/java/cn/nukkit/GameVersion.java b/src/main/java/cn/nukkit/GameVersion.java index 5e21b13237d..f32f77da301 100644 --- a/src/main/java/cn/nukkit/GameVersion.java +++ b/src/main/java/cn/nukkit/GameVersion.java @@ -48,6 +48,7 @@ public enum GameVersion { V1_20_0(589, "1.20.0", "1.20"), V1_20_10(594, "1.20.10"), V1_20_30(618, "1.20.30"), + V1_20_40(622, "1.20.40"), ; private static GameVersion FEATURE_VERSION = ENABLE_BLOCK_STATE_PERSISTENCE ? GameVersion.V1_18_0 : GameVersion.V1_12_0; diff --git a/src/main/java/cn/nukkit/Player.java b/src/main/java/cn/nukkit/Player.java index a9f78b2ef6e..2106157c151 100644 --- a/src/main/java/cn/nukkit/Player.java +++ b/src/main/java/cn/nukkit/Player.java @@ -4197,9 +4197,7 @@ public void close(TextContainer message, String reason) { public void close(TextContainer message, String reason, boolean notify) { if (this.connected && !this.closed) { if (notify && !reason.isEmpty()) { - DisconnectPacket pk = new DisconnectPacket(); - pk.message = reason; - this.dataPacket(pk); + sendDisconnectScreen(reason); } this.connected = false; @@ -6267,4 +6265,19 @@ protected void setFreezeEffectStrength(float freezeEffectStrength) { movementSpeedAttribute.replaceModifier(AttributeModifiers.freezeEffect(freezeEffectStrength)); } + + public void sendDisconnectScreen(@Nullable String message) { + sendDisconnectScreen(DisconnectPacket.REASON_UNKNOWN, message); + } + + public void sendDisconnectScreen(int reason, @Nullable String message) { + DisconnectPacket packet = new DisconnectPacket(); + packet.reason = reason; + if (message != null) { + packet.message = message; + } else { + packet.hideDisconnectionScreen = true; + } + dataPacket(packet); + } } diff --git a/src/main/java/cn/nukkit/block/BlockID.java b/src/main/java/cn/nukkit/block/BlockID.java index 2ec9d3748f0..447093ad431 100644 --- a/src/main/java/cn/nukkit/block/BlockID.java +++ b/src/main/java/cn/nukkit/block/BlockID.java @@ -7,6 +7,7 @@ public interface BlockID { int GRASS = 2; int DIRT = 3; int COBBLESTONE = 4; + int OAK_PLANKS = 5; //TODO: 1.20.50: flattening int PLANKS = 5; int SAPLING = 6; int BEDROCK = 7; @@ -612,6 +613,8 @@ public interface BlockID { int POINTED_DRIPSTONE = 563; int COPPER_ORE = 566; int LIGHTNING_ROD = 567; + int CRAFTER = 568; + int DRIPSTONE_BLOCK = 572; int DIRT_WITH_ROOTS = 573; int HANGING_ROOTS = 574; @@ -877,7 +880,12 @@ public interface BlockID { int DEAD_BUBBLE_CORAL = 842; int DEAD_FIRE_CORAL = 843; int DEAD_HORN_CORAL = 844; - + int GRANITE = 845; + int POLISHED_GRANITE = 846; + int DIORITE = 847; + int POLISHED_DIORITE = 848; + int ANDESITE = 849; + int POLISHED_ANDESITE = 850; int SNIFFER_EGG = 851; int ORANGE_CARPET = 852; int MAGENTA_CARPET = 853; @@ -987,7 +995,68 @@ public interface BlockID { int GREEN_TERRACOTTA = 991; int RED_TERRACOTTA = 992; int BLACK_TERRACOTTA = 993; + int SPRUCE_PLANKS = 994; + int BIRCH_PLANKS = 995; + int JUNGLE_PLANKS = 996; + int ACACIA_PLANKS = 997; + int DARK_OAK_PLANKS = 998; + int TUFF_SLAB = 999; + int TUFF_DOUBLE_SLAB = 1000; + int TUFF_STAIRS = 1001; + int TUFF_WALL = 1002; + int POLISHED_TUFF = 1003; + int POLISHED_TUFF_SLAB = 1004; + int POLISHED_TUFF_DOUBLE_SLAB = 1005; + int POLISHED_TUFF_STAIRS = 1006; + int POLISHED_TUFF_WALL = 1007; + int CHISELED_TUFF = 1008; + int TUFF_BRICKS = 1009; + int TUFF_BRICK_SLAB = 1010; + int TUFF_BRICK_DOUBLE_SLAB = 1011; + int TUFF_BRICK_STAIRS = 1012; + int TUFF_BRICK_WALL = 1013; + int CHISELED_TUFF_BRICKS = 1014; + int CHISELED_COPPER = 1015; + int EXPOSED_CHISELED_COPPER = 1016; + int WEATHERED_CHISELED_COPPER = 1017; + int OXIDIZED_CHISELED_COPPER = 1018; + int WAXED_CHISELED_COPPER = 1019; + int WAXED_EXPOSED_CHISELED_COPPER = 1020; + int WAXED_OXIDIZED_CHISELED_COPPER = 1021; + int WAXED_WEATHERED_CHISELED_COPPER = 1022; + int COPPER_GRATE = 1023; + int EXPOSED_COPPER_GRATE = 1024; + int WEATHERED_COPPER_GRATE = 1025; + int OXIDIZED_COPPER_GRATE = 1026; + int WAXED_COPPER_GRATE = 1027; + int WAXED_EXPOSED_COPPER_GRATE = 1028; + int WAXED_WEATHERED_COPPER_GRATE = 1029; + int WAXED_OXIDIZED_COPPER_GRATE = 1030; + int COPPER_BULB = 1031; + int EXPOSED_COPPER_BULB = 1032; + int WEATHERED_COPPER_BULB = 1033; + int OXIDIZED_COPPER_BULB = 1034; + int WAXED_COPPER_BULB = 1035; + int WAXED_EXPOSED_COPPER_BULB = 1036; + int WAXED_WEATHERED_COPPER_BULB = 1037; + int WAXED_OXIDIZED_COPPER_BULB = 1038; + int COPPER_DOOR = 1039; + int EXPOSED_COPPER_DOOR = 1040; + int WEATHERED_COPPER_DOOR = 1041; + int OXIDIZED_COPPER_DOOR = 1042; + int WAXED_COPPER_DOOR = 1043; + int WAXED_EXPOSED_COPPER_DOOR = 1044; + int WAXED_WEATHERED_COPPER_DOOR = 1045; + int WAXED_OXIDIZED_COPPER_DOOR = 1046; + int COPPER_TRAPDOOR = 1047; + int EXPOSED_COPPER_TRAPDOOR = 1048; + int WEATHERED_COPPER_TRAPDOOR = 1049; + int OXIDIZED_COPPER_TRAPDOOR = 1050; + int WAXED_COPPER_TRAPDOOR = 1051; + int WAXED_EXPOSED_COPPER_TRAPDOOR = 1052; + int WAXED_WEATHERED_COPPER_TRAPDOOR = 1053; + int WAXED_OXIDIZED_COPPER_TRAPDOOR = 1054; - int UNDEFINED = 994; + int UNDEFINED = 1055; } diff --git a/src/main/java/cn/nukkit/block/BlockIceFrosted.java b/src/main/java/cn/nukkit/block/BlockIceFrosted.java index beb5b1208bc..c39d0931988 100644 --- a/src/main/java/cn/nukkit/block/BlockIceFrosted.java +++ b/src/main/java/cn/nukkit/block/BlockIceFrosted.java @@ -117,7 +117,7 @@ private void slightlyMelt(boolean propagate) { if (!propagate) { return; } - for (BlockFace face : BlockFace.values()) { + for (BlockFace face : BlockFace.getValues()) { Block block = getSide(face); if (block instanceof BlockIceFrosted) { ((BlockIceFrosted) block).slightlyMelt(false); @@ -127,7 +127,7 @@ private void slightlyMelt(boolean propagate) { private int countNeighbors() { int result = 0; - for (BlockFace face : BlockFace.values()) { + for (BlockFace face : BlockFace.getValues()) { if (getSide(face).getId() == FROSTED_ICE && ++result >= 4) { return result; } diff --git a/src/main/java/cn/nukkit/block/BlockSnowLayer.java b/src/main/java/cn/nukkit/block/BlockSnowLayer.java index 1bcac3df0d5..a40f021033a 100644 --- a/src/main/java/cn/nukkit/block/BlockSnowLayer.java +++ b/src/main/java/cn/nukkit/block/BlockSnowLayer.java @@ -219,6 +219,14 @@ public boolean onActivate(Item item, BlockFace face, Player player) { return false; } + @Override + public boolean canPassThrough() { + if (V1_20_30.isAvailable()) { + return (this.getDamage() & HEIGHT_MASK) == 0; + } + return (this.getDamage() & HEIGHT_MASK) < 3; + } + @Override public boolean breaksWhenMoved() { return true; diff --git a/src/main/java/cn/nukkit/entity/data/EntityFlagID.java b/src/main/java/cn/nukkit/entity/data/EntityFlagID.java index 0dd4dbb44b8..82fd1c3034a 100644 --- a/src/main/java/cn/nukkit/entity/data/EntityFlagID.java +++ b/src/main/java/cn/nukkit/entity/data/EntityFlagID.java @@ -140,8 +140,19 @@ public interface EntityFlagID { * @since 1.20.10 */ int DATA_FLAG_CRAWLING = 114; - - int DATA_FLAG_UNDEFINED = 115; + /** + * @since 1.20.40 + */ + int DATA_FLAG_TIMER_FLAG_1 = 115; + /** + * @since 1.20.40 + */ + int DATA_FLAG_TIMER_FLAG_2 = 116; + /** + * @since 1.20.40 + */ + int DATA_FLAG_TIMER_FLAG_3 = 117; + int DATA_FLAG_UNDEFINED = 118; long NUKKIT_FLAG_VARIANT_BLOCK = 1L << 1; diff --git a/src/main/java/cn/nukkit/item/ItemBlockID.java b/src/main/java/cn/nukkit/item/ItemBlockID.java index cf7c93ea715..42ebc87a582 100644 --- a/src/main/java/cn/nukkit/item/ItemBlockID.java +++ b/src/main/java/cn/nukkit/item/ItemBlockID.java @@ -9,6 +9,7 @@ public interface ItemBlockID { int GRASS = 2; int DIRT = 3; int COBBLESTONE = 4; + int OAK_PLANKS = 5; int PLANKS = 5; int SAPLING = 6; int BEDROCK = 7; @@ -614,6 +615,8 @@ public interface ItemBlockID { int POINTED_DRIPSTONE = 0xff - BlockID.POINTED_DRIPSTONE; int COPPER_ORE = 0xff - BlockID.COPPER_ORE; int LIGHTNING_ROD = 0xff - BlockID.LIGHTNING_ROD; + int CRAFTER = 0xff - BlockID.CRAFTER; + int DRIPSTONE_BLOCK = 0xff - BlockID.DRIPSTONE_BLOCK; int DIRT_WITH_ROOTS = 0xff - BlockID.DIRT_WITH_ROOTS; int HANGING_ROOTS = 0xff - BlockID.HANGING_ROOTS; @@ -879,7 +882,12 @@ public interface ItemBlockID { int DEAD_BUBBLE_CORAL = 0xff - BlockID.DEAD_BUBBLE_CORAL; int DEAD_FIRE_CORAL = 0xff - BlockID.DEAD_FIRE_CORAL; int DEAD_HORN_CORAL = 0xff - BlockID.DEAD_HORN_CORAL; - + int GRANITE = 0xff - BlockID.GRANITE; + int POLISHED_GRANITE = 0xff - BlockID.POLISHED_GRANITE; + int DIORITE = 0xff - BlockID.DIORITE; + int POLISHED_DIORITE = 0xff - BlockID.POLISHED_DIORITE; + int ANDESITE = 0xff - BlockID.ANDESITE; + int POLISHED_ANDESITE = 0xff - BlockID.POLISHED_ANDESITE; int SNIFFER_EGG = 0xff - BlockID.SNIFFER_EGG; int ORANGE_CARPET = 0xff - BlockID.ORANGE_CARPET; int MAGENTA_CARPET = 0xff - BlockID.MAGENTA_CARPET; @@ -989,6 +997,67 @@ public interface ItemBlockID { int GREEN_TERRACOTTA = 0xff - BlockID.GREEN_TERRACOTTA; int RED_TERRACOTTA = 0xff - BlockID.RED_TERRACOTTA; int BLACK_TERRACOTTA = 0xff - BlockID.BLACK_TERRACOTTA; + int SPRUCE_PLANKS = 0xff - BlockID.SPRUCE_PLANKS; + int BIRCH_PLANKS = 0xff - BlockID.BIRCH_PLANKS; + int JUNGLE_PLANKS = 0xff - BlockID.JUNGLE_PLANKS; + int ACACIA_PLANKS = 0xff - BlockID.ACACIA_PLANKS; + int DARK_OAK_PLANKS = 0xff - BlockID.DARK_OAK_PLANKS; + int TUFF_SLAB = 0xff - BlockID.TUFF_SLAB; + int TUFF_DOUBLE_SLAB = 0xff - BlockID.TUFF_DOUBLE_SLAB; + int TUFF_STAIRS = 0xff - BlockID.TUFF_STAIRS; + int TUFF_WALL = 0xff - BlockID.TUFF_WALL; + int POLISHED_TUFF = 0xff - BlockID.POLISHED_TUFF; + int POLISHED_TUFF_SLAB = 0xff - BlockID.POLISHED_TUFF_SLAB; + int POLISHED_TUFF_DOUBLE_SLAB = 0xff - BlockID.POLISHED_TUFF_DOUBLE_SLAB; + int POLISHED_TUFF_STAIRS = 0xff - BlockID.POLISHED_TUFF_STAIRS; + int POLISHED_TUFF_WALL = 0xff - BlockID.POLISHED_TUFF_WALL; + int CHISELED_TUFF = 0xff - BlockID.CHISELED_TUFF; + int TUFF_BRICKS = 0xff - BlockID.TUFF_BRICKS; + int TUFF_BRICK_SLAB = 0xff - BlockID.TUFF_BRICK_SLAB; + int TUFF_BRICK_DOUBLE_SLAB = 0xff - BlockID.TUFF_BRICK_DOUBLE_SLAB; + int TUFF_BRICK_STAIRS = 0xff - BlockID.TUFF_BRICK_STAIRS; + int TUFF_BRICK_WALL = 0xff - BlockID.TUFF_BRICK_WALL; + int CHISELED_TUFF_BRICKS = 0xff - BlockID.CHISELED_TUFF_BRICKS; + int CHISELED_COPPER = 0xff - BlockID.CHISELED_COPPER; + int EXPOSED_CHISELED_COPPER = 0xff - BlockID.EXPOSED_CHISELED_COPPER; + int WEATHERED_CHISELED_COPPER = 0xff - BlockID.WEATHERED_CHISELED_COPPER; + int OXIDIZED_CHISELED_COPPER = 0xff - BlockID.OXIDIZED_CHISELED_COPPER; + int WAXED_CHISELED_COPPER = 0xff - BlockID.WAXED_CHISELED_COPPER; + int WAXED_EXPOSED_CHISELED_COPPER = 0xff - BlockID.WAXED_EXPOSED_CHISELED_COPPER; + int WAXED_OXIDIZED_CHISELED_COPPER = 0xff - BlockID.WAXED_OXIDIZED_CHISELED_COPPER; + int WAXED_WEATHERED_CHISELED_COPPER = 0xff - BlockID.WAXED_WEATHERED_CHISELED_COPPER; + int COPPER_GRATE = 0xff - BlockID.COPPER_GRATE; + int EXPOSED_COPPER_GRATE = 0xff - BlockID.EXPOSED_COPPER_GRATE; + int WEATHERED_COPPER_GRATE = 0xff - BlockID.WEATHERED_COPPER_GRATE; + int OXIDIZED_COPPER_GRATE = 0xff - BlockID.OXIDIZED_COPPER_GRATE; + int WAXED_COPPER_GRATE = 0xff - BlockID.WAXED_COPPER_GRATE; + int WAXED_EXPOSED_COPPER_GRATE = 0xff - BlockID.WAXED_EXPOSED_COPPER_GRATE; + int WAXED_WEATHERED_COPPER_GRATE = 0xff - BlockID.WAXED_WEATHERED_COPPER_GRATE; + int WAXED_OXIDIZED_COPPER_GRATE = 0xff - BlockID.WAXED_OXIDIZED_COPPER_GRATE; + int COPPER_BULB = 0xff - BlockID.COPPER_BULB; + int EXPOSED_COPPER_BULB = 0xff - BlockID.EXPOSED_COPPER_BULB; + int WEATHERED_COPPER_BULB = 0xff - BlockID.WEATHERED_COPPER_BULB; + int OXIDIZED_COPPER_BULB = 0xff - BlockID.OXIDIZED_COPPER_BULB; + int WAXED_COPPER_BULB = 0xff - BlockID.WAXED_COPPER_BULB; + int WAXED_EXPOSED_COPPER_BULB = 0xff - BlockID.WAXED_EXPOSED_COPPER_BULB; + int WAXED_WEATHERED_COPPER_BULB = 0xff - BlockID.WAXED_WEATHERED_COPPER_BULB; + int WAXED_OXIDIZED_COPPER_BULB = 0xff - BlockID.WAXED_OXIDIZED_COPPER_BULB; + int COPPER_DOOR = 0xff - BlockID.COPPER_DOOR; + int EXPOSED_COPPER_DOOR = 0xff - BlockID.EXPOSED_COPPER_DOOR; + int WEATHERED_COPPER_DOOR = 0xff - BlockID.WEATHERED_COPPER_DOOR; + int OXIDIZED_COPPER_DOOR = 0xff - BlockID.OXIDIZED_COPPER_DOOR; + int WAXED_COPPER_DOOR = 0xff - BlockID.WAXED_COPPER_DOOR; + int WAXED_EXPOSED_COPPER_DOOR = 0xff - BlockID.WAXED_EXPOSED_COPPER_DOOR; + int WAXED_WEATHERED_COPPER_DOOR = 0xff - BlockID.WAXED_WEATHERED_COPPER_DOOR; + int WAXED_OXIDIZED_COPPER_DOOR = 0xff - BlockID.WAXED_OXIDIZED_COPPER_DOOR; + int COPPER_TRAPDOOR = 0xff - BlockID.COPPER_TRAPDOOR; + int EXPOSED_COPPER_TRAPDOOR = 0xff - BlockID.EXPOSED_COPPER_TRAPDOOR; + int WEATHERED_COPPER_TRAPDOOR = 0xff - BlockID.WEATHERED_COPPER_TRAPDOOR; + int OXIDIZED_COPPER_TRAPDOOR = 0xff - BlockID.OXIDIZED_COPPER_TRAPDOOR; + int WAXED_COPPER_TRAPDOOR = 0xff - BlockID.WAXED_COPPER_TRAPDOOR; + int WAXED_EXPOSED_COPPER_TRAPDOOR = 0xff - BlockID.WAXED_EXPOSED_COPPER_TRAPDOOR; + int WAXED_WEATHERED_COPPER_TRAPDOOR = 0xff - BlockID.WAXED_WEATHERED_COPPER_TRAPDOOR; + int WAXED_OXIDIZED_COPPER_TRAPDOOR = 0xff - BlockID.WAXED_OXIDIZED_COPPER_TRAPDOOR; int UNDEFINED = 0xff - BlockID.UNDEFINED; diff --git a/src/main/java/cn/nukkit/item/ItemBrush.java b/src/main/java/cn/nukkit/item/ItemBrush.java new file mode 100644 index 00000000000..7f6bb080378 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemBrush.java @@ -0,0 +1,30 @@ +package cn.nukkit.item; + +public class ItemBrush extends ItemTool { + public ItemBrush() { + this(0, 1); + } + + public ItemBrush(Integer meta) { + this(meta, 1); + } + + public ItemBrush(Integer meta, int count) { + super(BRUSH, meta, count, "Brush"); + } + + @Override + public int getMaxDurability() { + return ItemTool.DURABILITY_BRUSH; + } + + @Override + public boolean noDamageOnAttack() { + return true; + } + + @Override + public boolean noDamageOnBreak() { + return true; + } +} diff --git a/src/main/java/cn/nukkit/item/ItemBucket.java b/src/main/java/cn/nukkit/item/ItemBucket.java index 496a61830fb..9aeb523f32b 100644 --- a/src/main/java/cn/nukkit/item/ItemBucket.java +++ b/src/main/java/cn/nukkit/item/ItemBucket.java @@ -311,30 +311,30 @@ public boolean onActivate(Level level, Player player, Block block, Block target, switch (meta) { case COD_BUCKET: - Entity cod = new EntityCod(block.getChunk(), Entity.getDefaultNBT(block)); + Entity cod = new EntityCod(block.getChunk(), Entity.getDefaultNBT(block.add(0.5, 0, 0.5))); cod.spawnToAll(); break; case SALMON_BUCKET: - Entity salmon = new EntitySalmon(block.getChunk(), Entity.getDefaultNBT(block)); + Entity salmon = new EntitySalmon(block.getChunk(), Entity.getDefaultNBT(block.add(0.5, 0, 0.5))); salmon.spawnToAll(); break; case TROPICAL_FISH_BUCKET: - Entity tropicalFish = new EntityTropicalFish(block.getChunk(), Entity.getDefaultNBT(block)); + Entity tropicalFish = new EntityTropicalFish(block.getChunk(), Entity.getDefaultNBT(block.add(0.5, 0, 0.5))); tropicalFish.spawnToAll(); break; case PUFFERFISH_BUCKET: - Entity pufferfish = new EntityPufferfish(block.getChunk(), Entity.getDefaultNBT(block)); + Entity pufferfish = new EntityPufferfish(block.getChunk(), Entity.getDefaultNBT(block.add(0.5, 0, 0.5))); pufferfish.spawnToAll(); break; case AXOLOTL_BUCKET: - Entity axolotl = new EntityAxolotl(block.getChunk(), Entity.getDefaultNBT(block)); + Entity axolotl = new EntityAxolotl(block.getChunk(), Entity.getDefaultNBT(block.add(0.5, 0, 0.5))); axolotl.spawnToAll(); break; case TADPOLE_BUCKET: if (!V1_19_0.isAvailable()) { break; } - Entity tadpole = new EntityTadpole(block.getChunk(), Entity.getDefaultNBT(block)); + Entity tadpole = new EntityTadpole(block.getChunk(), Entity.getDefaultNBT(block.add(0.5, 0, 0.5))); tadpole.spawnToAll(); break; } diff --git a/src/main/java/cn/nukkit/item/ItemFirework.java b/src/main/java/cn/nukkit/item/ItemFirework.java index f38d43890fe..114b03246df 100644 --- a/src/main/java/cn/nukkit/item/ItemFirework.java +++ b/src/main/java/cn/nukkit/item/ItemFirework.java @@ -229,10 +229,10 @@ public enum ExplosionType { CREEPER_SHAPED, BURST; - private static final ExplosionType[] $VALUES0 = values(); + private static final ExplosionType[] VALUES = values(); - public static ExplosionType[] values0() { - return $VALUES0; + public static ExplosionType[] getValues() { + return VALUES; } } } diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdAngler.java b/src/main/java/cn/nukkit/item/ItemPotterySherdAngler.java new file mode 100644 index 00000000000..f8047579b92 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdAngler.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdAngler extends Item { + public ItemPotterySherdAngler() { + this(0, 1); + } + + public ItemPotterySherdAngler(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdAngler(Integer meta, int count) { + super(ANGLER_POTTERY_SHERD, meta, count, "Angler Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdArcher.java b/src/main/java/cn/nukkit/item/ItemPotterySherdArcher.java new file mode 100644 index 00000000000..5ef69ce6682 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdArcher.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdArcher extends Item { + public ItemPotterySherdArcher() { + this(0, 1); + } + + public ItemPotterySherdArcher(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdArcher(Integer meta, int count) { + super(ARCHER_POTTERY_SHERD, meta, count, "Archer Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdArmsUp.java b/src/main/java/cn/nukkit/item/ItemPotterySherdArmsUp.java new file mode 100644 index 00000000000..e2428697541 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdArmsUp.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdArmsUp extends Item { + public ItemPotterySherdArmsUp() { + this(0, 1); + } + + public ItemPotterySherdArmsUp(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdArmsUp(Integer meta, int count) { + super(ARMS_UP_POTTERY_SHERD, meta, count, "Arms Up Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdBlade.java b/src/main/java/cn/nukkit/item/ItemPotterySherdBlade.java new file mode 100644 index 00000000000..54f3ef8c4dc --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdBlade.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdBlade extends Item { + public ItemPotterySherdBlade() { + this(0, 1); + } + + public ItemPotterySherdBlade(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdBlade(Integer meta, int count) { + super(BLADE_POTTERY_SHERD, meta, count, "Blade Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdBrewer.java b/src/main/java/cn/nukkit/item/ItemPotterySherdBrewer.java new file mode 100644 index 00000000000..39e4735c0e0 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdBrewer.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdBrewer extends Item { + public ItemPotterySherdBrewer() { + this(0, 1); + } + + public ItemPotterySherdBrewer(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdBrewer(Integer meta, int count) { + super(BREWER_POTTERY_SHERD, meta, count, "Brewer Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdBurn.java b/src/main/java/cn/nukkit/item/ItemPotterySherdBurn.java new file mode 100644 index 00000000000..261a64755c0 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdBurn.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdBurn extends Item { + public ItemPotterySherdBurn() { + this(0, 1); + } + + public ItemPotterySherdBurn(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdBurn(Integer meta, int count) { + super(BURN_POTTERY_SHERD, meta, count, "Burn Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdDanger.java b/src/main/java/cn/nukkit/item/ItemPotterySherdDanger.java new file mode 100644 index 00000000000..309b024cff2 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdDanger.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdDanger extends Item { + public ItemPotterySherdDanger() { + this(0, 1); + } + + public ItemPotterySherdDanger(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdDanger(Integer meta, int count) { + super(DANGER_POTTERY_SHERD, meta, count, "Danger Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdExplorer.java b/src/main/java/cn/nukkit/item/ItemPotterySherdExplorer.java new file mode 100644 index 00000000000..95702df5665 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdExplorer.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdExplorer extends Item { + public ItemPotterySherdExplorer() { + this(0, 1); + } + + public ItemPotterySherdExplorer(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdExplorer(Integer meta, int count) { + super(EXPLORER_POTTERY_SHERD, meta, count, "Explorer Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdFriend.java b/src/main/java/cn/nukkit/item/ItemPotterySherdFriend.java new file mode 100644 index 00000000000..ca222986ce9 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdFriend.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdFriend extends Item { + public ItemPotterySherdFriend() { + this(0, 1); + } + + public ItemPotterySherdFriend(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdFriend(Integer meta, int count) { + super(FRIEND_POTTERY_SHERD, meta, count, "Friend Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdHeart.java b/src/main/java/cn/nukkit/item/ItemPotterySherdHeart.java new file mode 100644 index 00000000000..9098b9e2388 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdHeart.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdHeart extends Item { + public ItemPotterySherdHeart() { + this(0, 1); + } + + public ItemPotterySherdHeart(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdHeart(Integer meta, int count) { + super(HEART_POTTERY_SHERD, meta, count, "Heart Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdHeartbreak.java b/src/main/java/cn/nukkit/item/ItemPotterySherdHeartbreak.java new file mode 100644 index 00000000000..70e8f494985 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdHeartbreak.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdHeartbreak extends Item { + public ItemPotterySherdHeartbreak() { + this(0, 1); + } + + public ItemPotterySherdHeartbreak(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdHeartbreak(Integer meta, int count) { + super(HEARTBREAK_POTTERY_SHERD, meta, count, "Heartbreak Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdHowl.java b/src/main/java/cn/nukkit/item/ItemPotterySherdHowl.java new file mode 100644 index 00000000000..e92b11a4a0d --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdHowl.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdHowl extends Item { + public ItemPotterySherdHowl() { + this(0, 1); + } + + public ItemPotterySherdHowl(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdHowl(Integer meta, int count) { + super(HOWL_POTTERY_SHERD, meta, count, "Howl Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdMiner.java b/src/main/java/cn/nukkit/item/ItemPotterySherdMiner.java new file mode 100644 index 00000000000..2747f2d8c06 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdMiner.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdMiner extends Item { + public ItemPotterySherdMiner() { + this(0, 1); + } + + public ItemPotterySherdMiner(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdMiner(Integer meta, int count) { + super(MINER_POTTERY_SHERD, meta, count, "Miner Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdMourner.java b/src/main/java/cn/nukkit/item/ItemPotterySherdMourner.java new file mode 100644 index 00000000000..e5edd679070 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdMourner.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdMourner extends Item { + public ItemPotterySherdMourner() { + this(0, 1); + } + + public ItemPotterySherdMourner(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdMourner(Integer meta, int count) { + super(MOURNER_POTTERY_SHERD, meta, count, "Mourner Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdPlenty.java b/src/main/java/cn/nukkit/item/ItemPotterySherdPlenty.java new file mode 100644 index 00000000000..56260171b02 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdPlenty.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdPlenty extends Item { + public ItemPotterySherdPlenty() { + this(0, 1); + } + + public ItemPotterySherdPlenty(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdPlenty(Integer meta, int count) { + super(PLENTY_POTTERY_SHERD, meta, count, "Plenty Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdPrize.java b/src/main/java/cn/nukkit/item/ItemPotterySherdPrize.java new file mode 100644 index 00000000000..027c7fb26be --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdPrize.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdPrize extends Item { + public ItemPotterySherdPrize() { + this(0, 1); + } + + public ItemPotterySherdPrize(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdPrize(Integer meta, int count) { + super(PRIZE_POTTERY_SHERD, meta, count, "Prize Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdSheaf.java b/src/main/java/cn/nukkit/item/ItemPotterySherdSheaf.java new file mode 100644 index 00000000000..daa30ef24e6 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdSheaf.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdSheaf extends Item { + public ItemPotterySherdSheaf() { + this(0, 1); + } + + public ItemPotterySherdSheaf(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdSheaf(Integer meta, int count) { + super(SHEAF_POTTERY_SHERD, meta, count, "Sheaf Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdShelter.java b/src/main/java/cn/nukkit/item/ItemPotterySherdShelter.java new file mode 100644 index 00000000000..ae04cb9d65a --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdShelter.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdShelter extends Item { + public ItemPotterySherdShelter() { + this(0, 1); + } + + public ItemPotterySherdShelter(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdShelter(Integer meta, int count) { + super(SHELTER_POTTERY_SHERD, meta, count, "Shelter Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdSkull.java b/src/main/java/cn/nukkit/item/ItemPotterySherdSkull.java new file mode 100644 index 00000000000..13cc6e151f0 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdSkull.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdSkull extends Item { + public ItemPotterySherdSkull() { + this(0, 1); + } + + public ItemPotterySherdSkull(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdSkull(Integer meta, int count) { + super(SKULL_POTTERY_SHERD, meta, count, "Skull Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemPotterySherdSnort.java b/src/main/java/cn/nukkit/item/ItemPotterySherdSnort.java new file mode 100644 index 00000000000..f5db8ffcca5 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemPotterySherdSnort.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemPotterySherdSnort extends Item { + public ItemPotterySherdSnort() { + this(0, 1); + } + + public ItemPotterySherdSnort(Integer meta) { + this(meta, 1); + } + + public ItemPotterySherdSnort(Integer meta, int count) { + super(SNORT_POTTERY_SHERD, meta, count, "Snort Pottery Sherd"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemRuntimeID.java b/src/main/java/cn/nukkit/item/ItemRuntimeID.java index 38084a3cad6..20255cc0e81 100644 --- a/src/main/java/cn/nukkit/item/ItemRuntimeID.java +++ b/src/main/java/cn/nukkit/item/ItemRuntimeID.java @@ -9,6 +9,48 @@ public interface ItemRuntimeID { int COPPER_INGOT = BASE_INTERNAL_ID + 1; int GLOW_BERRIES = BASE_INTERNAL_ID + 2; int CHEST_BOAT = BASE_INTERNAL_ID + 3; + int BAMBOO_SIGN = BASE_INTERNAL_ID + 4; + int TORCHFLOWER_SEEDS = BASE_INTERNAL_ID + 5; + int ARCHER_POTTERY_SHERD = BASE_INTERNAL_ID + 6; + int ARMS_UP_POTTERY_SHERD = BASE_INTERNAL_ID + 7; + int PRIZE_POTTERY_SHERD = BASE_INTERNAL_ID + 8; + int SKULL_POTTERY_SHERD = BASE_INTERNAL_ID + 9; + int BRUSH = BASE_INTERNAL_ID + 10; + int CHERRY_SIGN = BASE_INTERNAL_ID + 11; + int NETHERITE_UPGRADE_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 12; + int SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 13; + int DUNE_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 14; + int COAST_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 15; + int WILD_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 16; + int WARD_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 17; + int EYE_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 18; + int VEX_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 19; + int TIDE_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 20; + int SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 21; + int RIB_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 22; + int SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 23; + int ANGLER_POTTERY_SHERD = BASE_INTERNAL_ID + 24; + int BLADE_POTTERY_SHERD = BASE_INTERNAL_ID + 25; + int BREWER_POTTERY_SHERD = BASE_INTERNAL_ID + 26; + int BURN_POTTERY_SHERD = BASE_INTERNAL_ID + 27; + int DANGER_POTTERY_SHERD = BASE_INTERNAL_ID + 28; + int EXPLORER_POTTERY_SHERD = BASE_INTERNAL_ID + 29; + int FRIEND_POTTERY_SHERD = BASE_INTERNAL_ID + 30; + int HEART_POTTERY_SHERD = BASE_INTERNAL_ID + 31; + int HEARTBREAK_POTTERY_SHERD = BASE_INTERNAL_ID + 32; + int HOWL_POTTERY_SHERD = BASE_INTERNAL_ID + 33; + int MINER_POTTERY_SHERD = BASE_INTERNAL_ID + 34; + int MOURNER_POTTERY_SHERD = BASE_INTERNAL_ID + 35; + int PLENTY_POTTERY_SHERD = BASE_INTERNAL_ID + 36; + int SHEAF_POTTERY_SHERD = BASE_INTERNAL_ID + 37; + int SHELTER_POTTERY_SHERD = BASE_INTERNAL_ID + 38; + int SNORT_POTTERY_SHERD = BASE_INTERNAL_ID + 39; + int SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 40; + int WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 41; + int RAISER_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 42; + int SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 43; + int HOST_ARMOR_TRIM_SMITHING_TEMPLATE = BASE_INTERNAL_ID + 44; + int PITCHER_POD = BASE_INTERNAL_ID + 45; - int CUSTOM_ITEM = BASE_INTERNAL_ID + 4; + int CUSTOM_ITEM = BASE_INTERNAL_ID + 46; } diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimCoast.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimCoast.java new file mode 100644 index 00000000000..825541331e5 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimCoast.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimCoast extends Item { + public ItemSmithingTemplateArmorTrimCoast() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimCoast(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimCoast(Integer meta, int count) { + super(COAST_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimDune.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimDune.java new file mode 100644 index 00000000000..f6064409810 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimDune.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimDune extends Item { + public ItemSmithingTemplateArmorTrimDune() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimDune(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimDune(Integer meta, int count) { + super(DUNE_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimEye.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimEye.java new file mode 100644 index 00000000000..196c2860ae2 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimEye.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimEye extends Item { + public ItemSmithingTemplateArmorTrimEye() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimEye(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimEye(Integer meta, int count) { + super(EYE_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimHost.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimHost.java new file mode 100644 index 00000000000..7499d4ed3ac --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimHost.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimHost extends Item { + public ItemSmithingTemplateArmorTrimHost() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimHost(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimHost(Integer meta, int count) { + super(HOST_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimRaiser.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimRaiser.java new file mode 100644 index 00000000000..f253cd42e14 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimRaiser.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimRaiser extends Item { + public ItemSmithingTemplateArmorTrimRaiser() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimRaiser(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimRaiser(Integer meta, int count) { + super(RAISER_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimRib.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimRib.java new file mode 100644 index 00000000000..ea10ab8ef83 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimRib.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimRib extends Item { + public ItemSmithingTemplateArmorTrimRib() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimRib(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimRib(Integer meta, int count) { + super(RIB_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSentry.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSentry.java new file mode 100644 index 00000000000..fbbe9c1633d --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSentry.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimSentry extends Item { + public ItemSmithingTemplateArmorTrimSentry() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimSentry(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimSentry(Integer meta, int count) { + super(SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimShaper.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimShaper.java new file mode 100644 index 00000000000..3860e0a214e --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimShaper.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimShaper extends Item { + public ItemSmithingTemplateArmorTrimShaper() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimShaper(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimShaper(Integer meta, int count) { + super(SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSilence.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSilence.java new file mode 100644 index 00000000000..2aa58cd929f --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSilence.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimSilence extends Item { + public ItemSmithingTemplateArmorTrimSilence() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimSilence(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimSilence(Integer meta, int count) { + super(SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSnout.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSnout.java new file mode 100644 index 00000000000..980dcaed10e --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSnout.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimSnout extends Item { + public ItemSmithingTemplateArmorTrimSnout() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimSnout(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimSnout(Integer meta, int count) { + super(SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSpire.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSpire.java new file mode 100644 index 00000000000..f5c2952b2eb --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimSpire.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimSpire extends Item { + public ItemSmithingTemplateArmorTrimSpire() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimSpire(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimSpire(Integer meta, int count) { + super(SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimTide.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimTide.java new file mode 100644 index 00000000000..5e8276b4e88 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimTide.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimTide extends Item { + public ItemSmithingTemplateArmorTrimTide() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimTide(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimTide(Integer meta, int count) { + super(TIDE_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimVex.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimVex.java new file mode 100644 index 00000000000..035c4ff6c78 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimVex.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimVex extends Item { + public ItemSmithingTemplateArmorTrimVex() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimVex(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimVex(Integer meta, int count) { + super(VEX_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWard.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWard.java new file mode 100644 index 00000000000..d32de2c19b2 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWard.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimWard extends Item { + public ItemSmithingTemplateArmorTrimWard() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimWard(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimWard(Integer meta, int count) { + super(WARD_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWayfinder.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWayfinder.java new file mode 100644 index 00000000000..15dd9b09099 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWayfinder.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimWayfinder extends Item { + public ItemSmithingTemplateArmorTrimWayfinder() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimWayfinder(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimWayfinder(Integer meta, int count) { + super(WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWild.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWild.java new file mode 100644 index 00000000000..ece18e465c0 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateArmorTrimWild.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateArmorTrimWild extends Item { + public ItemSmithingTemplateArmorTrimWild() { + this(0, 1); + } + + public ItemSmithingTemplateArmorTrimWild(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateArmorTrimWild(Integer meta, int count) { + super(WILD_ARMOR_TRIM_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemSmithingTemplateUpgradeNetherite.java b/src/main/java/cn/nukkit/item/ItemSmithingTemplateUpgradeNetherite.java new file mode 100644 index 00000000000..c67bf84eda1 --- /dev/null +++ b/src/main/java/cn/nukkit/item/ItemSmithingTemplateUpgradeNetherite.java @@ -0,0 +1,15 @@ +package cn.nukkit.item; + +public class ItemSmithingTemplateUpgradeNetherite extends Item { + public ItemSmithingTemplateUpgradeNetherite() { + this(0, 1); + } + + public ItemSmithingTemplateUpgradeNetherite(Integer meta) { + this(meta, 1); + } + + public ItemSmithingTemplateUpgradeNetherite(Integer meta, int count) { + super(NETHERITE_UPGRADE_SMITHING_TEMPLATE, meta, count, "Smithing Template"); + } +} diff --git a/src/main/java/cn/nukkit/item/ItemTool.java b/src/main/java/cn/nukkit/item/ItemTool.java index e40b64bae78..e6401990203 100644 --- a/src/main/java/cn/nukkit/item/ItemTool.java +++ b/src/main/java/cn/nukkit/item/ItemTool.java @@ -43,6 +43,7 @@ public abstract class ItemTool extends Item implements ItemDurable { public static final int DURABILITY_SHIELD = 336; public static final int DURABILITY_CARROT_ON_A_STICK = 26; public static final int DURABILITY_WARPED_FUNGUS_ON_A_STICK = 100; + public static final int DURABILITY_BRUSH = 64; public static final int DURABILITY_SPARKLER = 100; public static final int DURABILITY_GLOW_STICK = 100; diff --git a/src/main/java/cn/nukkit/item/Items.java b/src/main/java/cn/nukkit/item/Items.java index 283f19bcdf6..b10fd31e77a 100644 --- a/src/main/java/cn/nukkit/item/Items.java +++ b/src/main/java/cn/nukkit/item/Items.java @@ -342,6 +342,49 @@ public static void registerVanillaNewItems() { registerNewItemAux("bamboo_chest_raft", CHEST_BOAT, ItemBoatChest.BAMBOO_RAFT, V1_20_0); registerNewItemAux("cherry_chest_boat", CHEST_BOAT, ItemBoatChest.CHERRY_BOAT, V1_20_0); +// registerNewItem("bamboo_sign", BAMBOO_SIGN, ItemSignBamboo.class, ItemSignBamboo::new, V1_20_0); +// registerNewItem("cherry_sign", CHERRY_SIGN, ItemSignCherry.class, ItemSignCherry::new, V1_20_0); +// registerNewItem("torchflower_seeds", TORCHFLOWER_SEEDS, ItemSeedsTorchflower.class, ItemSeedsTorchflower::new, V1_20_0); +// registerNewItem("pitcher_pod", PITCHER_POD, ItemPitcherPod.class, ItemPitcherPod::new, V1_20_0); + registerNewItem("brush", BRUSH, ItemBrush.class, ItemBrush::new, V1_20_0); + registerNewItem("archer_pottery_sherd", ARCHER_POTTERY_SHERD, ItemPotterySherdArcher.class, ItemPotterySherdArcher::new, V1_20_0); + registerNewItem("arms_up_pottery_sherd", ARMS_UP_POTTERY_SHERD, ItemPotterySherdArmsUp.class, ItemPotterySherdArmsUp::new, V1_20_0); + registerNewItem("prize_pottery_sherd", PRIZE_POTTERY_SHERD, ItemPotterySherdPrize.class, ItemPotterySherdPrize::new, V1_20_0); + registerNewItem("skull_pottery_sherd", SKULL_POTTERY_SHERD, ItemPotterySherdSkull.class, ItemPotterySherdSkull::new, V1_20_0); + registerNewItem("angler_pottery_sherd", ANGLER_POTTERY_SHERD, ItemPotterySherdAngler.class, ItemPotterySherdAngler::new, V1_20_0); + registerNewItem("blade_pottery_sherd", BLADE_POTTERY_SHERD, ItemPotterySherdBlade.class, ItemPotterySherdBlade::new, V1_20_0); + registerNewItem("brewer_pottery_sherd", BREWER_POTTERY_SHERD, ItemPotterySherdBrewer.class, ItemPotterySherdBrewer::new, V1_20_0); + registerNewItem("burn_pottery_sherd", BURN_POTTERY_SHERD, ItemPotterySherdBurn.class, ItemPotterySherdBurn::new, V1_20_0); + registerNewItem("danger_pottery_sherd", DANGER_POTTERY_SHERD, ItemPotterySherdDanger.class, ItemPotterySherdDanger::new, V1_20_0); + registerNewItem("explorer_pottery_sherd", EXPLORER_POTTERY_SHERD, ItemPotterySherdExplorer.class, ItemPotterySherdExplorer::new, V1_20_0); + registerNewItem("friend_pottery_sherd", FRIEND_POTTERY_SHERD, ItemPotterySherdFriend.class, ItemPotterySherdFriend::new, V1_20_0); + registerNewItem("heart_pottery_sherd", HEART_POTTERY_SHERD, ItemPotterySherdHeart.class, ItemPotterySherdHeart::new, V1_20_0); + registerNewItem("heartbreak_pottery_sherd", HEARTBREAK_POTTERY_SHERD, ItemPotterySherdHeartbreak.class, ItemPotterySherdHeartbreak::new, V1_20_0); + registerNewItem("howl_pottery_sherd", HOWL_POTTERY_SHERD, ItemPotterySherdHowl.class, ItemPotterySherdHowl::new, V1_20_0); + registerNewItem("miner_pottery_sherd", MINER_POTTERY_SHERD, ItemPotterySherdMiner.class, ItemPotterySherdMiner::new, V1_20_0); + registerNewItem("mourner_pottery_sherd", MOURNER_POTTERY_SHERD, ItemPotterySherdMourner.class, ItemPotterySherdMourner::new, V1_20_0); + registerNewItem("plenty_pottery_sherd", PLENTY_POTTERY_SHERD, ItemPotterySherdPlenty.class, ItemPotterySherdPlenty::new, V1_20_0); + registerNewItem("sheaf_pottery_sherd", SHEAF_POTTERY_SHERD, ItemPotterySherdSheaf.class, ItemPotterySherdSheaf::new, V1_20_0); + registerNewItem("shelter_pottery_sherd", SHELTER_POTTERY_SHERD, ItemPotterySherdShelter.class, ItemPotterySherdShelter::new, V1_20_0); + registerNewItem("snort_pottery_sherd", SNORT_POTTERY_SHERD, ItemPotterySherdSnort.class, ItemPotterySherdSnort::new, V1_20_0); + registerNewItem("netherite_upgrade_smithing_template", NETHERITE_UPGRADE_SMITHING_TEMPLATE, ItemSmithingTemplateUpgradeNetherite.class, ItemSmithingTemplateUpgradeNetherite::new, V1_20_0); + registerNewItem("sentry_armor_trim_smithing_template", SENTRY_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimSentry.class, ItemSmithingTemplateArmorTrimSentry::new, V1_20_0); + registerNewItem("dune_armor_trim_smithing_template", DUNE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimDune.class, ItemSmithingTemplateArmorTrimDune::new, V1_20_0); + registerNewItem("coast_armor_trim_smithing_template", COAST_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimCoast.class, ItemSmithingTemplateArmorTrimCoast::new, V1_20_0); + registerNewItem("wild_armor_trim_smithing_template", WILD_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimWild.class, ItemSmithingTemplateArmorTrimWild::new, V1_20_0); + registerNewItem("ward_armor_trim_smithing_template", WARD_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimWard.class, ItemSmithingTemplateArmorTrimWard::new, V1_20_0); + registerNewItem("eye_armor_trim_smithing_template", EYE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimEye.class, ItemSmithingTemplateArmorTrimEye::new, V1_20_0); + registerNewItem("vex_armor_trim_smithing_template", VEX_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimVex.class, ItemSmithingTemplateArmorTrimVex::new, V1_20_0); + registerNewItem("tide_armor_trim_smithing_template", TIDE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimTide.class, ItemSmithingTemplateArmorTrimTide::new, V1_20_0); + registerNewItem("snout_armor_trim_smithing_template", SNOUT_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimSnout.class, ItemSmithingTemplateArmorTrimSnout::new, V1_20_0); + registerNewItem("rib_armor_trim_smithing_template", RIB_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimRib.class, ItemSmithingTemplateArmorTrimRib::new, V1_20_0); + registerNewItem("spire_armor_trim_smithing_template", SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimSpire.class, ItemSmithingTemplateArmorTrimSpire::new, V1_20_0); + registerNewItem("silence_armor_trim_smithing_template", SILENCE_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimSilence.class, ItemSmithingTemplateArmorTrimSilence::new, V1_20_0); + registerNewItem("wayfinder_armor_trim_smithing_template", WAYFINDER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimWayfinder.class, ItemSmithingTemplateArmorTrimWayfinder::new, V1_20_0); + registerNewItem("raiser_armor_trim_smithing_template", RAISER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimRaiser.class, ItemSmithingTemplateArmorTrimRaiser::new, V1_20_0); + registerNewItem("shaper_armor_trim_smithing_template", SHAPER_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimShaper.class, ItemSmithingTemplateArmorTrimShaper::new, V1_20_0); + registerNewItem("host_armor_trim_smithing_template", HOST_ARMOR_TRIM_SMITHING_TEMPLATE, ItemSmithingTemplateArmorTrimHost.class, ItemSmithingTemplateArmorTrimHost::new, V1_20_0); + } private static Class registerItem(int id, Class clazz, ItemFactory factory) { diff --git a/src/main/java/cn/nukkit/level/GlobalBlockPaletteInterface.java b/src/main/java/cn/nukkit/level/GlobalBlockPaletteInterface.java index 0631b1428cf..2abf2f7ee7d 100644 --- a/src/main/java/cn/nukkit/level/GlobalBlockPaletteInterface.java +++ b/src/main/java/cn/nukkit/level/GlobalBlockPaletteInterface.java @@ -48,6 +48,7 @@ enum StaticVersion { V1_20_0(589, false), V1_20_10(594, false), V1_20_30(618, false), + V1_20_40(622, false), ; private static final StaticVersion[] VALUES = StaticVersion.values(); diff --git a/src/main/java/cn/nukkit/network/protocol/BossEventPacket.java b/src/main/java/cn/nukkit/network/protocol/BossEventPacket.java index 52a0ad0555c..7734cea1dc4 100644 --- a/src/main/java/cn/nukkit/network/protocol/BossEventPacket.java +++ b/src/main/java/cn/nukkit/network/protocol/BossEventPacket.java @@ -63,7 +63,7 @@ public void decode() { case TYPE_UPDATE_PROPERTIES: this.darkenScreen = this.getLShort(); case TYPE_TEXTURE: - this.color = BossBarColor.VALUES[(int) this.getUnsignedVarInt()]; + this.color = this.getBossBarColor(); this.overlay = (int) this.getUnsignedVarInt(); break; case TYPE_HEALTH_PERCENT: @@ -92,7 +92,7 @@ public void encode() { case TYPE_UPDATE_PROPERTIES: this.putLShort(this.darkenScreen); case TYPE_TEXTURE: - this.putUnsignedVarInt(this.color.ordinal()); + this.putBossBarColor(this.color); this.putUnsignedVarInt(this.overlay); break; case TYPE_HEALTH_PERCENT: @@ -105,17 +105,37 @@ public void encode() { } public enum BossBarColor { - PINK, - BLUE, - RED, - GREEN, - YELLOW, - PURPLE, - WHITE; + PINK(0), + BLUE(1), + RED(2), + GREEN(3), + YELLOW(4), + PURPLE(5), + /** + * @since 1.20.40 + */ + REBECCA_PURPLE(5), + WHITE(6), + ; + static final BossBarColor[] VALUES_OLD = new BossBarColor[]{PINK, BLUE, RED, GREEN, YELLOW, PURPLE, WHITE}; static final BossBarColor[] VALUES = values(); - public BossBarColor[] getValues() { + private final int oldId; + + BossBarColor(int oldId) { + this.oldId = oldId; + } + + public int getOldId() { + return oldId; + } + + public static BossBarColor fromOldId(int oldId) { + return VALUES_OLD[oldId]; + } + + public static BossBarColor[] getValues() { return VALUES; } } diff --git a/src/main/java/cn/nukkit/network/protocol/CommandRequestPacket.java b/src/main/java/cn/nukkit/network/protocol/CommandRequestPacket.java index 9e2083ca2ef..b41d46a5560 100644 --- a/src/main/java/cn/nukkit/network/protocol/CommandRequestPacket.java +++ b/src/main/java/cn/nukkit/network/protocol/CommandRequestPacket.java @@ -27,7 +27,7 @@ public int pid() { public void decode() { this.command = this.getString(); - CommandOriginData.Origin type = CommandOriginData.Origin.values0()[(int) this.getUnsignedVarInt()]; + CommandOriginData.Origin type = CommandOriginData.Origin.getValues()[(int) this.getUnsignedVarInt()]; UUID uuid = this.getUUID(); String requestId = this.getString(); long playerEntityUniqueId = 0; diff --git a/src/main/java/cn/nukkit/network/protocol/DisconnectPacket.java b/src/main/java/cn/nukkit/network/protocol/DisconnectPacket.java index 3aacd9a07cd..3ac54d10ed1 100644 --- a/src/main/java/cn/nukkit/network/protocol/DisconnectPacket.java +++ b/src/main/java/cn/nukkit/network/protocol/DisconnectPacket.java @@ -9,8 +9,101 @@ public class DisconnectPacket extends DataPacket { public static final int NETWORK_ID = ProtocolInfo.DISCONNECT_PACKET; - public boolean hideDisconnectionScreen = false; - public String message; + public static final int REASON_UNKNOWN = 0; + public static final int REASON_CANT_CONNECT_NO_INTERNET = 1; + public static final int REASON_NO_PERMISSIONS = 2; + public static final int REASON_UNRECOVERABLE_ERROR = 3; + public static final int REASON_THIRD_PARTY_BLOCKED = 4; + public static final int REASON_THIRD_PARTY_NO_INTERNET = 5; + public static final int REASON_THIRD_PARTY_BAD_IP = 6; + public static final int REASON_THIRD_PARTY_NO_SERVER_OR_SERVER_LOCKED = 7; + public static final int REASON_VERSION_MISMATCH = 8; + public static final int REASON_SKIN_ISSUE = 9; + public static final int REASON_INVITE_SESSION_NOT_FOUND = 10; + public static final int REASON_EDU_LEVEL_SETTINGS_MISSING = 11; + public static final int REASON_LOCAL_SERVER_NOT_FOUND = 12; + public static final int REASON_LEGACY_DISCONNECT = 13; + public static final int REASON_USER_LEAVE_GAME_ATTEMPTED = 14; + public static final int REASON_PLATFORM_LOCKED_SKINS_ERROR = 15; + public static final int REASON_REALMS_WORLD_UNASSIGNED = 16; + public static final int REASON_REALMS_SERVER_CANT_CONNECT = 17; + public static final int REASON_REALMS_SERVER_HIDDEN = 18; + public static final int REASON_REALMS_SERVER_DISABLED_BETA = 19; + public static final int REASON_REALMS_SERVER_DISABLED = 20; + public static final int REASON_CROSS_PLATFORM_DISALLOWED = 21; + public static final int REASON_CANT_CONNECT = 22; + public static final int REASON_SESSION_NOT_FOUND = 23; + public static final int REASON_CLIENT_SETTINGS_INCOMPATIBLE_WITH_SERVER = 24; + public static final int REASON_SERVER_FULL = 25; + public static final int REASON_INVALID_PLATFORM_SKIN = 26; + public static final int REASON_EDITION_VERSION_MISMATCH = 27; + public static final int REASON_EDITION_MISMATCH = 28; + public static final int REASON_LEVEL_NEWER_THAN_EXE_VERSION = 29; + public static final int REASON_NO_FAIL_OCCURRED = 30; + public static final int REASON_BANNED_SKIN = 31; + public static final int REASON_TIMEOUT = 32; + public static final int REASON_SERVER_NOT_FOUND = 33; + public static final int REASON_OUTDATED_SERVER = 34; + public static final int REASON_OUTDATED_CLIENT = 35; + public static final int REASON_NO_PREMIUM_PLATFORM = 36; + public static final int REASON_MULTIPLAYER_DISABLED = 37; + public static final int REASON_NO_WIFI = 38; + public static final int REASON_WORLD_CORRUPTION = 39; + public static final int REASON_NO_REASON = 40; + public static final int REASON_DISCONNECTED = 41; + public static final int REASON_INVALID_PLAYER = 42; + public static final int REASON_LOGGED_IN_OTHER_LOCATION = 43; + public static final int REASON_SERVER_ID_CONFLICT = 44; + public static final int REASON_NOT_ALLOWED = 45; + public static final int REASON_NOT_AUTHENTICATED = 46; + public static final int REASON_INVALID_TENANT = 47; + public static final int REASON_UNKNOWN_PACKET = 48; + public static final int REASON_UNEXPECTED_PACKET = 49; + public static final int REASON_INVALID_COMMAND_REQUEST_PACKET = 50; + public static final int REASON_HOST_SUSPENDED = 51; + public static final int REASON_LOGIN_PACKET_NO_REQUEST = 52; + public static final int REASON_LOGIN_PACKET_NO_CERT = 53; + public static final int REASON_MISSING_CLIENT = 54; + public static final int REASON_KICKED = 55; + public static final int REASON_KICKED_FOR_EXPLOIT = 56; + public static final int REASON_KICKED_FOR_IDLE = 57; + public static final int REASON_RESOURCE_PACK_PROBLEM = 58; + public static final int REASON_INCOMPATIBLE_PACK = 59; + public static final int REASON_OUT_OF_STORAGE = 60; + public static final int REASON_INVALID_LEVEL = 61; + public static final int REASON_DISCONNECT_PACKET_DEPRECATED = 62; + public static final int REASON_BLOCK_MISMATCH = 63; + public static final int REASON_INVALID_HEIGHTS = 64; + public static final int REASON_INVALID_WIDTHS = 65; + public static final int REASON_CONNECTION_LOST = 66; + public static final int REASON_ZOMBIE_CONNECTION = 67; + public static final int REASON_SHUTDOWN = 68; + public static final int REASON_REASON_NOT_SET = 69; + public static final int REASON_LOADING_STATE_TIMEOUT = 70; + public static final int REASON_RESOURCE_PACK_LOADING_FAILED = 71; + public static final int REASON_SEARCHING_FOR_SESSION_LOADING_SCREEN_FAILED = 72; + public static final int REASON_CONN_PROTOCOL_VERSION = 73; + public static final int REASON_SUBSYSTEM_STATUS_ERROR = 74; + public static final int REASON_EMPTY_AUTH_FROM_DISCOVERY = 75; + public static final int REASON_EMPTY_URL_FROM_DISCOVERY = 76; + public static final int REASON_EXPIRED_AUTH_FROM_DISCOVERY = 77; + public static final int REASON_UNKNOWN_SIGNAL_SERVICE_SIGN_IN_FAILURE = 78; + public static final int REASON_XBL_JOIN_LOBBY_FAILURE = 79; + public static final int REASON_UNSPECIFIED_CLIENT_INSTANCE_DISCONNECTION = 80; + public static final int REASON_CONN_SESSION_NOT_FOUND = 81; + public static final int REASON_CONN_CREATE_PEER_CONNECTION = 82; + public static final int REASON_CONN_ICE = 83; + public static final int REASON_CONN_CONNECT_REQUEST = 84; + public static final int REASON_CONN_CONNECT_RESPONSE = 85; + public static final int REASON_CONN_NEGOTIATION_TIMEOUT = 86; + public static final int REASON_CONN_INACTIVITY_TIMEOUT = 87; + public static final int REASON_STALE_CONNECTION_BEING_REPLACED = 88; + public static final int REASON_REALMS_SESSION_NOT_FOUND = 89; + public static final int REASON_BAD_PACKET = 90; + + public int reason = REASON_UNKNOWN; + public boolean hideDisconnectionScreen; + public String message = ""; @Override public int pid() { @@ -32,5 +125,4 @@ public void encode() { } } - } diff --git a/src/main/java/cn/nukkit/network/protocol/LevelSoundEventPacket.java b/src/main/java/cn/nukkit/network/protocol/LevelSoundEventPacket.java index ea4ac5c9273..1f33d7689e9 100644 --- a/src/main/java/cn/nukkit/network/protocol/LevelSoundEventPacket.java +++ b/src/main/java/cn/nukkit/network/protocol/LevelSoundEventPacket.java @@ -482,6 +482,8 @@ public class LevelSoundEventPacket extends DataPacket { public static final int SOUND_HOGLIN_CONVERT_TO_ZOMBIE = 474; public static final int SOUND_AMBIENT_UNDERWATER_ENTER = 475; public static final int SOUND_AMBIENT_UNDERWATER_EXIT = 476; + public static final int SOUND_BOTTLE_FILL = 477; + public static final int SOUND_BOTTLE_EMPTY = 478; public int sound; public float x; diff --git a/src/main/java/cn/nukkit/network/protocol/PlayerActionPacket.java b/src/main/java/cn/nukkit/network/protocol/PlayerActionPacket.java index 9643e5ecbbf..8878de72f20 100644 --- a/src/main/java/cn/nukkit/network/protocol/PlayerActionPacket.java +++ b/src/main/java/cn/nukkit/network/protocol/PlayerActionPacket.java @@ -72,6 +72,10 @@ public class PlayerActionPacket extends DataPacket { * @since 1.20.30 */ public static final int ACTION_STOP_FLYING = 35; + /** + * @since 1.20.40 + */ + public static final int ACTION_ACK_ENTITY_DATA = 36; public long entityId; public int action; diff --git a/src/main/java/cn/nukkit/network/protocol/types/CommandOriginData.java b/src/main/java/cn/nukkit/network/protocol/types/CommandOriginData.java index ef492cf49f0..dea5745b127 100644 --- a/src/main/java/cn/nukkit/network/protocol/types/CommandOriginData.java +++ b/src/main/java/cn/nukkit/network/protocol/types/CommandOriginData.java @@ -45,10 +45,10 @@ public enum Origin { EXECUTE_CONTEXT, ; - private static final Origin[] $VALUES0 = values(); + private static final Origin[] VALUES = values(); - public static Origin[] values0() { - return $VALUES0; + public static Origin[] getValues() { + return VALUES; } } } \ No newline at end of file diff --git a/src/main/java/cn/nukkit/utils/BinaryStream.java b/src/main/java/cn/nukkit/utils/BinaryStream.java index e1579b90a72..7330f27c643 100644 --- a/src/main/java/cn/nukkit/utils/BinaryStream.java +++ b/src/main/java/cn/nukkit/utils/BinaryStream.java @@ -22,6 +22,7 @@ import cn.nukkit.nbt.tag.ListTag; import cn.nukkit.nbt.tag.StringTag; import cn.nukkit.nbt.tag.Tag; +import cn.nukkit.network.protocol.BossEventPacket.BossBarColor; import cn.nukkit.network.protocol.types.EntityLink; import cn.nukkit.network.protocol.types.InputInteractionModel; import it.unimi.dsi.fastutil.io.FastByteArrayInputStream; @@ -1110,6 +1111,23 @@ public void putOptional(T obj, BiConsumer consumer) { consumer.accept(this, obj); } + public BossBarColor getBossBarColor() { + if (this.helper != null) { + return this.helper.getBossBarColor(this); + } + + return BossBarColor.fromOldId((int) this.getUnsignedVarInt()); + } + + public void putBossBarColor(BossBarColor color) { + if (this.helper != null) { + this.helper.putBossBarColor(this, color); + return; + } + + putUnsignedVarInt(color.getOldId()); + } + public boolean isReadable(int length) { return count - offset >= length; } @@ -1335,5 +1353,13 @@ public final int getCommandParameterTypeId(CommandParamType type, int defaultVal protected final List extractStringList(BinaryStream stream, Item item, String tagName) { return stream.extractStringList(item, tagName); } + + public BossBarColor getBossBarColor(BinaryStream stream) { + return BossBarColor.fromOldId((int) stream.getUnsignedVarInt()); + } + + public void putBossBarColor(BinaryStream stream, BossBarColor color) { + stream.putUnsignedVarInt(color.getOldId()); + } } } diff --git a/src/main/java/cn/nukkit/utils/TextFormat.java b/src/main/java/cn/nukkit/utils/TextFormat.java index 483de1dda06..3e2c7eadb9e 100644 --- a/src/main/java/cn/nukkit/utils/TextFormat.java +++ b/src/main/java/cn/nukkit/utils/TextFormat.java @@ -219,7 +219,7 @@ public static String clean(final String input, final boolean recursive) { return null; } - String result = CLEAN_PATTERN.matcher(cleanIcon(input, recursive)).replaceAll(""); + String result = CLEAN_PATTERN.matcher(cleanIcon(input)).replaceAll(""); if (recursive && CLEAN_PATTERN.matcher(result).find()) { return clean(result, true); @@ -234,27 +234,14 @@ public static String clean(final String input, final boolean recursive) { * @return A copy of the input string, without any icons. */ public static String cleanIcon(String input) { - return cleanIcon(input, false); - } - - public static String cleanIcon(String input, boolean recursive) { - if (input == null) { - return null; - } - - String result = CharacterIcon.CLEAN_PATTERN.matcher(input).replaceAll(""); - - if (recursive && CharacterIcon.CLEAN_PATTERN.matcher(result).find()) { - return cleanIcon(result, true); - } - return result; + return CharacterIcon.CLEAN_PATTERN.matcher(input).replaceAll(""); } /** * Translates a string using an alternate format code character into a * string that uses the internal TextFormat.ESCAPE format code * character. The alternate format code character will only be replaced if - * it is immediately followed by 0-9, A-G, a-g, K-O, k-o, R or r. + * it is immediately followed by 0-9, A-U or a-u. * * @param altFormatChar The alternate format code character to replace. Ex: & * @param textToTranslate Text containing the alternate format code character.