Open IvanCraft623 opened 1 week ago
Implement the new 1.21 copper blocks types!!!
I tested this PR by doing the following (tick all that apply):
[x] Writing a test plugin (provide the code)
public function onWorldSoundEvent(WorldSoundEvent $event) : void { $sound = $event->getSound(); if (!($powerOn = $sound instanceof RedstonePowerOnSound) && !$sound instanceof RedstonePowerOffSound) { return; }
$world = $event->getWorld(); $block = $world->getBlock($event->getPosition()); if (!$block instanceof Button) { return; }
$support = $block->getSide(Facing::opposite($block->getFacing())); if (!$support instanceof CopperBulb) { return; }
$world->setBlock($support->getPosition(), $support->togglePowered($powerOn)); }
Introduction
Implement the new 1.21 copper blocks types!!!
Changes
Gameplay
Blocks
Tests
I tested this PR by doing the following (tick all that apply):
[x] Writing a test plugin (provide the code)
$world = $event->getWorld(); $block = $world->getBlock($event->getPosition()); if (!$block instanceof Button) { return; }
$support = $block->getSide(Facing::opposite($block->getFacing())); if (!$support instanceof CopperBulb) { return; }
$world->setBlock($support->getPosition(), $support->togglePowered($powerOn)); }