Skip to content

Commit c5f666a

Browse files
authored
Merge pull request #45 from fuyutsuki/patch/1
Add function imports
2 parents 873be5f + 5e949cf commit c5f666a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+101
-137
lines changed

RedstoneCircuit/plugin.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: RedstoneCircuit
22
main: redstone\Main
33
version: 2.0.0
4-
api: [3.6.0]
4+
api: 3.6.0
55
author: tedo0627
66
load: STARTUP

RedstoneCircuit/src/redstone/Main.php

-4
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@
88
use pocketmine\block\BlockFactory;
99

1010
use pocketmine\item\Item;
11-
use pocketmine\item\ItemBlock;
12-
use pocketmine\item\ItemFactory;
1311

1412
use pocketmine\tile\Tile;
1513

16-
1714
use redstone\blockEntities\BlockEntityChest;
1815
use redstone\blockEntities\BlockEntityCommandBlock;
1916
use redstone\blockEntities\BlockEntityDaylightDetector;
@@ -69,7 +66,6 @@
6966
use redstone\blocks\BlockWoodenDoor;
7067

7168
use redstone\listeners\EventListener;
72-
use redstone\listeners\ScheduledBlockUpdateListener;
7369

7470
use redstone\utils\CustomConfig;
7571
use redstone\utils\GlobalBlockPalette;

RedstoneCircuit/src/redstone/blockEntities/BlockEntityCommandBlock.php

+10
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@
4242

4343
use redstone\inventories\CommandInventory;
4444

