Handle new Zombie metatag & change reset color to 21 (as documented on wiki.vg)

This commit is contained in:
Matsv 2018-03-20 15:55:27 +01:00
parent b7ca30efe8
commit 0ada2496de
3 changed files with 9 additions and 5 deletions

View File

@ -132,7 +132,7 @@ public class Entity1_13Types {
SPIDER(68, ABSTRACT_MONSTER), // akc
CAVE_SPIDER(6, SPIDER), // aje
// Zombies
// Zombies - META CHECKED
ZOMBIE(86, ABSTRACT_MONSTER), // aki
DROWNED(13, ZOMBIE), // ajg
HUSK(29, ZOMBIE), // ajp

View File

@ -35,8 +35,7 @@ public class MetadataRewriter {
if (metadata.getMetaType() == MetaType1_13.Slot) {
metadata.setMetaType(MetaType1_13.Slot);
InventoryPackets.toClient((Item) metadata.getValue());
}
if (metadata.getMetaType() == MetaType1_13.BlockID) {
} else if (metadata.getMetaType() == MetaType1_13.BlockID) {
// Convert to new block id
metadata.setValue(WorldPackets.toNewId((int) metadata.getValue()));
}
@ -50,6 +49,11 @@ public class MetadataRewriter {
metadata.setValue(15 - (int) metadata.getValue());
}
// Handle new zombie meta (INDEX 15 - Boolean - Zombie is shaking while enabled)
if (type.isOrHasParent(Entity1_13Types.EntityType.ZOMBIE)) {
if (metadata.getId() > 14)
metadata.setId(metadata.getId() + 1);
}
// Handle other changes
if (type.is(Entity1_13Types.EntityType.AREA_EFFECT_CLOUD)) {

View File

@ -308,8 +308,8 @@ public class ProtocolSnapshotTo1_12_2 extends Protocol {
// Handle new colors
byte color = wrapper.read(Type.BYTE);
if (color == -1) // -1 is no longer active, use white instead
wrapper.write(Type.VAR_INT, 15);
if (color == -1) // -1 changed to 21
wrapper.write(Type.VAR_INT, 21); // RESET
else
wrapper.write(Type.VAR_INT, (int) color);