34 public const TAG_DIRECTION =
"Direction";
35 public const TAG_RINGING =
"Ringing";
36 public const TAG_TICKS =
"Ticks";
38 private bool $ringing =
false;
39 private int $facing = Facing::NORTH;
40 private int $ticks = 0;
42 public function isRinging() :
bool{
return $this->ringing; }
44 public function setRinging(
bool $ringing) :
void{ $this->ringing = $ringing; }
46 public function getFacing() :
int{
return $this->facing; }
48 public function setFacing(
int $facing) :
void{ $this->facing = $facing; }
50 public function getTicks() :
int{
return $this->ticks; }
52 public function setTicks(
int $ticks) :
void{ $this->ticks = $ticks; }
55 $nbt->setByte(self::TAG_RINGING, $this->ringing ? 1 : 0);
56 $nbt->
setInt(self::TAG_DIRECTION, $this->facing);
57 $nbt->
setInt(self::TAG_TICKS, $this->ticks);
60 public function readSaveData(
CompoundTag $nbt) : void{
61 $this->ringing = $nbt->getByte(self::TAG_RINGING, 0) !== 0;
62 $this->facing = $nbt->getInt(self::TAG_DIRECTION, Facing::NORTH);
63 $this->ticks = $nbt->getInt(self::TAG_TICKS, 0);
67 $nbt->setByte(self::TAG_RINGING, $this->ringing ? 1 : 0);
68 $nbt->
setInt(self::TAG_DIRECTION, $this->facing);
69 $nbt->
setInt(self::TAG_TICKS, $this->ticks);
81 $nbt = $this->getSpawnCompound();
82 $nbt->
setByte(self::TAG_RINGING, 1);
83 $nbt->
setInt(self::TAG_DIRECTION, match($bellHitFace){
90 $nbt->
setInt(self::TAG_TICKS, 0);
91 return BlockActorDataPacket::create(BlockPosition::fromVector3($this->position),
new CacheableNbt($nbt));