45+
use function array_merge;
46+
use function count;
47+
use function is_string;
48+
use function preg_match_all;
49+
use function spl_object_hash;
50+
use function stripslashes;
51+
use function strlen;
52+
use function strval;
53+
use function substr;
54+
4555
class BlockEntityCommandBlock extends Spawnable implements InventoryHolder, Container, Nameable, CommandSender {
4656
use NameableTrait {
4757
addAdditionalSpawnData as addNameSpawnData;

RedstoneCircuit/src/redstone/blockEntities/BlockEntityDaylightDetector.php

-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use pocketmine\tile\Tile;
88

9-
109
use redstone\blocks\BlockDaylightDetector;
1110
use redstone\blocks\BlockDaylightDetectorInverted;
1211

@@ -54,7 +53,6 @@ public function getPower() {
5453
}
5554

5655
private function getTimePower(int $time) : int {
57-
$power = 0;
5856
$time = $time % 24000;
5957
if ($time >= 23960) {
6058
$power = 7;

RedstoneCircuit/src/redstone/blockEntities/BlockEntityDispenser.php

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use pocketmine\block\Block;
66
use pocketmine\block\BlockFactory;
7+
use pocketmine\block\Crops;
78
use pocketmine\block\Sapling;
89

910
use pocketmine\entity\Entity;
@@ -13,7 +14,6 @@
1314

1415
use pocketmine\item\Item;
1516
use pocketmine\item\Armor;
16-
use pocketmine\item\Crops;
1717
use pocketmine\item\ProjectileItem;
1818

1919
use pocketmine\math\Vector3;
@@ -28,16 +28,15 @@
2828
use pocketmine\tile\ContainerTrait;
2929
use pocketmine\tile\Nameable;
3030
use pocketmine\tile\NameableTrait;
31-
use pocketmine\tile\Tile;
3231
use pocketmine\tile\Spawnable;
3332

3433
use pocketmine\utils\Random;
3534

36-
37-
use redstone\Main;
38-
3935
use redstone\inventories\DispenserInventory;
4036

37+
use function count;
38+
use function mt_rand;
39+
4140
class BlockEntityDispenser extends Spawnable implements InventoryHolder, Container, Nameable {
4241
use NameableTrait {
4342
addAdditionalSpawnData as addNameSpawnData;

RedstoneCircuit/src/redstone/blockEntities/BlockEntityDropper.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@
1616
use pocketmine\tile\ContainerTrait;
1717
use pocketmine\tile\Nameable;
1818
use pocketmine\tile\NameableTrait;
19-
use pocketmine\tile\Tile;
2019
use pocketmine\tile\Spawnable;
2120

22-
2321
use redstone\inventories\DropperInventory;
2422

23+
use function count;
24+
use function mt_rand;
25+
2526
class BlockEntityDropper extends Spawnable implements InventoryHolder, Container, Nameable {
2627
use NameableTrait {
2728
addAdditionalSpawnData as addNameSpawnData;

RedstoneCircuit/src/redstone/blockEntities/BlockEntityHopper.php

+2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626

2727
use redstone\utils\Facing;
2828

29+
use function count;
30+
2931
class BlockEntityHopper extends Spawnable implements InventoryHolder, Container, Nameable {
3032
use NameableTrait {
3133
addAdditionalSpawnData as addNameSpawnData;

RedstoneCircuit/src/redstone/blockEntities/BlockEntityMovingBlock.php

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use pocketmine\tile\Spawnable;
1515
use pocketmine\tile\Tile;
1616

17-
1817
use redstone\Main;
1918

2019
class BlockEntityMovingBlock extends Spawnable {

RedstoneCircuit/src/redstone/blockEntities/BlockEntityNoteBlock.php

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
use pocketmine\tile\Tile;
88

9-
109
use redstone\utils\Facing;
1110

1211
class BlockEntityNoteBlock extends Tile {

RedstoneCircuit/src/redstone/blockEntities/BlockEntityPistonArm.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,18 @@
55
use pocketmine\block\Block;
66
use pocketmine\block\Flowable;
77

8-
use pocketmine\inventory\InventoryHolder;
9-
10-
use pocketmine\item\Item;
11-
12-
use pocketmine\level\Level;
13-
148
use pocketmine\math\Vector3;
159

1610
use pocketmine\nbt\NBT;
17-
use pocketmine\nbt\NetworkLittleEndianNBTStream;
1811

1912
use pocketmine\nbt\tag\CompoundTag;
2013
use pocketmine\nbt\tag\ListTag;
2114
use pocketmine\nbt\tag\IntTag;
2215

2316
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
24-
use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;
2517

2618
use pocketmine\tile\Spawnable;
2719

28-
2920
use redstone\Main;
3021

3122
use redstone\blocks\BlockMoving;
@@ -34,6 +25,8 @@
3425

3526
use redstone\utils\Facing;
3627

28+
use function count;
29+
3730
class BlockEntityPistonArm extends Spawnable {
3831

3932
protected $progress = 0;

RedstoneCircuit/src/redstone/blockEntities/BlockEntityRedstoneComparator.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use pocketmine\tile\ItemFrame;
1111
use pocketmine\tile\Tile;
1212

13-
1413
use redstone\blocks\BlockRedstoneComparatorPowered;
1514
use redstone\blocks\BlockRedstoneComparatorUnpowered;
1615
use redstone\blocks\BlockRedstoneDiode;
@@ -96,7 +95,7 @@ protected function hasSideUtility() : bool {
9695

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

102101
$sidePower = 0;

RedstoneCircuit/src/redstone/blocks/BlockButtonBase.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@
1616

1717
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
1818

19-
2019
use redstone\utils\Facing;
21-
use redstone\utils\RedstoneUtils;
2220

2321
abstract class BlockButtonBase extends Transparent implements IRedstone {
2422
use RedstoneTrait;
2523

26-
public function __construct(int $meta = 0){
24+
public function __construct(int $meta = 0) {
2725
$this->meta = $meta;
2826
}
2927

RedstoneCircuit/src/redstone/blocks/BlockButtonWooden.php

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use pocketmine\entity\projectile\Arrow;
99

1010
use pocketmine\math\AxisAlignedBB;
11-
use pocketmine\math\Facing;
1211

1312
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
1413

RedstoneCircuit/src/redstone/blocks/BlockCommand.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use pocketmine\tile\Tile;
1717

18-
1918
use redstone\blockEntities\BlockEntityCommandBlock;
2019

2120
class BlockCommand extends Solid implements IRedstone {

RedstoneCircuit/src/redstone/blocks/BlockDaylightDetector.php

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
use pocketmine\tile\Tile;
1616

17-
1817
use redstone\blockEntities\BlockEntityDaylightDetector;
1918

2019
class BlockDaylightDetector extends DaylightSensor implements IRedstone {

RedstoneCircuit/src/redstone/blocks/BlockDispenser.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use pocketmine\tile\Tile;
1717

18-
1918
use redstone\blockEntities\BlockEntityDispenser;
2019

2120
class BlockDispenser extends Solid implements IRedstone {

RedstoneCircuit/src/redstone/blocks/BlockDropper.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use pocketmine\tile\Tile;
1717

18-
1918
use redstone\blockEntities\BlockEntityDropper;
2019

2120
class BlockDropper extends Solid implements IRedstone {

RedstoneCircuit/src/redstone/blocks/BlockHopper.php

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
use pocketmine\tile\Tile;
1717

18-
1918
use redstone\blockEntities\BlockEntityHopper;
2019

2120
use redstone\utils\Facing;

RedstoneCircuit/src/redstone/blocks/BlockIronDoor.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use pocketmine\level\sound\DoorSound;
1414

15-
1615
use redstone\utils\Facing;
1716

1817
class BlockIronDoor extends IronDoor implements IRedstone {

RedstoneCircuit/src/redstone/blocks/BlockLever.php

-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414

1515
use pocketmine\math\Vector3;
1616

17-
1817
use redstone\utils\Facing;
1918

2019
class BlockLever extends Transparent implements IRedstone {

RedstoneCircuit/src/redstone/blocks/BlockPistonarmcollision.php

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
use pocketmine\item\Item;
1212

13-
14-
use redstone\blocks\BlockPiston;
15-
1613
use redstone\utils\Facing;
1714

1815
class BlockPistonarmcollision extends Transparent {

RedstoneCircuit/src/redstone/blocks/BlockPressurePlateBase.php

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
use pocketmine\network\mcpe\protocol\LevelSoundEventPacket;
1919

20-
2120
use redstone\utils\Facing;
2221

2322
abstract class BlockPressurePlateBase extends Transparent implements IRedstone {

RedstoneCircuit/src/redstone/blocks/BlockRedstone.php

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@
1414

1515
use pocketmine\math\Vector3;
1616

17-
18-
use redstone\utils\RedstoneUtils;
19-
2017
class BlockRedstone extends Solid implements IRedstone {
2118
use RedstoneTrait;
2219

RedstoneCircuit/src/redstone/blocks/BlockRedstoneComparatorPowered.php

-4
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
namespace redstone\blocks;
44

5-
use pocketmine\Server;
6-
7-
use redstone\utils\Facing;
8-
95
class BlockRedstoneComparatorPowered extends BlockRedstoneComparatorUnpowered {
106

117
protected $id = self::POWERED_COMPARATOR;

RedstoneCircuit/src/redstone/blocks/BlockRedstoneComparatorUnpowered.php

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use pocketmine\item\Item;
88

99
use pocketmine\block\Block;
10-
use pocketmine\block\BlockFactory;
1110

1211
use pocketmine\math\Vector3;
1312

RedstoneCircuit/src/redstone/blocks/BlockRedstoneDiode.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use pocketmine\math\Vector3;
1414

15-
1615
use redstone\utils\Facing;
1716

1817
abstract class BlockRedstoneDiode extends Flowable implements IRedstone {

RedstoneCircuit/src/redstone/blocks/BlockRedstoneRepeaterPowered.php

-11
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,6 @@
22

33
namespace redstone\blocks;
44

5-
use pocketmine\Player;
6-
7-
use pocketmine\block\Block;
8-
9-
use pocketmine\item\Item;
10-
11-
use pocketmine\math\Vector3;
12-
13-
14-
use redstone\utils\Facing;
15-
165
class BlockRedstoneRepeaterPowered extends BlockRedstoneRepeaterUnpowered {
176

187
protected $id = self::POWERED_REPEATER;

RedstoneCircuit/src/redstone/blocks/BlockRedstoneRepeaterUnpowered.php

-6
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66

77
use pocketmine\item\Item;
88

9-
use pocketmine\block\Block;
10-
use pocketmine\block\BlockFactory;
11-
12-
use pocketmine\math\Vector3;
13-
14-
159
use redstone\utils\Facing;
1610

1711
class BlockRedstoneRepeaterUnpowered extends BlockRedstoneDiode {

RedstoneCircuit/src/redstone/blocks/BlockRedstoneTorch.php

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use pocketmine\math\Vector3;
1414

15-
1615
use redstone\utils\Facing;
1716

1817
class BlockRedstoneTorch extends Torch implements IRedstone {

0 commit comments

Comments
 (0)