Remove useless typecasts

This commit is contained in:
Dylan K. Taylor 2020-02-06 15:58:52 +00:00
parent d26fcf7dee
commit da3742b39e
5 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ class EffectCommand extends VanillaCommand{
}
if($effect === null){
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.effect.notFound", [(string) $args[1]]));
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.effect.notFound", [$args[1]]));
return true;
}

View File

@ -83,8 +83,8 @@ class Painting extends Entity{
$this->namedtag->setInt("TileY", (int) $this->blockIn->y);
$this->namedtag->setInt("TileZ", (int) $this->blockIn->z);
$this->namedtag->setByte("Facing", (int) $this->direction);
$this->namedtag->setByte("Direction", (int) $this->direction); //Save both for full compatibility
$this->namedtag->setByte("Facing", $this->direction);
$this->namedtag->setByte("Direction", $this->direction); //Save both for full compatibility
$this->namedtag->setString("Motive", $this->motive);
}

View File

@ -100,7 +100,7 @@ class Explosion{
$currentChunk = null;
$currentSubChunk = null;
$mRays = (int) ($this->rays - 1);
$mRays = $this->rays - 1;
for($i = 0; $i < $this->rays; ++$i){
for($j = 0; $j < $this->rays; ++$j){
for($k = 0; $k < $this->rays; ++$k){

View File

@ -134,9 +134,9 @@ class Flat extends Generator{
protected function parsePreset() : void{
$preset = explode(";", $this->preset);
$blocks = (string) ($preset[1] ?? "");
$blocks = $preset[1] ?? "";
$this->biome = (int) ($preset[2] ?? 1);
$options = (string) ($preset[3] ?? "");
$options = $preset[3] ?? "";
$this->structure = self::parseLayers($blocks);
$this->floorLevel = count($this->structure);

View File

@ -535,7 +535,7 @@ class NetworkBinaryStream extends BinaryStream{
}
public function getByteRotation() : float{
return (float) ($this->getByte() * (360 / 256));
return ($this->getByte() * (360 / 256));
}
public function putByteRotation(float $rotation) : void{