From 71687b54e008929656433b4d8c71da9c3f1343b7 Mon Sep 17 00:00:00 2001 From: iso2013 Date: Sat, 16 Jun 2018 12:22:08 -0600 Subject: [PATCH] Fix a silly bug resulting in unmount packets being cancelled. --- API/pom.xml | 2 +- Plugin/pom.xml | 4 ++-- .../peapi/event/engine/listeners/GenericListener.java | 3 ++- .../java/net/blitzcube/peapi/packet/ObjectSpawnPacket.java | 2 +- pom.xml | 2 +- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/API/pom.xml b/API/pom.xml index 012212b..2e477f4 100644 --- a/API/pom.xml +++ b/API/pom.xml @@ -5,7 +5,7 @@ PacketEntityAPI net.blitzcube.peapi - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT 4.0.0 diff --git a/Plugin/pom.xml b/Plugin/pom.xml index b270549..d4829a8 100644 --- a/Plugin/pom.xml +++ b/Plugin/pom.xml @@ -6,7 +6,7 @@ PacketEntityAPI net.blitzcube.peapi - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT Plugin @@ -59,7 +59,7 @@ net.blitzcube.peapi API - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT diff --git a/Plugin/src/main/java/net/blitzcube/peapi/event/engine/listeners/GenericListener.java b/Plugin/src/main/java/net/blitzcube/peapi/event/engine/listeners/GenericListener.java index a114dc5..9373021 100644 --- a/Plugin/src/main/java/net/blitzcube/peapi/event/engine/listeners/GenericListener.java +++ b/Plugin/src/main/java/net/blitzcube/peapi/event/engine/listeners/GenericListener.java @@ -69,7 +69,8 @@ public void onPacketSending(PacketEvent packetEvent) { IEntityPacketEvent e = new EntityPacketEvent(manager, w, eT, target); dispatcher.dispatch(e, null); if (e.getPacket() instanceof IEntityGroupPacket) { - if (((IEntityGroupPacket) e.getPacket()).getGroup().size() == 0 || e.isCancelled()) { + if ((e.getPacketType() == IEntityPacketEvent.EntityPacketType.DESTROY + && ((IEntityGroupPacket) e.getPacket()).getGroup().size() == 0) || e.isCancelled()) { packetEvent.setCancelled(true); return; } diff --git a/Plugin/src/main/java/net/blitzcube/peapi/packet/ObjectSpawnPacket.java b/Plugin/src/main/java/net/blitzcube/peapi/packet/ObjectSpawnPacket.java index 0fa6083..df73ad3 100644 --- a/Plugin/src/main/java/net/blitzcube/peapi/packet/ObjectSpawnPacket.java +++ b/Plugin/src/main/java/net/blitzcube/peapi/packet/ObjectSpawnPacket.java @@ -246,7 +246,7 @@ public void setVelocity(Vector velocity) { type != EntityType.EXPERIENCE_ORB, "You cannot set a velocity for a " + type.name() + "!"); this.velocity = velocity; - //TODO: This is wrong. + //FixMe: This implementation is not correct. super.rawPacket.getIntegers().write(1, (int) velocity.getX()); super.rawPacket.getIntegers().write(2, (int) velocity.getY()); super.rawPacket.getIntegers().write(3, (int) velocity.getZ()); diff --git a/pom.xml b/pom.xml index ebb876d..f362859 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ net.blitzcube.peapi PacketEntityAPI pom - 0.4.0-SNAPSHOT + 0.4.1-SNAPSHOT API Plugin