Cancel Shulker Decleration @ Update Block Entity & rewrite some sounds

This commit is contained in:
Matsv 2017-06-01 15:03:27 +02:00
parent 5ef109c037
commit f33c694dd3
No known key found for this signature in database
GPG Key ID: 97CEC2A2EA31350F
2 changed files with 24 additions and 4 deletions

View File

@ -237,6 +237,26 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_10To1_11> {
}
);
// Update Block Entity
protocol.registerOutgoing(State.PLAY, 0x09, 0x09, new PacketRemapper() {
@Override
public void registerMap() {
map(Type.POSITION); // 0 - Position
map(Type.UNSIGNED_BYTE); // 1 - Action
map(Type.NBT); // 2 - NBT
handler(new PacketHandler() {
@Override
public void handle(PacketWrapper wrapper) throws Exception {
// Remove on shulkerbox decleration TODO convert to normal chest to make it work correctly?
if (wrapper.get(Type.UNSIGNED_BYTE, 0) == 10) {
wrapper.cancel();
}
}
});
}
});
protocol.getEntityPackets().registerMetaHandler().handle(e -> {
Metadata data = e.getData();
@ -253,7 +273,7 @@ public class BlockItemPackets extends BlockItemRewriter<Protocol1_10To1_11> {
for (int i = 219; i < 235; i++)
rewriteBlockItem(i,
new Item((short) 54, (byte) 1, (short) 0, getNamedTag("1.11 Shulker Box (Color #" + (i - 219) + ")")),
new Block(i, 1));
new Block(54, 1));
// Observer to Dispenser TODO facing position?
rewriteBlockItem(218, new Item((short) 23, (byte) 1, (short) 0, getNamedTag("1.11 Observer")), new Block(23, 0));

View File

@ -69,10 +69,10 @@ public class SoundPackets extends SoundRewriter<Protocol1_10To1_11> {
protected void registerRewrites() {
// TODO find good replacement sounds
// Automatically generated from PAaaS
added(85, -1); // block.shulker_box.close
added(86, -1); // block.shulker_box.open
added(85, 121, 0.5f); // block.shulker_box.close -> block.wooden_trapdoor.close
added(86, 122, 0.5f); // block.shulker_box.open -> block.wooden_trapdoor.open
added(176, -1); // entity.elder_guardian.flop
added(176, 227); // entity.elder_guardian.flop -> entity.guardian.flop
removed(196); // entity.experience_orb.touch