mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-14 22:01:59 +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->setSneaking(false);
|
||||||
|
|
||||||
$this->extinguish();
|
$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->deadTicks = 0;
|
||||||
$this->noDamageTicks = 60;
|
$this->noDamageTicks = 60;
|
||||||
|
|
||||||
|
@ -91,8 +91,8 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
* 29 (block coords) bed position */
|
* 29 (block coords) bed position */
|
||||||
const DATA_LEAD_HOLDER_EID = 38; //long
|
const DATA_LEAD_HOLDER_EID = 38; //long
|
||||||
const DATA_SCALE = 39; //float
|
const DATA_SCALE = 39; //float
|
||||||
/* 40 (string)
|
const DATA_BUTTON_TEXT = 40; //string
|
||||||
* 41 (long) */
|
/* 41 (long) */
|
||||||
const DATA_MAX_AIR = 44; //short
|
const DATA_MAX_AIR = 44; //short
|
||||||
const DATA_MARK_VARIANT = 45; //int
|
const DATA_MARK_VARIANT = 45; //int
|
||||||
/* 46 (byte)
|
/* 46 (byte)
|
||||||
@ -142,13 +142,15 @@ abstract class Entity extends Location implements Metadatable{
|
|||||||
|
|
||||||
protected $dataFlags = 0;
|
protected $dataFlags = 0;
|
||||||
protected $dataProperties = [
|
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_AIR => [self::DATA_TYPE_SHORT, 400],
|
||||||
|
self::DATA_MAX_AIR => [self::DATA_TYPE_SHORT, 400],
|
||||||
self::DATA_NAMETAG => [self::DATA_TYPE_STRING, ""],
|
self::DATA_NAMETAG => [self::DATA_TYPE_STRING, ""],
|
||||||
//self::DATA_SHOW_NAMETAG => [self::DATA_TYPE_BYTE, 1],
|
//self::DATA_SHOW_NAMETAG => [self::DATA_TYPE_BYTE, 1],
|
||||||
//self::DATA_SILENT => [self::DATA_TYPE_BYTE, 0],
|
//self::DATA_SILENT => [self::DATA_TYPE_BYTE, 0],
|
||||||
//self::DATA_NO_AI => [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_LEAD_HOLDER_EID => [self::DATA_TYPE_LONG, -1],
|
||||||
|
self::DATA_SCALE => [self::DATA_TYPE_FLOAT, 1],
|
||||||
];
|
];
|
||||||
|
|
||||||
public $passenger = null;
|
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->hasEffect(Effect::WATER_BREATHING) and $this->isInsideOfWater()){
|
||||||
if($this instanceof WaterAnimal){
|
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{
|
}else{
|
||||||
$hasUpdate = true;
|
$hasUpdate = true;
|
||||||
$airTicks = $this->getDataProperty(self::DATA_AIR) - $tickDiff;
|
$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);
|
$this->setDataProperty(self::DATA_AIR, self::DATA_TYPE_SHORT, $airTicks);
|
||||||
}else{
|
}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