Skip to content

Commit cbef89a

Browse files
author
iso2013
committed
Add a method to set the identifier a packet is acting on.
1 parent 7c3126a commit cbef89a

101 files changed

Lines changed: 459 additions & 387 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

API/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<artifactId>PacketEntityAPI</artifactId>
77
<groupId>net.blitzcube.peapi</groupId>
8-
<version>0.4.3-SNAPSHOT</version>
8+
<version>0.5.0-SNAPSHOT</version>
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

API/src/main/java/net/blitzcube/peapi/api/packet/IEntityPacket.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,14 @@ public interface IEntityPacket {
2424
*/
2525
int getDelay();
2626

27+
/**
28+
* Set the identifier that this packet is acting on. Null values will be ignored, and the underlying packet will
29+
* not change.
30+
*
31+
* @param identifier the identifier of the entity being changed by this packet.
32+
*/
33+
void setIdentifier(IEntityIdentifier identifier);
34+
2735
/**
2836
* Gets the raw ProtocolLib packet container that is used by the engine to send this packet to the client.
2937
*

Plugin/pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<artifactId>PacketEntityAPI</artifactId>
88
<groupId>net.blitzcube.peapi</groupId>
9-
<version>0.4.3-SNAPSHOT</version>
9+
<version>0.5.0-SNAPSHOT</version>
1010
</parent>
1111

1212
<artifactId>Plugin</artifactId>
@@ -59,7 +59,7 @@
5959
<dependency>
6060
<groupId>net.blitzcube.peapi</groupId>
6161
<artifactId>API</artifactId>
62-
<version>0.4.3-SNAPSHOT</version>
62+
<version>0.5.0-SNAPSHOT</version>
6363
</dependency>
6464
</dependencies>
6565
</project>

Plugin/src/main/java/net/blitzcube/peapi/packet/EntityPacket.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public IEntityIdentifier getIdentifier() {
5757
return identifier;
5858
}
5959

60+
@Override
61+
public void setIdentifier(IEntityIdentifier identifier) {
62+
if (identifier != null)
63+
this.rawPacket.getIntegers().write(0, identifier.getEntityID());
64+
}
65+
6066
@Override
6167
public PacketContainer getRawPacket() {
6268
return rawPacket;

docs/javadocs/allclasses-frame.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Jul 26 19:59:48 MDT 2018 -->
5+
<!-- Generated by javadoc (1.8.0_161) on Sat Jul 28 11:21:53 MDT 2018 -->
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>All Classes (PacketEntityAPI docs v0.4.3-SNAPSHOT)</title>
8-
<meta name="date" content="2018-07-26">
7+
<title>All Classes (PacketEntityAPI docs v0.5.0-SNAPSHOT)</title>
8+
<meta name="date" content="2018-07-28">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<script type="text/javascript" src="script.js"></script>
1111
</head>

docs/javadocs/allclasses-noframe.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Jul 26 19:59:48 MDT 2018 -->
5+
<!-- Generated by javadoc (1.8.0_161) on Sat Jul 28 11:21:53 MDT 2018 -->
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>All Classes (PacketEntityAPI docs v0.4.3-SNAPSHOT)</title>
8-
<meta name="date" content="2018-07-26">
7+
<title>All Classes (PacketEntityAPI docs v0.5.0-SNAPSHOT)</title>
8+
<meta name="date" content="2018-07-28">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<script type="text/javascript" src="script.js"></script>
1111
</head>

docs/javadocs/constant-values.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Jul 26 19:59:47 MDT 2018 -->
5+
<!-- Generated by javadoc (1.8.0_161) on Sat Jul 28 11:21:52 MDT 2018 -->
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>Constant Field Values (PacketEntityAPI docs v0.4.3-SNAPSHOT)</title>
8-
<meta name="date" content="2018-07-26">
7+
<title>Constant Field Values (PacketEntityAPI docs v0.5.0-SNAPSHOT)</title>
8+
<meta name="date" content="2018-07-28">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<script type="text/javascript" src="script.js"></script>
1111
</head>
1212
<body>
1313
<script type="text/javascript"><!--
1414
try {
1515
if (location.href.indexOf('is-external=true') == -1) {
16-
parent.document.title="Constant Field Values (PacketEntityAPI docs v0.4.3-SNAPSHOT)";
16+
parent.document.title="Constant Field Values (PacketEntityAPI docs v0.5.0-SNAPSHOT)";
1717
}
1818
}
1919
catch(err) {

docs/javadocs/deprecated-list.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Jul 26 19:59:48 MDT 2018 -->
5+
<!-- Generated by javadoc (1.8.0_161) on Sat Jul 28 11:21:53 MDT 2018 -->
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>Deprecated List (PacketEntityAPI docs v0.4.3-SNAPSHOT)</title>
8-
<meta name="date" content="2018-07-26">
7+
<title>Deprecated List (PacketEntityAPI docs v0.5.0-SNAPSHOT)</title>
8+
<meta name="date" content="2018-07-28">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<script type="text/javascript" src="script.js"></script>
1111
</head>
1212
<body>
1313
<script type="text/javascript"><!--
1414
try {
1515
if (location.href.indexOf('is-external=true') == -1) {
16-
parent.document.title="Deprecated List (PacketEntityAPI docs v0.4.3-SNAPSHOT)";
16+
parent.document.title="Deprecated List (PacketEntityAPI docs v0.5.0-SNAPSHOT)";
1717
}
1818
}
1919
catch(err) {

docs/javadocs/help-doc.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Jul 26 19:59:48 MDT 2018 -->
5+
<!-- Generated by javadoc (1.8.0_161) on Sat Jul 28 11:21:53 MDT 2018 -->
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>API Help (PacketEntityAPI docs v0.4.3-SNAPSHOT)</title>
8-
<meta name="date" content="2018-07-26">
7+
<title>API Help (PacketEntityAPI docs v0.5.0-SNAPSHOT)</title>
8+
<meta name="date" content="2018-07-28">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<script type="text/javascript" src="script.js"></script>
1111
</head>
1212
<body>
1313
<script type="text/javascript"><!--
1414
try {
1515
if (location.href.indexOf('is-external=true') == -1) {
16-
parent.document.title="API Help (PacketEntityAPI docs v0.4.3-SNAPSHOT)";
16+
parent.document.title="API Help (PacketEntityAPI docs v0.5.0-SNAPSHOT)";
1717
}
1818
}
1919
catch(err) {

docs/javadocs/index-all.html

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<!-- NewPage -->
33
<html lang="en">
44
<head>
5-
<!-- Generated by javadoc (1.8.0_161) on Thu Jul 26 19:59:48 MDT 2018 -->
5+
<!-- Generated by javadoc (1.8.0_161) on Sat Jul 28 11:21:53 MDT 2018 -->
66
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7-
<title>Index (PacketEntityAPI docs v0.4.3-SNAPSHOT)</title>
8-
<meta name="date" content="2018-07-26">
7+
<title>Index (PacketEntityAPI docs v0.5.0-SNAPSHOT)</title>
8+
<meta name="date" content="2018-07-28">
99
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
1010
<script type="text/javascript" src="script.js"></script>
1111
</head>
1212
<body>
1313
<script type="text/javascript"><!--
1414
try {
1515
if (location.href.indexOf('is-external=true') == -1) {
16-
parent.document.title="Index (PacketEntityAPI docs v0.4.3-SNAPSHOT)";
16+
parent.document.title="Index (PacketEntityAPI docs v0.5.0-SNAPSHOT)";
1717
}
1818
}
1919
catch(err) {
@@ -1433,6 +1433,14 @@ <h2 class="title">S</h2>
14331433
<dd>
14341434
<div class="block">Sets the hitbox of this entity.</div>
14351435
</dd>
1436+
<dt><span class="memberNameLink"><a
1437+
href="net/blitzcube/peapi/api/packet/IEntityPacket.html#setIdentifier-net.blitzcube.peapi.api.entity.IEntityIdentifier-">setIdentifier(IEntityIdentifier)</a></span>
1438+
- Method in interface net.blitzcube.peapi.api.packet.<a
1439+
href="net/blitzcube/peapi/api/packet/IEntityPacket.html"
1440+
title="interface in net.blitzcube.peapi.api.packet">IEntityPacket</a></dt>
1441+
<dd>
1442+
<div class="block">Set the identifier that this packet is acting on.</div>
1443+
</dd>
14361444
<dt><span class="memberNameLink"><a
14371445
href="net/blitzcube/peapi/api/packet/IEntityEquipmentPacket.html#setItem-org.bukkit.inventory.ItemStack-">setItem(ItemStack)</a></span>
14381446
- Method in interface net.blitzcube.peapi.api.packet.<a

0 commit comments

Comments
 (0)