Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add function imports #45

Merged
merged 1 commit into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RedstoneCircuit/plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: RedstoneCircuit
main: redstone\Main
version: 2.0.0
api: [3.6.0]
api: 3.6.0
author: tedo0627
load: STARTUP
4 changes: 0 additions & 4 deletions RedstoneCircuit/src/redstone/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
use pocketmine\block\BlockFactory;

use pocketmine\item\Item;
use pocketmine\item\ItemBlock;
use pocketmine\item\ItemFactory;

use pocketmine\tile\Tile;


use redstone\blockEntities\BlockEntityChest;
use redstone\blockEntities\BlockEntityCommandBlock;
use redstone\blockEntities\BlockEntityDaylightDetector;
Expand Down Expand Up @@ -69,7 +66,6 @@
use redstone\blocks\BlockWoodenDoor;

use redstone\listeners\EventListener;
use redstone\listeners\ScheduledBlockUpdateListener;

use redstone\utils\CustomConfig;
use redstone\utils\GlobalBlockPalette;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@

use redstone\inventories\CommandInventory;

use function array_merge;
use function count;
use function is_string;
use function preg_match_all;
use function spl_object_hash;
use function stripslashes;
use function strlen;
use function strval;
use function substr;

class BlockEntityCommandBlock extends Spawnable implements InventoryHolder, Container, Nameable, CommandSender {
use NameableTrait {
addAdditionalSpawnData as addNameSpawnData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use pocketmine\tile\Tile;


use redstone\blocks\BlockDaylightDetector;
use redstone\blocks\BlockDaylightDetectorInverted;

Expand Down Expand Up @@ -54,7 +53,6 @@ public function getPower() {
}

private function getTimePower(int $time) : int {
$power = 0;
$time = $time % 24000;
if ($time >= 23960) {
$power = 7;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\Crops;
use pocketmine\block\Sapling;

use pocketmine\entity\Entity;
Expand All @@ -13,7 +14,6 @@

use pocketmine\item\Item;
use pocketmine\item\Armor;
use pocketmine\item\Crops;
use pocketmine\item\ProjectileItem;

use pocketmine\math\Vector3;
Expand All @@ -28,16 +28,15 @@
use pocketmine\tile\ContainerTrait;
use pocketmine\tile\Nameable;
use pocketmine\tile\NameableTrait;
use pocketmine\tile\Tile;
use pocketmine\tile\Spawnable;

use pocketmine\utils\Random;


use redstone\Main;

use redstone\inventories\DispenserInventory;

use function count;
use function mt_rand;

class BlockEntityDispenser extends Spawnable implements InventoryHolder, Container, Nameable {
use NameableTrait {
addAdditionalSpawnData as addNameSpawnData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
use pocketmine\tile\ContainerTrait;
use pocketmine\tile\Nameable;
use pocketmine\tile\NameableTrait;
use pocketmine\tile\Tile;
use pocketmine\tile\Spawnable;


use redstone\inventories\DropperInventory;

use function count;
use function mt_rand;

class BlockEntityDropper extends Spawnable implements InventoryHolder, Container, Nameable {
use NameableTrait {
addAdditionalSpawnData as addNameSpawnData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@

use redstone\utils\Facing;

use function count;

class BlockEntityHopper extends Spawnable implements InventoryHolder, Container, Nameable {
use NameableTrait {
addAdditionalSpawnData as addNameSpawnData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use pocketmine\tile\Spawnable;
use pocketmine\tile\Tile;


use redstone\Main;

class BlockEntityMovingBlock extends Spawnable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use pocketmine\tile\Tile;


use redstone\utils\Facing;

class BlockEntityNoteBlock extends Tile {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,18 @@
use pocketmine\block\Block;
use pocketmine\block\Flowable;

use pocketmine\inventory\InventoryHolder;

use pocketmine\item\Item;

use pocketmine\level\Level;

use pocketmine\math\Vector3;

use pocketmine\nbt\NBT;
use pocketmine\nbt\NetworkLittleEndianNBTStream;

use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\ListTag;
use pocketmine\nbt\tag\IntTag;

use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;

use pocketmine\tile\Spawnable;


use redstone\Main;

use redstone\blocks\BlockMoving;
Expand All @@ -34,6 +25,8 @@

use redstone\utils\Facing;

use function count;

class BlockEntityPistonArm extends Spawnable {

protected $progress = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use pocketmine\tile\ItemFrame;
use pocketmine\tile\Tile;


use redstone\blocks\BlockRedstoneComparatorPowered;
use redstone\blocks\BlockRedstoneComparatorUnpowered;
use redstone\blocks\BlockRedstoneDiode;
Expand Down Expand Up @@ -96,7 +95,7 @@ protected function hasSideUtility() : bool {

public function recalculateOutputPower() : int {
$block = $this->getBlock();
$power = $block->getRedstonePower($this->getSide($block->getInputFace()), $block->getInputFace());
$power = $block->getRedstonePower($this->getSide($block->getInputFace()), $block->getInputFace());// HACK: Method 'getRedstonePower' not found in \pocketmine\block\Block
$power = max($power, $this->recalculateSideUtilityPower());

$sidePower = 0;
Expand Down
4 changes: 1 addition & 3 deletions RedstoneCircuit/src/redstone/blocks/BlockButtonBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,12 @@

use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;


use redstone\utils\Facing;
use redstone\utils\RedstoneUtils;

abstract class BlockButtonBase extends Transparent implements IRedstone {
use RedstoneTrait;

public function __construct(int $meta = 0){
public function __construct(int $meta = 0) {
$this->meta = $meta;
}

Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockButtonWooden.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use pocketmine\entity\projectile\Arrow;

use pocketmine\math\AxisAlignedBB;
use pocketmine\math\Facing;

use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;

Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use pocketmine\tile\Tile;


use redstone\blockEntities\BlockEntityCommandBlock;

class BlockCommand extends Solid implements IRedstone {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

use pocketmine\tile\Tile;


use redstone\blockEntities\BlockEntityDaylightDetector;

class BlockDaylightDetector extends DaylightSensor implements IRedstone {
Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockDispenser.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use pocketmine\tile\Tile;


use redstone\blockEntities\BlockEntityDispenser;

class BlockDispenser extends Solid implements IRedstone {
Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockDropper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use pocketmine\tile\Tile;


use redstone\blockEntities\BlockEntityDropper;

class BlockDropper extends Solid implements IRedstone {
Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockHopper.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

use pocketmine\tile\Tile;


use redstone\blockEntities\BlockEntityHopper;

use redstone\utils\Facing;
Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockIronDoor.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use pocketmine\level\sound\DoorSound;


use redstone\utils\Facing;

class BlockIronDoor extends IronDoor implements IRedstone {
Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockLever.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

use pocketmine\math\Vector3;


use redstone\utils\Facing;

class BlockLever extends Transparent implements IRedstone {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

use pocketmine\item\Item;


use redstone\blocks\BlockPiston;

use redstone\utils\Facing;

class BlockPistonarmcollision extends Transparent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;


use redstone\utils\Facing;

abstract class BlockPressurePlateBase extends Transparent implements IRedstone {
Expand Down
3 changes: 0 additions & 3 deletions RedstoneCircuit/src/redstone/blocks/BlockRedstone.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@

use pocketmine\math\Vector3;


use redstone\utils\RedstoneUtils;

class BlockRedstone extends Solid implements IRedstone {
use RedstoneTrait;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

namespace redstone\blocks;

use pocketmine\Server;

use redstone\utils\Facing;

class BlockRedstoneComparatorPowered extends BlockRedstoneComparatorUnpowered {

protected $id = self::POWERED_COMPARATOR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use pocketmine\item\Item;

use pocketmine\block\Block;
use pocketmine\block\BlockFactory;

use pocketmine\math\Vector3;

Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockRedstoneDiode.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use pocketmine\math\Vector3;


use redstone\utils\Facing;

abstract class BlockRedstoneDiode extends Flowable implements IRedstone {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,6 @@

namespace redstone\blocks;

use pocketmine\Player;

use pocketmine\block\Block;

use pocketmine\item\Item;

use pocketmine\math\Vector3;


use redstone\utils\Facing;

class BlockRedstoneRepeaterPowered extends BlockRedstoneRepeaterUnpowered {

protected $id = self::POWERED_REPEATER;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@

use pocketmine\item\Item;

use pocketmine\block\Block;
use pocketmine\block\BlockFactory;

use pocketmine\math\Vector3;


use redstone\utils\Facing;

class BlockRedstoneRepeaterUnpowered extends BlockRedstoneDiode {
Expand Down
1 change: 0 additions & 1 deletion RedstoneCircuit/src/redstone/blocks/BlockRedstoneTorch.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use pocketmine\math\Vector3;


use redstone\utils\Facing;

class BlockRedstoneTorch extends Torch implements IRedstone {
Expand Down
Loading