Skip to content

Commit 520128a

Browse files
committed
Shut up some phpstan errors
1 parent 5308f14 commit 520128a

File tree

3 files changed

+1
-13
lines changed

3 files changed

+1
-13
lines changed

src/xenialdan/MagicWE2/API.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ public static function getRotationData(BlockState $blockState, int $rotation) :
684684
return API::$rotationData[$id . ":" . $meta][(string) $rotation] ?? [];
685685
}
686686

687-
public static function setRotationData(array $json){
687+
public static function setRotationData(array $json) : void{
688688
self::$rotationData = $json;
689689
}
690690

src/xenialdan/MagicWE2/EventListener.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,6 @@ private function onBreakBlock(BlockBreakEvent $event) : void{
188188
if(($selection = $session->getLatestSelection()) === null){
189189
$session->addSelection(($selection = new Selection($session->getUUID(), $event->getBlock()->getPosition()->getWorld()))); // TODO check if the selection inside of the session updates
190190
}
191-
if(is_null($selection)){
192-
throw new Error("No selection created - Check the console for errors");
193-
}
194191
$selection->setPos1($event->getBlock()->getPosition());
195192
break;
196193
}
@@ -241,9 +238,6 @@ private function onRightClickBlock(PlayerInteractEvent $event) : void{
241238
if(($selection = $session->getLatestSelection()) === null){
242239
$session->addSelection(($selection = new Selection($session->getUUID(), $event->getBlock()->getPosition()->getWorld()))); // TODO check if the selection inside of the session updates
243240
}
244-
if(is_null($selection)){
245-
throw new Error("No selection created - Check the console for errors");
246-
}
247241
$selection->setPos2($event->getBlock()->getPosition());
248242
break;
249243
}
@@ -321,9 +315,6 @@ private function onLeftClickBlock(PlayerInteractEvent $event) : void{
321315
if(($selection = $session->getLatestSelection()) === null){
322316
$session->addSelection(($selection = new Selection($session->getUUID(), $event->getBlock()->getPosition()->getWorld()))); // TODO check if the selection inside of the session updates
323317
}
324-
if(is_null($selection)){
325-
throw new Error("No selection created - Check the console for errors");
326-
}
327318
$selection->setPos1($event->getBlock()->getPosition());
328319
break;
329320
}

src/xenialdan/MagicWE2/commands/selection/ChunkCommand.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,6 @@ public function onRun(CommandSender $sender, string $aliasUsed, array $args): vo
5656
if(($selection = $session->getLatestSelection()) === null){
5757
$session->addSelection(($selection = new Selection($session->getUUID(), $sender->getWorld()))); // TODO check if the selection inside of the session updates
5858
}
59-
if(is_null($selection)){
60-
throw new Error("No selection created - Check the console for errors");
61-
}
6259
$chunk = $sender->getWorld()->getOrLoadChunkAtPosition($sender->getPosition());
6360
if(is_null($chunk)){
6461
throw new Error("Could not find a chunk at your position");

0 commit comments

Comments
 (0)