mirror of
https://github.com/GeyserMC/MCProtocolLib.git
synced 2024-12-12 08:41:00 -05:00
Merge branch 'master' of https://github.com/Steveice10/MCProtocolLib into feature/1.16
This commit is contained in:
commit
6004e4af74
25 changed files with 257 additions and 316 deletions
4
pom.xml
4
pom.xml
|
@ -62,13 +62,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.steveice10</groupId>
|
<groupId>com.github.steveice10</groupId>
|
||||||
<artifactId>packetlib</artifactId>
|
<artifactId>packetlib</artifactId>
|
||||||
<version>master-SNAPSHOT</version>
|
<version>43b394dfdc</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.steveice10</groupId>
|
<groupId>com.github.steveice10</groupId>
|
||||||
<artifactId>mcauthlib</artifactId>
|
<artifactId>mcauthlib</artifactId>
|
||||||
<version>1.1</version>
|
<version>401c99c722</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -104,9 +104,9 @@ import com.github.steveice10.mc.protocol.packet.ingame.server.entity.player.Serv
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.player.ServerPlayerPositionRotationPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.player.ServerPlayerPositionRotationPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.player.ServerPlayerSetExperiencePacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.player.ServerPlayerSetExperiencePacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnExpOrbPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnExpOrbPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnGlobalEntityPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnWeatherEntityPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnMobPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnLivingEntityPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnObjectPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnEntityPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnPaintingPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnPaintingPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnPlayerPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn.ServerSpawnPlayerPacket;
|
||||||
import com.github.steveice10.mc.protocol.packet.ingame.server.scoreboard.ServerDisplayScoreboardPacket;
|
import com.github.steveice10.mc.protocol.packet.ingame.server.scoreboard.ServerDisplayScoreboardPacket;
|
||||||
|
@ -373,10 +373,10 @@ public class MinecraftProtocol extends PacketProtocol {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initClientGame(Session session) {
|
private void initClientGame(Session session) {
|
||||||
this.registerIncoming(0x00, ServerSpawnObjectPacket.class);
|
this.registerIncoming(0x00, ServerSpawnEntityPacket.class);
|
||||||
this.registerIncoming(0x01, ServerSpawnExpOrbPacket.class);
|
this.registerIncoming(0x01, ServerSpawnExpOrbPacket.class);
|
||||||
this.registerIncoming(0x02, ServerSpawnGlobalEntityPacket.class);
|
this.registerIncoming(0x02, ServerSpawnWeatherEntityPacket.class);
|
||||||
this.registerIncoming(0x03, ServerSpawnMobPacket.class);
|
this.registerIncoming(0x03, ServerSpawnLivingEntityPacket.class);
|
||||||
this.registerIncoming(0x04, ServerSpawnPaintingPacket.class);
|
this.registerIncoming(0x04, ServerSpawnPaintingPacket.class);
|
||||||
this.registerIncoming(0x05, ServerSpawnPlayerPacket.class);
|
this.registerIncoming(0x05, ServerSpawnPlayerPacket.class);
|
||||||
this.registerIncoming(0x06, ServerEntityAnimationPacket.class);
|
this.registerIncoming(0x06, ServerEntityAnimationPacket.class);
|
||||||
|
@ -565,10 +565,10 @@ public class MinecraftProtocol extends PacketProtocol {
|
||||||
this.registerIncoming(0x2D, ClientPlayerPlaceBlockPacket.class);
|
this.registerIncoming(0x2D, ClientPlayerPlaceBlockPacket.class);
|
||||||
this.registerIncoming(0x2E, ClientPlayerUseItemPacket.class);
|
this.registerIncoming(0x2E, ClientPlayerUseItemPacket.class);
|
||||||
|
|
||||||
this.registerOutgoing(0x00, ServerSpawnObjectPacket.class);
|
this.registerOutgoing(0x00, ServerSpawnEntityPacket.class);
|
||||||
this.registerOutgoing(0x01, ServerSpawnExpOrbPacket.class);
|
this.registerOutgoing(0x01, ServerSpawnExpOrbPacket.class);
|
||||||
this.registerOutgoing(0x02, ServerSpawnGlobalEntityPacket.class);
|
this.registerOutgoing(0x02, ServerSpawnWeatherEntityPacket.class);
|
||||||
this.registerOutgoing(0x03, ServerSpawnMobPacket.class);
|
this.registerOutgoing(0x03, ServerSpawnLivingEntityPacket.class);
|
||||||
this.registerOutgoing(0x04, ServerSpawnPaintingPacket.class);
|
this.registerOutgoing(0x04, ServerSpawnPaintingPacket.class);
|
||||||
this.registerOutgoing(0x05, ServerSpawnPlayerPacket.class);
|
this.registerOutgoing(0x05, ServerSpawnPlayerPacket.class);
|
||||||
this.registerOutgoing(0x06, ServerEntityAnimationPacket.class);
|
this.registerOutgoing(0x06, ServerEntityAnimationPacket.class);
|
||||||
|
|
|
@ -32,12 +32,11 @@ import com.github.steveice10.mc.protocol.data.game.entity.player.InteractAction;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerAction;
|
import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerAction;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerState;
|
import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerState;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.player.PositionElement;
|
import com.github.steveice10.mc.protocol.data.game.entity.player.PositionElement;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.GlobalEntityType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.WeatherEntityType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.MobType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.PaintingType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.PaintingType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.HangingDirection;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.HangingDirection;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.MinecartType;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.MinecartType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.ObjectType;
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.recipe.RecipeType;
|
import com.github.steveice10.mc.protocol.data.game.recipe.RecipeType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.scoreboard.CollisionRule;
|
import com.github.steveice10.mc.protocol.data.game.scoreboard.CollisionRule;
|
||||||
import com.github.steveice10.mc.protocol.data.game.scoreboard.NameTagVisibility;
|
import com.github.steveice10.mc.protocol.data.game.scoreboard.NameTagVisibility;
|
||||||
|
@ -371,150 +370,114 @@ public class MagicValues {
|
||||||
register(PositionElement.PITCH, 3);
|
register(PositionElement.PITCH, 3);
|
||||||
register(PositionElement.YAW, 4);
|
register(PositionElement.YAW, 4);
|
||||||
|
|
||||||
register(GlobalEntityType.LIGHTNING_BOLT, 1);
|
register(WeatherEntityType.LIGHTNING_BOLT, 1);
|
||||||
|
|
||||||
register(MobType.AREA_EFFECT_CLOUD, 0);
|
register(EntityType.AREA_EFFECT_CLOUD, 0);
|
||||||
register(MobType.ARMOR_STAND, 1);
|
register(EntityType.ARMOR_STAND, 1);
|
||||||
register(MobType.ARROW, 2);
|
register(EntityType.ARROW, 2);
|
||||||
register(MobType.BAT, 3);
|
register(EntityType.BAT, 3);
|
||||||
register(MobType.BEE, 4);
|
register(EntityType.BEE, 4);
|
||||||
register(MobType.BLAZE, 5);
|
register(EntityType.BLAZE, 5);
|
||||||
register(MobType.BOAT, 6);
|
register(EntityType.BOAT, 6);
|
||||||
register(MobType.CAT, 7);
|
register(EntityType.CAT, 7);
|
||||||
register(MobType.CAVE_SPIDER, 8);
|
register(EntityType.CAVE_SPIDER, 8);
|
||||||
register(MobType.CHICKEN, 9);
|
register(EntityType.CHICKEN, 9);
|
||||||
register(MobType.COD, 10);
|
register(EntityType.COD, 10);
|
||||||
register(MobType.COW, 11);
|
register(EntityType.COW, 11);
|
||||||
register(MobType.CREEPER, 12);
|
register(EntityType.CREEPER, 12);
|
||||||
register(MobType.DONKEY, 13);
|
register(EntityType.DONKEY, 13);
|
||||||
register(MobType.DOLPHIN, 14);
|
register(EntityType.DOLPHIN, 14);
|
||||||
register(MobType.DRAGON_FIREBALL, 15);
|
register(EntityType.DRAGON_FIREBALL, 15);
|
||||||
register(MobType.DROWNED, 16);
|
register(EntityType.DROWNED, 16);
|
||||||
register(MobType.ELDER_GUARDIAN, 17);
|
register(EntityType.ELDER_GUARDIAN, 17);
|
||||||
register(MobType.END_CRYSTAL, 18);
|
register(EntityType.END_CRYSTAL, 18);
|
||||||
register(MobType.ENDER_DRAGON, 19);
|
register(EntityType.ENDER_DRAGON, 19);
|
||||||
register(MobType.ENDERMAN, 20);
|
register(EntityType.ENDERMAN, 20);
|
||||||
register(MobType.ENDERMITE, 21);
|
register(EntityType.ENDERMITE, 21);
|
||||||
register(MobType.EVOKER_FANGS, 22);
|
register(EntityType.EVOKER_FANGS, 22);
|
||||||
register(MobType.EVOKER, 23);
|
register(EntityType.EVOKER, 23);
|
||||||
register(MobType.EXPERIENCE_ORB, 24);
|
register(EntityType.EXPERIENCE_ORB, 24);
|
||||||
register(MobType.EYE_OF_ENDER, 25);
|
register(EntityType.EYE_OF_ENDER, 25);
|
||||||
register(MobType.FALLING_BLOCK, 26);
|
register(EntityType.FALLING_BLOCK, 26);
|
||||||
register(MobType.FIREWORK_ROCKET, 27);
|
register(EntityType.FIREWORK_ROCKET, 27);
|
||||||
register(MobType.FOX, 28);
|
register(EntityType.FOX, 28);
|
||||||
register(MobType.GHAST, 29);
|
register(EntityType.GHAST, 29);
|
||||||
register(MobType.GIANT, 30);
|
register(EntityType.GIANT, 30);
|
||||||
register(MobType.GUARDIAN, 31);
|
register(EntityType.GUARDIAN, 31);
|
||||||
register(MobType.HORSE, 32);
|
register(EntityType.HORSE, 32);
|
||||||
register(MobType.HUSK, 33);
|
register(EntityType.HUSK, 33);
|
||||||
register(MobType.ILLUSIONER, 34);
|
register(EntityType.ILLUSIONER, 34);
|
||||||
register(MobType.ITEM, 35);
|
register(EntityType.ITEM, 35);
|
||||||
register(MobType.ITEM_FRAME, 36);
|
register(EntityType.ITEM_FRAME, 36);
|
||||||
register(MobType.FIREBALL, 37);
|
register(EntityType.FIREBALL, 37);
|
||||||
register(MobType.LEASH_KNOT, 38);
|
register(EntityType.LEASH_KNOT, 38);
|
||||||
register(MobType.LLAMA, 39);
|
register(EntityType.LLAMA, 39);
|
||||||
register(MobType.LLAMA_SPIT, 40);
|
register(EntityType.LLAMA_SPIT, 40);
|
||||||
register(MobType.MAGMA_CUBE, 41);
|
register(EntityType.MAGMA_CUBE, 41);
|
||||||
register(MobType.MINECART, 42);
|
register(EntityType.MINECART, 42);
|
||||||
register(MobType.MINECART_CHEST, 43);
|
register(EntityType.MINECART_CHEST, 43);
|
||||||
register(MobType.MINECART_COMMAND_BLOCK, 44);
|
register(EntityType.MINECART_COMMAND_BLOCK, 44);
|
||||||
register(MobType.MINECART_FURNACE, 45);
|
register(EntityType.MINECART_FURNACE, 45);
|
||||||
register(MobType.MINECART_HOPPER, 46);
|
register(EntityType.MINECART_HOPPER, 46);
|
||||||
register(MobType.MINECART_SPAWNER, 47);
|
register(EntityType.MINECART_SPAWNER, 47);
|
||||||
register(MobType.MINECART_TNT, 48);
|
register(EntityType.MINECART_TNT, 48);
|
||||||
register(MobType.MULE, 49);
|
register(EntityType.MULE, 49);
|
||||||
register(MobType.MOOSHROOM, 50);
|
register(EntityType.MOOSHROOM, 50);
|
||||||
register(MobType.OCELOT, 51);
|
register(EntityType.OCELOT, 51);
|
||||||
register(MobType.PAINTING, 52);
|
register(EntityType.PAINTING, 52);
|
||||||
register(MobType.PANDA, 53);
|
register(EntityType.PANDA, 53);
|
||||||
register(MobType.PARROT, 54);
|
register(EntityType.PARROT, 54);
|
||||||
register(MobType.PIG, 55);
|
register(EntityType.PIG, 55);
|
||||||
register(MobType.PUFFERFISH, 56);
|
register(EntityType.PUFFERFISH, 56);
|
||||||
register(MobType.POLAR_BEAR, 57);
|
register(EntityType.POLAR_BEAR, 57);
|
||||||
register(MobType.PRIMED_TNT, 58);
|
register(EntityType.PRIMED_TNT, 58);
|
||||||
register(MobType.RABBIT, 59);
|
register(EntityType.RABBIT, 59);
|
||||||
register(MobType.SALMON, 60);
|
register(EntityType.SALMON, 60);
|
||||||
register(MobType.SHEEP, 61);
|
register(EntityType.SHEEP, 61);
|
||||||
register(MobType.SHULKER, 62);
|
register(EntityType.SHULKER, 62);
|
||||||
register(MobType.SHULKER_BULLET, 63);
|
register(EntityType.SHULKER_BULLET, 63);
|
||||||
register(MobType.SILVERFISH, 64);
|
register(EntityType.SILVERFISH, 64);
|
||||||
register(MobType.SKELETON, 65);
|
register(EntityType.SKELETON, 65);
|
||||||
register(MobType.SKELETON_HORSE, 66);
|
register(EntityType.SKELETON_HORSE, 66);
|
||||||
register(MobType.SLIME, 67);
|
register(EntityType.SLIME, 67);
|
||||||
register(MobType.SMALL_FIREBALL, 68);
|
register(EntityType.SMALL_FIREBALL, 68);
|
||||||
register(MobType.SNOW_GOLEM, 69);
|
register(EntityType.SNOW_GOLEM, 69);
|
||||||
register(MobType.SNOWBALL, 70);
|
register(EntityType.SNOWBALL, 70);
|
||||||
register(MobType.SPECTRAL_ARROW, 71);
|
register(EntityType.SPECTRAL_ARROW, 71);
|
||||||
register(MobType.SPIDER, 72);
|
register(EntityType.SPIDER, 72);
|
||||||
register(MobType.SQUID, 73);
|
register(EntityType.SQUID, 73);
|
||||||
register(MobType.STRAY, 74);
|
register(EntityType.STRAY, 74);
|
||||||
register(MobType.TRADER_LLAMA, 75);
|
register(EntityType.TRADER_LLAMA, 75);
|
||||||
register(MobType.TROPICAL_FISH, 76);
|
register(EntityType.TROPICAL_FISH, 76);
|
||||||
register(MobType.TURTLE, 77);
|
register(EntityType.TURTLE, 77);
|
||||||
register(MobType.THROWN_EGG, 78);
|
register(EntityType.THROWN_EGG, 78);
|
||||||
register(MobType.THROWN_ENDERPEARL, 79);
|
register(EntityType.THROWN_ENDERPEARL, 79);
|
||||||
register(MobType.THROWN_EXP_BOTTLE, 80);
|
register(EntityType.THROWN_EXP_BOTTLE, 80);
|
||||||
register(MobType.THROWN_POTION, 81);
|
register(EntityType.THROWN_POTION, 81);
|
||||||
register(MobType.TRIDENT, 82);
|
register(EntityType.TRIDENT, 82);
|
||||||
register(MobType.VEX, 83);
|
register(EntityType.VEX, 83);
|
||||||
register(MobType.VILLAGER, 84);
|
register(EntityType.VILLAGER, 84);
|
||||||
register(MobType.IRON_GOLEM, 85);
|
register(EntityType.IRON_GOLEM, 85);
|
||||||
register(MobType.VINDICATOR, 86);
|
register(EntityType.VINDICATOR, 86);
|
||||||
register(MobType.PILLAGER, 87);
|
register(EntityType.PILLAGER, 87);
|
||||||
register(MobType.WANDERING_TRADER, 88);
|
register(EntityType.WANDERING_TRADER, 88);
|
||||||
register(MobType.WITCH, 89);
|
register(EntityType.WITCH, 89);
|
||||||
register(MobType.WITHER, 90);
|
register(EntityType.WITHER, 90);
|
||||||
register(MobType.WITHER_SKELETON, 91);
|
register(EntityType.WITHER_SKELETON, 91);
|
||||||
register(MobType.WITHER_SKULL, 92);
|
register(EntityType.WITHER_SKULL, 92);
|
||||||
register(MobType.WOLF, 93);
|
register(EntityType.WOLF, 93);
|
||||||
register(MobType.ZOMBIE, 94);
|
register(EntityType.ZOMBIE, 94);
|
||||||
register(MobType.ZOMBIFIED_PIGLIN, 95);
|
register(EntityType.ZOMBIFIED_PIGLIN, 95);
|
||||||
register(MobType.ZOMBIE_HORSE, 96);
|
register(EntityType.ZOMBIE_HORSE, 96);
|
||||||
register(MobType.ZOMBIE_VILLAGER, 97);
|
register(EntityType.ZOMBIE_VILLAGER, 97);
|
||||||
register(MobType.PHANTOM, 98);
|
register(EntityType.PHANTOM, 98);
|
||||||
register(MobType.RAVAGER, 99);
|
register(EntityType.RAVAGER, 99);
|
||||||
register(MobType.HOGLIN, 100);
|
register(EntityType.HOGLIN, 100);
|
||||||
register(MobType.PIGLIN, 101);
|
register(EntityType.PIGLIN, 101);
|
||||||
register(MobType.STRIDER, 102);
|
register(EntityType.STRIDER, 102);
|
||||||
register(MobType.ZOGLIN, 103);
|
register(EntityType.ZOGLIN, 103);
|
||||||
register(MobType.PLAYER, 105);
|
register(EntityType.PLAYER, 105);
|
||||||
register(MobType.FISHING_BOBBER, 106);
|
register(EntityType.FISHING_BOBBER, 106);
|
||||||
|
|
||||||
register(ObjectType.AREA_EFFECT_CLOUD, 0);
|
|
||||||
register(ObjectType.ARMOR_STAND, 1);
|
|
||||||
register(ObjectType.ARROW, 2);
|
|
||||||
register(ObjectType.BOAT, 6);
|
|
||||||
register(ObjectType.DRAGON_FIREBALL, 15);
|
|
||||||
register(ObjectType.END_CRYSTAL, 18);
|
|
||||||
register(ObjectType.EVOKER_FANGS, 22);
|
|
||||||
register(ObjectType.EXPERIENCE_ORB, 24);
|
|
||||||
register(ObjectType.EYE_OF_ENDER, 25);
|
|
||||||
register(ObjectType.FALLING_BLOCK, 26);
|
|
||||||
register(ObjectType.FIREWORK_ROCKET, 27);
|
|
||||||
register(ObjectType.ITEM, 35);
|
|
||||||
register(ObjectType.ITEM_FRAME, 36);
|
|
||||||
register(ObjectType.FIREBALL, 37);
|
|
||||||
register(ObjectType.LEASH_KNOT, 38);
|
|
||||||
register(ObjectType.LLAMA_SPIT, 40);
|
|
||||||
register(ObjectType.MINECART, 42);
|
|
||||||
register(ObjectType.CHEST_MINECART, 43);
|
|
||||||
register(ObjectType.COMMAND_BLOCK_MINECART, 44);
|
|
||||||
register(ObjectType.FURNACE_MINECART, 45);
|
|
||||||
register(ObjectType.HOPPER_MINECART, 46);
|
|
||||||
register(ObjectType.SPAWNER_MINECART, 47);
|
|
||||||
register(ObjectType.TNT_MINECART, 48);
|
|
||||||
register(ObjectType.TNT, 58);
|
|
||||||
register(ObjectType.SHULKER_BULLET, 63);
|
|
||||||
register(ObjectType.SMALL_FIREBALL, 68);
|
|
||||||
register(ObjectType.SNOWBALL, 70);
|
|
||||||
register(ObjectType.SPECTRAL_ARROW, 71);
|
|
||||||
register(ObjectType.EGG, 78);
|
|
||||||
register(ObjectType.ENDER_PEARL, 79);
|
|
||||||
register(ObjectType.EXPERIENCE_BOTTLE, 80);
|
|
||||||
register(ObjectType.POTION, 81);
|
|
||||||
register(ObjectType.TRIDENT, 82);
|
|
||||||
register(ObjectType.WITHER_SKULL, 92);
|
|
||||||
register(ObjectType.FISHING_BOBBER, 106);
|
|
||||||
|
|
||||||
register(MinecartType.NORMAL, 0);
|
register(MinecartType.NORMAL, 0);
|
||||||
register(MinecartType.CHEST, 1);
|
register(MinecartType.CHEST, 1);
|
||||||
|
@ -1177,7 +1140,6 @@ public class MagicValues {
|
||||||
|
|
||||||
register(SuggestionType.ASK_SERVER, "minecraft:ask_server");
|
register(SuggestionType.ASK_SERVER, "minecraft:ask_server");
|
||||||
register(SuggestionType.ALL_RECIPES, "minecraft:all_recipes");
|
register(SuggestionType.ALL_RECIPES, "minecraft:all_recipes");
|
||||||
register(SuggestionType.AVAILABLE_BIOMES, "minecraft:available_biomes");
|
|
||||||
register(SuggestionType.AVAILABLE_SOUNDS, "minecraft:available_sounds");
|
register(SuggestionType.AVAILABLE_SOUNDS, "minecraft:available_sounds");
|
||||||
register(SuggestionType.SUMMONABLE_ENTITIES, "minecraft:summonable_entities");
|
register(SuggestionType.SUMMONABLE_ENTITIES, "minecraft:summonable_entities");
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class Advancement {
|
||||||
public static class DisplayData {
|
public static class DisplayData {
|
||||||
private final @NonNull Message title;
|
private final @NonNull Message title;
|
||||||
private final @NonNull Message description;
|
private final @NonNull Message description;
|
||||||
private final @NonNull ItemStack icon;
|
private final ItemStack icon;
|
||||||
private final @NonNull FrameType frameType;
|
private final @NonNull FrameType frameType;
|
||||||
private final boolean showToast;
|
private final boolean showToast;
|
||||||
private final boolean hidden;
|
private final boolean hidden;
|
||||||
|
@ -42,7 +42,7 @@ public class Advancement {
|
||||||
private final float posY;
|
private final float posY;
|
||||||
private final String backgroundTexture;
|
private final String backgroundTexture;
|
||||||
|
|
||||||
public DisplayData(@NonNull Message title, @NonNull Message description, @NonNull ItemStack icon, @NonNull FrameType frameType,
|
public DisplayData(@NonNull Message title, @NonNull Message description, ItemStack icon, @NonNull FrameType frameType,
|
||||||
boolean showToast, boolean hidden, float posX, float posY) {
|
boolean showToast, boolean hidden, float posX, float posY) {
|
||||||
this(title, description, icon, frameType, showToast, hidden, posX, posY, null);
|
this(title, description, icon, frameType, showToast, hidden, posX, posY, null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type.object;
|
package com.github.steveice10.mc.protocol.data.game.entity.object;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type.object;
|
package com.github.steveice10.mc.protocol.data.game.entity.object;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type.object;
|
package com.github.steveice10.mc.protocol.data.game.entity.object;
|
||||||
|
|
||||||
public enum HangingDirection implements ObjectData {
|
public enum HangingDirection implements ObjectData {
|
||||||
DOWN,
|
DOWN,
|
|
@ -1,4 +1,4 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type.object;
|
package com.github.steveice10.mc.protocol.data.game.entity.object;
|
||||||
|
|
||||||
public enum MinecartType implements ObjectData {
|
public enum MinecartType implements ObjectData {
|
||||||
NORMAL,
|
NORMAL,
|
|
@ -0,0 +1,4 @@
|
||||||
|
package com.github.steveice10.mc.protocol.data.game.entity.object;
|
||||||
|
|
||||||
|
public interface ObjectData {
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type.object;
|
package com.github.steveice10.mc.protocol.data.game.entity.object;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,4 +1,4 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type.object;
|
package com.github.steveice10.mc.protocol.data.game.entity.object;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
|
@ -1,6 +1,6 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type;
|
package com.github.steveice10.mc.protocol.data.game.entity.type;
|
||||||
|
|
||||||
public enum MobType {
|
public enum EntityType {
|
||||||
AREA_EFFECT_CLOUD,
|
AREA_EFFECT_CLOUD,
|
||||||
ARMOR_STAND,
|
ARMOR_STAND,
|
||||||
ARROW,
|
ARROW,
|
|
@ -1,5 +1,5 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type;
|
package com.github.steveice10.mc.protocol.data.game.entity.type;
|
||||||
|
|
||||||
public enum GlobalEntityType {
|
public enum WeatherEntityType {
|
||||||
LIGHTNING_BOLT;
|
LIGHTNING_BOLT;
|
||||||
}
|
}
|
|
@ -1,4 +0,0 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type.object;
|
|
||||||
|
|
||||||
public interface ObjectData {
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
package com.github.steveice10.mc.protocol.data.game.entity.type.object;
|
|
||||||
|
|
||||||
public enum ObjectType {
|
|
||||||
EVOKER_FANGS,
|
|
||||||
AREA_EFFECT_CLOUD,
|
|
||||||
ARROW,
|
|
||||||
ARMOR_STAND,
|
|
||||||
BOAT,
|
|
||||||
DRAGON_FIREBALL,
|
|
||||||
END_CRYSTAL,
|
|
||||||
EXPERIENCE_ORB,
|
|
||||||
EYE_OF_ENDER,
|
|
||||||
FALLING_BLOCK,
|
|
||||||
FIREWORK_ROCKET,
|
|
||||||
ITEM,
|
|
||||||
ITEM_FRAME,
|
|
||||||
FIREBALL,
|
|
||||||
LEASH_KNOT,
|
|
||||||
LLAMA_SPIT,
|
|
||||||
MINECART,
|
|
||||||
CHEST_MINECART,
|
|
||||||
COMMAND_BLOCK_MINECART,
|
|
||||||
FURNACE_MINECART,
|
|
||||||
HOPPER_MINECART,
|
|
||||||
SPAWNER_MINECART,
|
|
||||||
TNT_MINECART,
|
|
||||||
TNT,
|
|
||||||
SMALL_FIREBALL,
|
|
||||||
SNOWBALL,
|
|
||||||
SPECTRAL_ARROW,
|
|
||||||
SHULKER_BULLET,
|
|
||||||
EGG,
|
|
||||||
ENDER_PEARL,
|
|
||||||
EXPERIENCE_BOTTLE,
|
|
||||||
POTION,
|
|
||||||
TRIDENT,
|
|
||||||
WITHER_SKULL,
|
|
||||||
FISHING_BOBBER,
|
|
||||||
}
|
|
|
@ -10,6 +10,7 @@ public enum UpdatedTileType {
|
||||||
STRUCTURE_BLOCK,
|
STRUCTURE_BLOCK,
|
||||||
END_GATEWAY,
|
END_GATEWAY,
|
||||||
SIGN,
|
SIGN,
|
||||||
|
SHULKER_BOX,
|
||||||
BED,
|
BED,
|
||||||
JIGSAW_BLOCK,
|
JIGSAW_BLOCK,
|
||||||
CAMPFIRE,
|
CAMPFIRE,
|
||||||
|
|
|
@ -58,5 +58,9 @@ public enum ParticleType {
|
||||||
NAUTILUS,
|
NAUTILUS,
|
||||||
DOLPHIN,
|
DOLPHIN,
|
||||||
CAMPFIRE_COSY_SMOKE,
|
CAMPFIRE_COSY_SMOKE,
|
||||||
CAMPFIRE_SIGNAL_SMOKE;
|
CAMPFIRE_SIGNAL_SMOKE,
|
||||||
|
DRIPPING_HONEY,
|
||||||
|
FALLING_HONEY,
|
||||||
|
LANDING_HONEY,
|
||||||
|
FALLING_NECTAR
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.github.steveice10.mc.protocol.packet.ingame.client.window;
|
package com.github.steveice10.mc.protocol.packet.ingame.client.window;
|
||||||
|
|
||||||
|
import com.github.steveice10.mc.protocol.data.MagicValues;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.ItemStack;
|
||||||
|
import com.github.steveice10.mc.protocol.data.game.entity.player.Hand;
|
||||||
import com.github.steveice10.packetlib.io.NetInput;
|
import com.github.steveice10.packetlib.io.NetInput;
|
||||||
import com.github.steveice10.packetlib.io.NetOutput;
|
import com.github.steveice10.packetlib.io.NetOutput;
|
||||||
import com.github.steveice10.packetlib.packet.Packet;
|
import com.github.steveice10.packetlib.packet.Packet;
|
||||||
|
@ -20,17 +22,20 @@ import java.io.IOException;
|
||||||
public class ClientEditBookPacket implements Packet {
|
public class ClientEditBookPacket implements Packet {
|
||||||
private @NonNull ItemStack book;
|
private @NonNull ItemStack book;
|
||||||
private boolean signing;
|
private boolean signing;
|
||||||
|
private @NonNull Hand hand;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void read(NetInput in) throws IOException {
|
public void read(NetInput in) throws IOException {
|
||||||
this.book = ItemStack.read(in);
|
this.book = ItemStack.read(in);
|
||||||
this.signing = in.readBoolean();
|
this.signing = in.readBoolean();
|
||||||
|
this.hand = MagicValues.key(Hand.class, in.readVarInt());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(NetOutput out) throws IOException {
|
public void write(NetOutput out) throws IOException {
|
||||||
ItemStack.write(out, this.book);
|
ItemStack.write(out, this.book);
|
||||||
out.writeBoolean(this.signing);
|
out.writeBoolean(this.signing);
|
||||||
|
out.writeVarInt(MagicValues.value(Integer.class, hand));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,6 +17,8 @@ import lombok.NonNull;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@ -42,8 +44,9 @@ public class ServerPlayerListEntryPacket implements Packet {
|
||||||
|
|
||||||
PlayerListEntry entry = null;
|
PlayerListEntry entry = null;
|
||||||
switch(this.action) {
|
switch(this.action) {
|
||||||
case ADD_PLAYER:
|
case ADD_PLAYER: {
|
||||||
int properties = in.readVarInt();
|
int properties = in.readVarInt();
|
||||||
|
List<GameProfile.Property> propertyList = new ArrayList<>();
|
||||||
for(int index = 0; index < properties; index++) {
|
for(int index = 0; index < properties; index++) {
|
||||||
String propertyName = in.readString();
|
String propertyName = in.readString();
|
||||||
String value = in.readString();
|
String value = in.readString();
|
||||||
|
@ -52,11 +55,13 @@ public class ServerPlayerListEntryPacket implements Packet {
|
||||||
signature = in.readString();
|
signature = in.readString();
|
||||||
}
|
}
|
||||||
|
|
||||||
profile.getProperties().add(new GameProfile.Property(propertyName, value, signature));
|
propertyList.add(new GameProfile.Property(propertyName, value, signature));
|
||||||
}
|
}
|
||||||
|
|
||||||
int g = in.readVarInt();
|
profile.setProperties(propertyList);
|
||||||
GameMode gameMode = MagicValues.key(GameMode.class, g < 0 ? 0 : g);
|
|
||||||
|
int rawGameMode = in.readVarInt();
|
||||||
|
GameMode gameMode = MagicValues.key(GameMode.class, rawGameMode < 0 ? 0 : rawGameMode);
|
||||||
int ping = in.readVarInt();
|
int ping = in.readVarInt();
|
||||||
Message displayName = null;
|
Message displayName = null;
|
||||||
if(in.readBoolean()) {
|
if(in.readBoolean()) {
|
||||||
|
@ -65,23 +70,29 @@ public class ServerPlayerListEntryPacket implements Packet {
|
||||||
|
|
||||||
entry = new PlayerListEntry(profile, gameMode, ping, displayName);
|
entry = new PlayerListEntry(profile, gameMode, ping, displayName);
|
||||||
break;
|
break;
|
||||||
case UPDATE_GAMEMODE:
|
}
|
||||||
g = in.readVarInt();
|
case UPDATE_GAMEMODE: {
|
||||||
GameMode mode = MagicValues.key(GameMode.class, g < 0 ? 0 : g);
|
int rawGameMode = in.readVarInt();
|
||||||
|
GameMode mode = MagicValues.key(GameMode.class, rawGameMode < 0 ? 0 : rawGameMode);
|
||||||
|
|
||||||
entry = new PlayerListEntry(profile, mode);
|
entry = new PlayerListEntry(profile, mode);
|
||||||
break;
|
break;
|
||||||
case UPDATE_LATENCY:
|
}
|
||||||
int png = in.readVarInt();
|
case UPDATE_LATENCY: {
|
||||||
entry = new PlayerListEntry(profile, png);
|
int ping = in.readVarInt();
|
||||||
|
|
||||||
|
entry = new PlayerListEntry(profile, ping);
|
||||||
break;
|
break;
|
||||||
case UPDATE_DISPLAY_NAME:
|
}
|
||||||
Message disp = null;
|
case UPDATE_DISPLAY_NAME: {
|
||||||
|
Message displayName = null;
|
||||||
if(in.readBoolean()) {
|
if(in.readBoolean()) {
|
||||||
disp = Message.fromString(in.readString());
|
displayName = Message.fromString(in.readString());
|
||||||
}
|
}
|
||||||
|
|
||||||
entry = new PlayerListEntry(profile, disp);
|
entry = new PlayerListEntry(profile, displayName);
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case REMOVE_PLAYER:
|
case REMOVE_PLAYER:
|
||||||
entry = new PlayerListEntry(profile);
|
entry = new PlayerListEntry(profile);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
package com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn;
|
package com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.MagicValues;
|
import com.github.steveice10.mc.protocol.data.MagicValues;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.FallingBlockData;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.GenericObjectData;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.FallingBlockData;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.HangingDirection;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.GenericObjectData;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.MinecartType;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.HangingDirection;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.ObjectData;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.MinecartType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.ObjectType;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.ObjectData;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.ProjectileData;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.ProjectileData;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.SplashPotionData;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.SplashPotionData;
|
||||||
import com.github.steveice10.packetlib.io.NetInput;
|
import com.github.steveice10.packetlib.io.NetInput;
|
||||||
import com.github.steveice10.packetlib.io.NetOutput;
|
import com.github.steveice10.packetlib.io.NetOutput;
|
||||||
import com.github.steveice10.packetlib.packet.Packet;
|
import com.github.steveice10.packetlib.packet.Packet;
|
||||||
|
@ -26,10 +26,10 @@ import java.util.UUID;
|
||||||
@Setter(AccessLevel.NONE)
|
@Setter(AccessLevel.NONE)
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ServerSpawnObjectPacket implements Packet {
|
public class ServerSpawnEntityPacket implements Packet {
|
||||||
private int entityId;
|
private int entityId;
|
||||||
private @NonNull UUID uuid;
|
private @NonNull UUID uuid;
|
||||||
private @NonNull ObjectType type;
|
private @NonNull EntityType type;
|
||||||
private @NonNull ObjectData data;
|
private @NonNull ObjectData data;
|
||||||
private double x;
|
private double x;
|
||||||
private double y;
|
private double y;
|
||||||
|
@ -40,17 +40,17 @@ public class ServerSpawnObjectPacket implements Packet {
|
||||||
private double motionY;
|
private double motionY;
|
||||||
private double motionZ;
|
private double motionZ;
|
||||||
|
|
||||||
public ServerSpawnObjectPacket(int entityId, @NonNull UUID uuid, @NonNull ObjectType type,
|
public ServerSpawnEntityPacket(int entityId, @NonNull UUID uuid, @NonNull EntityType type,
|
||||||
double x, double y, double z, float yaw, float pitch) {
|
double x, double y, double z, float yaw, float pitch) {
|
||||||
this(entityId, uuid, type, new GenericObjectData(0), x, y, z, yaw, pitch, 0, 0, 0);
|
this(entityId, uuid, type, new GenericObjectData(0), x, y, z, yaw, pitch, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerSpawnObjectPacket(int entityId, @NonNull UUID uuid, @NonNull ObjectType type, @NonNull ObjectData data,
|
public ServerSpawnEntityPacket(int entityId, @NonNull UUID uuid, @NonNull EntityType type, @NonNull ObjectData data,
|
||||||
double x, double y, double z, float yaw, float pitch) {
|
double x, double y, double z, float yaw, float pitch) {
|
||||||
this(entityId, uuid, type, data, x, y, z, yaw, pitch, 0, 0, 0);
|
this(entityId, uuid, type, data, x, y, z, yaw, pitch, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerSpawnObjectPacket(int entityId, @NonNull UUID uuid, @NonNull ObjectType type,
|
public ServerSpawnEntityPacket(int entityId, @NonNull UUID uuid, @NonNull EntityType type,
|
||||||
double x, double y, double z, float yaw, float pitch,
|
double x, double y, double z, float yaw, float pitch,
|
||||||
double motionX, double motionY, double motionZ) {
|
double motionX, double motionY, double motionZ) {
|
||||||
this(entityId, uuid, type, new GenericObjectData(0), x, y, z, yaw, pitch, motionX, motionY, motionZ);
|
this(entityId, uuid, type, new GenericObjectData(0), x, y, z, yaw, pitch, motionX, motionY, motionZ);
|
||||||
|
@ -60,7 +60,7 @@ public class ServerSpawnObjectPacket implements Packet {
|
||||||
public void read(NetInput in) throws IOException {
|
public void read(NetInput in) throws IOException {
|
||||||
this.entityId = in.readVarInt();
|
this.entityId = in.readVarInt();
|
||||||
this.uuid = in.readUUID();
|
this.uuid = in.readUUID();
|
||||||
this.type = MagicValues.key(ObjectType.class, in.readVarInt());
|
this.type = MagicValues.key(EntityType.class, in.readVarInt());
|
||||||
this.x = in.readDouble();
|
this.x = in.readDouble();
|
||||||
this.y = in.readDouble();
|
this.y = in.readDouble();
|
||||||
this.z = in.readDouble();
|
this.z = in.readDouble();
|
||||||
|
@ -68,16 +68,16 @@ public class ServerSpawnObjectPacket implements Packet {
|
||||||
this.yaw = in.readByte() * 360 / 256f;
|
this.yaw = in.readByte() * 360 / 256f;
|
||||||
|
|
||||||
int data = in.readInt();
|
int data = in.readInt();
|
||||||
if(this.type == ObjectType.MINECART) {
|
if(this.type == EntityType.MINECART) {
|
||||||
this.data = MagicValues.key(MinecartType.class, data);
|
this.data = MagicValues.key(MinecartType.class, data);
|
||||||
} else if(this.type == ObjectType.ITEM_FRAME) {
|
} else if(this.type == EntityType.ITEM_FRAME) {
|
||||||
this.data = MagicValues.key(HangingDirection.class, data);
|
this.data = MagicValues.key(HangingDirection.class, data);
|
||||||
} else if(this.type == ObjectType.FALLING_BLOCK) {
|
} else if(this.type == EntityType.FALLING_BLOCK) {
|
||||||
this.data = new FallingBlockData(data & 65535, data >> 16);
|
this.data = new FallingBlockData(data & 65535, data >> 16);
|
||||||
} else if(this.type == ObjectType.POTION) {
|
} else if(this.type == EntityType.THROWN_POTION) {
|
||||||
this.data = new SplashPotionData(data);
|
this.data = new SplashPotionData(data);
|
||||||
} else if(this.type == ObjectType.SPECTRAL_ARROW || this.type == ObjectType.FIREBALL || this.type == ObjectType.SMALL_FIREBALL
|
} else if(this.type == EntityType.SPECTRAL_ARROW || this.type == EntityType.FIREBALL || this.type == EntityType.SMALL_FIREBALL
|
||||||
|| this.type == ObjectType.DRAGON_FIREBALL || this.type == ObjectType.WITHER_SKULL || this.type == ObjectType.FISHING_BOBBER) {
|
|| this.type == EntityType.DRAGON_FIREBALL || this.type == EntityType.WITHER_SKULL || this.type == EntityType.FISHING_BOBBER) {
|
||||||
this.data = new ProjectileData(data);
|
this.data = new ProjectileData(data);
|
||||||
} else {
|
} else {
|
||||||
this.data = new GenericObjectData(data);
|
this.data = new GenericObjectData(data);
|
|
@ -1,7 +1,7 @@
|
||||||
package com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn;
|
package com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.MagicValues;
|
import com.github.steveice10.mc.protocol.data.MagicValues;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.MobType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
||||||
import com.github.steveice10.packetlib.io.NetInput;
|
import com.github.steveice10.packetlib.io.NetInput;
|
||||||
import com.github.steveice10.packetlib.io.NetOutput;
|
import com.github.steveice10.packetlib.io.NetOutput;
|
||||||
import com.github.steveice10.packetlib.packet.Packet;
|
import com.github.steveice10.packetlib.packet.Packet;
|
||||||
|
@ -19,10 +19,10 @@ import java.util.UUID;
|
||||||
@Setter(AccessLevel.NONE)
|
@Setter(AccessLevel.NONE)
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ServerSpawnMobPacket implements Packet {
|
public class ServerSpawnLivingEntityPacket implements Packet {
|
||||||
private int entityId;
|
private int entityId;
|
||||||
private @NonNull UUID uuid;
|
private @NonNull UUID uuid;
|
||||||
private @NonNull MobType type;
|
private @NonNull EntityType type;
|
||||||
private double x;
|
private double x;
|
||||||
private double y;
|
private double y;
|
||||||
private double z;
|
private double z;
|
||||||
|
@ -37,7 +37,7 @@ public class ServerSpawnMobPacket implements Packet {
|
||||||
public void read(NetInput in) throws IOException {
|
public void read(NetInput in) throws IOException {
|
||||||
this.entityId = in.readVarInt();
|
this.entityId = in.readVarInt();
|
||||||
this.uuid = in.readUUID();
|
this.uuid = in.readUUID();
|
||||||
this.type = MagicValues.key(MobType.class, in.readVarInt());
|
this.type = MagicValues.key(EntityType.class, in.readVarInt());
|
||||||
this.x = in.readDouble();
|
this.x = in.readDouble();
|
||||||
this.y = in.readDouble();
|
this.y = in.readDouble();
|
||||||
this.z = in.readDouble();
|
this.z = in.readDouble();
|
|
@ -3,7 +3,7 @@ package com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn;
|
||||||
import com.github.steveice10.mc.protocol.data.MagicValues;
|
import com.github.steveice10.mc.protocol.data.MagicValues;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
|
import com.github.steveice10.mc.protocol.data.game.entity.metadata.Position;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.PaintingType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.PaintingType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.HangingDirection;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.HangingDirection;
|
||||||
import com.github.steveice10.packetlib.io.NetInput;
|
import com.github.steveice10.packetlib.io.NetInput;
|
||||||
import com.github.steveice10.packetlib.io.NetOutput;
|
import com.github.steveice10.packetlib.io.NetOutput;
|
||||||
import com.github.steveice10.packetlib.packet.Packet;
|
import com.github.steveice10.packetlib.packet.Packet;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn;
|
package com.github.steveice10.mc.protocol.packet.ingame.server.entity.spawn;
|
||||||
|
|
||||||
import com.github.steveice10.mc.protocol.data.MagicValues;
|
import com.github.steveice10.mc.protocol.data.MagicValues;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.GlobalEntityType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.WeatherEntityType;
|
||||||
import com.github.steveice10.packetlib.io.NetInput;
|
import com.github.steveice10.packetlib.io.NetInput;
|
||||||
import com.github.steveice10.packetlib.io.NetOutput;
|
import com.github.steveice10.packetlib.io.NetOutput;
|
||||||
import com.github.steveice10.packetlib.packet.Packet;
|
import com.github.steveice10.packetlib.packet.Packet;
|
||||||
|
@ -18,9 +18,9 @@ import java.io.IOException;
|
||||||
@Setter(AccessLevel.NONE)
|
@Setter(AccessLevel.NONE)
|
||||||
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
@NoArgsConstructor(access = AccessLevel.PRIVATE)
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ServerSpawnGlobalEntityPacket implements Packet {
|
public class ServerSpawnWeatherEntityPacket implements Packet {
|
||||||
private int entityId;
|
private int entityId;
|
||||||
private @NonNull GlobalEntityType type;
|
private @NonNull WeatherEntityType type;
|
||||||
private double x;
|
private double x;
|
||||||
private double y;
|
private double y;
|
||||||
private double z;
|
private double z;
|
||||||
|
@ -28,7 +28,7 @@ public class ServerSpawnGlobalEntityPacket implements Packet {
|
||||||
@Override
|
@Override
|
||||||
public void read(NetInput in) throws IOException {
|
public void read(NetInput in) throws IOException {
|
||||||
this.entityId = in.readVarInt();
|
this.entityId = in.readVarInt();
|
||||||
this.type = MagicValues.key(GlobalEntityType.class, in.readByte());
|
this.type = MagicValues.key(WeatherEntityType.class, in.readByte());
|
||||||
this.x = in.readDouble();
|
this.x = in.readDouble();
|
||||||
this.y = in.readDouble();
|
this.y = in.readDouble();
|
||||||
this.z = in.readDouble();
|
this.z = in.readDouble();
|
|
@ -19,63 +19,62 @@ import java.io.IOException;
|
||||||
public class ServerWorldBorderPacket implements Packet {
|
public class ServerWorldBorderPacket implements Packet {
|
||||||
private @NonNull WorldBorderAction action;
|
private @NonNull WorldBorderAction action;
|
||||||
|
|
||||||
private double radius;
|
private double newSize;
|
||||||
|
|
||||||
private double oldRadius;
|
private double oldSize;
|
||||||
private double newRadius;
|
private long lerpTime;
|
||||||
private long speed;
|
|
||||||
|
|
||||||
private double centerX;
|
private double newCenterX;
|
||||||
private double centerY;
|
private double newCenterZ;
|
||||||
|
|
||||||
private int portalTeleportBoundary;
|
private int newAbsoluteMaxSize;
|
||||||
|
|
||||||
private int warningTime;
|
private int warningTime;
|
||||||
|
|
||||||
private int warningBlocks;
|
private int warningBlocks;
|
||||||
|
|
||||||
public ServerWorldBorderPacket(double radius) {
|
public ServerWorldBorderPacket(double newSize) {
|
||||||
this.action = WorldBorderAction.SET_SIZE;
|
this.action = WorldBorderAction.SET_SIZE;
|
||||||
|
|
||||||
this.radius = radius;
|
this.newSize = newSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerWorldBorderPacket(double oldRadius, double newRadius, long speed) {
|
public ServerWorldBorderPacket(double oldSize, double newSize, long lerpTime) {
|
||||||
this.action = WorldBorderAction.LERP_SIZE;
|
this.action = WorldBorderAction.LERP_SIZE;
|
||||||
|
|
||||||
this.oldRadius = oldRadius;
|
this.oldSize = oldSize;
|
||||||
this.newRadius = newRadius;
|
this.newSize = newSize;
|
||||||
this.speed = speed;
|
this.lerpTime = lerpTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerWorldBorderPacket(double centerX, double centerY) {
|
public ServerWorldBorderPacket(double newCenterX, double newCenterZ) {
|
||||||
this.action = WorldBorderAction.SET_CENTER;
|
this.action = WorldBorderAction.SET_CENTER;
|
||||||
|
|
||||||
this.centerX = centerX;
|
this.newCenterX = newCenterX;
|
||||||
this.centerY = centerY;
|
this.newCenterZ = newCenterZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerWorldBorderPacket(boolean time, int warning) {
|
public ServerWorldBorderPacket(boolean isTime, int warningValue) {
|
||||||
if(time) {
|
if(isTime) {
|
||||||
this.action = WorldBorderAction.SET_WARNING_TIME;
|
this.action = WorldBorderAction.SET_WARNING_TIME;
|
||||||
|
|
||||||
this.warningTime = warning;
|
this.warningTime = warningValue;
|
||||||
} else {
|
} else {
|
||||||
this.action = WorldBorderAction.SET_WARNING_BLOCKS;
|
this.action = WorldBorderAction.SET_WARNING_BLOCKS;
|
||||||
|
|
||||||
this.warningBlocks = warning;
|
this.warningBlocks = warningValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ServerWorldBorderPacket(double centerX, double centerY, double oldRadius, double newRadius, long speed, int portalTeleportBoundary, int warningTime, int warningBlocks) {
|
public ServerWorldBorderPacket(double newCenterX, double newCenterZ, double oldSize, double newSize, long lerpTime, int newAbsoluteMaxSize, int warningTime, int warningBlocks) {
|
||||||
this.action = WorldBorderAction.INITIALIZE;
|
this.action = WorldBorderAction.INITIALIZE;
|
||||||
|
|
||||||
this.centerX = centerX;
|
this.newCenterX = newCenterX;
|
||||||
this.centerY = centerY;
|
this.newCenterZ = newCenterZ;
|
||||||
this.oldRadius = oldRadius;
|
this.oldSize = oldSize;
|
||||||
this.newRadius = newRadius;
|
this.newSize = newSize;
|
||||||
this.speed = speed;
|
this.lerpTime = lerpTime;
|
||||||
this.portalTeleportBoundary = portalTeleportBoundary;
|
this.newAbsoluteMaxSize = newAbsoluteMaxSize;
|
||||||
this.warningTime = warningTime;
|
this.warningTime = warningTime;
|
||||||
this.warningBlocks = warningBlocks;
|
this.warningBlocks = warningBlocks;
|
||||||
}
|
}
|
||||||
|
@ -84,21 +83,21 @@ public class ServerWorldBorderPacket implements Packet {
|
||||||
public void read(NetInput in) throws IOException {
|
public void read(NetInput in) throws IOException {
|
||||||
this.action = MagicValues.key(WorldBorderAction.class, in.readVarInt());
|
this.action = MagicValues.key(WorldBorderAction.class, in.readVarInt());
|
||||||
if(this.action == WorldBorderAction.SET_SIZE) {
|
if(this.action == WorldBorderAction.SET_SIZE) {
|
||||||
this.radius = in.readDouble();
|
this.newSize = in.readDouble();
|
||||||
} else if(this.action == WorldBorderAction.LERP_SIZE) {
|
} else if(this.action == WorldBorderAction.LERP_SIZE) {
|
||||||
this.oldRadius = in.readDouble();
|
this.oldSize = in.readDouble();
|
||||||
this.newRadius = in.readDouble();
|
this.newSize = in.readDouble();
|
||||||
this.speed = in.readVarLong();
|
this.lerpTime = in.readVarLong();
|
||||||
} else if(this.action == WorldBorderAction.SET_CENTER) {
|
} else if(this.action == WorldBorderAction.SET_CENTER) {
|
||||||
this.centerX = in.readDouble();
|
this.newCenterX = in.readDouble();
|
||||||
this.centerY = in.readDouble();
|
this.newCenterZ = in.readDouble();
|
||||||
} else if(this.action == WorldBorderAction.INITIALIZE) {
|
} else if(this.action == WorldBorderAction.INITIALIZE) {
|
||||||
this.centerX = in.readDouble();
|
this.newCenterX = in.readDouble();
|
||||||
this.centerY = in.readDouble();
|
this.newCenterZ = in.readDouble();
|
||||||
this.oldRadius = in.readDouble();
|
this.oldSize = in.readDouble();
|
||||||
this.newRadius = in.readDouble();
|
this.newSize = in.readDouble();
|
||||||
this.speed = in.readVarLong();
|
this.lerpTime = in.readVarLong();
|
||||||
this.portalTeleportBoundary = in.readVarInt();
|
this.newAbsoluteMaxSize = in.readVarInt();
|
||||||
this.warningTime = in.readVarInt();
|
this.warningTime = in.readVarInt();
|
||||||
this.warningBlocks = in.readVarInt();
|
this.warningBlocks = in.readVarInt();
|
||||||
} else if(this.action == WorldBorderAction.SET_WARNING_TIME) {
|
} else if(this.action == WorldBorderAction.SET_WARNING_TIME) {
|
||||||
|
@ -112,21 +111,21 @@ public class ServerWorldBorderPacket implements Packet {
|
||||||
public void write(NetOutput out) throws IOException {
|
public void write(NetOutput out) throws IOException {
|
||||||
out.writeVarInt(MagicValues.value(Integer.class, this.action));
|
out.writeVarInt(MagicValues.value(Integer.class, this.action));
|
||||||
if(this.action == WorldBorderAction.SET_SIZE) {
|
if(this.action == WorldBorderAction.SET_SIZE) {
|
||||||
out.writeDouble(this.radius);
|
out.writeDouble(this.newSize);
|
||||||
} else if(this.action == WorldBorderAction.LERP_SIZE) {
|
} else if(this.action == WorldBorderAction.LERP_SIZE) {
|
||||||
out.writeDouble(this.oldRadius);
|
out.writeDouble(this.oldSize);
|
||||||
out.writeDouble(this.newRadius);
|
out.writeDouble(this.newSize);
|
||||||
out.writeVarLong(this.speed);
|
out.writeVarLong(this.lerpTime);
|
||||||
} else if(this.action == WorldBorderAction.SET_CENTER) {
|
} else if(this.action == WorldBorderAction.SET_CENTER) {
|
||||||
out.writeDouble(this.centerX);
|
out.writeDouble(this.newCenterX);
|
||||||
out.writeDouble(this.centerY);
|
out.writeDouble(this.newCenterZ);
|
||||||
} else if(this.action == WorldBorderAction.INITIALIZE) {
|
} else if(this.action == WorldBorderAction.INITIALIZE) {
|
||||||
out.writeDouble(this.centerX);
|
out.writeDouble(this.newCenterX);
|
||||||
out.writeDouble(this.centerY);
|
out.writeDouble(this.newCenterZ);
|
||||||
out.writeDouble(this.oldRadius);
|
out.writeDouble(this.oldSize);
|
||||||
out.writeDouble(this.newRadius);
|
out.writeDouble(this.newSize);
|
||||||
out.writeVarLong(this.speed);
|
out.writeVarLong(this.lerpTime);
|
||||||
out.writeVarInt(this.portalTeleportBoundary);
|
out.writeVarInt(this.newAbsoluteMaxSize);
|
||||||
out.writeVarInt(this.warningTime);
|
out.writeVarInt(this.warningTime);
|
||||||
out.writeVarInt(this.warningBlocks);
|
out.writeVarInt(this.warningBlocks);
|
||||||
} else if(this.action == WorldBorderAction.SET_WARNING_TIME) {
|
} else if(this.action == WorldBorderAction.SET_WARNING_TIME) {
|
||||||
|
|
|
@ -32,12 +32,11 @@ import com.github.steveice10.mc.protocol.data.game.entity.player.InteractAction;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerAction;
|
import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerAction;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerState;
|
import com.github.steveice10.mc.protocol.data.game.entity.player.PlayerState;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.player.PositionElement;
|
import com.github.steveice10.mc.protocol.data.game.entity.player.PositionElement;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.GlobalEntityType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.WeatherEntityType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.MobType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.EntityType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.PaintingType;
|
import com.github.steveice10.mc.protocol.data.game.entity.type.PaintingType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.HangingDirection;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.HangingDirection;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.MinecartType;
|
import com.github.steveice10.mc.protocol.data.game.entity.object.MinecartType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.entity.type.object.ObjectType;
|
|
||||||
import com.github.steveice10.mc.protocol.data.game.recipe.RecipeType;
|
import com.github.steveice10.mc.protocol.data.game.recipe.RecipeType;
|
||||||
import com.github.steveice10.mc.protocol.data.game.scoreboard.CollisionRule;
|
import com.github.steveice10.mc.protocol.data.game.scoreboard.CollisionRule;
|
||||||
import com.github.steveice10.mc.protocol.data.game.scoreboard.NameTagVisibility;
|
import com.github.steveice10.mc.protocol.data.game.scoreboard.NameTagVisibility;
|
||||||
|
@ -143,9 +142,8 @@ public class MagicValuesTest {
|
||||||
this.register(Effect.class, Integer.class);
|
this.register(Effect.class, Integer.class);
|
||||||
this.register(EntityStatus.class, Integer.class);
|
this.register(EntityStatus.class, Integer.class);
|
||||||
this.register(PositionElement.class, Integer.class);
|
this.register(PositionElement.class, Integer.class);
|
||||||
this.register(GlobalEntityType.class, Integer.class);
|
this.register(WeatherEntityType.class, Integer.class);
|
||||||
this.register(MobType.class, Integer.class);
|
this.register(EntityType.class, Integer.class);
|
||||||
this.register(ObjectType.class, Integer.class);
|
|
||||||
this.register(MinecartType.class, Integer.class);
|
this.register(MinecartType.class, Integer.class);
|
||||||
this.register(HangingDirection.class, Integer.class);
|
this.register(HangingDirection.class, Integer.class);
|
||||||
this.register(PaintingType.class, Integer.class);
|
this.register(PaintingType.class, Integer.class);
|
||||||
|
|
Loading…
Reference in a new issue