Skip to content

Commit

Permalink
Fix a silly bug resulting in unmount packets being cancelled.
Browse files Browse the repository at this point in the history
  • Loading branch information
iso2013 committed Jun 16, 2018
1 parent edde72d commit 71687b5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion API/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>PacketEntityAPI</artifactId>
<groupId>net.blitzcube.peapi</groupId>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions Plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>PacketEntityAPI</artifactId>
<groupId>net.blitzcube.peapi</groupId>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>
</parent>

<artifactId>Plugin</artifactId>
Expand Down Expand Up @@ -59,7 +59,7 @@
<dependency>
<groupId>net.blitzcube.peapi</groupId>
<artifactId>API</artifactId>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>net.blitzcube.peapi</groupId>
<artifactId>PacketEntityAPI</artifactId>
<packaging>pom</packaging>
<version>0.4.0-SNAPSHOT</version>
<version>0.4.1-SNAPSHOT</version>
<modules>
<module>API</module>
<module>Plugin</module>
Expand Down

0 comments on commit 71687b5

Please sign in to comment.