mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Added support for more NBT data, renaming inventories, fixed tags not being saved, added support for tags in /give
This commit is contained in:
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class AngryVillagerParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 29);
|
||||
parent::__construct($pos, Particle::TYPE_VILLAGER_ANGRY);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class BubbleParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 1);
|
||||
parent::__construct($pos, Particle::TYPE_BUBBLE);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class CriticalParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, $scale = 2){
|
||||
parent::__construct($pos, 2, $scale);
|
||||
parent::__construct($pos, Particle::TYPE_CRITICAL, $scale);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class DustParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, $r, $g, $b, $a = 255){
|
||||
parent::__construct($pos, 22, (($a & 0xff) << 24) | (($r & 0xff) << 16) | (($g & 0xff) << 8) | ($b & 0xff));
|
||||
parent::__construct($pos, Particle::TYPE_DUST, (($a & 0xff) << 24) | (($r & 0xff) << 16) | (($g & 0xff) << 8) | ($b & 0xff));
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class EnchantParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 23);
|
||||
parent::__construct($pos, Particle::TYPE_MOB_SPELL);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class EnchantmentTableParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 31);
|
||||
parent::__construct($pos, Particle::TYPE_ENCHANTMENT_TABLE);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class EntityFlameParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 13);
|
||||
parent::__construct($pos, Particle::TYPE_MOB_FLAME);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class ExplodeParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 4);
|
||||
parent::__construct($pos, Particle::TYPE_EXPLODE);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class FlameParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 5);
|
||||
parent::__construct($pos, Particle::TYPE_FLAME);
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,11 @@ class FloatingTextParticle extends Particle{
|
||||
protected $entityId;
|
||||
protected $invisible = false;
|
||||
|
||||
/**
|
||||
* @param Vector3 $pos
|
||||
* @param int $text
|
||||
* @param string $title
|
||||
*/
|
||||
public function __construct(Vector3 $pos, $text, $title = ""){
|
||||
parent::__construct($pos->x, $pos->y, $pos->z);
|
||||
$this->text = $text;
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class HappyVillagerParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 30);
|
||||
parent::__construct($pos, Particle::TYPE_VILLAGER_HAPPY);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class HeartParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, $scale = 0){
|
||||
parent::__construct($pos, 14, $scale);
|
||||
parent::__construct($pos, Particle::TYPE_HEART, $scale);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class HugeExplodeParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 12);
|
||||
parent::__construct($pos, Particle::TYPE_HUGE_EXPLODE);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class InkParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, $scale = 0){
|
||||
parent::__construct($pos, 26, $scale);
|
||||
parent::__construct($pos, Particle::TYPE_INK, $scale);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class InstantEnchantParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 25);
|
||||
parent::__construct($pos, Particle::TYPE_MOB_SPELL_INSTANTANEOUS);
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ use pocketmine\item\Item;
|
||||
|
||||
class ItemBreakParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, Item $item){
|
||||
parent::__construct($pos, 9, ($item->getId() << 16) | $item->getDamage());
|
||||
parent::__construct($pos, Particle::TYPE_ITEM_BREAK, ($item->getId() << 16) | $item->getDamage());
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class LargeExplodeParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 11);
|
||||
parent::__construct($pos, Particle::TYPE_LARGE_EXPLODE);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class LavaDripParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 21);
|
||||
parent::__construct($pos, Particle::TYPE_DRIP_LAVA);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class LavaParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 6);
|
||||
parent::__construct($pos, Particle::TYPE_LAVA);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,39 @@ use pocketmine\math\Vector3;
|
||||
use pocketmine\network\protocol\DataPacket;
|
||||
|
||||
abstract class Particle extends Vector3{
|
||||
|
||||
const TYPE_BUBBLE = 1;
|
||||
const TYPE_CRITICAL = 2;
|
||||
const TYPE_SMOKE = 3;
|
||||
const TYPE_EXPLODE = 4;
|
||||
const TYPE_WHITE_SMOKE = 5;
|
||||
const TYPE_FLAME = 6;
|
||||
const TYPE_LAVA = 7;
|
||||
const TYPE_LARGE_SMOKE = 8;
|
||||
const TYPE_REDSTONE = 9;
|
||||
const TYPE_ITEM_BREAK = 10;
|
||||
const TYPE_SNOWBALL_POOF = 11;
|
||||
const TYPE_LARGE_EXPLODE = 12;
|
||||
const TYPE_HUGE_EXPLODE = 13;
|
||||
const TYPE_MOB_FLAME = 14;
|
||||
const TYPE_HEART = 15;
|
||||
const TYPE_TERRAIN = 16;
|
||||
const TYPE_TOWN_AURA = 17;
|
||||
const TYPE_PORTAL = 18;
|
||||
const TYPE_WATER_SPLASH = 19;
|
||||
const TYPE_WATER_WAKE = 20;
|
||||
const TYPE_DRIP_WATER = 21;
|
||||
const TYPE_DRIP_LAVA = 22;
|
||||
const TYPE_DUST = 23;
|
||||
const TYPE_MOB_SPELL = 24;
|
||||
const TYPE_MOB_SPELL_AMBIENT = 25;
|
||||
const TYPE_MOB_SPELL_INSTANTANEOUS = 26;
|
||||
const TYPE_INK = 27;
|
||||
const TYPE_SLIME = 28;
|
||||
const TYPE_RAIN_SPLASH = 29;
|
||||
const TYPE_VILLAGER_ANGRY = 30;
|
||||
const TYPE_VILLAGER_HAPPY = 31;
|
||||
const TYPE_ENCHANTMENT_TABLE = 32;
|
||||
|
||||
/**
|
||||
* @return DataPacket|DataPacket[]
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class PortalParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 17);
|
||||
parent::__construct($pos, Particle::TYPE_PORTAL);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class RainSplashParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 28);
|
||||
parent::__construct($pos, Particle::TYPE_RAIN_SPLASH);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class RedstoneParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, $lifetime = 1){
|
||||
parent::__construct($pos, 8, $lifetime);
|
||||
parent::__construct($pos, Particle::TYPE_REDSTONE, $lifetime);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class SmokeParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, $scale = 0){
|
||||
parent::__construct($pos, 3, (int) $scale);
|
||||
parent::__construct($pos, Particle::TYPE_SMOKE, (int) $scale);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class SplashParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 18);
|
||||
parent::__construct($pos, Particle::TYPE_WATER_SPLASH);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class SporeParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 16);
|
||||
parent::__construct($pos, Particle::TYPE_TOWN_AURA);
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class TerrainParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos, Block $b){
|
||||
parent::__construct($pos, 15, ($b->getDamage() << 8) | $b->getId());
|
||||
parent::__construct($pos, Particle::TYPE_TERRAIN, ($b->getDamage() << 8) | $b->getId());
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class WaterDripParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 20);
|
||||
parent::__construct($pos, Particle::TYPE_DRIP_WATER);
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,6 @@ use pocketmine\math\Vector3;
|
||||
|
||||
class WaterParticle extends GenericParticle{
|
||||
public function __construct(Vector3 $pos){
|
||||
parent::__construct($pos, 19);
|
||||
parent::__construct($pos, Particle::TYPE_WATER_WAKE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user