Play Guardian animation when Totem of Undying is used.

This commit is contained in:
Matsv 2017-06-03 11:54:05 +02:00
parent 2060a698bd
commit 41d1ceb7cd
No known key found for this signature in database
GPG Key ID: 97CEC2A2EA31350F
2 changed files with 25 additions and 2 deletions

View File

@ -11,5 +11,4 @@ TODO:
- Entity names that changed?
- llama inventory slots
- Rewrite Shulker box name
- Play Guardian effect for totems?
- Rewrite Shulker box name

View File

@ -338,6 +338,30 @@ public class EntityPackets extends EntityRewriter<Protocol1_10To1_11> {
});
}
});
// Entity Status
protocol.registerOutgoing(State.PLAY, 0x1B, 0x1B, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.INT); // 0 - Entity ID
map(Type.BYTE); // 1 - Entity Status
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
byte b = wrapper.get(Type.BYTE, 0);
if (b == 35) {
wrapper.clearPacket();
wrapper.setId(0x1E); // Change Game State
wrapper.write(Type.UNSIGNED_BYTE, (short) 10); // Play Elder Guardian animation
wrapper.write(Type.FLOAT, 0F);
}
}
});
}
});
}
@Override