Update to 1.13.1, fix entity IDs.

This commit is contained in:
Steveice10 2018-08-29 20:00:33 -07:00
parent c4c23eb00f
commit eee8573395
6 changed files with 136 additions and 108 deletions

View file

@ -5,7 +5,7 @@
<groupId>com.github.steveice10</groupId> <groupId>com.github.steveice10</groupId>
<artifactId>mcprotocollib</artifactId> <artifactId>mcprotocollib</artifactId>
<version>1.13-1-SNAPSHOT</version> <version>1.13.1-1-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>MCProtocolLib</name> <name>MCProtocolLib</name>

View file

@ -2,8 +2,8 @@ package com.github.steveice10.mc.protocol;
public class MinecraftConstants { public class MinecraftConstants {
// General Constants // General Constants
public static final String GAME_VERSION = "1.13"; public static final String GAME_VERSION = "1.13.1";
public static final int PROTOCOL_VERSION = 393; public static final int PROTOCOL_VERSION = 401;
// General Key Constants // General Key Constants
public static final String PROFILE_KEY = "profile"; public static final String PROFILE_KEY = "profile";

View file

@ -334,56 +334,63 @@ public class MagicValues {
register(GlobalEntityType.LIGHTNING_BOLT, 1); register(GlobalEntityType.LIGHTNING_BOLT, 1);
register(MobType.ELDER_GUARDIAN, 4); register(MobType.BAT, 3);
register(MobType.WITHER_SKELETON, 5); register(MobType.BLAZE, 4);
register(MobType.STRAY, 6); register(MobType.CAVE_SPIDER, 6);
register(MobType.HUSK, 23); register(MobType.CHICKEN, 7);
register(MobType.ZOMBIE_VILLAGER, 27); register(MobType.COD, 8);
register(MobType.SKELETON_HORSE, 28); register(MobType.COW, 9);
register(MobType.ZOMBIE_HORSE, 29); register(MobType.CREEPER, 10);
register(MobType.ARMOR_STAND, 30); register(MobType.DONKEY, 11);
register(MobType.DONKEY, 31); register(MobType.DOLPHIN, 12);
register(MobType.MULE, 32); register(MobType.DROWNED, 14);
register(MobType.EVOCATION_ILLAGER, 34); register(MobType.ELDER_GUARDIAN, 15);
register(MobType.VEX, 35); register(MobType.ENDER_DRAGON, 17);
register(MobType.VINDICATION_ILLAGER, 36); register(MobType.ENDERMAN, 18);
register(MobType.ILLUSION_ILLAGER, 37); register(MobType.ENDERMITE, 19);
register(MobType.CREEPER, 50); register(MobType.EVOCATION_ILLAGER, 21);
register(MobType.SKELETON, 51); register(MobType.GHAST, 26);
register(MobType.SPIDER, 52); register(MobType.GIANT_ZOMBIE, 27);
register(MobType.GIANT_ZOMBIE, 53); register(MobType.GUARDIAN, 28);
register(MobType.ZOMBIE, 54); register(MobType.HORSE, 29);
register(MobType.SLIME, 55); register(MobType.HUSK, 30);
register(MobType.GHAST, 56); register(MobType.ILLUSION_ILLAGER, 31);
register(MobType.ZOMBIE_PIGMAN, 57); register(MobType.LLAMA, 36);
register(MobType.ENDERMAN, 58); register(MobType.MAGMA_CUBE, 38);
register(MobType.CAVE_SPIDER, 59); register(MobType.MULE, 46);
register(MobType.SILVERFISH, 60); register(MobType.MOOSHROOM, 47);
register(MobType.BLAZE, 61); register(MobType.OCELOT, 48);
register(MobType.MAGMA_CUBE, 62); register(MobType.PARROT, 50);
register(MobType.ENDER_DRAGON, 63); register(MobType.PIG, 51);
register(MobType.WITHER, 64); register(MobType.PUFFERFISH, 52);
register(MobType.BAT, 65); register(MobType.ZOMBIE_PIGMAN, 53);
register(MobType.WITCH, 66); register(MobType.POLAR_BEAR, 54);
register(MobType.ENDERMITE, 67); register(MobType.RABBIT, 56);
register(MobType.GUARDIAN, 68); register(MobType.SALMON, 57);
register(MobType.SHULKER, 69); register(MobType.SHEEP, 58);
register(MobType.PIG, 90); register(MobType.SHULKER, 59);
register(MobType.SHEEP, 91); register(MobType.SILVERFISH, 61);
register(MobType.COW, 92); register(MobType.SKELETON, 62);
register(MobType.CHICKEN, 93); register(MobType.SKELETON_HORSE, 63);
register(MobType.SQUID, 94); register(MobType.SLIME, 64);
register(MobType.WOLF, 95); register(MobType.SNOWMAN, 66);
register(MobType.MOOSHROOM, 96); register(MobType.SPIDER, 69);
register(MobType.SNOWMAN, 97); register(MobType.SQUID, 70);
register(MobType.OCELOT, 98); register(MobType.STRAY, 71);
register(MobType.IRON_GOLEM, 99); register(MobType.TROPICAL_FISH, 72);
register(MobType.HORSE, 100); register(MobType.TURTLE, 73);
register(MobType.RABBIT, 101); register(MobType.VEX, 78);
register(MobType.POLAR_BEAR, 102); register(MobType.VILLAGER, 79);
register(MobType.LLAMA, 103); register(MobType.IRON_GOLEM, 80);
register(MobType.PARROT, 105); register(MobType.VINDICATION_ILLAGER, 81);
register(MobType.VILLAGER, 120); register(MobType.WITCH, 82);
register(MobType.WITHER, 83);
register(MobType.WITHER_SKELETON, 84);
register(MobType.WOLF, 86);
register(MobType.ZOMBIE, 87);
register(MobType.ZOMBIE_HORSE, 88);
register(MobType.ZOMBIE_VILLAGER, 89);
register(MobType.PHANTOM, 90);
register(ObjectType.BOAT, 1); register(ObjectType.BOAT, 1);
register(ObjectType.ITEM, 2); register(ObjectType.ITEM, 2);
@ -412,6 +419,7 @@ public class MagicValues {
register(ObjectType.FISH_HOOK, 90); register(ObjectType.FISH_HOOK, 90);
register(ObjectType.SPECTRAL_ARROW, 91); register(ObjectType.SPECTRAL_ARROW, 91);
register(ObjectType.DRAGON_FIREBALL, 93); register(ObjectType.DRAGON_FIREBALL, 93);
register(ObjectType.TRIDENT, 94);
register(MinecartType.NORMAL, 0); register(MinecartType.NORMAL, 0);
register(MinecartType.CHEST, 1); register(MinecartType.CHEST, 1);

View file

@ -1,54 +1,61 @@
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 MobType {
ELDER_GUARDIAN,
WITHER_SKELETON,
STRAY,
HUSK,
ZOMBIE_VILLAGER,
SKELETON_HORSE,
ZOMBIE_HORSE,
ARMOR_STAND,
DONKEY,
MULE,
EVOCATION_ILLAGER,
VEX,
VINDICATION_ILLAGER,
ILLUSION_ILLAGER,
CREEPER,
SKELETON,
SPIDER,
GIANT_ZOMBIE,
ZOMBIE,
SLIME,
GHAST,
ZOMBIE_PIGMAN,
ENDERMAN,
CAVE_SPIDER,
SILVERFISH,
BLAZE,
MAGMA_CUBE,
ENDER_DRAGON,
WITHER,
BAT, BAT,
WITCH, BLAZE,
ENDERMITE, CAVE_SPIDER,
GUARDIAN,
SHULKER,
PIG,
SHEEP,
COW,
CHICKEN, CHICKEN,
SQUID, COD,
WOLF, COW,
MOOSHROOM, CREEPER,
SNOWMAN, DONKEY,
OCELOT, DOLPHIN,
IRON_GOLEM, DROWNED,
ELDER_GUARDIAN,
ENDER_DRAGON,
ENDERMAN,
ENDERMITE,
EVOCATION_ILLAGER,
GHAST,
GIANT_ZOMBIE,
GUARDIAN,
HORSE, HORSE,
RABBIT, HUSK,
POLAR_BEAR, ILLUSION_ILLAGER,
LLAMA, LLAMA,
MAGMA_CUBE,
MULE,
MOOSHROOM,
OCELOT,
PARROT, PARROT,
VILLAGER; PIG,
PUFFERFISH,
ZOMBIE_PIGMAN,
POLAR_BEAR,
RABBIT,
SALMON,
SHEEP,
SHULKER,
SILVERFISH,
SKELETON,
SKELETON_HORSE,
SLIME,
SNOWMAN,
SPIDER,
SQUID,
STRAY,
TROPICAL_FISH,
TURTLE,
VEX,
VILLAGER,
IRON_GOLEM,
VINDICATION_ILLAGER,
WITCH,
WITHER,
WITHER_SKELETON,
WOLF,
ZOMBIE,
ZOMBIE_HORSE,
ZOMBIE_VILLAGER,
PHANTOM;
} }

View file

@ -27,5 +27,6 @@ public enum ObjectType {
FISH_HOOK, FISH_HOOK,
SPECTRAL_ARROW, SPECTRAL_ARROW,
TIPPED_ARROW, TIPPED_ARROW,
DRAGON_FIREBALL; DRAGON_FIREBALL,
TRIDENT;
} }

View file

@ -21,13 +21,14 @@ public class ServerBossBarPacket extends MinecraftPacket {
private BossBarColor color; private BossBarColor color;
private BossBarDivision division; private BossBarDivision division;
private boolean darkenSky; private boolean darkenSky;
private boolean dragonBar; private boolean playEndMusic;
private boolean showFog;
@SuppressWarnings("unused") @SuppressWarnings("unused")
private ServerBossBarPacket() { private ServerBossBarPacket() {
} }
public ServerBossBarPacket(UUID uuid, BossBarAction action, Message title, float health, BossBarColor color, BossBarDivision division, boolean darkenSky, boolean dragonBar) { public ServerBossBarPacket(UUID uuid, BossBarAction action, Message title, float health, BossBarColor color, BossBarDivision division, boolean darkenSky, boolean playEndMusic, boolean showFog) {
this.uuid = uuid; this.uuid = uuid;
this.action = BossBarAction.ADD; this.action = BossBarAction.ADD;
@ -36,7 +37,8 @@ public class ServerBossBarPacket extends MinecraftPacket {
this.color = color; this.color = color;
this.division = division; this.division = division;
this.darkenSky = darkenSky; this.darkenSky = darkenSky;
this.dragonBar = dragonBar; this.playEndMusic = playEndMusic;
this.showFog = showFog;
} }
public ServerBossBarPacket(UUID uuid) { public ServerBossBarPacket(UUID uuid) {
@ -66,12 +68,13 @@ public class ServerBossBarPacket extends MinecraftPacket {
this.division = division; this.division = division;
} }
public ServerBossBarPacket(UUID uuid, BossBarAction action, boolean darkenSky, boolean dragonBar) { public ServerBossBarPacket(UUID uuid, BossBarAction action, boolean darkenSky, boolean playEndMusic, boolean showFog) {
this.uuid = uuid; this.uuid = uuid;
this.action = BossBarAction.UPDATE_FLAGS; this.action = BossBarAction.UPDATE_FLAGS;
this.darkenSky = darkenSky; this.darkenSky = darkenSky;
this.dragonBar = dragonBar; this.playEndMusic = playEndMusic;
this.showFog = showFog;
} }
public UUID getUUID() { public UUID getUUID() {
@ -102,8 +105,12 @@ public class ServerBossBarPacket extends MinecraftPacket {
return this.darkenSky; return this.darkenSky;
} }
public boolean isDragonBar() { public boolean shouldPlayEndMusic() {
return this.dragonBar; return this.playEndMusic;
}
public boolean shouldShowFog() {
return this.showFog;
} }
@Override @Override
@ -127,7 +134,8 @@ public class ServerBossBarPacket extends MinecraftPacket {
if(this.action == BossBarAction.ADD || this.action == BossBarAction.UPDATE_FLAGS) { if(this.action == BossBarAction.ADD || this.action == BossBarAction.UPDATE_FLAGS) {
int flags = in.readUnsignedByte(); int flags = in.readUnsignedByte();
this.darkenSky = (flags & 0x1) == 0x1; this.darkenSky = (flags & 0x1) == 0x1;
this.dragonBar = (flags & 0x2) == 0x2; this.playEndMusic = (flags & 0x2) == 0x2;
this.showFog = (flags & 0x4) == 0x4;
} }
} }
@ -155,10 +163,14 @@ public class ServerBossBarPacket extends MinecraftPacket {
flags |= 0x1; flags |= 0x1;
} }
if(this.dragonBar) { if(this.playEndMusic) {
flags |= 0x2; flags |= 0x2;
} }
if(this.showFog) {
flags |= 0x4;
}
out.writeByte(flags); out.writeByte(flags);
} }
} }