Skip to content

Commit 9796b98

Browse files
authored
fix: remove old darkenScreen field from BossEventPacket
1 parent 5132c83 commit 9796b98

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

src/BossEventPacket.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class BossEventPacket extends DataPacket implements ClientboundPacket, Serverbou
5252
public float $healthPercent;
5353
public string $title;
5454
public string $filteredTitle;
55-
public bool $darkenScreen;
5655
public int $color;
5756
public int $overlay;
5857

@@ -63,12 +62,11 @@ private static function base(int $bossActorUniqueId, int $eventId) : self{
6362
return $result;
6463
}
6564

66-
public static function show(int $bossActorUniqueId, string $title, float $healthPercent, bool $darkenScreen = false, int $color = BossBarColor::PURPLE, int $overlay = BossBarOverlay::PROGRESS) : self{
65+
public static function show(int $bossActorUniqueId, string $title, float $healthPercent, int $color = BossBarColor::PURPLE, int $overlay = BossBarOverlay::PROGRESS) : self{
6766
$result = self::base($bossActorUniqueId, self::TYPE_SHOW);
6867
$result->title = $title;
6968
$result->filteredTitle = $title;
7069
$result->healthPercent = $healthPercent;
71-
$result->darkenScreen = $darkenScreen;
7270
$result->color = $color;
7371
$result->overlay = $overlay;
7472
return $result;
@@ -103,9 +101,8 @@ public static function title(int $bossActorUniqueId, string $title) : self{
103101
return $result;
104102
}
105103

106-
public static function properties(int $bossActorUniqueId, bool $darkenScreen, int $color = BossBarColor::PURPLE, int $overlay = BossBarOverlay::PROGRESS) : self{
104+
public static function properties(int $bossActorUniqueId, int $color = BossBarColor::PURPLE, int $overlay = BossBarOverlay::PROGRESS) : self{
107105
$result = self::base($bossActorUniqueId, self::TYPE_PROPERTIES);
108-
$result->darkenScreen = $darkenScreen;
109106
$result->color = $color;
110107
$result->overlay = $overlay;
111108
return $result;
@@ -124,11 +121,6 @@ protected function decodePayload(ByteBufferReader $in) : void{
124121
$this->title = CommonTypes::getString($in);
125122
$this->filteredTitle = CommonTypes::getString($in);
126123
$this->healthPercent = LE::readFloat($in);
127-
$this->darkenScreen = match($raw = LE::readUnsignedShort($in)){
128-
0 => false,
129-
1 => true,
130-
default => throw new PacketDecodeException("Invalid darkenScreen value $raw"),
131-
};
132124
$this->color = VarInt::readUnsignedInt($in);
133125
$this->overlay = VarInt::readUnsignedInt($in);
134126
}
@@ -140,7 +132,6 @@ protected function encodePayload(ByteBufferWriter $out) : void{
140132
CommonTypes::putString($out, $this->title);
141133
CommonTypes::putString($out, $this->filteredTitle);
142134
LE::writeFloat($out, $this->healthPercent);
143-
LE::writeUnsignedShort($out, $this->darkenScreen ? 1 : 0);
144135
VarInt::writeUnsignedInt($out, $this->color);
145136
VarInt::writeUnsignedInt($out, $this->overlay);
146137
}

0 commit comments

Comments
 (0)