From cbef89aa8cde7da46da6d22ad7f63f7506d14662 Mon Sep 17 00:00:00 2001 From: iso2013 Date: Sat, 28 Jul 2018 11:23:19 -0600 Subject: [PATCH] Add a method to set the identifier a packet is acting on. --- API/pom.xml | 2 +- .../peapi/api/packet/IEntityPacket.java | 8 ++++ Plugin/pom.xml | 4 +- .../blitzcube/peapi/packet/EntityPacket.java | 6 +++ docs/javadocs/allclasses-frame.html | 6 +-- docs/javadocs/allclasses-noframe.html | 6 +-- docs/javadocs/constant-values.html | 8 ++-- docs/javadocs/deprecated-list.html | 8 ++-- docs/javadocs/help-doc.html | 8 ++-- docs/javadocs/index-all.html | 16 ++++++-- docs/javadocs/index.html | 4 +- .../blitzcube/peapi/api/IPacketEntityAPI.html | 8 ++-- .../peapi/api/class-use/IPacketEntityAPI.html | 8 ++-- .../peapi/api/entity/IEntityIdentifier.html | 8 ++-- .../entity/class-use/IEntityIdentifier.html | 18 +++++++-- .../peapi/api/entity/fake/IFakeEntity.html | 8 ++-- .../api/entity/fake/IFakeEntityFactory.html | 8 ++-- .../entity/fake/class-use/IFakeEntity.html | 8 ++-- .../fake/class-use/IFakeEntityFactory.html | 8 ++-- .../peapi/api/entity/fake/package-frame.html | 6 +-- .../api/entity/fake/package-summary.html | 8 ++-- .../peapi/api/entity/fake/package-tree.html | 8 ++-- .../peapi/api/entity/fake/package-use.html | 8 ++-- .../peapi/api/entity/hitbox/IHitbox.html | 8 ++-- .../api/entity/hitbox/class-use/IHitbox.html | 8 ++-- .../api/entity/hitbox/package-frame.html | 6 +-- .../api/entity/hitbox/package-summary.html | 8 ++-- .../peapi/api/entity/hitbox/package-tree.html | 8 ++-- .../peapi/api/entity/hitbox/package-use.html | 8 ++-- .../api/entity/modifier/IEntityModifier.html | 8 ++-- .../modifier/IEntityModifierRegistry.html | 8 ++-- .../entity/modifier/IModifiableEntity.html | 8 ++-- .../modifier/class-use/IEntityModifier.html | 8 ++-- .../class-use/IEntityModifierRegistry.html | 8 ++-- .../modifier/class-use/IModifiableEntity.html | 8 ++-- .../api/entity/modifier/package-frame.html | 6 +-- .../api/entity/modifier/package-summary.html | 8 ++-- .../api/entity/modifier/package-tree.html | 8 ++-- .../api/entity/modifier/package-use.html | 8 ++-- .../peapi/api/entity/package-frame.html | 6 +-- .../peapi/api/entity/package-summary.html | 8 ++-- .../peapi/api/entity/package-tree.html | 8 ++-- .../peapi/api/entity/package-use.html | 8 ++-- .../peapi/api/event/IEntityPacketContext.html | 8 ++-- .../IEntityPacketEvent.EntityPacketType.html | 8 ++-- .../peapi/api/event/IEntityPacketEvent.html | 8 ++-- .../event/class-use/IEntityPacketContext.html | 8 ++-- .../IEntityPacketEvent.EntityPacketType.html | 8 ++-- .../event/class-use/IEntityPacketEvent.html | 8 ++-- .../peapi/api/event/package-frame.html | 6 +-- .../peapi/api/event/package-summary.html | 8 ++-- .../peapi/api/event/package-tree.html | 8 ++-- .../peapi/api/event/package-use.html | 8 ++-- .../listener/IListener.ListenerPriority.html | 8 ++-- .../peapi/api/listener/IListener.html | 8 ++-- .../class-use/IListener.ListenerPriority.html | 8 ++-- .../api/listener/class-use/IListener.html | 8 ++-- .../peapi/api/listener/package-frame.html | 6 +-- .../peapi/api/listener/package-summary.html | 8 ++-- .../peapi/api/listener/package-tree.html | 8 ++-- .../peapi/api/listener/package-use.html | 8 ++-- .../blitzcube/peapi/api/package-frame.html | 6 +-- .../blitzcube/peapi/api/package-summary.html | 8 ++-- .../net/blitzcube/peapi/api/package-tree.html | 8 ++-- .../net/blitzcube/peapi/api/package-use.html | 8 ++-- .../IEntityAnimationPacket.AnimationType.html | 8 ++-- .../api/packet/IEntityAnimationPacket.html | 11 ++--- .../packet/IEntityClickPacket.ClickType.html | 8 ++-- .../peapi/api/packet/IEntityClickPacket.html | 11 ++--- .../peapi/api/packet/IEntityDataPacket.html | 11 ++--- .../api/packet/IEntityDestroyPacket.html | 11 ++--- .../api/packet/IEntityEquipmentPacket.html | 11 ++--- .../peapi/api/packet/IEntityGroupPacket.html | 11 ++--- .../peapi/api/packet/IEntityMountPacket.html | 11 ++--- .../peapi/api/packet/IEntityPacket.html | 40 ++++++++++++++++--- .../api/packet/IEntityPacketFactory.html | 8 ++-- .../peapi/api/packet/IEntitySpawnPacket.html | 11 ++--- .../peapi/api/packet/IEntityStatusPacket.html | 11 ++--- .../peapi/api/packet/IObjectSpawnPacket.html | 11 ++--- .../IEntityAnimationPacket.AnimationType.html | 8 ++-- .../class-use/IEntityAnimationPacket.html | 8 ++-- .../IEntityClickPacket.ClickType.html | 8 ++-- .../packet/class-use/IEntityClickPacket.html | 8 ++-- .../packet/class-use/IEntityDataPacket.html | 8 ++-- .../class-use/IEntityDestroyPacket.html | 8 ++-- .../class-use/IEntityEquipmentPacket.html | 8 ++-- .../packet/class-use/IEntityGroupPacket.html | 8 ++-- .../packet/class-use/IEntityMountPacket.html | 8 ++-- .../api/packet/class-use/IEntityPacket.html | 8 ++-- .../class-use/IEntityPacketFactory.html | 8 ++-- .../packet/class-use/IEntitySpawnPacket.html | 8 ++-- .../packet/class-use/IEntityStatusPacket.html | 8 ++-- .../packet/class-use/IObjectSpawnPacket.html | 8 ++-- .../peapi/api/packet/package-frame.html | 6 +-- .../peapi/api/packet/package-summary.html | 8 ++-- .../peapi/api/packet/package-tree.html | 8 ++-- .../peapi/api/packet/package-use.html | 8 ++-- docs/javadocs/overview-frame.html | 6 +-- docs/javadocs/overview-summary.html | 10 ++--- docs/javadocs/overview-tree.html | 8 ++-- pom.xml | 2 +- 101 files changed, 459 insertions(+), 387 deletions(-) diff --git a/API/pom.xml b/API/pom.xml index 91608ad..9d14e38 100644 --- a/API/pom.xml +++ b/API/pom.xml @@ -5,7 +5,7 @@ PacketEntityAPI net.blitzcube.peapi - 0.4.3-SNAPSHOT + 0.5.0-SNAPSHOT 4.0.0 diff --git a/API/src/main/java/net/blitzcube/peapi/api/packet/IEntityPacket.java b/API/src/main/java/net/blitzcube/peapi/api/packet/IEntityPacket.java index 4355c5a..2b6e06a 100644 --- a/API/src/main/java/net/blitzcube/peapi/api/packet/IEntityPacket.java +++ b/API/src/main/java/net/blitzcube/peapi/api/packet/IEntityPacket.java @@ -24,6 +24,14 @@ public interface IEntityPacket { */ int getDelay(); + /** + * Set the identifier that this packet is acting on. Null values will be ignored, and the underlying packet will + * not change. + * + * @param identifier the identifier of the entity being changed by this packet. + */ + void setIdentifier(IEntityIdentifier identifier); + /** * Gets the raw ProtocolLib packet container that is used by the engine to send this packet to the client. * diff --git a/Plugin/pom.xml b/Plugin/pom.xml index 6ef5be9..8eef56d 100644 --- a/Plugin/pom.xml +++ b/Plugin/pom.xml @@ -6,7 +6,7 @@ PacketEntityAPI net.blitzcube.peapi - 0.4.3-SNAPSHOT + 0.5.0-SNAPSHOT Plugin @@ -59,7 +59,7 @@ net.blitzcube.peapi API - 0.4.3-SNAPSHOT + 0.5.0-SNAPSHOT diff --git a/Plugin/src/main/java/net/blitzcube/peapi/packet/EntityPacket.java b/Plugin/src/main/java/net/blitzcube/peapi/packet/EntityPacket.java index d3e61c8..3b8d165 100644 --- a/Plugin/src/main/java/net/blitzcube/peapi/packet/EntityPacket.java +++ b/Plugin/src/main/java/net/blitzcube/peapi/packet/EntityPacket.java @@ -57,6 +57,12 @@ public IEntityIdentifier getIdentifier() { return identifier; } + @Override + public void setIdentifier(IEntityIdentifier identifier) { + if (identifier != null) + this.rawPacket.getIntegers().write(0, identifier.getEntityID()); + } + @Override public PacketContainer getRawPacket() { return rawPacket; diff --git a/docs/javadocs/allclasses-frame.html b/docs/javadocs/allclasses-frame.html index a047dae..5f32f7f 100644 --- a/docs/javadocs/allclasses-frame.html +++ b/docs/javadocs/allclasses-frame.html @@ -2,10 +2,10 @@ - + - All Classes (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + All Classes (PacketEntityAPI docs v0.5.0-SNAPSHOT) + diff --git a/docs/javadocs/allclasses-noframe.html b/docs/javadocs/allclasses-noframe.html index 2e870e9..3967786 100644 --- a/docs/javadocs/allclasses-noframe.html +++ b/docs/javadocs/allclasses-noframe.html @@ -2,10 +2,10 @@ - + - All Classes (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + All Classes (PacketEntityAPI docs v0.5.0-SNAPSHOT) + diff --git a/docs/javadocs/constant-values.html b/docs/javadocs/constant-values.html index 406d519..f00c383 100644 --- a/docs/javadocs/constant-values.html +++ b/docs/javadocs/constant-values.html @@ -2,10 +2,10 @@ - + - Constant Field Values (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + Constant Field Values (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ diff --git a/docs/javadocs/net/blitzcube/peapi/api/entity/fake/package-summary.html b/docs/javadocs/net/blitzcube/peapi/api/entity/fake/package-summary.html index 2be7c6e..c93f91a 100644 --- a/docs/javadocs/net/blitzcube/peapi/api/entity/fake/package-summary.html +++ b/docs/javadocs/net/blitzcube/peapi/api/entity/fake/package-summary.html @@ -2,10 +2,10 @@ - + - net.blitzcube.peapi.api.entity.fake (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + net.blitzcube.peapi.api.entity.fake (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@ diff --git a/docs/javadocs/net/blitzcube/peapi/api/entity/hitbox/package-summary.html b/docs/javadocs/net/blitzcube/peapi/api/entity/hitbox/package-summary.html index ce8587d..276e7db 100644 --- a/docs/javadocs/net/blitzcube/peapi/api/entity/hitbox/package-summary.html +++ b/docs/javadocs/net/blitzcube/peapi/api/entity/hitbox/package-summary.html @@ -2,10 +2,10 @@ - + - net.blitzcube.peapi.api.entity.hitbox (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + net.blitzcube.peapi.api.entity.hitbox (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ diff --git a/docs/javadocs/net/blitzcube/peapi/api/entity/modifier/package-summary.html b/docs/javadocs/net/blitzcube/peapi/api/entity/modifier/package-summary.html index e6890bf..24e66ec 100644 --- a/docs/javadocs/net/blitzcube/peapi/api/entity/modifier/package-summary.html +++ b/docs/javadocs/net/blitzcube/peapi/api/entity/modifier/package-summary.html @@ -2,10 +2,10 @@ - + - net.blitzcube.peapi.api.entity.modifier (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + net.blitzcube.peapi.api.entity.modifier (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ diff --git a/docs/javadocs/net/blitzcube/peapi/api/entity/package-summary.html b/docs/javadocs/net/blitzcube/peapi/api/entity/package-summary.html index 2f1012c..2b7d77f 100644 --- a/docs/javadocs/net/blitzcube/peapi/api/entity/package-summary.html +++ b/docs/javadocs/net/blitzcube/peapi/api/entity/package-summary.html @@ -2,10 +2,10 @@ - + - net.blitzcube.peapi.api.entity (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + net.blitzcube.peapi.api.entity (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ diff --git a/docs/javadocs/net/blitzcube/peapi/api/event/package-summary.html b/docs/javadocs/net/blitzcube/peapi/api/event/package-summary.html index 1be0047..858929b 100644 --- a/docs/javadocs/net/blitzcube/peapi/api/event/package-summary.html +++ b/docs/javadocs/net/blitzcube/peapi/api/event/package-summary.html @@ -2,10 +2,10 @@ - + - net.blitzcube.peapi.api.event (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + net.blitzcube.peapi.api.event (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@ @@ -13,7 +13,7 @@ diff --git a/docs/javadocs/net/blitzcube/peapi/api/listener/package-summary.html b/docs/javadocs/net/blitzcube/peapi/api/listener/package-summary.html index 86f3e54..b09ec39 100644 --- a/docs/javadocs/net/blitzcube/peapi/api/listener/package-summary.html +++ b/docs/javadocs/net/blitzcube/peapi/api/listener/package-summary.html @@ -2,10 +2,10 @@ - + - net.blitzcube.peapi.api.listener (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + net.blitzcube.peapi.api.listener (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ diff --git a/docs/javadocs/net/blitzcube/peapi/api/package-summary.html b/docs/javadocs/net/blitzcube/peapi/api/package-summary.html index 2d9a0fd..9149f9d 100644 --- a/docs/javadocs/net/blitzcube/peapi/api/package-summary.html +++ b/docs/javadocs/net/blitzcube/peapi/api/package-summary.html @@ -2,10 +2,10 @@ - + - net.blitzcube.peapi.api (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + net.blitzcube.peapi.api (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,13 +13,13 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -13,7 +13,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ @@ -14,7 +14,7 @@ diff --git a/docs/javadocs/net/blitzcube/peapi/api/packet/package-summary.html b/docs/javadocs/net/blitzcube/peapi/api/packet/package-summary.html index 3fe77c1..30e984a 100644 --- a/docs/javadocs/net/blitzcube/peapi/api/packet/package-summary.html +++ b/docs/javadocs/net/blitzcube/peapi/api/packet/package-summary.html @@ -2,10 +2,10 @@ - + - net.blitzcube.peapi.api.packet (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + net.blitzcube.peapi.api.packet (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@ diff --git a/docs/javadocs/overview-summary.html b/docs/javadocs/overview-summary.html index fec03d6..f5fe5bd 100644 --- a/docs/javadocs/overview-summary.html +++ b/docs/javadocs/overview-summary.html @@ -2,10 +2,10 @@ - + - Overview (PacketEntityAPI docs v0.4.3-SNAPSHOT) - + Overview (PacketEntityAPI docs v0.5.0-SNAPSHOT) + @@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@