Skip to content

Commit

Permalink
Shut up some phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
inxomnyaa committed Oct 5, 2022
1 parent 5308f14 commit 520128a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 13 deletions.
2 changes: 1 addition & 1 deletion src/xenialdan/MagicWE2/API.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ public static function getRotationData(BlockState $blockState, int $rotation) :
return API::$rotationData[$id . ":" . $meta][(string) $rotation] ?? [];
}

public static function setRotationData(array $json){
public static function setRotationData(array $json) : void{
self::$rotationData = $json;
}

Expand Down
9 changes: 0 additions & 9 deletions src/xenialdan/MagicWE2/EventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ private function onBreakBlock(BlockBreakEvent $event) : void{
if(($selection = $session->getLatestSelection()) === null){
$session->addSelection(($selection = new Selection($session->getUUID(), $event->getBlock()->getPosition()->getWorld()))); // TODO check if the selection inside of the session updates
}
if(is_null($selection)){
throw new Error("No selection created - Check the console for errors");
}
$selection->setPos1($event->getBlock()->getPosition());
break;
}
Expand Down Expand Up @@ -241,9 +238,6 @@ private function onRightClickBlock(PlayerInteractEvent $event) : void{
if(($selection = $session->getLatestSelection()) === null){
$session->addSelection(($selection = new Selection($session->getUUID(), $event->getBlock()->getPosition()->getWorld()))); // TODO check if the selection inside of the session updates
}
if(is_null($selection)){
throw new Error("No selection created - Check the console for errors");
}
$selection->setPos2($event->getBlock()->getPosition());
break;
}
Expand Down Expand Up @@ -321,9 +315,6 @@ private function onLeftClickBlock(PlayerInteractEvent $event) : void{
if(($selection = $session->getLatestSelection()) === null){
$session->addSelection(($selection = new Selection($session->getUUID(), $event->getBlock()->getPosition()->getWorld()))); // TODO check if the selection inside of the session updates
}
if(is_null($selection)){
throw new Error("No selection created - Check the console for errors");
}
$selection->setPos1($event->getBlock()->getPosition());
break;
}
Expand Down
3 changes: 0 additions & 3 deletions src/xenialdan/MagicWE2/commands/selection/ChunkCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ public function onRun(CommandSender $sender, string $aliasUsed, array $args): vo
if(($selection = $session->getLatestSelection()) === null){
$session->addSelection(($selection = new Selection($session->getUUID(), $sender->getWorld()))); // TODO check if the selection inside of the session updates
}
if(is_null($selection)){
throw new Error("No selection created - Check the console for errors");
}
$chunk = $sender->getWorld()->getOrLoadChunkAtPosition($sender->getPosition());
if(is_null($chunk)){
throw new Error("Could not find a chunk at your position");
Expand Down

0 comments on commit 520128a

Please sign in to comment.