Update some non-critical protocol magic numbers

This commit is contained in:
Dylan K. Taylor 2018-12-20 19:59:42 +00:00
parent a7f1181335
commit ea9f9aa250
3 changed files with 74 additions and 5 deletions

View File

@ -175,6 +175,14 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
public const DATA_SCORE_TAG = 83; //string
public const DATA_BALLOON_ATTACHED_ENTITY = 84; //int64, entity unique ID of owner
public const DATA_PUFFERFISH_SIZE = 85; //byte
public const DATA_BOAT_BUBBLE_TIME = 86; //int (time in bubble column)
public const DATA_PLAYER_AGENT_EID = 87; //long
/* 88 (float) related to panda sitting
* 89 (float) related to panda sitting
* 90 (unknown) */
public const DATA_FLAGS2 = 91; //long (extended data flags)
/* 92 (float) related to panda lying down
* 93 (float) related to panda lying down */
public const DATA_FLAG_ONFIRE = 0;
@ -231,13 +239,23 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
public const DATA_FLAG_ENCHANTED = 51;
public const DATA_FLAG_SHOW_TRIDENT_ROPE = 52; // tridents show an animated rope when enchanted with loyalty after they are thrown and return to their owner. To be combined with DATA_OWNER_EID
public const DATA_FLAG_CONTAINER_PRIVATE = 53; //inventory is private, doesn't drop contents when killed if true
//54 TransformationComponent
public const DATA_FLAG_TRANSFORMING = 54;
public const DATA_FLAG_SPIN_ATTACK = 55;
public const DATA_FLAG_SWIMMING = 56;
public const DATA_FLAG_BRIBED = 57; //dolphins have this set when they go to find treasure for the player
public const DATA_FLAG_PREGNANT = 58;
public const DATA_FLAG_LAYING_EGG = 59;
//60 ??
public const DATA_FLAG_RIDER_CAN_PICK = 60; //???
public const DATA_FLAG_TRANSITION_SITTING = 61;
public const DATA_FLAG_EATING = 62;
public const DATA_FLAG_LAYING_DOWN = 63;
public const DATA_FLAG_SNEEZING = 64;
public const DATA_FLAG_TRUSTING = 65;
public const DATA_FLAG_ROLLING = 66;
public const DATA_FLAG_SCARED = 67;
public const DATA_FLAG_IN_SCAFFOLDING = 68;
public const DATA_FLAG_OVER_SCAFFOLDING = 69;
public const DATA_FLAG_FALL_THROUGH_SCAFFOLDING = 70;
public static $entityCount = 1;
/** @var Entity[] */
@ -2081,7 +2099,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
* @return bool
*/
public function getGenericFlag(int $flagId) : bool{
return $this->getDataFlag(self::DATA_FLAGS, $flagId);
return $this->getDataFlag($flagId >= 64 ? self::DATA_FLAGS2 : self::DATA_FLAGS, $flagId % 64);
}
/**
@ -2091,7 +2109,7 @@ abstract class Entity extends Location implements Metadatable, EntityIds{
* @param bool $value
*/
public function setGenericFlag(int $flagId, bool $value = true) : void{
$this->setDataFlag(self::DATA_FLAGS, $flagId, $value, self::DATA_TYPE_LONG);
$this->setDataFlag($flagId >= 64 ? self::DATA_FLAGS2 : self::DATA_FLAGS, $flagId % 64, $value, self::DATA_TYPE_LONG);
}
/**

View File

@ -72,6 +72,16 @@ abstract class Particle extends Vector3{
public const TYPE_SPIT = 42;
public const TYPE_TOTEM = 43;
public const TYPE_FOOD = 44;
public const TYPE_FIREWORKS_STARTER = 45;
public const TYPE_FIREWORKS_SPARK = 46;
public const TYPE_FIREWORKS_OVERLAY = 47;
public const TYPE_BALLOON_GAS = 48;
public const TYPE_COLORED_FLAME = 49;
public const TYPE_SPARKLER = 50;
public const TYPE_CONDUIT = 51;
public const TYPE_BUBBLE_COLUMN_UP = 52;
public const TYPE_BUBBLE_COLUMN_DOWN = 53;
public const TYPE_SNEEZE = 54;
/**
* @return DataPacket|DataPacket[]

View File

@ -242,7 +242,48 @@ class LevelSoundEventPacket extends DataPacket{
public const SOUND_CONVERT_TO_DROWNED = 211;
public const SOUND_BUCKET_FILL_FISH = 212;
public const SOUND_BUCKET_EMPTY_FISH = 213;
public const SOUND_UNDEFINED = 214;
public const SOUND_BUBBLE_UP = 214;
public const SOUND_BUBBLE_DOWN = 215;
public const SOUND_BUBBLE_POP = 216;
public const SOUND_BUBBLE_UPINSIDE = 217;
public const SOUND_BUBBLE_DOWNINSIDE = 218;
public const SOUND_HURT_BABY = 219;
public const SOUND_DEATH_BABY = 220;
public const SOUND_STEP_BABY = 221;
public const SOUND_BORN = 223;
public const SOUND_BLOCK_TURTLE_EGG_BREAK = 224;
public const SOUND_BLOCK_TURTLE_EGG_CRACK = 225;
public const SOUND_BLOCK_TURTLE_EGG_HATCH = 226;
public const SOUND_BLOCK_TURTLE_EGG_ATTACK = 228;
public const SOUND_BEACON_ACTIVATE = 229;
public const SOUND_BEACON_AMBIENT = 230;
public const SOUND_BEACON_DEACTIVATE = 231;
public const SOUND_BEACON_POWER = 232;
public const SOUND_CONDUIT_ACTIVATE = 233;
public const SOUND_CONDUIT_AMBIENT = 234;
public const SOUND_CONDUIT_ATTACK = 235;
public const SOUND_CONDUIT_DEACTIVATE = 236;
public const SOUND_CONDUIT_SHORT = 237;
public const SOUND_SWOOP = 238;
public const SOUND_BLOCK_BAMBOO_SAPLING_PLACE = 239;
public const SOUND_PRESNEEZE = 240;
public const SOUND_SNEEZE = 241;
public const SOUND_AMBIENT_TAME = 242;
public const SOUND_SCARED = 243;
public const SOUND_BLOCK_SCAFFOLDING_CLIMB = 244;
public const SOUND_CROSSBOW_LOADING_START = 245;
public const SOUND_CROSSBOW_LOADING_MIDDLE = 246;
public const SOUND_CROSSBOW_LOADING_END = 247;
public const SOUND_CROSSBOW_SHOOT = 248;
public const SOUND_CROSSBOW_QUICK_CHARGE_START = 249;
public const SOUND_CROSSBOW_QUICK_CHARGE_MIDDLE = 250;
public const SOUND_CROSSBOW_QUICK_CHARGE_END = 251;
public const SOUND_AMBIENT_AGGRESSIVE = 252;
public const SOUND_AMBIENT_WORRIED = 253;
public const SOUND_CANT_BREED = 254;
public const SOUND_UNDEFINED = 255;
/** @var int */
public $sound;