mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +00:00
More new data properties
This commit is contained in:
parent
867ec6b509
commit
787f6594b2
@ -2207,7 +2207,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->setSneaking(false);
|
||||
|
||||
$this->extinguish();
|
||||
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, 300, false);
|
||||
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, 400, false);
|
||||
$this->deadTicks = 0;
|
||||
$this->noDamageTicks = 60;
|
||||
|
||||
|
@ -91,8 +91,8 @@ abstract class Entity extends Location implements Metadatable{
|
||||
* 29 (block coords) bed position */
|
||||
const DATA_LEAD_HOLDER_EID = 38; //long
|
||||
const DATA_SCALE = 39; //float
|
||||
/* 40 (string)
|
||||
* 41 (long) */
|
||||
const DATA_BUTTON_TEXT = 40; //string
|
||||
/* 41 (long) */
|
||||
const DATA_MAX_AIR = 44; //short
|
||||
const DATA_MARK_VARIANT = 45; //int
|
||||
/* 46 (byte)
|
||||
@ -142,13 +142,15 @@ abstract class Entity extends Location implements Metadatable{
|
||||
|
||||
protected $dataFlags = 0;
|
||||
protected $dataProperties = [
|
||||
self::DATA_FLAGS => [self::DATA_TYPE_BYTE, 0],
|
||||
self::DATA_FLAGS => [self::DATA_TYPE_LONG, 0],
|
||||
self::DATA_AIR => [self::DATA_TYPE_SHORT, 400],
|
||||
self::DATA_MAX_AIR => [self::DATA_TYPE_SHORT, 400],
|
||||
self::DATA_NAMETAG => [self::DATA_TYPE_STRING, ""],
|
||||
//self::DATA_SHOW_NAMETAG => [self::DATA_TYPE_BYTE, 1],
|
||||
//self::DATA_SILENT => [self::DATA_TYPE_BYTE, 0],
|
||||
//self::DATA_NO_AI => [self::DATA_TYPE_BYTE, 0],
|
||||
self::DATA_LEAD_HOLDER_EID => [self::DATA_TYPE_LONG, -1],
|
||||
self::DATA_SCALE => [self::DATA_TYPE_FLOAT, 1],
|
||||
];
|
||||
|
||||
public $passenger = null;
|
||||
|
@ -190,7 +190,7 @@ abstract class Living extends Entity implements Damageable{
|
||||
|
||||
if(!$this->hasEffect(Effect::WATER_BREATHING) and $this->isInsideOfWater()){
|
||||
if($this instanceof WaterAnimal){
|
||||
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, 300);
|
||||
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, 400);
|
||||
}else{
|
||||
$hasUpdate = true;
|
||||
$airTicks = $this->getDataProperty(self::DATA_AIR) - $tickDiff;
|
||||
@ -214,7 +214,7 @@ abstract class Living extends Entity implements Damageable{
|
||||
}
|
||||
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, $airTicks);
|
||||
}else{
|
||||
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, 300);
|
||||
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, 400);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user