Here are the examples of the java api protocolsupportpocketstuff.packet.play.EntityDataPacket taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
2 Examples
15
Source : PocketMetadata.java
with GNU Affero General Public License v3.0
from ProtocolSupport
with GNU Affero General Public License v3.0
from ProtocolSupport
/**
* Sets the scale of an enreplacedy using its ID
* @param enreplacedyId
* @param scale
*/
public static void setScale(int enreplacedyId, float scale) {
if (scale == 1) {
enreplacedyScales.remove(enreplacedyId);
} else {
enreplacedyScales.put(enreplacedyId, scale);
}
// Update to all players
CollectionsUtils.ArrayMap<DataWatcherObject<?>> metadata = new CollectionsUtils.ArrayMap<>(PeMetaBase.SCALE);
metadata.put(PeMetaBase.SCALE, new DataWatcherObjectFloatLe(scale));
EnreplacedyDataPacket packet = new EnreplacedyDataPacket(enreplacedyId, metadata);
for (Connection connection : PocketCon.getPocketConnections()) {
PocketCon.sendPocketPacket(connection, packet);
}
}
13
Source : PocketMetadata.java
with GNU Affero General Public License v3.0
from ProtocolSupport
with GNU Affero General Public License v3.0
from ProtocolSupport
/**
* Sets the interact text of an enreplacedy using its id.
* You can see the text when you look at an enreplacedy on pocketedition.
* @param enreplacedyId
* @param interactText
*/
public static void setInteractText(int enreplacedyId, String interactText) {
if (interactText.equals(EnreplacedyMetadataProvider.DEFAULTINTERACT)) {
enreplacedyInteracts.remove(enreplacedyId);
} else {
enreplacedyInteracts.put(enreplacedyId, interactText);
}
// Update to all players
CollectionsUtils.ArrayMap<DataWatcherObject<?>> metadata = new CollectionsUtils.ArrayMap<>(PeMetaBase.BUTTON_TEXT_V1);
metadata.put(PeMetaBase.BUTTON_TEXT_V1, new DataWatcherObjectString(interactText));
EnreplacedyDataPacket packet = new EnreplacedyDataPacket(enreplacedyId, metadata);
for (Connection connection : PocketCon.getPocketConnections()) {
PocketCon.sendPocketPacket(connection, packet);
}
}