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>
<artifactId>mcprotocollib</artifactId>
<version>1.13-1-SNAPSHOT</version>
<version>1.13.1-1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>MCProtocolLib</name>

View file

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

View file

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

View file

@ -1,54 +1,61 @@
package com.github.steveice10.mc.protocol.data.game.entity.type;
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,
WITCH,
ENDERMITE,
GUARDIAN,
SHULKER,
PIG,
SHEEP,
COW,
BLAZE,
CAVE_SPIDER,
CHICKEN,
SQUID,
WOLF,
MOOSHROOM,
SNOWMAN,
OCELOT,
IRON_GOLEM,
COD,
COW,
CREEPER,
DONKEY,
DOLPHIN,
DROWNED,
ELDER_GUARDIAN,
ENDER_DRAGON,
ENDERMAN,
ENDERMITE,
EVOCATION_ILLAGER,
GHAST,
GIANT_ZOMBIE,
GUARDIAN,
HORSE,
RABBIT,
POLAR_BEAR,
HUSK,
ILLUSION_ILLAGER,
LLAMA,
MAGMA_CUBE,
MULE,
MOOSHROOM,
OCELOT,
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,
SPECTRAL_ARROW,
TIPPED_ARROW,
DRAGON_FIREBALL;
DRAGON_FIREBALL,
TRIDENT;
}

View file

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