From 9c067dc2970dc10a6eed1e24a21dfa71cf4a30bb Mon Sep 17 00:00:00 2001 From: Hugo_ <55756021+Dhaiven@users.noreply.github.com> Date: Fri, 21 Feb 2025 11:49:36 +0100 Subject: [PATCH 1/6] Add interfaces for commons properties --- src/block/ActivatorRail.php | 3 +- src/block/AmethystCluster.php | 3 +- src/block/Anvil.php | 3 +- src/block/Barrel.php | 3 +- src/block/BaseBanner.php | 3 +- src/block/BaseBigDripleaf.php | 3 +- src/block/BaseCoral.php | 3 +- src/block/BaseSign.php | 3 +- src/block/Bed.php | 4 +- src/block/Bell.php | 3 +- src/block/BoneBlock.php | 3 +- src/block/Button.php | 3 +- src/block/Cactus.php | 3 +- src/block/CakeWithCandle.php | 3 +- src/block/CakeWithDyedCandle.php | 3 +- src/block/Campfire.php | 4 +- src/block/Candle.php | 3 +- src/block/Carpet.php | 3 +- src/block/CarvedPumpkin.php | 3 +- src/block/CaveVines.php | 3 +- src/block/Chain.php | 3 +- src/block/ChemistryTable.php | 3 +- src/block/Chest.php | 3 +- src/block/ChiseledBookshelf.php | 3 +- src/block/ChorusFlower.php | 3 +- src/block/CocoaBlock.php | 4 +- src/block/Concrete.php | 3 +- src/block/ConcretePowder.php | 3 +- src/block/CopperBulb.php | 4 +- src/block/CoralBlock.php | 3 +- src/block/Crops.php | 3 +- src/block/DaylightSensor.php | 3 +- src/block/Door.php | 3 +- src/block/DoublePitcherCrop.php | 3 +- src/block/DyedCandle.php | 3 +- src/block/DyedShulkerBox.php | 3 +- src/block/EndPortalFrame.php | 3 +- src/block/EndRod.php | 3 +- src/block/EnderChest.php | 3 +- src/block/FenceGate.php | 4 +- src/block/Fire.php | 3 +- src/block/FloorBanner.php | 3 +- src/block/FloorSign.php | 3 +- src/block/FrostedIce.php | 3 +- src/block/Furnace.php | 3 +- src/block/GlazedTerracotta.php | 4 +- src/block/GlowLichen.php | 3 +- src/block/HayBale.php | 3 +- src/block/Hopper.php | 3 +- src/block/ItemFrame.php | 3 +- src/block/Ladder.php | 3 +- src/block/Lectern.php | 3 +- src/block/LightningRod.php | 3 +- src/block/Loom.php | 3 +- src/block/NetherVines.php | 3 +- src/block/NetherWartPlant.php | 3 +- src/block/PinkPetals.php | 3 +- src/block/PitcherCrop.php | 3 +- src/block/Planks.php | 3 +- src/block/PoweredRail.php | 3 +- src/block/RedstoneComparator.php | 5 +- src/block/RedstoneLamp.php | 3 +- src/block/RedstoneOre.php | 3 +- src/block/RedstoneRepeater.php | 4 +- src/block/RedstoneTorch.php | 3 +- src/block/RedstoneWire.php | 3 +- src/block/ResinClump.php | 3 +- src/block/ShulkerBox.php | 3 +- src/block/SimplePillar.php | 3 +- src/block/SmallDripleaf.php | 3 +- src/block/StainedGlass.php | 3 +- src/block/StainedGlassPane.php | 3 +- src/block/StainedHardenedClay.php | 3 +- src/block/StainedHardenedGlass.php | 3 +- src/block/StainedHardenedGlassPane.php | 3 +- src/block/Stair.php | 3 +- src/block/Stonecutter.php | 3 +- src/block/Sugarcane.php | 3 +- src/block/SweetBerryBush.php | 3 +- src/block/Trapdoor.php | 3 +- src/block/TripwireHook.php | 3 +- src/block/WallBanner.php | 3 +- src/block/WallCoralFan.php | 3 +- src/block/WallSign.php | 3 +- src/block/WeightedPressurePlate.php | 3 +- src/block/Wood.php | 3 +- src/block/WoodenButton.php | 3 +- src/block/WoodenDoor.php | 3 +- src/block/WoodenFence.php | 3 +- src/block/WoodenPressurePlate.php | 3 +- src/block/WoodenSlab.php | 3 +- src/block/WoodenStairs.php | 3 +- src/block/WoodenTrapdoor.php | 3 +- src/block/Wool.php | 3 +- src/block/utils/AgeableInterface.php | 34 +++++++++++++ .../AnalogRedstoneSignalEmitterInterface.php | 34 +++++++++++++ src/block/utils/ColoredInterface.php | 31 ++++++++++++ src/block/utils/CoralTypeInterface.php | 35 +++++++++++++ src/block/utils/LightableInterface.php | 31 ++++++++++++ src/block/utils/MultiFacingInterface.php | 50 +++++++++++++++++++ src/block/utils/PillarRotationInterface.php | 35 +++++++++++++ .../utils/PoweredByRedstoneInterface.php | 31 ++++++++++++ src/block/utils/SignLikeRotationInterface.php | 39 +++++++++++++++ src/block/utils/SingleFacingInterface.php | 41 +++++++++++++++ src/block/utils/WoodTypeInterface.php | 29 +++++++++++ 105 files changed, 587 insertions(+), 94 deletions(-) create mode 100644 src/block/utils/AgeableInterface.php create mode 100644 src/block/utils/AnalogRedstoneSignalEmitterInterface.php create mode 100644 src/block/utils/ColoredInterface.php create mode 100644 src/block/utils/CoralTypeInterface.php create mode 100644 src/block/utils/LightableInterface.php create mode 100644 src/block/utils/MultiFacingInterface.php create mode 100644 src/block/utils/PillarRotationInterface.php create mode 100644 src/block/utils/PoweredByRedstoneInterface.php create mode 100644 src/block/utils/SignLikeRotationInterface.php create mode 100644 src/block/utils/SingleFacingInterface.php create mode 100644 src/block/utils/WoodTypeInterface.php diff --git a/src/block/ActivatorRail.php b/src/block/ActivatorRail.php index dcd0ef93b05..eee75c95f39 100644 --- a/src/block/ActivatorRail.php +++ b/src/block/ActivatorRail.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\RailPoweredByRedstoneTrait; -class ActivatorRail extends StraightOnlyRail{ +class ActivatorRail extends StraightOnlyRail implements PoweredByRedstoneInterface{ use RailPoweredByRedstoneTrait; //TODO diff --git a/src/block/AmethystCluster.php b/src/block/AmethystCluster.php index 639490456a3..1912e5c0506 100644 --- a/src/block/AmethystCluster.php +++ b/src/block/AmethystCluster.php @@ -26,6 +26,7 @@ use pocketmine\block\utils\AmethystTrait; use pocketmine\block\utils\AnyFacingTrait; use pocketmine\block\utils\FortuneDropHelper; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -38,7 +39,7 @@ use pocketmine\utils\AssumptionFailedError; use pocketmine\world\BlockTransaction; -final class AmethystCluster extends Transparent{ +final class AmethystCluster extends Transparent implements SingleFacingInterface{ use AmethystTrait; use AnyFacingTrait; diff --git a/src/block/Anvil.php b/src/block/Anvil.php index 2c48f9a7c42..3431d81e237 100644 --- a/src/block/Anvil.php +++ b/src/block/Anvil.php @@ -27,6 +27,7 @@ use pocketmine\block\utils\Fallable; use pocketmine\block\utils\FallableTrait; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\entity\object\FallingBlock; @@ -41,7 +42,7 @@ use pocketmine\world\sound\Sound; use function round; -class Anvil extends Transparent implements Fallable{ +class Anvil extends Transparent implements Fallable, SingleFacingInterface{ use FallableTrait; use HorizontalFacingTrait; diff --git a/src/block/Barrel.php b/src/block/Barrel.php index 0f0499ab93b..b7fd91ad0c5 100644 --- a/src/block/Barrel.php +++ b/src/block/Barrel.php @@ -25,6 +25,7 @@ use pocketmine\block\tile\Barrel as TileBarrel; use pocketmine\block\utils\AnyFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; use pocketmine\math\Facing; @@ -33,7 +34,7 @@ use pocketmine\world\BlockTransaction; use function abs; -class Barrel extends Opaque{ +class Barrel extends Opaque implements SingleFacingInterface{ use AnyFacingTrait; protected bool $open = false; diff --git a/src/block/BaseBanner.php b/src/block/BaseBanner.php index b563234533b..a999494e6ec 100644 --- a/src/block/BaseBanner.php +++ b/src/block/BaseBanner.php @@ -25,6 +25,7 @@ use pocketmine\block\tile\Banner as TileBanner; use pocketmine\block\utils\BannerPatternLayer; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\SupportType; use pocketmine\item\Banner as ItemBanner; @@ -36,7 +37,7 @@ use function assert; use function count; -abstract class BaseBanner extends Transparent{ +abstract class BaseBanner extends Transparent implements ColoredInterface{ use ColoredTrait; /** diff --git a/src/block/BaseBigDripleaf.php b/src/block/BaseBigDripleaf.php index f0ff59cf08b..a3094af5e0f 100644 --- a/src/block/BaseBigDripleaf.php +++ b/src/block/BaseBigDripleaf.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\event\block\StructureGrowEvent; use pocketmine\item\Fertilizer; @@ -33,7 +34,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -abstract class BaseBigDripleaf extends Transparent{ +abstract class BaseBigDripleaf extends Transparent implements SingleFacingInterface{ use HorizontalFacingTrait; abstract protected function isHead() : bool; diff --git a/src/block/BaseCoral.php b/src/block/BaseCoral.php index b9c595a97d4..52b5f137a25 100644 --- a/src/block/BaseCoral.php +++ b/src/block/BaseCoral.php @@ -24,12 +24,13 @@ namespace pocketmine\block; use pocketmine\block\utils\BlockEventHelper; +use pocketmine\block\utils\CoralTypeInterface; use pocketmine\block\utils\CoralTypeTrait; use pocketmine\block\utils\SupportType; use pocketmine\item\Item; use function mt_rand; -abstract class BaseCoral extends Transparent{ +abstract class BaseCoral extends Transparent implements CoralTypeInterface{ use CoralTypeTrait; public function onNearbyBlockChange() : void{ diff --git a/src/block/BaseSign.php b/src/block/BaseSign.php index 0f5d77d5825..548d8c12498 100644 --- a/src/block/BaseSign.php +++ b/src/block/BaseSign.php @@ -28,6 +28,7 @@ use pocketmine\block\utils\SignText; use pocketmine\block\utils\SupportType; use pocketmine\block\utils\WoodType; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; use pocketmine\color\Color; use pocketmine\event\block\SignChangeEvent; @@ -44,7 +45,7 @@ use function assert; use function strlen; -abstract class BaseSign extends Transparent{ +abstract class BaseSign extends Transparent implements WoodTypeInterface{ use WoodTypeTrait; protected SignText $text; diff --git a/src/block/Bed.php b/src/block/Bed.php index 133c4a9cc5a..c7828d128c8 100644 --- a/src/block/Bed.php +++ b/src/block/Bed.php @@ -24,9 +24,11 @@ namespace pocketmine\block; use pocketmine\block\tile\Bed as TileBed; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\DyeColor; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\entity\Entity; @@ -41,7 +43,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\World; -class Bed extends Transparent{ +class Bed extends Transparent implements ColoredInterface, SingleFacingInterface{ use ColoredTrait; use HorizontalFacingTrait; diff --git a/src/block/Bell.php b/src/block/Bell.php index 53a6fc7fbb4..32dffd5e58c 100644 --- a/src/block/Bell.php +++ b/src/block/Bell.php @@ -26,6 +26,7 @@ use pocketmine\block\tile\Bell as TileBell; use pocketmine\block\utils\BellAttachmentType; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\entity\projectile\Projectile; @@ -38,7 +39,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\BellRingSound; -final class Bell extends Transparent{ +final class Bell extends Transparent implements SingleFacingInterface{ use HorizontalFacingTrait; private BellAttachmentType $attachmentType = BellAttachmentType::FLOOR; diff --git a/src/block/BoneBlock.php b/src/block/BoneBlock.php index 247bdb74863..f02456fe9dd 100644 --- a/src/block/BoneBlock.php +++ b/src/block/BoneBlock.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\PillarRotationInterface; use pocketmine\block\utils\PillarRotationTrait; -class BoneBlock extends Opaque{ +class BoneBlock extends Opaque implements PillarRotationInterface{ use PillarRotationTrait; } diff --git a/src/block/Button.php b/src/block/Button.php index 73bd1d556bd..bfd2fbec92e 100644 --- a/src/block/Button.php +++ b/src/block/Button.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\AnyFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; use pocketmine\math\Facing; @@ -33,7 +34,7 @@ use pocketmine\world\sound\RedstonePowerOffSound; use pocketmine\world\sound\RedstonePowerOnSound; -abstract class Button extends Flowable{ +abstract class Button extends Flowable implements SingleFacingInterface{ use AnyFacingTrait; protected bool $pressed = false; diff --git a/src/block/Cactus.php b/src/block/Cactus.php index 67b15b94693..d69ffc4d0aa 100644 --- a/src/block/Cactus.php +++ b/src/block/Cactus.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\StaticSupportTrait; @@ -33,7 +34,7 @@ use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -class Cactus extends Transparent{ +class Cactus extends Transparent implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/CakeWithCandle.php b/src/block/CakeWithCandle.php index 546843d6c30..35c7e453a8c 100644 --- a/src/block/CakeWithCandle.php +++ b/src/block/CakeWithCandle.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\CandleTrait; +use pocketmine\block\utils\LightableInterface; use pocketmine\entity\Living; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; @@ -31,7 +32,7 @@ use pocketmine\math\Vector3; use pocketmine\player\Player; -class CakeWithCandle extends BaseCake{ +class CakeWithCandle extends BaseCake implements LightableInterface{ use CandleTrait { onInteract as onInteractCandle; } diff --git a/src/block/CakeWithDyedCandle.php b/src/block/CakeWithDyedCandle.php index 0dff358e164..06d87558c81 100644 --- a/src/block/CakeWithDyedCandle.php +++ b/src/block/CakeWithDyedCandle.php @@ -23,10 +23,11 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\DyeColor; -class CakeWithDyedCandle extends CakeWithCandle{ +class CakeWithDyedCandle extends CakeWithCandle implements ColoredInterface{ use ColoredTrait; public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){ diff --git a/src/block/Campfire.php b/src/block/Campfire.php index 9f4c42a9ccc..de3899aa417 100644 --- a/src/block/Campfire.php +++ b/src/block/Campfire.php @@ -26,7 +26,9 @@ use pocketmine\block\inventory\CampfireInventory; use pocketmine\block\tile\Campfire as TileCampfire; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\LightableInterface; use pocketmine\block\utils\LightableTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\crafting\FurnaceRecipe; use pocketmine\crafting\FurnaceType; @@ -59,7 +61,7 @@ use function min; use function mt_rand; -class Campfire extends Transparent{ +class Campfire extends Transparent implements LightableInterface, SingleFacingInterface{ use HorizontalFacingTrait{ HorizontalFacingTrait::describeBlockOnlyState as encodeFacingState; } diff --git a/src/block/Candle.php b/src/block/Candle.php index 7f22641e118..6f9f5062564 100644 --- a/src/block/Candle.php +++ b/src/block/Candle.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\CandleTrait; +use pocketmine\block\utils\LightableInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -35,7 +36,7 @@ use pocketmine\utils\AssumptionFailedError; use pocketmine\world\BlockTransaction; -class Candle extends Transparent{ +class Candle extends Transparent implements LightableInterface{ use CandleTrait { describeBlockOnlyState as encodeLitState; getLightLevel as getBaseLightLevel; diff --git a/src/block/Carpet.php b/src/block/Carpet.php index 2d8e7ea4740..4ccec230270 100644 --- a/src/block/Carpet.php +++ b/src/block/Carpet.php @@ -23,12 +23,13 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -class Carpet extends Flowable{ +class Carpet extends Flowable implements ColoredInterface{ use ColoredTrait; use StaticSupportTrait; diff --git a/src/block/CarvedPumpkin.php b/src/block/CarvedPumpkin.php index 98f3c2307ac..a948da789af 100644 --- a/src/block/CarvedPumpkin.php +++ b/src/block/CarvedPumpkin.php @@ -24,7 +24,8 @@ namespace pocketmine\block; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; -class CarvedPumpkin extends Opaque{ +class CarvedPumpkin extends Opaque implements SingleFacingInterface{ use FacesOppositePlacingPlayerTrait; } diff --git a/src/block/CaveVines.php b/src/block/CaveVines.php index daa973507f3..599f8496aa4 100644 --- a/src/block/CaveVines.php +++ b/src/block/CaveVines.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\StaticSupportTrait; @@ -39,7 +40,7 @@ use pocketmine\world\sound\GlowBerriesPickSound; use function mt_rand; -class CaveVines extends Flowable{ +class CaveVines extends Flowable implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/Chain.php b/src/block/Chain.php index e9cc2c9be8d..1eb3472100c 100644 --- a/src/block/Chain.php +++ b/src/block/Chain.php @@ -23,13 +23,14 @@ namespace pocketmine\block; +use pocketmine\block\utils\PillarRotationInterface; use pocketmine\block\utils\PillarRotationTrait; use pocketmine\block\utils\SupportType; use pocketmine\math\Axis; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -final class Chain extends Transparent{ +final class Chain extends Transparent implements PillarRotationInterface{ use PillarRotationTrait; public function getSupportType(int $facing) : SupportType{ diff --git a/src/block/ChemistryTable.php b/src/block/ChemistryTable.php index 058e4028839..e39df7a3ad2 100644 --- a/src/block/ChemistryTable.php +++ b/src/block/ChemistryTable.php @@ -24,11 +24,12 @@ namespace pocketmine\block; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Vector3; use pocketmine\player\Player; -final class ChemistryTable extends Opaque{ +final class ChemistryTable extends Opaque implements SingleFacingInterface{ use FacesOppositePlacingPlayerTrait; public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{ diff --git a/src/block/Chest.php b/src/block/Chest.php index 7d265000745..8684091ada5 100644 --- a/src/block/Chest.php +++ b/src/block/Chest.php @@ -25,6 +25,7 @@ use pocketmine\block\tile\Chest as TileChest; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\event\block\ChestPairEvent; use pocketmine\item\Item; @@ -33,7 +34,7 @@ use pocketmine\math\Vector3; use pocketmine\player\Player; -class Chest extends Transparent{ +class Chest extends Transparent implements SingleFacingInterface{ use FacesOppositePlacingPlayerTrait; protected function recalculateCollisionBoxes() : array{ diff --git a/src/block/ChiseledBookshelf.php b/src/block/ChiseledBookshelf.php index 73c4861bf35..7504a202d28 100644 --- a/src/block/ChiseledBookshelf.php +++ b/src/block/ChiseledBookshelf.php @@ -27,6 +27,7 @@ use pocketmine\block\utils\ChiseledBookshelfSlot; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Book; use pocketmine\item\EnchantedBook; @@ -38,7 +39,7 @@ use pocketmine\player\Player; use function spl_object_id; -class ChiseledBookshelf extends Opaque{ +class ChiseledBookshelf extends Opaque implements SingleFacingInterface{ use HorizontalFacingTrait; use FacesOppositePlacingPlayerTrait; diff --git a/src/block/ChorusFlower.php b/src/block/ChorusFlower.php index cc3c606d92d..da4f43be43f 100644 --- a/src/block/ChorusFlower.php +++ b/src/block/ChorusFlower.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\entity\projectile\Projectile; @@ -40,7 +41,7 @@ use function min; use function mt_rand; -final class ChorusFlower extends Flowable{ +final class ChorusFlower extends Flowable implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/CocoaBlock.php b/src/block/CocoaBlock.php index 83e1de34bc6..f0b71f7d135 100644 --- a/src/block/CocoaBlock.php +++ b/src/block/CocoaBlock.php @@ -23,9 +23,11 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\WoodType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Fertilizer; @@ -39,7 +41,7 @@ use pocketmine\world\BlockTransaction; use function mt_rand; -class CocoaBlock extends Flowable{ +class CocoaBlock extends Flowable implements AgeableInterface, SingleFacingInterface{ use HorizontalFacingTrait; use AgeableTrait; diff --git a/src/block/Concrete.php b/src/block/Concrete.php index fae6f8e2f82..34835f4bf27 100644 --- a/src/block/Concrete.php +++ b/src/block/Concrete.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -class Concrete extends Opaque{ +class Concrete extends Opaque implements ColoredInterface{ use ColoredTrait; } diff --git a/src/block/ConcretePowder.php b/src/block/ConcretePowder.php index 59f14bc7226..511d725a560 100644 --- a/src/block/ConcretePowder.php +++ b/src/block/ConcretePowder.php @@ -24,12 +24,13 @@ namespace pocketmine\block; use pocketmine\block\utils\BlockEventHelper; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\Fallable; use pocketmine\block\utils\FallableTrait; use pocketmine\math\Facing; -class ConcretePowder extends Opaque implements Fallable{ +class ConcretePowder extends Opaque implements Fallable, ColoredInterface{ use ColoredTrait; use FallableTrait { onNearbyBlockChange as protected startFalling; diff --git a/src/block/CopperBulb.php b/src/block/CopperBulb.php index 97fc209fee3..44c8848c247 100644 --- a/src/block/CopperBulb.php +++ b/src/block/CopperBulb.php @@ -26,11 +26,13 @@ use pocketmine\block\utils\CopperMaterial; use pocketmine\block\utils\CopperOxidation; use pocketmine\block\utils\CopperTrait; +use pocketmine\block\utils\LightableInterface; use pocketmine\block\utils\LightableTrait; +use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\data\runtime\RuntimeDataDescriber; -class CopperBulb extends Opaque implements CopperMaterial{ +class CopperBulb extends Opaque implements CopperMaterial, LightableInterface, PoweredByRedstoneInterface{ use CopperTrait; use PoweredByRedstoneTrait; use LightableTrait{ diff --git a/src/block/CoralBlock.php b/src/block/CoralBlock.php index 3e7ca8224f7..2f0b2786f02 100644 --- a/src/block/CoralBlock.php +++ b/src/block/CoralBlock.php @@ -24,11 +24,12 @@ namespace pocketmine\block; use pocketmine\block\utils\BlockEventHelper; +use pocketmine\block\utils\CoralTypeInterface; use pocketmine\block\utils\CoralTypeTrait; use pocketmine\item\Item; use function mt_rand; -final class CoralBlock extends Opaque{ +final class CoralBlock extends Opaque implements CoralTypeInterface{ use CoralTypeTrait; public function onNearbyBlockChange() : void{ diff --git a/src/block/Crops.php b/src/block/Crops.php index e90ac623679..575c057982a 100644 --- a/src/block/Crops.php +++ b/src/block/Crops.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\CropGrowthHelper; @@ -34,7 +35,7 @@ use pocketmine\player\Player; use function mt_rand; -abstract class Crops extends Flowable{ +abstract class Crops extends Flowable implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/DaylightSensor.php b/src/block/DaylightSensor.php index 5720af52934..569f3cc258c 100644 --- a/src/block/DaylightSensor.php +++ b/src/block/DaylightSensor.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -36,7 +37,7 @@ use function round; use const M_PI; -class DaylightSensor extends Transparent{ +class DaylightSensor extends Transparent implements AnalogRedstoneSignalEmitterInterface{ use AnalogRedstoneSignalEmitterTrait; protected bool $inverted = false; diff --git a/src/block/Door.php b/src/block/Door.php index fa88267e120..cc9893cb4f7 100644 --- a/src/block/Door.php +++ b/src/block/Door.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -34,7 +35,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\DoorSound; -class Door extends Transparent{ +class Door extends Transparent implements SingleFacingInterface{ use HorizontalFacingTrait; protected bool $top = false; diff --git a/src/block/DoublePitcherCrop.php b/src/block/DoublePitcherCrop.php index 1233ed05d71..b1c890dd8be 100644 --- a/src/block/DoublePitcherCrop.php +++ b/src/block/DoublePitcherCrop.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\CropGrowthHelper; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -37,7 +38,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class DoublePitcherCrop extends DoublePlant{ +final class DoublePitcherCrop extends DoublePlant implements AgeableInterface{ use AgeableTrait { describeBlockOnlyState as describeAge; } diff --git a/src/block/DyedCandle.php b/src/block/DyedCandle.php index a495e8d0033..a214da576bc 100644 --- a/src/block/DyedCandle.php +++ b/src/block/DyedCandle.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -class DyedCandle extends Candle{ +class DyedCandle extends Candle implements ColoredInterface{ use ColoredTrait; protected function getCandleIfCompatibleType(Block $block) : ?Candle{ diff --git a/src/block/DyedShulkerBox.php b/src/block/DyedShulkerBox.php index 5eae9237e45..40f18dd0162 100644 --- a/src/block/DyedShulkerBox.php +++ b/src/block/DyedShulkerBox.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -final class DyedShulkerBox extends ShulkerBox{ +final class DyedShulkerBox extends ShulkerBox implements ColoredInterface{ use ColoredTrait; } diff --git a/src/block/EndPortalFrame.php b/src/block/EndPortalFrame.php index ed5b7743389..41272908777 100644 --- a/src/block/EndPortalFrame.php +++ b/src/block/EndPortalFrame.php @@ -24,11 +24,12 @@ namespace pocketmine\block; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -class EndPortalFrame extends Opaque{ +class EndPortalFrame extends Opaque implements SingleFacingInterface{ use FacesOppositePlacingPlayerTrait; protected bool $eye = false; diff --git a/src/block/EndRod.php b/src/block/EndRod.php index a6770f3708f..ce86aa11b86 100644 --- a/src/block/EndRod.php +++ b/src/block/EndRod.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\AnyFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Axis; use pocketmine\math\AxisAlignedBB; @@ -32,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class EndRod extends Flowable{ +class EndRod extends Flowable implements SingleFacingInterface{ use AnyFacingTrait; public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ diff --git a/src/block/EnderChest.php b/src/block/EnderChest.php index 6a8cf108c92..f785c3d7485 100644 --- a/src/block/EnderChest.php +++ b/src/block/EnderChest.php @@ -26,6 +26,7 @@ use pocketmine\block\inventory\EnderChestInventory; use pocketmine\block\tile\EnderChest as TileEnderChest; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; @@ -33,7 +34,7 @@ use pocketmine\math\Vector3; use pocketmine\player\Player; -class EnderChest extends Transparent{ +class EnderChest extends Transparent implements SingleFacingInterface{ use FacesOppositePlacingPlayerTrait; public function getLightLevel() : int{ diff --git a/src/block/FenceGate.php b/src/block/FenceGate.php index 2bbfdf89231..27312215244 100644 --- a/src/block/FenceGate.php +++ b/src/block/FenceGate.php @@ -24,7 +24,9 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -35,7 +37,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\DoorSound; -class FenceGate extends Transparent{ +class FenceGate extends Transparent implements SingleFacingInterface, WoodTypeInterface{ use WoodTypeTrait; use HorizontalFacingTrait; diff --git a/src/block/Fire.php b/src/block/Fire.php index 35a7a696c6c..ad0a3dc8ca1 100644 --- a/src/block/Fire.php +++ b/src/block/Fire.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\SupportType; @@ -35,7 +36,7 @@ use function min; use function mt_rand; -class Fire extends BaseFire{ +class Fire extends BaseFire implements AgeableInterface{ use AgeableTrait; public const MAX_AGE = 15; diff --git a/src/block/FloorBanner.php b/src/block/FloorBanner.php index 73bc457878b..da6379cfacc 100644 --- a/src/block/FloorBanner.php +++ b/src/block/FloorBanner.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\SignLikeRotationInterface; use pocketmine\block\utils\SignLikeRotationTrait; use pocketmine\item\Item; use pocketmine\math\Facing; @@ -30,7 +31,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class FloorBanner extends BaseBanner{ +final class FloorBanner extends BaseBanner implements SignLikeRotationInterface{ use SignLikeRotationTrait; protected function getSupportingFace() : int{ diff --git a/src/block/FloorSign.php b/src/block/FloorSign.php index 5615d15d896..78cdf4acc39 100644 --- a/src/block/FloorSign.php +++ b/src/block/FloorSign.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\SignLikeRotationInterface; use pocketmine\block\utils\SignLikeRotationTrait; use pocketmine\item\Item; use pocketmine\math\Facing; @@ -30,7 +31,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class FloorSign extends BaseSign{ +final class FloorSign extends BaseSign implements SignLikeRotationInterface{ use SignLikeRotationTrait; protected function getSupportingFace() : int{ diff --git a/src/block/FrostedIce.php b/src/block/FrostedIce.php index 3e859230678..2c921fcbcea 100644 --- a/src/block/FrostedIce.php +++ b/src/block/FrostedIce.php @@ -23,11 +23,12 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use function mt_rand; -class FrostedIce extends Ice{ +class FrostedIce extends Ice implements AgeableInterface{ use AgeableTrait; public const MAX_AGE = 3; diff --git a/src/block/Furnace.php b/src/block/Furnace.php index 7a64e3cd3e5..a97412a3ca9 100644 --- a/src/block/Furnace.php +++ b/src/block/Furnace.php @@ -25,6 +25,7 @@ use pocketmine\block\tile\Furnace as TileFurnace; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\LightableInterface; use pocketmine\block\utils\LightableTrait; use pocketmine\crafting\FurnaceType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -33,7 +34,7 @@ use pocketmine\player\Player; use function mt_rand; -class Furnace extends Opaque{ +class Furnace extends Opaque implements LightableInterface{ use FacesOppositePlacingPlayerTrait; use LightableTrait; diff --git a/src/block/GlazedTerracotta.php b/src/block/GlazedTerracotta.php index 15b3254e5d9..682289152aa 100644 --- a/src/block/GlazedTerracotta.php +++ b/src/block/GlazedTerracotta.php @@ -23,10 +23,12 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; -class GlazedTerracotta extends Opaque{ +class GlazedTerracotta extends Opaque implements ColoredInterface, SingleFacingInterface{ use ColoredTrait; use FacesOppositePlacingPlayerTrait; } diff --git a/src/block/GlowLichen.php b/src/block/GlowLichen.php index a44c4d03588..70100f2adea 100644 --- a/src/block/GlowLichen.php +++ b/src/block/GlowLichen.php @@ -25,6 +25,7 @@ use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\MultiAnySupportTrait; +use pocketmine\block\utils\MultiFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\item\Fertilizer; use pocketmine\item\Item; @@ -35,7 +36,7 @@ use function count; use function shuffle; -class GlowLichen extends Transparent{ +class GlowLichen extends Transparent implements MultiFacingInterface{ use MultiAnySupportTrait; public function getLightLevel() : int{ diff --git a/src/block/HayBale.php b/src/block/HayBale.php index 6fdd2cb6352..5646ba7820a 100644 --- a/src/block/HayBale.php +++ b/src/block/HayBale.php @@ -23,10 +23,11 @@ namespace pocketmine\block; +use pocketmine\block\utils\PillarRotationInterface; use pocketmine\block\utils\PillarRotationTrait; use pocketmine\entity\Entity; -class HayBale extends Opaque{ +class HayBale extends Opaque implements PillarRotationInterface{ use PillarRotationTrait; public function getFlameEncouragement() : int{ diff --git a/src/block/Hopper.php b/src/block/Hopper.php index 0d823674b23..3f2aa0552fa 100644 --- a/src/block/Hopper.php +++ b/src/block/Hopper.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\tile\Hopper as TileHopper; +use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -34,7 +35,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class Hopper extends Transparent{ +class Hopper extends Transparent implements PoweredByRedstoneInterface{ use PoweredByRedstoneTrait; private int $facing = Facing::DOWN; diff --git a/src/block/ItemFrame.php b/src/block/ItemFrame.php index c03806a3b55..abbe8e9d8ba 100644 --- a/src/block/ItemFrame.php +++ b/src/block/ItemFrame.php @@ -25,6 +25,7 @@ use pocketmine\block\tile\ItemFrame as TileItemFrame; use pocketmine\block\utils\AnyFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -39,7 +40,7 @@ use function is_infinite; use function is_nan; -class ItemFrame extends Flowable{ +class ItemFrame extends Flowable implements SingleFacingInterface{ use AnyFacingTrait; public const ROTATIONS = 8; diff --git a/src/block/Ladder.php b/src/block/Ladder.php index 09c0b8f6bc1..7a37d3988d6 100644 --- a/src/block/Ladder.php +++ b/src/block/Ladder.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\entity\Entity; use pocketmine\entity\Living; @@ -35,7 +36,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class Ladder extends Transparent{ +class Ladder extends Transparent implements SingleFacingInterface{ use HorizontalFacingTrait; public function hasEntityCollision() : bool{ diff --git a/src/block/Lectern.php b/src/block/Lectern.php index 03880b3c5f1..c2222e6e74b 100644 --- a/src/block/Lectern.php +++ b/src/block/Lectern.php @@ -25,6 +25,7 @@ use pocketmine\block\tile\Lectern as TileLectern; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -36,7 +37,7 @@ use pocketmine\world\sound\LecternPlaceBookSound; use function count; -class Lectern extends Transparent{ +class Lectern extends Transparent implements SingleFacingInterface{ use FacesOppositePlacingPlayerTrait; protected int $viewedPage = 0; diff --git a/src/block/LightningRod.php b/src/block/LightningRod.php index a0dd50542cc..04ba1459645 100644 --- a/src/block/LightningRod.php +++ b/src/block/LightningRod.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\AnyFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Axis; use pocketmine\math\AxisAlignedBB; @@ -32,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class LightningRod extends Transparent{ +final class LightningRod extends Transparent implements SingleFacingInterface{ use AnyFacingTrait; protected function recalculateCollisionBoxes() : array{ diff --git a/src/block/Loom.php b/src/block/Loom.php index d3dd4f3c766..fc38caa02ea 100644 --- a/src/block/Loom.php +++ b/src/block/Loom.php @@ -25,11 +25,12 @@ use pocketmine\block\inventory\LoomInventory; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Vector3; use pocketmine\player\Player; -final class Loom extends Opaque{ +final class Loom extends Opaque implements SingleFacingInterface{ use FacesOppositePlacingPlayerTrait; public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{ diff --git a/src/block/NetherVines.php b/src/block/NetherVines.php index e8729c00f05..8cd497e7831 100644 --- a/src/block/NetherVines.php +++ b/src/block/NetherVines.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\FortuneDropHelper; use pocketmine\block\utils\StaticSupportTrait; @@ -41,7 +42,7 @@ /** * This class is used for Weeping & Twisting vines, because they have same behaviour */ -class NetherVines extends Flowable{ +class NetherVines extends Flowable implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/NetherWartPlant.php b/src/block/NetherWartPlant.php index 34e6fd57ece..1a0c3866fd9 100644 --- a/src/block/NetherWartPlant.php +++ b/src/block/NetherWartPlant.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\FortuneDropHelper; @@ -31,7 +32,7 @@ use pocketmine\math\Facing; use function mt_rand; -class NetherWartPlant extends Flowable{ +class NetherWartPlant extends Flowable implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/PinkPetals.php b/src/block/PinkPetals.php index 17bc4c50a6b..b654365dd22 100644 --- a/src/block/PinkPetals.php +++ b/src/block/PinkPetals.php @@ -25,6 +25,7 @@ use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Fertilizer; @@ -34,7 +35,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class PinkPetals extends Flowable{ +class PinkPetals extends Flowable implements SingleFacingInterface{ use HorizontalFacingTrait; use StaticSupportTrait { canBePlacedAt as supportedWhenPlacedAt; diff --git a/src/block/PitcherCrop.php b/src/block/PitcherCrop.php index d41aed284dd..56c11153604 100644 --- a/src/block/PitcherCrop.php +++ b/src/block/PitcherCrop.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\CropGrowthHelper; @@ -38,7 +39,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class PitcherCrop extends Flowable{ +final class PitcherCrop extends Flowable implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/Planks.php b/src/block/Planks.php index 1074f8adf34..6be34d84ea9 100644 --- a/src/block/Planks.php +++ b/src/block/Planks.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class Planks extends Opaque{ +class Planks extends Opaque implements WoodTypeInterface{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/PoweredRail.php b/src/block/PoweredRail.php index 25d6dc9e3cc..16decc2dd08 100644 --- a/src/block/PoweredRail.php +++ b/src/block/PoweredRail.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\RailPoweredByRedstoneTrait; -class PoweredRail extends StraightOnlyRail{ +class PoweredRail extends StraightOnlyRail implements PoweredByRedstoneInterface{ use RailPoweredByRedstoneTrait; } diff --git a/src/block/RedstoneComparator.php b/src/block/RedstoneComparator.php index 40e1ef510b1..e366cbde3dc 100644 --- a/src/block/RedstoneComparator.php +++ b/src/block/RedstoneComparator.php @@ -24,9 +24,12 @@ namespace pocketmine\block; use pocketmine\block\tile\Comparator; +use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\PoweredByRedstoneTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -38,7 +41,7 @@ use pocketmine\world\BlockTransaction; use function assert; -class RedstoneComparator extends Flowable{ +class RedstoneComparator extends Flowable implements AnalogRedstoneSignalEmitterInterface, PoweredByRedstoneInterface, SingleFacingInterface{ use HorizontalFacingTrait; use AnalogRedstoneSignalEmitterTrait; use PoweredByRedstoneTrait; diff --git a/src/block/RedstoneLamp.php b/src/block/RedstoneLamp.php index 58098c395e8..6341b9f91d2 100644 --- a/src/block/RedstoneLamp.php +++ b/src/block/RedstoneLamp.php @@ -23,10 +23,11 @@ namespace pocketmine\block; +use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\data\runtime\RuntimeDataDescriber; -class RedstoneLamp extends Opaque{ +class RedstoneLamp extends Opaque implements PoweredByRedstoneInterface{ use PoweredByRedstoneTrait; protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{ diff --git a/src/block/RedstoneOre.php b/src/block/RedstoneOre.php index 10e701a6f4c..03b401ae696 100644 --- a/src/block/RedstoneOre.php +++ b/src/block/RedstoneOre.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\FortuneDropHelper; +use pocketmine\block\utils\LightableInterface; use pocketmine\block\utils\LightableTrait; use pocketmine\item\Item; use pocketmine\item\VanillaItems; @@ -31,7 +32,7 @@ use pocketmine\player\Player; use function mt_rand; -class RedstoneOre extends Opaque{ +class RedstoneOre extends Opaque implements LightableInterface{ use LightableTrait; public function getLightLevel() : int{ diff --git a/src/block/RedstoneRepeater.php b/src/block/RedstoneRepeater.php index bf9d0c5da1e..685a9373a2e 100644 --- a/src/block/RedstoneRepeater.php +++ b/src/block/RedstoneRepeater.php @@ -24,7 +24,9 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\PoweredByRedstoneTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -35,7 +37,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class RedstoneRepeater extends Flowable{ +class RedstoneRepeater extends Flowable implements PoweredByRedstoneInterface, SingleFacingInterface{ use HorizontalFacingTrait; use PoweredByRedstoneTrait; use StaticSupportTrait; diff --git a/src/block/RedstoneTorch.php b/src/block/RedstoneTorch.php index 26c86038b95..aab0833df0a 100644 --- a/src/block/RedstoneTorch.php +++ b/src/block/RedstoneTorch.php @@ -23,10 +23,11 @@ namespace pocketmine\block; +use pocketmine\block\utils\LightableInterface; use pocketmine\block\utils\LightableTrait; use pocketmine\data\runtime\RuntimeDataDescriber; -class RedstoneTorch extends Torch{ +class RedstoneTorch extends Torch implements LightableInterface{ use LightableTrait; public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){ diff --git a/src/block/RedstoneWire.php b/src/block/RedstoneWire.php index a2d293fca0d..1b9decf5053 100644 --- a/src/block/RedstoneWire.php +++ b/src/block/RedstoneWire.php @@ -23,13 +23,14 @@ namespace pocketmine\block; +use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\item\Item; use pocketmine\item\VanillaItems; use pocketmine\math\Facing; -class RedstoneWire extends Flowable{ +class RedstoneWire extends Flowable implements AnalogRedstoneSignalEmitterInterface{ use AnalogRedstoneSignalEmitterTrait; use StaticSupportTrait; diff --git a/src/block/ResinClump.php b/src/block/ResinClump.php index 75126edf3a1..43ed45df098 100644 --- a/src/block/ResinClump.php +++ b/src/block/ResinClump.php @@ -24,9 +24,10 @@ namespace pocketmine\block; use pocketmine\block\utils\MultiAnySupportTrait; +use pocketmine\block\utils\MultiFacingInterface; use pocketmine\block\utils\SupportType; -final class ResinClump extends Transparent{ +final class ResinClump extends Transparent implements MultiFacingInterface{ use MultiAnySupportTrait; public function isSolid() : bool{ diff --git a/src/block/ShulkerBox.php b/src/block/ShulkerBox.php index d557401eec3..fe01c8c688f 100644 --- a/src/block/ShulkerBox.php +++ b/src/block/ShulkerBox.php @@ -25,6 +25,7 @@ use pocketmine\block\tile\ShulkerBox as TileShulkerBox; use pocketmine\block\utils\AnyFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -32,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class ShulkerBox extends Opaque{ +class ShulkerBox extends Opaque implements SingleFacingInterface{ use AnyFacingTrait; protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{ diff --git a/src/block/SimplePillar.php b/src/block/SimplePillar.php index 98c89f89ccf..2b27cef3da0 100644 --- a/src/block/SimplePillar.php +++ b/src/block/SimplePillar.php @@ -23,12 +23,13 @@ namespace pocketmine\block; +use pocketmine\block\utils\PillarRotationInterface; use pocketmine\block\utils\PillarRotationTrait; /** * @internal This class provides a general base for pillar-like blocks. It **should not** be used for contract binding * in APIs, because not all pillar-like blocks extend this class. */ -class SimplePillar extends Opaque{ +class SimplePillar extends Opaque implements PillarRotationInterface{ use PillarRotationTrait; } diff --git a/src/block/SmallDripleaf.php b/src/block/SmallDripleaf.php index d192e43db70..5b58585d56b 100644 --- a/src/block/SmallDripleaf.php +++ b/src/block/SmallDripleaf.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\event\block\StructureGrowEvent; @@ -36,7 +37,7 @@ use pocketmine\world\Position; use function mt_rand; -class SmallDripleaf extends Transparent{ +class SmallDripleaf extends Transparent implements SingleFacingInterface{ use HorizontalFacingTrait; protected bool $top = false; diff --git a/src/block/StainedGlass.php b/src/block/StainedGlass.php index bc0d8487700..a080817f005 100644 --- a/src/block/StainedGlass.php +++ b/src/block/StainedGlass.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -final class StainedGlass extends Glass{ +final class StainedGlass extends Glass implements ColoredInterface{ use ColoredTrait; } diff --git a/src/block/StainedGlassPane.php b/src/block/StainedGlassPane.php index 18ecfdee0e6..35ab1356f8a 100644 --- a/src/block/StainedGlassPane.php +++ b/src/block/StainedGlassPane.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -final class StainedGlassPane extends GlassPane{ +final class StainedGlassPane extends GlassPane implements ColoredInterface{ use ColoredTrait; } diff --git a/src/block/StainedHardenedClay.php b/src/block/StainedHardenedClay.php index 2c2c01ba3ab..06499b83750 100644 --- a/src/block/StainedHardenedClay.php +++ b/src/block/StainedHardenedClay.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -final class StainedHardenedClay extends HardenedClay{ +final class StainedHardenedClay extends HardenedClay implements ColoredInterface{ use ColoredTrait; } diff --git a/src/block/StainedHardenedGlass.php b/src/block/StainedHardenedGlass.php index cc609a49a9b..63b1801b4f5 100644 --- a/src/block/StainedHardenedGlass.php +++ b/src/block/StainedHardenedGlass.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -final class StainedHardenedGlass extends HardenedGlass{ +final class StainedHardenedGlass extends HardenedGlass implements ColoredInterface{ use ColoredTrait; } diff --git a/src/block/StainedHardenedGlassPane.php b/src/block/StainedHardenedGlassPane.php index 63dbe1f776e..ef73dfc72eb 100644 --- a/src/block/StainedHardenedGlassPane.php +++ b/src/block/StainedHardenedGlassPane.php @@ -23,8 +23,9 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -final class StainedHardenedGlassPane extends HardenedGlassPane{ +final class StainedHardenedGlassPane extends HardenedGlassPane implements ColoredInterface{ use ColoredTrait; } diff --git a/src/block/Stair.php b/src/block/Stair.php index d66a9ce5cfc..169fe68126a 100644 --- a/src/block/Stair.php +++ b/src/block/Stair.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\StairShape; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -35,7 +36,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class Stair extends Transparent{ +class Stair extends Transparent implements SingleFacingInterface{ use HorizontalFacingTrait; protected bool $upsideDown = false; diff --git a/src/block/Stonecutter.php b/src/block/Stonecutter.php index 30c19d25dcb..76600c38232 100644 --- a/src/block/Stonecutter.php +++ b/src/block/Stonecutter.php @@ -25,6 +25,7 @@ use pocketmine\block\inventory\StonecutterInventory; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; @@ -32,7 +33,7 @@ use pocketmine\math\Vector3; use pocketmine\player\Player; -class Stonecutter extends Transparent{ +class Stonecutter extends Transparent implements SingleFacingInterface{ use FacesOppositePlacingPlayerTrait; public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{ diff --git a/src/block/Sugarcane.php b/src/block/Sugarcane.php index 2da2dc9b971..d5a71cd7e1d 100644 --- a/src/block/Sugarcane.php +++ b/src/block/Sugarcane.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\StaticSupportTrait; @@ -34,7 +35,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\Position; -class Sugarcane extends Flowable{ +class Sugarcane extends Flowable implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait { onNearbyBlockChange as onSupportBlockChange; diff --git a/src/block/SweetBerryBush.php b/src/block/SweetBerryBush.php index eabdde118aa..4732e1948a7 100644 --- a/src/block/SweetBerryBush.php +++ b/src/block/SweetBerryBush.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\FortuneDropHelper; @@ -39,7 +40,7 @@ use pocketmine\world\sound\SweetBerriesPickSound; use function mt_rand; -class SweetBerryBush extends Flowable{ +class SweetBerryBush extends Flowable implements AgeableInterface{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/Trapdoor.php b/src/block/Trapdoor.php index a903e1b5e74..49ac2bba8ce 100644 --- a/src/block/Trapdoor.php +++ b/src/block/Trapdoor.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -34,7 +35,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\DoorSound; -class Trapdoor extends Transparent{ +class Trapdoor extends Transparent implements SingleFacingInterface{ use HorizontalFacingTrait; protected bool $open = false; diff --git a/src/block/TripwireHook.php b/src/block/TripwireHook.php index 32581982526..8524c6feb50 100644 --- a/src/block/TripwireHook.php +++ b/src/block/TripwireHook.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; use pocketmine\math\Axis; @@ -32,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class TripwireHook extends Flowable{ +class TripwireHook extends Flowable implements SingleFacingInterface{ use HorizontalFacingTrait; protected bool $connected = false; diff --git a/src/block/WallBanner.php b/src/block/WallBanner.php index 5182fe9f8f8..c351b7ca324 100644 --- a/src/block/WallBanner.php +++ b/src/block/WallBanner.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Axis; use pocketmine\math\Facing; @@ -31,7 +32,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class WallBanner extends BaseBanner{ +final class WallBanner extends BaseBanner implements SingleFacingInterface{ use HorizontalFacingTrait; protected function getSupportingFace() : int{ diff --git a/src/block/WallCoralFan.php b/src/block/WallCoralFan.php index f9dece1cd65..da88916e4ab 100644 --- a/src/block/WallCoralFan.php +++ b/src/block/WallCoralFan.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; use pocketmine\item\VanillaItems; @@ -33,7 +34,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class WallCoralFan extends BaseCoral{ +final class WallCoralFan extends BaseCoral implements SingleFacingInterface{ use HorizontalFacingTrait; protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{ diff --git a/src/block/WallSign.php b/src/block/WallSign.php index 07826eae730..36c4cf29aeb 100644 --- a/src/block/WallSign.php +++ b/src/block/WallSign.php @@ -24,6 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\HorizontalFacingTrait; +use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Axis; use pocketmine\math\Facing; @@ -31,7 +32,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class WallSign extends BaseSign{ +final class WallSign extends BaseSign implements SingleFacingInterface{ use HorizontalFacingTrait; protected function getSupportingFace() : int{ diff --git a/src/block/WeightedPressurePlate.php b/src/block/WeightedPressurePlate.php index 726b31f6ba2..19e83458172 100644 --- a/src/block/WeightedPressurePlate.php +++ b/src/block/WeightedPressurePlate.php @@ -23,13 +23,14 @@ namespace pocketmine\block; +use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; use function ceil; use function count; use function max; use function min; -class WeightedPressurePlate extends PressurePlate{ +class WeightedPressurePlate extends PressurePlate implements AnalogRedstoneSignalEmitterInterface{ use AnalogRedstoneSignalEmitterTrait; private readonly float $signalStrengthFactor; diff --git a/src/block/Wood.php b/src/block/Wood.php index 127533b989a..1f566a1a9b8 100644 --- a/src/block/Wood.php +++ b/src/block/Wood.php @@ -23,6 +23,7 @@ namespace pocketmine\block; +use pocketmine\block\utils\PillarRotationInterface; use pocketmine\block\utils\PillarRotationTrait; use pocketmine\block\utils\WoodTypeTrait; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -32,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\sound\ItemUseOnBlockSound; -class Wood extends Opaque{ +class Wood extends Opaque implements PillarRotationInterface{ use PillarRotationTrait; use WoodTypeTrait; diff --git a/src/block/WoodenButton.php b/src/block/WoodenButton.php index 7ba8a7af0d1..3c445cbaa23 100644 --- a/src/block/WoodenButton.php +++ b/src/block/WoodenButton.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class WoodenButton extends Button{ +class WoodenButton extends Button implements WoodTypeInterface{ use WoodTypeTrait; protected function getActivationTime() : int{ diff --git a/src/block/WoodenDoor.php b/src/block/WoodenDoor.php index 96f349e4969..c3b5b31ff34 100644 --- a/src/block/WoodenDoor.php +++ b/src/block/WoodenDoor.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class WoodenDoor extends Door{ +class WoodenDoor extends Door implements WoodTypeInterface{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/WoodenFence.php b/src/block/WoodenFence.php index c12043a8653..840fed4880a 100644 --- a/src/block/WoodenFence.php +++ b/src/block/WoodenFence.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class WoodenFence extends Fence{ +class WoodenFence extends Fence implements WoodTypeInterface{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/WoodenPressurePlate.php b/src/block/WoodenPressurePlate.php index a629c2f1c77..427e6272b98 100644 --- a/src/block/WoodenPressurePlate.php +++ b/src/block/WoodenPressurePlate.php @@ -24,9 +24,10 @@ namespace pocketmine\block; use pocketmine\block\utils\WoodType; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class WoodenPressurePlate extends SimplePressurePlate{ +class WoodenPressurePlate extends SimplePressurePlate implements WoodTypeInterface{ use WoodTypeTrait; public function __construct( diff --git a/src/block/WoodenSlab.php b/src/block/WoodenSlab.php index b388a36ea3c..18ba9957158 100644 --- a/src/block/WoodenSlab.php +++ b/src/block/WoodenSlab.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class WoodenSlab extends Slab{ +class WoodenSlab extends Slab implements WoodTypeInterface{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/WoodenStairs.php b/src/block/WoodenStairs.php index 0d9ba62cebf..229b0767614 100644 --- a/src/block/WoodenStairs.php +++ b/src/block/WoodenStairs.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class WoodenStairs extends Stair{ +class WoodenStairs extends Stair implements WoodTypeInterface{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/WoodenTrapdoor.php b/src/block/WoodenTrapdoor.php index c0a6623a173..4c96527df28 100644 --- a/src/block/WoodenTrapdoor.php +++ b/src/block/WoodenTrapdoor.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class WoodenTrapdoor extends Trapdoor{ +class WoodenTrapdoor extends Trapdoor implements WoodTypeInterface{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/Wool.php b/src/block/Wool.php index 0b008ac042f..0fc40bbd973 100644 --- a/src/block/Wool.php +++ b/src/block/Wool.php @@ -23,9 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; -class Wool extends Opaque{ +class Wool extends Opaque implements ColoredInterface{ use ColoredTrait; public function getFlameEncouragement() : int{ diff --git a/src/block/utils/AgeableInterface.php b/src/block/utils/AgeableInterface.php new file mode 100644 index 00000000000..6da87f9d640 --- /dev/null +++ b/src/block/utils/AgeableInterface.php @@ -0,0 +1,34 @@ + Date: Fri, 21 Feb 2025 11:53:14 +0100 Subject: [PATCH 2/6] Fix doc --- src/block/utils/MultiFacingInterface.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/block/utils/MultiFacingInterface.php b/src/block/utils/MultiFacingInterface.php index 6e451fc85e7..8ddd8764c8c 100644 --- a/src/block/utils/MultiFacingInterface.php +++ b/src/block/utils/MultiFacingInterface.php @@ -42,6 +42,8 @@ public function hasFace(int $face) : bool; public function setFace(int $face, bool $value) : self; /** + * @param int[] $faces + * * @throws \InvalidArgumentException if a value in `$faces` is not Facing value * @see Facing */ From d0344d49fb6946ae7699c44aab14127138a6deba Mon Sep 17 00:00:00 2001 From: Hugo_ <55756021+Dhaiven@users.noreply.github.com> Date: Thu, 27 Feb 2025 11:18:58 +0100 Subject: [PATCH 3/6] Split SingleFacingInterface into two variant --- src/block/AmethystCluster.php | 4 +- src/block/Anvil.php | 4 +- src/block/Barrel.php | 4 +- src/block/BaseBigDripleaf.php | 4 +- src/block/Bed.php | 4 +- src/block/Bell.php | 4 +- src/block/Button.php | 4 +- src/block/Campfire.php | 4 +- src/block/CarvedPumpkin.php | 4 +- src/block/ChemistryTable.php | 4 +- src/block/Chest.php | 4 +- src/block/ChiseledBookshelf.php | 4 +- src/block/CocoaBlock.php | 4 +- src/block/Door.php | 4 +- src/block/EndPortalFrame.php | 4 +- src/block/EndRod.php | 4 +- src/block/EnderChest.php | 4 +- src/block/FenceGate.php | 4 +- src/block/GlazedTerracotta.php | 4 +- src/block/ItemFrame.php | 4 +- src/block/Ladder.php | 4 +- src/block/Lectern.php | 4 +- src/block/LightningRod.php | 4 +- src/block/Loom.php | 4 +- src/block/PinkPetals.php | 4 +- src/block/RedstoneComparator.php | 4 +- src/block/RedstoneRepeater.php | 4 +- src/block/ShulkerBox.php | 4 +- src/block/SmallDripleaf.php | 4 +- src/block/Stair.php | 4 +- src/block/Stonecutter.php | 4 +- src/block/Trapdoor.php | 4 +- src/block/TripwireHook.php | 4 +- src/block/WallBanner.php | 4 +- src/block/WallCoralFan.php | 4 +- src/block/WallSign.php | 4 +- ...ingleFacingInterface.php => AnyFacing.php} | 2 +- src/block/utils/HorizontalFacing.php | 42 +++++++++++++++++++ 38 files changed, 115 insertions(+), 73 deletions(-) rename src/block/utils/{SingleFacingInterface.php => AnyFacing.php} (96%) create mode 100644 src/block/utils/HorizontalFacing.php diff --git a/src/block/AmethystCluster.php b/src/block/AmethystCluster.php index 1912e5c0506..8a750e974f1 100644 --- a/src/block/AmethystCluster.php +++ b/src/block/AmethystCluster.php @@ -24,9 +24,9 @@ namespace pocketmine\block; use pocketmine\block\utils\AmethystTrait; +use pocketmine\block\utils\AnyFacing; use pocketmine\block\utils\AnyFacingTrait; use pocketmine\block\utils\FortuneDropHelper; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -39,7 +39,7 @@ use pocketmine\utils\AssumptionFailedError; use pocketmine\world\BlockTransaction; -final class AmethystCluster extends Transparent implements SingleFacingInterface{ +final class AmethystCluster extends Transparent implements AnyFacing{ use AmethystTrait; use AnyFacingTrait; diff --git a/src/block/Anvil.php b/src/block/Anvil.php index 3431d81e237..fcb4d045c4d 100644 --- a/src/block/Anvil.php +++ b/src/block/Anvil.php @@ -26,8 +26,8 @@ use pocketmine\block\inventory\AnvilInventory; use pocketmine\block\utils\Fallable; use pocketmine\block\utils\FallableTrait; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\entity\object\FallingBlock; @@ -42,7 +42,7 @@ use pocketmine\world\sound\Sound; use function round; -class Anvil extends Transparent implements Fallable, SingleFacingInterface{ +class Anvil extends Transparent implements Fallable, HorizontalFacing{ use FallableTrait; use HorizontalFacingTrait; diff --git a/src/block/Barrel.php b/src/block/Barrel.php index b7fd91ad0c5..7b2ea356e4d 100644 --- a/src/block/Barrel.php +++ b/src/block/Barrel.php @@ -24,8 +24,8 @@ namespace pocketmine\block; use pocketmine\block\tile\Barrel as TileBarrel; +use pocketmine\block\utils\AnyFacing; use pocketmine\block\utils\AnyFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; use pocketmine\math\Facing; @@ -34,7 +34,7 @@ use pocketmine\world\BlockTransaction; use function abs; -class Barrel extends Opaque implements SingleFacingInterface{ +class Barrel extends Opaque implements AnyFacing{ use AnyFacingTrait; protected bool $open = false; diff --git a/src/block/BaseBigDripleaf.php b/src/block/BaseBigDripleaf.php index a3094af5e0f..94e2c12a238 100644 --- a/src/block/BaseBigDripleaf.php +++ b/src/block/BaseBigDripleaf.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\event\block\StructureGrowEvent; use pocketmine\item\Fertilizer; @@ -34,7 +34,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -abstract class BaseBigDripleaf extends Transparent implements SingleFacingInterface{ +abstract class BaseBigDripleaf extends Transparent implements HorizontalFacing{ use HorizontalFacingTrait; abstract protected function isHead() : bool; diff --git a/src/block/Bed.php b/src/block/Bed.php index c7828d128c8..487e8845e5f 100644 --- a/src/block/Bed.php +++ b/src/block/Bed.php @@ -27,8 +27,8 @@ use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\DyeColor; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\entity\Entity; @@ -43,7 +43,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\World; -class Bed extends Transparent implements ColoredInterface, SingleFacingInterface{ +class Bed extends Transparent implements ColoredInterface, HorizontalFacing{ use ColoredTrait; use HorizontalFacingTrait; diff --git a/src/block/Bell.php b/src/block/Bell.php index 32dffd5e58c..258abc62827 100644 --- a/src/block/Bell.php +++ b/src/block/Bell.php @@ -25,8 +25,8 @@ use pocketmine\block\tile\Bell as TileBell; use pocketmine\block\utils\BellAttachmentType; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\entity\projectile\Projectile; @@ -39,7 +39,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\BellRingSound; -final class Bell extends Transparent implements SingleFacingInterface{ +final class Bell extends Transparent implements HorizontalFacing{ use HorizontalFacingTrait; private BellAttachmentType $attachmentType = BellAttachmentType::FLOOR; diff --git a/src/block/Button.php b/src/block/Button.php index bfd2fbec92e..4d1f1bbc5c2 100644 --- a/src/block/Button.php +++ b/src/block/Button.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\AnyFacing; use pocketmine\block\utils\AnyFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; use pocketmine\math\Facing; @@ -34,7 +34,7 @@ use pocketmine\world\sound\RedstonePowerOffSound; use pocketmine\world\sound\RedstonePowerOnSound; -abstract class Button extends Flowable implements SingleFacingInterface{ +abstract class Button extends Flowable implements AnyFacing{ use AnyFacingTrait; protected bool $pressed = false; diff --git a/src/block/Campfire.php b/src/block/Campfire.php index de3899aa417..4167febaf5a 100644 --- a/src/block/Campfire.php +++ b/src/block/Campfire.php @@ -25,10 +25,10 @@ use pocketmine\block\inventory\CampfireInventory; use pocketmine\block\tile\Campfire as TileCampfire; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; use pocketmine\block\utils\LightableInterface; use pocketmine\block\utils\LightableTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\crafting\FurnaceRecipe; use pocketmine\crafting\FurnaceType; @@ -61,7 +61,7 @@ use function min; use function mt_rand; -class Campfire extends Transparent implements LightableInterface, SingleFacingInterface{ +class Campfire extends Transparent implements LightableInterface, HorizontalFacing{ use HorizontalFacingTrait{ HorizontalFacingTrait::describeBlockOnlyState as encodeFacingState; } diff --git a/src/block/CarvedPumpkin.php b/src/block/CarvedPumpkin.php index a948da789af..cfdb8d49da8 100644 --- a/src/block/CarvedPumpkin.php +++ b/src/block/CarvedPumpkin.php @@ -24,8 +24,8 @@ namespace pocketmine\block; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; -class CarvedPumpkin extends Opaque implements SingleFacingInterface{ +class CarvedPumpkin extends Opaque implements HorizontalFacing{ use FacesOppositePlacingPlayerTrait; } diff --git a/src/block/ChemistryTable.php b/src/block/ChemistryTable.php index e39df7a3ad2..9b5e78f920c 100644 --- a/src/block/ChemistryTable.php +++ b/src/block/ChemistryTable.php @@ -24,12 +24,12 @@ namespace pocketmine\block; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\item\Item; use pocketmine\math\Vector3; use pocketmine\player\Player; -final class ChemistryTable extends Opaque implements SingleFacingInterface{ +final class ChemistryTable extends Opaque implements HorizontalFacing{ use FacesOppositePlacingPlayerTrait; public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{ diff --git a/src/block/Chest.php b/src/block/Chest.php index 8684091ada5..c0dc09d9edd 100644 --- a/src/block/Chest.php +++ b/src/block/Chest.php @@ -25,7 +25,7 @@ use pocketmine\block\tile\Chest as TileChest; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\SupportType; use pocketmine\event\block\ChestPairEvent; use pocketmine\item\Item; @@ -34,7 +34,7 @@ use pocketmine\math\Vector3; use pocketmine\player\Player; -class Chest extends Transparent implements SingleFacingInterface{ +class Chest extends Transparent implements HorizontalFacing{ use FacesOppositePlacingPlayerTrait; protected function recalculateCollisionBoxes() : array{ diff --git a/src/block/ChiseledBookshelf.php b/src/block/ChiseledBookshelf.php index 7504a202d28..be49c7a9153 100644 --- a/src/block/ChiseledBookshelf.php +++ b/src/block/ChiseledBookshelf.php @@ -26,8 +26,8 @@ use pocketmine\block\tile\ChiseledBookshelf as TileChiseledBookshelf; use pocketmine\block\utils\ChiseledBookshelfSlot; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Book; use pocketmine\item\EnchantedBook; @@ -39,7 +39,7 @@ use pocketmine\player\Player; use function spl_object_id; -class ChiseledBookshelf extends Opaque implements SingleFacingInterface{ +class ChiseledBookshelf extends Opaque implements HorizontalFacing{ use HorizontalFacingTrait; use FacesOppositePlacingPlayerTrait; diff --git a/src/block/CocoaBlock.php b/src/block/CocoaBlock.php index f0b71f7d135..5d379bccc72 100644 --- a/src/block/CocoaBlock.php +++ b/src/block/CocoaBlock.php @@ -26,8 +26,8 @@ use pocketmine\block\utils\AgeableInterface; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\WoodType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Fertilizer; @@ -41,7 +41,7 @@ use pocketmine\world\BlockTransaction; use function mt_rand; -class CocoaBlock extends Flowable implements AgeableInterface, SingleFacingInterface{ +class CocoaBlock extends Flowable implements AgeableInterface, HorizontalFacing{ use HorizontalFacingTrait; use AgeableTrait; diff --git a/src/block/Door.php b/src/block/Door.php index cc9893cb4f7..2ff53645c55 100644 --- a/src/block/Door.php +++ b/src/block/Door.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -35,7 +35,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\DoorSound; -class Door extends Transparent implements SingleFacingInterface{ +class Door extends Transparent implements HorizontalFacing{ use HorizontalFacingTrait; protected bool $top = false; diff --git a/src/block/EndPortalFrame.php b/src/block/EndPortalFrame.php index 41272908777..6c4865fdd70 100644 --- a/src/block/EndPortalFrame.php +++ b/src/block/EndPortalFrame.php @@ -24,12 +24,12 @@ namespace pocketmine\block; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -class EndPortalFrame extends Opaque implements SingleFacingInterface{ +class EndPortalFrame extends Opaque implements HorizontalFacing{ use FacesOppositePlacingPlayerTrait; protected bool $eye = false; diff --git a/src/block/EndRod.php b/src/block/EndRod.php index ce86aa11b86..e3d439f6a26 100644 --- a/src/block/EndRod.php +++ b/src/block/EndRod.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\AnyFacing; use pocketmine\block\utils\AnyFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Axis; use pocketmine\math\AxisAlignedBB; @@ -33,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class EndRod extends Flowable implements SingleFacingInterface{ +class EndRod extends Flowable implements AnyFacing{ use AnyFacingTrait; public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ diff --git a/src/block/EnderChest.php b/src/block/EnderChest.php index f785c3d7485..5dec4f3af6a 100644 --- a/src/block/EnderChest.php +++ b/src/block/EnderChest.php @@ -26,7 +26,7 @@ use pocketmine\block\inventory\EnderChestInventory; use pocketmine\block\tile\EnderChest as TileEnderChest; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\SupportType; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; @@ -34,7 +34,7 @@ use pocketmine\math\Vector3; use pocketmine\player\Player; -class EnderChest extends Transparent implements SingleFacingInterface{ +class EnderChest extends Transparent implements HorizontalFacing{ use FacesOppositePlacingPlayerTrait; public function getLightLevel() : int{ diff --git a/src/block/FenceGate.php b/src/block/FenceGate.php index 27312215244..0338aac5830 100644 --- a/src/block/FenceGate.php +++ b/src/block/FenceGate.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; @@ -37,7 +37,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\DoorSound; -class FenceGate extends Transparent implements SingleFacingInterface, WoodTypeInterface{ +class FenceGate extends Transparent implements HorizontalFacing, WoodTypeInterface{ use WoodTypeTrait; use HorizontalFacingTrait; diff --git a/src/block/GlazedTerracotta.php b/src/block/GlazedTerracotta.php index 682289152aa..c698d2b2044 100644 --- a/src/block/GlazedTerracotta.php +++ b/src/block/GlazedTerracotta.php @@ -26,9 +26,9 @@ use pocketmine\block\utils\ColoredInterface; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; -class GlazedTerracotta extends Opaque implements ColoredInterface, SingleFacingInterface{ +class GlazedTerracotta extends Opaque implements ColoredInterface, HorizontalFacing{ use ColoredTrait; use FacesOppositePlacingPlayerTrait; } diff --git a/src/block/ItemFrame.php b/src/block/ItemFrame.php index abbe8e9d8ba..0fda7775839 100644 --- a/src/block/ItemFrame.php +++ b/src/block/ItemFrame.php @@ -24,8 +24,8 @@ namespace pocketmine\block; use pocketmine\block\tile\ItemFrame as TileItemFrame; +use pocketmine\block\utils\AnyFacing; use pocketmine\block\utils\AnyFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -40,7 +40,7 @@ use function is_infinite; use function is_nan; -class ItemFrame extends Flowable implements SingleFacingInterface{ +class ItemFrame extends Flowable implements AnyFacing{ use AnyFacingTrait; public const ROTATIONS = 8; diff --git a/src/block/Ladder.php b/src/block/Ladder.php index 7a37d3988d6..6edaebbf2db 100644 --- a/src/block/Ladder.php +++ b/src/block/Ladder.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\entity\Entity; use pocketmine\entity\Living; @@ -36,7 +36,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class Ladder extends Transparent implements SingleFacingInterface{ +class Ladder extends Transparent implements HorizontalFacing{ use HorizontalFacingTrait; public function hasEntityCollision() : bool{ diff --git a/src/block/Lectern.php b/src/block/Lectern.php index c2222e6e74b..9ba01c1c5f3 100644 --- a/src/block/Lectern.php +++ b/src/block/Lectern.php @@ -25,7 +25,7 @@ use pocketmine\block\tile\Lectern as TileLectern; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -37,7 +37,7 @@ use pocketmine\world\sound\LecternPlaceBookSound; use function count; -class Lectern extends Transparent implements SingleFacingInterface{ +class Lectern extends Transparent implements HorizontalFacing{ use FacesOppositePlacingPlayerTrait; protected int $viewedPage = 0; diff --git a/src/block/LightningRod.php b/src/block/LightningRod.php index 04ba1459645..9c197122967 100644 --- a/src/block/LightningRod.php +++ b/src/block/LightningRod.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\AnyFacing; use pocketmine\block\utils\AnyFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Axis; use pocketmine\math\AxisAlignedBB; @@ -33,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class LightningRod extends Transparent implements SingleFacingInterface{ +final class LightningRod extends Transparent implements AnyFacing{ use AnyFacingTrait; protected function recalculateCollisionBoxes() : array{ diff --git a/src/block/Loom.php b/src/block/Loom.php index fc38caa02ea..a2b9fc235ea 100644 --- a/src/block/Loom.php +++ b/src/block/Loom.php @@ -25,12 +25,12 @@ use pocketmine\block\inventory\LoomInventory; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\item\Item; use pocketmine\math\Vector3; use pocketmine\player\Player; -final class Loom extends Opaque implements SingleFacingInterface{ +final class Loom extends Opaque implements HorizontalFacing{ use FacesOppositePlacingPlayerTrait; public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{ diff --git a/src/block/PinkPetals.php b/src/block/PinkPetals.php index b654365dd22..b8b6e248cef 100644 --- a/src/block/PinkPetals.php +++ b/src/block/PinkPetals.php @@ -24,8 +24,8 @@ namespace pocketmine\block; use pocketmine\block\utils\BlockEventHelper; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Fertilizer; @@ -35,7 +35,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class PinkPetals extends Flowable implements SingleFacingInterface{ +class PinkPetals extends Flowable implements HorizontalFacing{ use HorizontalFacingTrait; use StaticSupportTrait { canBePlacedAt as supportedWhenPlacedAt; diff --git a/src/block/RedstoneComparator.php b/src/block/RedstoneComparator.php index e366cbde3dc..cd7ff0dd272 100644 --- a/src/block/RedstoneComparator.php +++ b/src/block/RedstoneComparator.php @@ -26,10 +26,10 @@ use pocketmine\block\tile\Comparator; use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\PoweredByRedstoneTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -41,7 +41,7 @@ use pocketmine\world\BlockTransaction; use function assert; -class RedstoneComparator extends Flowable implements AnalogRedstoneSignalEmitterInterface, PoweredByRedstoneInterface, SingleFacingInterface{ +class RedstoneComparator extends Flowable implements AnalogRedstoneSignalEmitterInterface, PoweredByRedstoneInterface, HorizontalFacing{ use HorizontalFacingTrait; use AnalogRedstoneSignalEmitterTrait; use PoweredByRedstoneTrait; diff --git a/src/block/RedstoneRepeater.php b/src/block/RedstoneRepeater.php index 685a9373a2e..aaea8428c3b 100644 --- a/src/block/RedstoneRepeater.php +++ b/src/block/RedstoneRepeater.php @@ -23,10 +23,10 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; use pocketmine\block\utils\PoweredByRedstoneInterface; use pocketmine\block\utils\PoweredByRedstoneTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -37,7 +37,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class RedstoneRepeater extends Flowable implements PoweredByRedstoneInterface, SingleFacingInterface{ +class RedstoneRepeater extends Flowable implements PoweredByRedstoneInterface, HorizontalFacing{ use HorizontalFacingTrait; use PoweredByRedstoneTrait; use StaticSupportTrait; diff --git a/src/block/ShulkerBox.php b/src/block/ShulkerBox.php index fe01c8c688f..52a3b83cd70 100644 --- a/src/block/ShulkerBox.php +++ b/src/block/ShulkerBox.php @@ -24,8 +24,8 @@ namespace pocketmine\block; use pocketmine\block\tile\ShulkerBox as TileShulkerBox; +use pocketmine\block\utils\AnyFacing; use pocketmine\block\utils\AnyFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -33,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class ShulkerBox extends Opaque implements SingleFacingInterface{ +class ShulkerBox extends Opaque implements AnyFacing{ use AnyFacingTrait; protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{ diff --git a/src/block/SmallDripleaf.php b/src/block/SmallDripleaf.php index 5b58585d56b..846be5c931f 100644 --- a/src/block/SmallDripleaf.php +++ b/src/block/SmallDripleaf.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\event\block\StructureGrowEvent; @@ -37,7 +37,7 @@ use pocketmine\world\Position; use function mt_rand; -class SmallDripleaf extends Transparent implements SingleFacingInterface{ +class SmallDripleaf extends Transparent implements HorizontalFacing{ use HorizontalFacingTrait; protected bool $top = false; diff --git a/src/block/Stair.php b/src/block/Stair.php index 169fe68126a..56101de1390 100644 --- a/src/block/Stair.php +++ b/src/block/Stair.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\StairShape; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -36,7 +36,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class Stair extends Transparent implements SingleFacingInterface{ +class Stair extends Transparent implements HorizontalFacing{ use HorizontalFacingTrait; protected bool $upsideDown = false; diff --git a/src/block/Stonecutter.php b/src/block/Stonecutter.php index 76600c38232..0fd2593266b 100644 --- a/src/block/Stonecutter.php +++ b/src/block/Stonecutter.php @@ -25,7 +25,7 @@ use pocketmine\block\inventory\StonecutterInventory; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\SingleFacingInterface; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\SupportType; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; @@ -33,7 +33,7 @@ use pocketmine\math\Vector3; use pocketmine\player\Player; -class Stonecutter extends Transparent implements SingleFacingInterface{ +class Stonecutter extends Transparent implements HorizontalFacing{ use FacesOppositePlacingPlayerTrait; public function onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player = null, array &$returnedItems = []) : bool{ diff --git a/src/block/Trapdoor.php b/src/block/Trapdoor.php index 49ac2bba8ce..5e8a7dc3f1d 100644 --- a/src/block/Trapdoor.php +++ b/src/block/Trapdoor.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -35,7 +35,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\DoorSound; -class Trapdoor extends Transparent implements SingleFacingInterface{ +class Trapdoor extends Transparent implements HorizontalFacing{ use HorizontalFacingTrait; protected bool $open = false; diff --git a/src/block/TripwireHook.php b/src/block/TripwireHook.php index 8524c6feb50..4e40cf62e9e 100644 --- a/src/block/TripwireHook.php +++ b/src/block/TripwireHook.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; use pocketmine\math\Axis; @@ -33,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class TripwireHook extends Flowable implements SingleFacingInterface{ +class TripwireHook extends Flowable implements HorizontalFacing{ use HorizontalFacingTrait; protected bool $connected = false; diff --git a/src/block/WallBanner.php b/src/block/WallBanner.php index c351b7ca324..ddb157cdadf 100644 --- a/src/block/WallBanner.php +++ b/src/block/WallBanner.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Axis; use pocketmine\math\Facing; @@ -32,7 +32,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class WallBanner extends BaseBanner implements SingleFacingInterface{ +final class WallBanner extends BaseBanner implements HorizontalFacing{ use HorizontalFacingTrait; protected function getSupportingFace() : int{ diff --git a/src/block/WallCoralFan.php b/src/block/WallCoralFan.php index da88916e4ab..67745a5370b 100644 --- a/src/block/WallCoralFan.php +++ b/src/block/WallCoralFan.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; use pocketmine\item\VanillaItems; @@ -34,7 +34,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class WallCoralFan extends BaseCoral implements SingleFacingInterface{ +final class WallCoralFan extends BaseCoral implements HorizontalFacing{ use HorizontalFacingTrait; protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{ diff --git a/src/block/WallSign.php b/src/block/WallSign.php index 36c4cf29aeb..c6b42608de0 100644 --- a/src/block/WallSign.php +++ b/src/block/WallSign.php @@ -23,8 +23,8 @@ namespace pocketmine\block; +use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\SingleFacingInterface; use pocketmine\item\Item; use pocketmine\math\Axis; use pocketmine\math\Facing; @@ -32,7 +32,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class WallSign extends BaseSign implements SingleFacingInterface{ +final class WallSign extends BaseSign implements HorizontalFacing{ use HorizontalFacingTrait; protected function getSupportingFace() : int{ diff --git a/src/block/utils/SingleFacingInterface.php b/src/block/utils/AnyFacing.php similarity index 96% rename from src/block/utils/SingleFacingInterface.php rename to src/block/utils/AnyFacing.php index a02e81680a9..00ef417297c 100644 --- a/src/block/utils/SingleFacingInterface.php +++ b/src/block/utils/AnyFacing.php @@ -25,7 +25,7 @@ use pocketmine\math\Facing; -interface SingleFacingInterface{ +interface AnyFacing{ /** * @see Facing diff --git a/src/block/utils/HorizontalFacing.php b/src/block/utils/HorizontalFacing.php new file mode 100644 index 00000000000..083be360897 --- /dev/null +++ b/src/block/utils/HorizontalFacing.php @@ -0,0 +1,42 @@ + Date: Sun, 9 Mar 2025 12:01:45 +0100 Subject: [PATCH 4/6] Rename interfaces --- src/block/ActivatorRail.php | 4 ++-- src/block/BaseBanner.php | 4 ++-- src/block/BaseCoral.php | 4 ++-- src/block/BaseSign.php | 4 ++-- src/block/Bed.php | 4 ++-- src/block/BoneBlock.php | 4 ++-- src/block/Cactus.php | 4 ++-- src/block/CakeWithCandle.php | 4 ++-- src/block/CakeWithDyedCandle.php | 4 ++-- src/block/Campfire.php | 4 ++-- src/block/Candle.php | 4 ++-- src/block/Carpet.php | 4 ++-- src/block/CaveVines.php | 4 ++-- src/block/Chain.php | 4 ++-- src/block/ChorusFlower.php | 4 ++-- src/block/CocoaBlock.php | 4 ++-- src/block/Concrete.php | 4 ++-- src/block/ConcretePowder.php | 4 ++-- src/block/CopperBulb.php | 6 +++--- src/block/CoralBlock.php | 4 ++-- src/block/Crops.php | 4 ++-- src/block/DaylightSensor.php | 4 ++-- src/block/DoublePitcherCrop.php | 4 ++-- src/block/DyedCandle.php | 4 ++-- src/block/DyedShulkerBox.php | 4 ++-- src/block/FenceGate.php | 4 ++-- src/block/Fire.php | 4 ++-- src/block/FloorBanner.php | 4 ++-- src/block/FloorSign.php | 4 ++-- src/block/FrostedIce.php | 4 ++-- src/block/Furnace.php | 4 ++-- src/block/GlazedTerracotta.php | 4 ++-- src/block/GlowLichen.php | 4 ++-- src/block/HayBale.php | 4 ++-- src/block/Hopper.php | 4 ++-- src/block/NetherVines.php | 4 ++-- src/block/NetherWartPlant.php | 4 ++-- src/block/PitcherCrop.php | 4 ++-- src/block/Planks.php | 4 ++-- src/block/PoweredRail.php | 4 ++-- src/block/RedstoneComparator.php | 6 +++--- src/block/RedstoneLamp.php | 4 ++-- src/block/RedstoneOre.php | 4 ++-- src/block/RedstoneRepeater.php | 4 ++-- src/block/RedstoneTorch.php | 4 ++-- src/block/RedstoneWire.php | 4 ++-- src/block/ResinClump.php | 4 ++-- src/block/SimplePillar.php | 4 ++-- src/block/StainedGlass.php | 4 ++-- src/block/StainedGlassPane.php | 4 ++-- src/block/StainedHardenedClay.php | 4 ++-- src/block/StainedHardenedGlass.php | 4 ++-- src/block/StainedHardenedGlassPane.php | 4 ++-- src/block/Sugarcane.php | 4 ++-- src/block/SweetBerryBush.php | 4 ++-- src/block/WeightedPressurePlate.php | 4 ++-- src/block/Wood.php | 4 ++-- src/block/WoodenButton.php | 4 ++-- src/block/WoodenDoor.php | 4 ++-- src/block/WoodenFence.php | 4 ++-- src/block/WoodenPressurePlate.php | 4 ++-- src/block/WoodenSlab.php | 4 ++-- src/block/WoodenStairs.php | 4 ++-- src/block/WoodenTrapdoor.php | 4 ++-- src/block/Wool.php | 4 ++-- src/block/utils/{AgeableInterface.php => Ageable.php} | 2 +- ...EmitterInterface.php => AnalogRedstoneSignalEmitter.php} | 2 +- src/block/utils/{ColoredInterface.php => Colored.php} | 2 +- .../utils/{CoralTypeInterface.php => CoralMaterial.php} | 2 +- src/block/utils/{LightableInterface.php => Lightable.php} | 2 +- .../utils/{MultiFacingInterface.php => MultiFacing.php} | 2 +- .../{PillarRotationInterface.php => PillarRotation.php} | 2 +- ...PoweredByRedstoneInterface.php => PoweredByRedstone.php} | 2 +- .../{SignLikeRotationInterface.php => SignLikeRotation.php} | 2 +- src/block/utils/{WoodTypeInterface.php => WoodMaterial.php} | 2 +- 75 files changed, 142 insertions(+), 142 deletions(-) rename src/block/utils/{AgeableInterface.php => Ageable.php} (97%) rename src/block/utils/{AnalogRedstoneSignalEmitterInterface.php => AnalogRedstoneSignalEmitter.php} (95%) rename src/block/utils/{ColoredInterface.php => Colored.php} (96%) rename src/block/utils/{CoralTypeInterface.php => CoralMaterial.php} (96%) rename src/block/utils/{LightableInterface.php => Lightable.php} (96%) rename src/block/utils/{MultiFacingInterface.php => MultiFacing.php} (97%) rename src/block/utils/{PillarRotationInterface.php => PillarRotation.php} (96%) rename src/block/utils/{PoweredByRedstoneInterface.php => PoweredByRedstone.php} (95%) rename src/block/utils/{SignLikeRotationInterface.php => SignLikeRotation.php} (96%) rename src/block/utils/{WoodTypeInterface.php => WoodMaterial.php} (96%) diff --git a/src/block/ActivatorRail.php b/src/block/ActivatorRail.php index eee75c95f39..da15eb1e842 100644 --- a/src/block/ActivatorRail.php +++ b/src/block/ActivatorRail.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\PoweredByRedstoneInterface; +use pocketmine\block\utils\PoweredByRedstone; use pocketmine\block\utils\RailPoweredByRedstoneTrait; -class ActivatorRail extends StraightOnlyRail implements PoweredByRedstoneInterface{ +class ActivatorRail extends StraightOnlyRail implements PoweredByRedstone{ use RailPoweredByRedstoneTrait; //TODO diff --git a/src/block/BaseBanner.php b/src/block/BaseBanner.php index a999494e6ec..376f1f9dcc6 100644 --- a/src/block/BaseBanner.php +++ b/src/block/BaseBanner.php @@ -25,7 +25,7 @@ use pocketmine\block\tile\Banner as TileBanner; use pocketmine\block\utils\BannerPatternLayer; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\SupportType; use pocketmine\item\Banner as ItemBanner; @@ -37,7 +37,7 @@ use function assert; use function count; -abstract class BaseBanner extends Transparent implements ColoredInterface{ +abstract class BaseBanner extends Transparent implements Colored{ use ColoredTrait; /** diff --git a/src/block/BaseCoral.php b/src/block/BaseCoral.php index 52b5f137a25..c1cc9bb2566 100644 --- a/src/block/BaseCoral.php +++ b/src/block/BaseCoral.php @@ -24,13 +24,13 @@ namespace pocketmine\block; use pocketmine\block\utils\BlockEventHelper; -use pocketmine\block\utils\CoralTypeInterface; +use pocketmine\block\utils\CoralMaterial; use pocketmine\block\utils\CoralTypeTrait; use pocketmine\block\utils\SupportType; use pocketmine\item\Item; use function mt_rand; -abstract class BaseCoral extends Transparent implements CoralTypeInterface{ +abstract class BaseCoral extends Transparent implements CoralMaterial{ use CoralTypeTrait; public function onNearbyBlockChange() : void{ diff --git a/src/block/BaseSign.php b/src/block/BaseSign.php index 548d8c12498..0efaa603ced 100644 --- a/src/block/BaseSign.php +++ b/src/block/BaseSign.php @@ -27,8 +27,8 @@ use pocketmine\block\utils\DyeColor; use pocketmine\block\utils\SignText; use pocketmine\block\utils\SupportType; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodType; -use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; use pocketmine\color\Color; use pocketmine\event\block\SignChangeEvent; @@ -45,7 +45,7 @@ use function assert; use function strlen; -abstract class BaseSign extends Transparent implements WoodTypeInterface{ +abstract class BaseSign extends Transparent implements WoodMaterial{ use WoodTypeTrait; protected SignText $text; diff --git a/src/block/Bed.php b/src/block/Bed.php index 487e8845e5f..21bd3a17246 100644 --- a/src/block/Bed.php +++ b/src/block/Bed.php @@ -24,7 +24,7 @@ namespace pocketmine\block; use pocketmine\block\tile\Bed as TileBed; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\DyeColor; use pocketmine\block\utils\HorizontalFacing; @@ -43,7 +43,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\World; -class Bed extends Transparent implements ColoredInterface, HorizontalFacing{ +class Bed extends Transparent implements Colored, HorizontalFacing{ use ColoredTrait; use HorizontalFacingTrait; diff --git a/src/block/BoneBlock.php b/src/block/BoneBlock.php index f02456fe9dd..465d9603335 100644 --- a/src/block/BoneBlock.php +++ b/src/block/BoneBlock.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\PillarRotationInterface; +use pocketmine\block\utils\PillarRotation; use pocketmine\block\utils\PillarRotationTrait; -class BoneBlock extends Opaque implements PillarRotationInterface{ +class BoneBlock extends Opaque implements PillarRotation{ use PillarRotationTrait; } diff --git a/src/block/Cactus.php b/src/block/Cactus.php index d69ffc4d0aa..51c98786bed 100644 --- a/src/block/Cactus.php +++ b/src/block/Cactus.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\StaticSupportTrait; @@ -34,7 +34,7 @@ use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -class Cactus extends Transparent implements AgeableInterface{ +class Cactus extends Transparent implements Ageable{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/CakeWithCandle.php b/src/block/CakeWithCandle.php index 35c7e453a8c..1462776c27e 100644 --- a/src/block/CakeWithCandle.php +++ b/src/block/CakeWithCandle.php @@ -24,7 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\CandleTrait; -use pocketmine\block\utils\LightableInterface; +use pocketmine\block\utils\Lightable; use pocketmine\entity\Living; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; @@ -32,7 +32,7 @@ use pocketmine\math\Vector3; use pocketmine\player\Player; -class CakeWithCandle extends BaseCake implements LightableInterface{ +class CakeWithCandle extends BaseCake implements Lightable{ use CandleTrait { onInteract as onInteractCandle; } diff --git a/src/block/CakeWithDyedCandle.php b/src/block/CakeWithDyedCandle.php index 06d87558c81..04ab0c6ebe2 100644 --- a/src/block/CakeWithDyedCandle.php +++ b/src/block/CakeWithDyedCandle.php @@ -23,11 +23,11 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\DyeColor; -class CakeWithDyedCandle extends CakeWithCandle implements ColoredInterface{ +class CakeWithDyedCandle extends CakeWithCandle implements Colored{ use ColoredTrait; public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){ diff --git a/src/block/Campfire.php b/src/block/Campfire.php index 4167febaf5a..edfc87ecbe8 100644 --- a/src/block/Campfire.php +++ b/src/block/Campfire.php @@ -27,7 +27,7 @@ use pocketmine\block\tile\Campfire as TileCampfire; use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\LightableInterface; +use pocketmine\block\utils\Lightable; use pocketmine\block\utils\LightableTrait; use pocketmine\block\utils\SupportType; use pocketmine\crafting\FurnaceRecipe; @@ -61,7 +61,7 @@ use function min; use function mt_rand; -class Campfire extends Transparent implements LightableInterface, HorizontalFacing{ +class Campfire extends Transparent implements Lightable, HorizontalFacing{ use HorizontalFacingTrait{ HorizontalFacingTrait::describeBlockOnlyState as encodeFacingState; } diff --git a/src/block/Candle.php b/src/block/Candle.php index 6f9f5062564..977f13a09b5 100644 --- a/src/block/Candle.php +++ b/src/block/Candle.php @@ -24,7 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\CandleTrait; -use pocketmine\block\utils\LightableInterface; +use pocketmine\block\utils\Lightable; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -36,7 +36,7 @@ use pocketmine\utils\AssumptionFailedError; use pocketmine\world\BlockTransaction; -class Candle extends Transparent implements LightableInterface{ +class Candle extends Transparent implements Lightable{ use CandleTrait { describeBlockOnlyState as encodeLitState; getLightLevel as getBaseLightLevel; diff --git a/src/block/Carpet.php b/src/block/Carpet.php index 4ccec230270..fd8b42a099b 100644 --- a/src/block/Carpet.php +++ b/src/block/Carpet.php @@ -23,13 +23,13 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -class Carpet extends Flowable implements ColoredInterface{ +class Carpet extends Flowable implements Colored{ use ColoredTrait; use StaticSupportTrait; diff --git a/src/block/CaveVines.php b/src/block/CaveVines.php index 599f8496aa4..84d7d3169bc 100644 --- a/src/block/CaveVines.php +++ b/src/block/CaveVines.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\StaticSupportTrait; @@ -40,7 +40,7 @@ use pocketmine\world\sound\GlowBerriesPickSound; use function mt_rand; -class CaveVines extends Flowable implements AgeableInterface{ +class CaveVines extends Flowable implements Ageable{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/Chain.php b/src/block/Chain.php index 1eb3472100c..5ec3b1e2a8c 100644 --- a/src/block/Chain.php +++ b/src/block/Chain.php @@ -23,14 +23,14 @@ namespace pocketmine\block; -use pocketmine\block\utils\PillarRotationInterface; +use pocketmine\block\utils\PillarRotation; use pocketmine\block\utils\PillarRotationTrait; use pocketmine\block\utils\SupportType; use pocketmine\math\Axis; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; -final class Chain extends Transparent implements PillarRotationInterface{ +final class Chain extends Transparent implements PillarRotation{ use PillarRotationTrait; public function getSupportType(int $facing) : SupportType{ diff --git a/src/block/ChorusFlower.php b/src/block/ChorusFlower.php index da4f43be43f..ef48d5a8936 100644 --- a/src/block/ChorusFlower.php +++ b/src/block/ChorusFlower.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\entity\projectile\Projectile; @@ -41,7 +41,7 @@ use function min; use function mt_rand; -final class ChorusFlower extends Flowable implements AgeableInterface{ +final class ChorusFlower extends Flowable implements Ageable{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/CocoaBlock.php b/src/block/CocoaBlock.php index 5d379bccc72..ae09ccb0ad5 100644 --- a/src/block/CocoaBlock.php +++ b/src/block/CocoaBlock.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\HorizontalFacing; @@ -41,7 +41,7 @@ use pocketmine\world\BlockTransaction; use function mt_rand; -class CocoaBlock extends Flowable implements AgeableInterface, HorizontalFacing{ +class CocoaBlock extends Flowable implements Ageable, HorizontalFacing{ use HorizontalFacingTrait; use AgeableTrait; diff --git a/src/block/Concrete.php b/src/block/Concrete.php index 34835f4bf27..6cad111935d 100644 --- a/src/block/Concrete.php +++ b/src/block/Concrete.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -class Concrete extends Opaque implements ColoredInterface{ +class Concrete extends Opaque implements Colored{ use ColoredTrait; } diff --git a/src/block/ConcretePowder.php b/src/block/ConcretePowder.php index 511d725a560..89b53053bb6 100644 --- a/src/block/ConcretePowder.php +++ b/src/block/ConcretePowder.php @@ -24,13 +24,13 @@ namespace pocketmine\block; use pocketmine\block\utils\BlockEventHelper; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\Fallable; use pocketmine\block\utils\FallableTrait; use pocketmine\math\Facing; -class ConcretePowder extends Opaque implements Fallable, ColoredInterface{ +class ConcretePowder extends Opaque implements Fallable, Colored{ use ColoredTrait; use FallableTrait { onNearbyBlockChange as protected startFalling; diff --git a/src/block/CopperBulb.php b/src/block/CopperBulb.php index 44c8848c247..d0bdedf3c7c 100644 --- a/src/block/CopperBulb.php +++ b/src/block/CopperBulb.php @@ -26,13 +26,13 @@ use pocketmine\block\utils\CopperMaterial; use pocketmine\block\utils\CopperOxidation; use pocketmine\block\utils\CopperTrait; -use pocketmine\block\utils\LightableInterface; +use pocketmine\block\utils\Lightable; use pocketmine\block\utils\LightableTrait; -use pocketmine\block\utils\PoweredByRedstoneInterface; +use pocketmine\block\utils\PoweredByRedstone; use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\data\runtime\RuntimeDataDescriber; -class CopperBulb extends Opaque implements CopperMaterial, LightableInterface, PoweredByRedstoneInterface{ +class CopperBulb extends Opaque implements CopperMaterial, Lightable, PoweredByRedstone{ use CopperTrait; use PoweredByRedstoneTrait; use LightableTrait{ diff --git a/src/block/CoralBlock.php b/src/block/CoralBlock.php index 2f0b2786f02..c2120999810 100644 --- a/src/block/CoralBlock.php +++ b/src/block/CoralBlock.php @@ -24,12 +24,12 @@ namespace pocketmine\block; use pocketmine\block\utils\BlockEventHelper; -use pocketmine\block\utils\CoralTypeInterface; +use pocketmine\block\utils\CoralMaterial; use pocketmine\block\utils\CoralTypeTrait; use pocketmine\item\Item; use function mt_rand; -final class CoralBlock extends Opaque implements CoralTypeInterface{ +final class CoralBlock extends Opaque implements CoralMaterial{ use CoralTypeTrait; public function onNearbyBlockChange() : void{ diff --git a/src/block/Crops.php b/src/block/Crops.php index 575c057982a..b0488d15092 100644 --- a/src/block/Crops.php +++ b/src/block/Crops.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\CropGrowthHelper; @@ -35,7 +35,7 @@ use pocketmine\player\Player; use function mt_rand; -abstract class Crops extends Flowable implements AgeableInterface{ +abstract class Crops extends Flowable implements Ageable{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/DaylightSensor.php b/src/block/DaylightSensor.php index 569f3cc258c..ed56d2f4410 100644 --- a/src/block/DaylightSensor.php +++ b/src/block/DaylightSensor.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; +use pocketmine\block\utils\AnalogRedstoneSignalEmitter; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -37,7 +37,7 @@ use function round; use const M_PI; -class DaylightSensor extends Transparent implements AnalogRedstoneSignalEmitterInterface{ +class DaylightSensor extends Transparent implements AnalogRedstoneSignalEmitter{ use AnalogRedstoneSignalEmitterTrait; protected bool $inverted = false; diff --git a/src/block/DoublePitcherCrop.php b/src/block/DoublePitcherCrop.php index b1c890dd8be..89d9e98b56a 100644 --- a/src/block/DoublePitcherCrop.php +++ b/src/block/DoublePitcherCrop.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\CropGrowthHelper; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -38,7 +38,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class DoublePitcherCrop extends DoublePlant implements AgeableInterface{ +final class DoublePitcherCrop extends DoublePlant implements Ageable{ use AgeableTrait { describeBlockOnlyState as describeAge; } diff --git a/src/block/DyedCandle.php b/src/block/DyedCandle.php index a214da576bc..57a8b592391 100644 --- a/src/block/DyedCandle.php +++ b/src/block/DyedCandle.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -class DyedCandle extends Candle implements ColoredInterface{ +class DyedCandle extends Candle implements Colored{ use ColoredTrait; protected function getCandleIfCompatibleType(Block $block) : ?Candle{ diff --git a/src/block/DyedShulkerBox.php b/src/block/DyedShulkerBox.php index 40f18dd0162..8be2718a2ea 100644 --- a/src/block/DyedShulkerBox.php +++ b/src/block/DyedShulkerBox.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -final class DyedShulkerBox extends ShulkerBox implements ColoredInterface{ +final class DyedShulkerBox extends ShulkerBox implements Colored{ use ColoredTrait; } diff --git a/src/block/FenceGate.php b/src/block/FenceGate.php index 0338aac5830..d8cdfe4e2aa 100644 --- a/src/block/FenceGate.php +++ b/src/block/FenceGate.php @@ -26,7 +26,7 @@ use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; use pocketmine\block\utils\SupportType; -use pocketmine\block\utils\WoodTypeInterface; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Item; @@ -37,7 +37,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\sound\DoorSound; -class FenceGate extends Transparent implements HorizontalFacing, WoodTypeInterface{ +class FenceGate extends Transparent implements HorizontalFacing, WoodMaterial{ use WoodTypeTrait; use HorizontalFacingTrait; diff --git a/src/block/Fire.php b/src/block/Fire.php index ad0a3dc8ca1..62809fb9d80 100644 --- a/src/block/Fire.php +++ b/src/block/Fire.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\SupportType; @@ -36,7 +36,7 @@ use function min; use function mt_rand; -class Fire extends BaseFire implements AgeableInterface{ +class Fire extends BaseFire implements Ageable{ use AgeableTrait; public const MAX_AGE = 15; diff --git a/src/block/FloorBanner.php b/src/block/FloorBanner.php index da6379cfacc..ba089b6c035 100644 --- a/src/block/FloorBanner.php +++ b/src/block/FloorBanner.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\SignLikeRotationInterface; +use pocketmine\block\utils\SignLikeRotation; use pocketmine\block\utils\SignLikeRotationTrait; use pocketmine\item\Item; use pocketmine\math\Facing; @@ -31,7 +31,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class FloorBanner extends BaseBanner implements SignLikeRotationInterface{ +final class FloorBanner extends BaseBanner implements SignLikeRotation{ use SignLikeRotationTrait; protected function getSupportingFace() : int{ diff --git a/src/block/FloorSign.php b/src/block/FloorSign.php index 78cdf4acc39..94e51ffe848 100644 --- a/src/block/FloorSign.php +++ b/src/block/FloorSign.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\SignLikeRotationInterface; +use pocketmine\block\utils\SignLikeRotation; use pocketmine\block\utils\SignLikeRotationTrait; use pocketmine\item\Item; use pocketmine\math\Facing; @@ -31,7 +31,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class FloorSign extends BaseSign implements SignLikeRotationInterface{ +final class FloorSign extends BaseSign implements SignLikeRotation{ use SignLikeRotationTrait; protected function getSupportingFace() : int{ diff --git a/src/block/FrostedIce.php b/src/block/FrostedIce.php index 2c921fcbcea..046d75811ff 100644 --- a/src/block/FrostedIce.php +++ b/src/block/FrostedIce.php @@ -23,12 +23,12 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use function mt_rand; -class FrostedIce extends Ice implements AgeableInterface{ +class FrostedIce extends Ice implements Ageable{ use AgeableTrait; public const MAX_AGE = 3; diff --git a/src/block/Furnace.php b/src/block/Furnace.php index a97412a3ca9..54480e62c8a 100644 --- a/src/block/Furnace.php +++ b/src/block/Furnace.php @@ -25,7 +25,7 @@ use pocketmine\block\tile\Furnace as TileFurnace; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; -use pocketmine\block\utils\LightableInterface; +use pocketmine\block\utils\Lightable; use pocketmine\block\utils\LightableTrait; use pocketmine\crafting\FurnaceType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -34,7 +34,7 @@ use pocketmine\player\Player; use function mt_rand; -class Furnace extends Opaque implements LightableInterface{ +class Furnace extends Opaque implements Lightable{ use FacesOppositePlacingPlayerTrait; use LightableTrait; diff --git a/src/block/GlazedTerracotta.php b/src/block/GlazedTerracotta.php index c698d2b2044..ccb92887550 100644 --- a/src/block/GlazedTerracotta.php +++ b/src/block/GlazedTerracotta.php @@ -23,12 +23,12 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; use pocketmine\block\utils\FacesOppositePlacingPlayerTrait; use pocketmine\block\utils\HorizontalFacing; -class GlazedTerracotta extends Opaque implements ColoredInterface, HorizontalFacing{ +class GlazedTerracotta extends Opaque implements Colored, HorizontalFacing{ use ColoredTrait; use FacesOppositePlacingPlayerTrait; } diff --git a/src/block/GlowLichen.php b/src/block/GlowLichen.php index 70100f2adea..6ad8d374854 100644 --- a/src/block/GlowLichen.php +++ b/src/block/GlowLichen.php @@ -25,7 +25,7 @@ use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\MultiAnySupportTrait; -use pocketmine\block\utils\MultiFacingInterface; +use pocketmine\block\utils\MultiFacing; use pocketmine\block\utils\SupportType; use pocketmine\item\Fertilizer; use pocketmine\item\Item; @@ -36,7 +36,7 @@ use function count; use function shuffle; -class GlowLichen extends Transparent implements MultiFacingInterface{ +class GlowLichen extends Transparent implements MultiFacing{ use MultiAnySupportTrait; public function getLightLevel() : int{ diff --git a/src/block/HayBale.php b/src/block/HayBale.php index 5646ba7820a..dacfe92fa86 100644 --- a/src/block/HayBale.php +++ b/src/block/HayBale.php @@ -23,11 +23,11 @@ namespace pocketmine\block; -use pocketmine\block\utils\PillarRotationInterface; +use pocketmine\block\utils\PillarRotation; use pocketmine\block\utils\PillarRotationTrait; use pocketmine\entity\Entity; -class HayBale extends Opaque implements PillarRotationInterface{ +class HayBale extends Opaque implements PillarRotation{ use PillarRotationTrait; public function getFlameEncouragement() : int{ diff --git a/src/block/Hopper.php b/src/block/Hopper.php index 3f2aa0552fa..4956b668fbe 100644 --- a/src/block/Hopper.php +++ b/src/block/Hopper.php @@ -24,7 +24,7 @@ namespace pocketmine\block; use pocketmine\block\tile\Hopper as TileHopper; -use pocketmine\block\utils\PoweredByRedstoneInterface; +use pocketmine\block\utils\PoweredByRedstone; use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\block\utils\SupportType; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -35,7 +35,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class Hopper extends Transparent implements PoweredByRedstoneInterface{ +class Hopper extends Transparent implements PoweredByRedstone{ use PoweredByRedstoneTrait; private int $facing = Facing::DOWN; diff --git a/src/block/NetherVines.php b/src/block/NetherVines.php index 8cd497e7831..67a0b6f949b 100644 --- a/src/block/NetherVines.php +++ b/src/block/NetherVines.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\FortuneDropHelper; use pocketmine\block\utils\StaticSupportTrait; @@ -42,7 +42,7 @@ /** * This class is used for Weeping & Twisting vines, because they have same behaviour */ -class NetherVines extends Flowable implements AgeableInterface{ +class NetherVines extends Flowable implements Ageable{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/NetherWartPlant.php b/src/block/NetherWartPlant.php index 1a0c3866fd9..df060975494 100644 --- a/src/block/NetherWartPlant.php +++ b/src/block/NetherWartPlant.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\FortuneDropHelper; @@ -32,7 +32,7 @@ use pocketmine\math\Facing; use function mt_rand; -class NetherWartPlant extends Flowable implements AgeableInterface{ +class NetherWartPlant extends Flowable implements Ageable{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/PitcherCrop.php b/src/block/PitcherCrop.php index 56c11153604..1c771bb8a38 100644 --- a/src/block/PitcherCrop.php +++ b/src/block/PitcherCrop.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\CropGrowthHelper; @@ -39,7 +39,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -final class PitcherCrop extends Flowable implements AgeableInterface{ +final class PitcherCrop extends Flowable implements Ageable{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/Planks.php b/src/block/Planks.php index 6be34d84ea9..ad795636186 100644 --- a/src/block/Planks.php +++ b/src/block/Planks.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\WoodTypeInterface; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; -class Planks extends Opaque implements WoodTypeInterface{ +class Planks extends Opaque implements WoodMaterial{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/PoweredRail.php b/src/block/PoweredRail.php index 16decc2dd08..321b19a462f 100644 --- a/src/block/PoweredRail.php +++ b/src/block/PoweredRail.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\PoweredByRedstoneInterface; +use pocketmine\block\utils\PoweredByRedstone; use pocketmine\block\utils\RailPoweredByRedstoneTrait; -class PoweredRail extends StraightOnlyRail implements PoweredByRedstoneInterface{ +class PoweredRail extends StraightOnlyRail implements PoweredByRedstone{ use RailPoweredByRedstoneTrait; } diff --git a/src/block/RedstoneComparator.php b/src/block/RedstoneComparator.php index cd7ff0dd272..88050b85a19 100644 --- a/src/block/RedstoneComparator.php +++ b/src/block/RedstoneComparator.php @@ -24,11 +24,11 @@ namespace pocketmine\block; use pocketmine\block\tile\Comparator; -use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; +use pocketmine\block\utils\AnalogRedstoneSignalEmitter; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\PoweredByRedstoneInterface; +use pocketmine\block\utils\PoweredByRedstone; use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\block\utils\SupportType; @@ -41,7 +41,7 @@ use pocketmine\world\BlockTransaction; use function assert; -class RedstoneComparator extends Flowable implements AnalogRedstoneSignalEmitterInterface, PoweredByRedstoneInterface, HorizontalFacing{ +class RedstoneComparator extends Flowable implements AnalogRedstoneSignalEmitter, PoweredByRedstone, HorizontalFacing{ use HorizontalFacingTrait; use AnalogRedstoneSignalEmitterTrait; use PoweredByRedstoneTrait; diff --git a/src/block/RedstoneLamp.php b/src/block/RedstoneLamp.php index 6341b9f91d2..33a97801dc7 100644 --- a/src/block/RedstoneLamp.php +++ b/src/block/RedstoneLamp.php @@ -23,11 +23,11 @@ namespace pocketmine\block; -use pocketmine\block\utils\PoweredByRedstoneInterface; +use pocketmine\block\utils\PoweredByRedstone; use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\data\runtime\RuntimeDataDescriber; -class RedstoneLamp extends Opaque implements PoweredByRedstoneInterface{ +class RedstoneLamp extends Opaque implements PoweredByRedstone{ use PoweredByRedstoneTrait; protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{ diff --git a/src/block/RedstoneOre.php b/src/block/RedstoneOre.php index 03b401ae696..3477a351926 100644 --- a/src/block/RedstoneOre.php +++ b/src/block/RedstoneOre.php @@ -24,7 +24,7 @@ namespace pocketmine\block; use pocketmine\block\utils\FortuneDropHelper; -use pocketmine\block\utils\LightableInterface; +use pocketmine\block\utils\Lightable; use pocketmine\block\utils\LightableTrait; use pocketmine\item\Item; use pocketmine\item\VanillaItems; @@ -32,7 +32,7 @@ use pocketmine\player\Player; use function mt_rand; -class RedstoneOre extends Opaque implements LightableInterface{ +class RedstoneOre extends Opaque implements Lightable{ use LightableTrait; public function getLightLevel() : int{ diff --git a/src/block/RedstoneRepeater.php b/src/block/RedstoneRepeater.php index aaea8428c3b..4059ff1cc51 100644 --- a/src/block/RedstoneRepeater.php +++ b/src/block/RedstoneRepeater.php @@ -25,7 +25,7 @@ use pocketmine\block\utils\HorizontalFacing; use pocketmine\block\utils\HorizontalFacingTrait; -use pocketmine\block\utils\PoweredByRedstoneInterface; +use pocketmine\block\utils\PoweredByRedstone; use pocketmine\block\utils\PoweredByRedstoneTrait; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\block\utils\SupportType; @@ -37,7 +37,7 @@ use pocketmine\player\Player; use pocketmine\world\BlockTransaction; -class RedstoneRepeater extends Flowable implements PoweredByRedstoneInterface, HorizontalFacing{ +class RedstoneRepeater extends Flowable implements PoweredByRedstone, HorizontalFacing{ use HorizontalFacingTrait; use PoweredByRedstoneTrait; use StaticSupportTrait; diff --git a/src/block/RedstoneTorch.php b/src/block/RedstoneTorch.php index aab0833df0a..f73076ccc4a 100644 --- a/src/block/RedstoneTorch.php +++ b/src/block/RedstoneTorch.php @@ -23,11 +23,11 @@ namespace pocketmine\block; -use pocketmine\block\utils\LightableInterface; +use pocketmine\block\utils\Lightable; use pocketmine\block\utils\LightableTrait; use pocketmine\data\runtime\RuntimeDataDescriber; -class RedstoneTorch extends Torch implements LightableInterface{ +class RedstoneTorch extends Torch implements Lightable{ use LightableTrait; public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo){ diff --git a/src/block/RedstoneWire.php b/src/block/RedstoneWire.php index 1b9decf5053..6be27bcb47c 100644 --- a/src/block/RedstoneWire.php +++ b/src/block/RedstoneWire.php @@ -23,14 +23,14 @@ namespace pocketmine\block; -use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; +use pocketmine\block\utils\AnalogRedstoneSignalEmitter; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; use pocketmine\block\utils\StaticSupportTrait; use pocketmine\item\Item; use pocketmine\item\VanillaItems; use pocketmine\math\Facing; -class RedstoneWire extends Flowable implements AnalogRedstoneSignalEmitterInterface{ +class RedstoneWire extends Flowable implements AnalogRedstoneSignalEmitter{ use AnalogRedstoneSignalEmitterTrait; use StaticSupportTrait; diff --git a/src/block/ResinClump.php b/src/block/ResinClump.php index 43ed45df098..2855a7cc343 100644 --- a/src/block/ResinClump.php +++ b/src/block/ResinClump.php @@ -24,10 +24,10 @@ namespace pocketmine\block; use pocketmine\block\utils\MultiAnySupportTrait; -use pocketmine\block\utils\MultiFacingInterface; +use pocketmine\block\utils\MultiFacing; use pocketmine\block\utils\SupportType; -final class ResinClump extends Transparent implements MultiFacingInterface{ +final class ResinClump extends Transparent implements MultiFacing{ use MultiAnySupportTrait; public function isSolid() : bool{ diff --git a/src/block/SimplePillar.php b/src/block/SimplePillar.php index 2b27cef3da0..6a7af96edc5 100644 --- a/src/block/SimplePillar.php +++ b/src/block/SimplePillar.php @@ -23,13 +23,13 @@ namespace pocketmine\block; -use pocketmine\block\utils\PillarRotationInterface; +use pocketmine\block\utils\PillarRotation; use pocketmine\block\utils\PillarRotationTrait; /** * @internal This class provides a general base for pillar-like blocks. It **should not** be used for contract binding * in APIs, because not all pillar-like blocks extend this class. */ -class SimplePillar extends Opaque implements PillarRotationInterface{ +class SimplePillar extends Opaque implements PillarRotation{ use PillarRotationTrait; } diff --git a/src/block/StainedGlass.php b/src/block/StainedGlass.php index a080817f005..baf4755bb01 100644 --- a/src/block/StainedGlass.php +++ b/src/block/StainedGlass.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -final class StainedGlass extends Glass implements ColoredInterface{ +final class StainedGlass extends Glass implements Colored{ use ColoredTrait; } diff --git a/src/block/StainedGlassPane.php b/src/block/StainedGlassPane.php index 35ab1356f8a..897c291c7a7 100644 --- a/src/block/StainedGlassPane.php +++ b/src/block/StainedGlassPane.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -final class StainedGlassPane extends GlassPane implements ColoredInterface{ +final class StainedGlassPane extends GlassPane implements Colored{ use ColoredTrait; } diff --git a/src/block/StainedHardenedClay.php b/src/block/StainedHardenedClay.php index 06499b83750..765e97e4f21 100644 --- a/src/block/StainedHardenedClay.php +++ b/src/block/StainedHardenedClay.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -final class StainedHardenedClay extends HardenedClay implements ColoredInterface{ +final class StainedHardenedClay extends HardenedClay implements Colored{ use ColoredTrait; } diff --git a/src/block/StainedHardenedGlass.php b/src/block/StainedHardenedGlass.php index 63b1801b4f5..c3a794e4d96 100644 --- a/src/block/StainedHardenedGlass.php +++ b/src/block/StainedHardenedGlass.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -final class StainedHardenedGlass extends HardenedGlass implements ColoredInterface{ +final class StainedHardenedGlass extends HardenedGlass implements Colored{ use ColoredTrait; } diff --git a/src/block/StainedHardenedGlassPane.php b/src/block/StainedHardenedGlassPane.php index ef73dfc72eb..9631ff5a9e8 100644 --- a/src/block/StainedHardenedGlassPane.php +++ b/src/block/StainedHardenedGlassPane.php @@ -23,9 +23,9 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -final class StainedHardenedGlassPane extends HardenedGlassPane implements ColoredInterface{ +final class StainedHardenedGlassPane extends HardenedGlassPane implements Colored{ use ColoredTrait; } diff --git a/src/block/Sugarcane.php b/src/block/Sugarcane.php index d5a71cd7e1d..0874413c566 100644 --- a/src/block/Sugarcane.php +++ b/src/block/Sugarcane.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\StaticSupportTrait; @@ -35,7 +35,7 @@ use pocketmine\world\BlockTransaction; use pocketmine\world\Position; -class Sugarcane extends Flowable implements AgeableInterface{ +class Sugarcane extends Flowable implements Ageable{ use AgeableTrait; use StaticSupportTrait { onNearbyBlockChange as onSupportBlockChange; diff --git a/src/block/SweetBerryBush.php b/src/block/SweetBerryBush.php index 4732e1948a7..881b7359f91 100644 --- a/src/block/SweetBerryBush.php +++ b/src/block/SweetBerryBush.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\AgeableInterface; +use pocketmine\block\utils\Ageable; use pocketmine\block\utils\AgeableTrait; use pocketmine\block\utils\BlockEventHelper; use pocketmine\block\utils\FortuneDropHelper; @@ -40,7 +40,7 @@ use pocketmine\world\sound\SweetBerriesPickSound; use function mt_rand; -class SweetBerryBush extends Flowable implements AgeableInterface{ +class SweetBerryBush extends Flowable implements Ageable{ use AgeableTrait; use StaticSupportTrait; diff --git a/src/block/WeightedPressurePlate.php b/src/block/WeightedPressurePlate.php index 19e83458172..065f8b2c8c9 100644 --- a/src/block/WeightedPressurePlate.php +++ b/src/block/WeightedPressurePlate.php @@ -23,14 +23,14 @@ namespace pocketmine\block; -use pocketmine\block\utils\AnalogRedstoneSignalEmitterInterface; +use pocketmine\block\utils\AnalogRedstoneSignalEmitter; use pocketmine\block\utils\AnalogRedstoneSignalEmitterTrait; use function ceil; use function count; use function max; use function min; -class WeightedPressurePlate extends PressurePlate implements AnalogRedstoneSignalEmitterInterface{ +class WeightedPressurePlate extends PressurePlate implements AnalogRedstoneSignalEmitter{ use AnalogRedstoneSignalEmitterTrait; private readonly float $signalStrengthFactor; diff --git a/src/block/Wood.php b/src/block/Wood.php index 1f566a1a9b8..7da134cc88a 100644 --- a/src/block/Wood.php +++ b/src/block/Wood.php @@ -23,7 +23,7 @@ namespace pocketmine\block; -use pocketmine\block\utils\PillarRotationInterface; +use pocketmine\block\utils\PillarRotation; use pocketmine\block\utils\PillarRotationTrait; use pocketmine\block\utils\WoodTypeTrait; use pocketmine\data\runtime\RuntimeDataDescriber; @@ -33,7 +33,7 @@ use pocketmine\player\Player; use pocketmine\world\sound\ItemUseOnBlockSound; -class Wood extends Opaque implements PillarRotationInterface{ +class Wood extends Opaque implements PillarRotation{ use PillarRotationTrait; use WoodTypeTrait; diff --git a/src/block/WoodenButton.php b/src/block/WoodenButton.php index 3c445cbaa23..4eed3a50e31 100644 --- a/src/block/WoodenButton.php +++ b/src/block/WoodenButton.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\WoodTypeInterface; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; -class WoodenButton extends Button implements WoodTypeInterface{ +class WoodenButton extends Button implements WoodMaterial{ use WoodTypeTrait; protected function getActivationTime() : int{ diff --git a/src/block/WoodenDoor.php b/src/block/WoodenDoor.php index c3b5b31ff34..b7918a8200e 100644 --- a/src/block/WoodenDoor.php +++ b/src/block/WoodenDoor.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\WoodTypeInterface; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; -class WoodenDoor extends Door implements WoodTypeInterface{ +class WoodenDoor extends Door implements WoodMaterial{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/WoodenFence.php b/src/block/WoodenFence.php index 840fed4880a..73c8da44ddc 100644 --- a/src/block/WoodenFence.php +++ b/src/block/WoodenFence.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\WoodTypeInterface; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; -class WoodenFence extends Fence implements WoodTypeInterface{ +class WoodenFence extends Fence implements WoodMaterial{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/WoodenPressurePlate.php b/src/block/WoodenPressurePlate.php index 427e6272b98..6d638788b3c 100644 --- a/src/block/WoodenPressurePlate.php +++ b/src/block/WoodenPressurePlate.php @@ -23,11 +23,11 @@ namespace pocketmine\block; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodType; -use pocketmine\block\utils\WoodTypeInterface; use pocketmine\block\utils\WoodTypeTrait; -class WoodenPressurePlate extends SimplePressurePlate implements WoodTypeInterface{ +class WoodenPressurePlate extends SimplePressurePlate implements WoodMaterial{ use WoodTypeTrait; public function __construct( diff --git a/src/block/WoodenSlab.php b/src/block/WoodenSlab.php index 18ba9957158..3ed606c64f5 100644 --- a/src/block/WoodenSlab.php +++ b/src/block/WoodenSlab.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\WoodTypeInterface; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; -class WoodenSlab extends Slab implements WoodTypeInterface{ +class WoodenSlab extends Slab implements WoodMaterial{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/WoodenStairs.php b/src/block/WoodenStairs.php index 229b0767614..8da3fceb6fb 100644 --- a/src/block/WoodenStairs.php +++ b/src/block/WoodenStairs.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\WoodTypeInterface; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; -class WoodenStairs extends Stair implements WoodTypeInterface{ +class WoodenStairs extends Stair implements WoodMaterial{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/WoodenTrapdoor.php b/src/block/WoodenTrapdoor.php index 4c96527df28..2b796df5267 100644 --- a/src/block/WoodenTrapdoor.php +++ b/src/block/WoodenTrapdoor.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\WoodTypeInterface; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; -class WoodenTrapdoor extends Trapdoor implements WoodTypeInterface{ +class WoodenTrapdoor extends Trapdoor implements WoodMaterial{ use WoodTypeTrait; public function getFuelTime() : int{ diff --git a/src/block/Wool.php b/src/block/Wool.php index 0fc40bbd973..d47c27d278c 100644 --- a/src/block/Wool.php +++ b/src/block/Wool.php @@ -23,10 +23,10 @@ namespace pocketmine\block; -use pocketmine\block\utils\ColoredInterface; +use pocketmine\block\utils\Colored; use pocketmine\block\utils\ColoredTrait; -class Wool extends Opaque implements ColoredInterface{ +class Wool extends Opaque implements Colored{ use ColoredTrait; public function getFlameEncouragement() : int{ diff --git a/src/block/utils/AgeableInterface.php b/src/block/utils/Ageable.php similarity index 97% rename from src/block/utils/AgeableInterface.php rename to src/block/utils/Ageable.php index 6da87f9d640..d88a57e2f35 100644 --- a/src/block/utils/AgeableInterface.php +++ b/src/block/utils/Ageable.php @@ -23,7 +23,7 @@ namespace pocketmine\block\utils; -interface AgeableInterface{ +interface Ageable{ public function getAge() : int; diff --git a/src/block/utils/AnalogRedstoneSignalEmitterInterface.php b/src/block/utils/AnalogRedstoneSignalEmitter.php similarity index 95% rename from src/block/utils/AnalogRedstoneSignalEmitterInterface.php rename to src/block/utils/AnalogRedstoneSignalEmitter.php index 86d4237fccc..d36a2dbd2c8 100644 --- a/src/block/utils/AnalogRedstoneSignalEmitterInterface.php +++ b/src/block/utils/AnalogRedstoneSignalEmitter.php @@ -23,7 +23,7 @@ namespace pocketmine\block\utils; -interface AnalogRedstoneSignalEmitterInterface{ +interface AnalogRedstoneSignalEmitter{ public function getOutputSignalStrength() : int; diff --git a/src/block/utils/ColoredInterface.php b/src/block/utils/Colored.php similarity index 96% rename from src/block/utils/ColoredInterface.php rename to src/block/utils/Colored.php index 806c00b0ddb..12f3954231b 100644 --- a/src/block/utils/ColoredInterface.php +++ b/src/block/utils/Colored.php @@ -23,7 +23,7 @@ namespace pocketmine\block\utils; -interface ColoredInterface{ +interface Colored{ public function getColor() : DyeColor; diff --git a/src/block/utils/CoralTypeInterface.php b/src/block/utils/CoralMaterial.php similarity index 96% rename from src/block/utils/CoralTypeInterface.php rename to src/block/utils/CoralMaterial.php index 01ecd1e9572..fe7ae42601e 100644 --- a/src/block/utils/CoralTypeInterface.php +++ b/src/block/utils/CoralMaterial.php @@ -23,7 +23,7 @@ namespace pocketmine\block\utils; -interface CoralTypeInterface{ +interface CoralMaterial{ public function getCoralType() : CoralType; diff --git a/src/block/utils/LightableInterface.php b/src/block/utils/Lightable.php similarity index 96% rename from src/block/utils/LightableInterface.php rename to src/block/utils/Lightable.php index 9d928b288d9..d013e49a020 100644 --- a/src/block/utils/LightableInterface.php +++ b/src/block/utils/Lightable.php @@ -23,7 +23,7 @@ namespace pocketmine\block\utils; -interface LightableInterface{ +interface Lightable{ public function isLit() : bool; diff --git a/src/block/utils/MultiFacingInterface.php b/src/block/utils/MultiFacing.php similarity index 97% rename from src/block/utils/MultiFacingInterface.php rename to src/block/utils/MultiFacing.php index 8ddd8764c8c..496d0485ca0 100644 --- a/src/block/utils/MultiFacingInterface.php +++ b/src/block/utils/MultiFacing.php @@ -25,7 +25,7 @@ use pocketmine\math\Facing; -interface MultiFacingInterface{ +interface MultiFacing{ /** * @return int[] diff --git a/src/block/utils/PillarRotationInterface.php b/src/block/utils/PillarRotation.php similarity index 96% rename from src/block/utils/PillarRotationInterface.php rename to src/block/utils/PillarRotation.php index 92621e1757a..f64c4e12258 100644 --- a/src/block/utils/PillarRotationInterface.php +++ b/src/block/utils/PillarRotation.php @@ -25,7 +25,7 @@ use pocketmine\math\Axis; -interface PillarRotationInterface{ +interface PillarRotation{ /** @see Axis */ public function getAxis() : int; diff --git a/src/block/utils/PoweredByRedstoneInterface.php b/src/block/utils/PoweredByRedstone.php similarity index 95% rename from src/block/utils/PoweredByRedstoneInterface.php rename to src/block/utils/PoweredByRedstone.php index 5cd11eb8790..6f825cba2b8 100644 --- a/src/block/utils/PoweredByRedstoneInterface.php +++ b/src/block/utils/PoweredByRedstone.php @@ -23,7 +23,7 @@ namespace pocketmine\block\utils; -interface PoweredByRedstoneInterface{ +interface PoweredByRedstone{ public function isPowered() : bool; diff --git a/src/block/utils/SignLikeRotationInterface.php b/src/block/utils/SignLikeRotation.php similarity index 96% rename from src/block/utils/SignLikeRotationInterface.php rename to src/block/utils/SignLikeRotation.php index 0c91bc066f6..d38640b202c 100644 --- a/src/block/utils/SignLikeRotationInterface.php +++ b/src/block/utils/SignLikeRotation.php @@ -23,7 +23,7 @@ namespace pocketmine\block\utils; -interface SignLikeRotationInterface{ +interface SignLikeRotation{ /** * @return int between 0 and 15 diff --git a/src/block/utils/WoodTypeInterface.php b/src/block/utils/WoodMaterial.php similarity index 96% rename from src/block/utils/WoodTypeInterface.php rename to src/block/utils/WoodMaterial.php index 78670c8df66..2fd2bbcca4f 100644 --- a/src/block/utils/WoodTypeInterface.php +++ b/src/block/utils/WoodMaterial.php @@ -23,7 +23,7 @@ namespace pocketmine\block\utils; -interface WoodTypeInterface{ +interface WoodMaterial{ public function getWoodType() : WoodType; } From f143de903bee247f55e4537ebca2d3fafecf5e0a Mon Sep 17 00:00:00 2001 From: Hugo_ <55756021+Dhaiven@users.noreply.github.com> Date: Sun, 23 Mar 2025 14:23:49 +0100 Subject: [PATCH 5/6] Add return this to documentation --- src/block/utils/Ageable.php | 1 + src/block/utils/AnalogRedstoneSignalEmitter.php | 1 + src/block/utils/AnyFacing.php | 1 + src/block/utils/Colored.php | 3 +++ src/block/utils/CopperMaterial.php | 6 ++++++ src/block/utils/CoralMaterial.php | 6 ++++++ src/block/utils/HorizontalFacing.php | 1 + src/block/utils/Lightable.php | 3 +++ src/block/utils/MultiFacing.php | 4 ++++ src/block/utils/PillarRotation.php | 6 +++++- src/block/utils/PoweredByRedstone.php | 3 +++ src/block/utils/SignLikeRotation.php | 1 + 12 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/block/utils/Ageable.php b/src/block/utils/Ageable.php index d88a57e2f35..0b88d97cca2 100644 --- a/src/block/utils/Ageable.php +++ b/src/block/utils/Ageable.php @@ -29,6 +29,7 @@ public function getAge() : int; /** * @throws \InvalidArgumentException if `$age` is out of bounds + * @return $this */ public function setAge(int $age) : self; } diff --git a/src/block/utils/AnalogRedstoneSignalEmitter.php b/src/block/utils/AnalogRedstoneSignalEmitter.php index d36a2dbd2c8..7c018d81b5d 100644 --- a/src/block/utils/AnalogRedstoneSignalEmitter.php +++ b/src/block/utils/AnalogRedstoneSignalEmitter.php @@ -29,6 +29,7 @@ public function getOutputSignalStrength() : int; /** * @throws \InvalidArgumentException if `$signalStrength` is out of bounds + * @return $this */ public function setOutputSignalStrength(int $signalStrength) : self; } diff --git a/src/block/utils/AnyFacing.php b/src/block/utils/AnyFacing.php index 00ef417297c..c6e663df097 100644 --- a/src/block/utils/AnyFacing.php +++ b/src/block/utils/AnyFacing.php @@ -34,6 +34,7 @@ public function getFacing() : int; /** * @throws \InvalidArgumentException if `$facing` is not a `Facing` constant + * @return $this * * @see Facing */ diff --git a/src/block/utils/Colored.php b/src/block/utils/Colored.php index 12f3954231b..af26d0b5d9d 100644 --- a/src/block/utils/Colored.php +++ b/src/block/utils/Colored.php @@ -27,5 +27,8 @@ interface Colored{ public function getColor() : DyeColor; + /** + * @return $this + */ public function setColor(DyeColor $color) : self; } diff --git a/src/block/utils/CopperMaterial.php b/src/block/utils/CopperMaterial.php index 6df22620b70..ef6560620bd 100644 --- a/src/block/utils/CopperMaterial.php +++ b/src/block/utils/CopperMaterial.php @@ -30,9 +30,15 @@ interface CopperMaterial{ public function getOxidation() : CopperOxidation; + /** + * @return $this + */ public function setOxidation(CopperOxidation $oxidation) : CopperMaterial; public function isWaxed() : bool; + /** + * @return $this + */ public function setWaxed(bool $waxed) : CopperMaterial; } diff --git a/src/block/utils/CoralMaterial.php b/src/block/utils/CoralMaterial.php index fe7ae42601e..0284322ac42 100644 --- a/src/block/utils/CoralMaterial.php +++ b/src/block/utils/CoralMaterial.php @@ -27,9 +27,15 @@ interface CoralMaterial{ public function getCoralType() : CoralType; + /** + * @return $this + */ public function setCoralType(CoralType $coralType) : self; public function isDead() : bool; + /** + * @return $this + */ public function setDead(bool $dead) : self; } diff --git a/src/block/utils/HorizontalFacing.php b/src/block/utils/HorizontalFacing.php index 083be360897..1d5f590506f 100644 --- a/src/block/utils/HorizontalFacing.php +++ b/src/block/utils/HorizontalFacing.php @@ -35,6 +35,7 @@ public function getFacing() : int; /** * @throws \InvalidArgumentException if `$facing` is not a `Facing` constant * or if `$facing` is not horizontal + * @return $this * * @see Facing */ diff --git a/src/block/utils/Lightable.php b/src/block/utils/Lightable.php index d013e49a020..36ac479f3ef 100644 --- a/src/block/utils/Lightable.php +++ b/src/block/utils/Lightable.php @@ -27,5 +27,8 @@ interface Lightable{ public function isLit() : bool; + /** + * @return $this + */ public function setLit(bool $lit = true) : self; } diff --git a/src/block/utils/MultiFacing.php b/src/block/utils/MultiFacing.php index 496d0485ca0..ad998d9c586 100644 --- a/src/block/utils/MultiFacing.php +++ b/src/block/utils/MultiFacing.php @@ -37,6 +37,8 @@ public function hasFace(int $face) : bool; /** * @throws \InvalidArgumentException if `$face` is not Facing value + * @return $this + * * @see Facing */ public function setFace(int $face, bool $value) : self; @@ -45,6 +47,8 @@ public function setFace(int $face, bool $value) : self; * @param int[] $faces * * @throws \InvalidArgumentException if a value in `$faces` is not Facing value + * @return $this + * * @see Facing */ public function setFaces(array $faces) : self; diff --git a/src/block/utils/PillarRotation.php b/src/block/utils/PillarRotation.php index f64c4e12258..f016ce50c6f 100644 --- a/src/block/utils/PillarRotation.php +++ b/src/block/utils/PillarRotation.php @@ -30,6 +30,10 @@ interface PillarRotation{ /** @see Axis */ public function getAxis() : int; - /** @see Axis */ + /** + * @return $this + * + * @see Axis + */ public function setAxis(int $axis) : self; } diff --git a/src/block/utils/PoweredByRedstone.php b/src/block/utils/PoweredByRedstone.php index 6f825cba2b8..452de430965 100644 --- a/src/block/utils/PoweredByRedstone.php +++ b/src/block/utils/PoweredByRedstone.php @@ -27,5 +27,8 @@ interface PoweredByRedstone{ public function isPowered() : bool; + /** + * @return $this + */ public function setPowered(bool $powered) : self; } diff --git a/src/block/utils/SignLikeRotation.php b/src/block/utils/SignLikeRotation.php index d38640b202c..4425fb80a54 100644 --- a/src/block/utils/SignLikeRotation.php +++ b/src/block/utils/SignLikeRotation.php @@ -34,6 +34,7 @@ public function getRotation() : int; * @param int $rotation between 0 and 15 * * @throws \InvalidArgumentException if `$rotation` is out of hounds + * @return $this */ public function setRotation(int $rotation) : self; } From d6bd760171f33233b12844f0b43d743a0d77d812 Mon Sep 17 00:00:00 2001 From: Hugo_ <55756021+Dhaiven@users.noreply.github.com> Date: Mon, 19 May 2025 13:47:00 +0200 Subject: [PATCH 6/6] Add WoodMaterial in Wood class --- src/block/Wood.php | 3 ++- src/block/utils/AnalogRedstoneSignalEmitter.php | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/block/Wood.php b/src/block/Wood.php index 7da134cc88a..7aa667bc8d0 100644 --- a/src/block/Wood.php +++ b/src/block/Wood.php @@ -25,6 +25,7 @@ use pocketmine\block\utils\PillarRotation; use pocketmine\block\utils\PillarRotationTrait; +use pocketmine\block\utils\WoodMaterial; use pocketmine\block\utils\WoodTypeTrait; use pocketmine\data\runtime\RuntimeDataDescriber; use pocketmine\item\Axe; @@ -33,7 +34,7 @@ use pocketmine\player\Player; use pocketmine\world\sound\ItemUseOnBlockSound; -class Wood extends Opaque implements PillarRotation{ +class Wood extends Opaque implements PillarRotation, WoodMaterial{ use PillarRotationTrait; use WoodTypeTrait; diff --git a/src/block/utils/AnalogRedstoneSignalEmitter.php b/src/block/utils/AnalogRedstoneSignalEmitter.php index 7c018d81b5d..fa2cc4b11c4 100644 --- a/src/block/utils/AnalogRedstoneSignalEmitter.php +++ b/src/block/utils/AnalogRedstoneSignalEmitter.php @@ -28,7 +28,6 @@ interface AnalogRedstoneSignalEmitter{ public function getOutputSignalStrength() : int; /** - * @throws \InvalidArgumentException if `$signalStrength` is out of bounds * @return $this */ public function setOutputSignalStrength(int $signalStrength) : self;