Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement new 1.21 copper blocks #6366

Merged
merged 11 commits into from
Sep 25, 2024

Conversation

IvanCraft623
Copy link
Member

@IvanCraft623 IvanCraft623 commented Jun 23, 2024

Introduction

Implement the new 1.21 copper blocks types!!!

Changes

Gameplay

Blocks

  • Added the following new blocks:
    • All types of Copper Bulb
    • All types of Copper Door
    • All types of Copper Trapdoor
    • All types of Chiseled Copper
    • All types of Copper Grate

Tests

I tested this PR by doing the following (tick all that apply):

  • Playtesting using a Minecraft client (provide screenshots or a video)
    Copper blocks
  • Writing a test plugin (provide the code)
    • To be able to test Copper Bulb light activation I wrote this hack 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));
}

@jasonw4331 jasonw4331 added Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Jun 23, 2024
src/block/CopperDoor.php Outdated Show resolved Hide resolved
src/block/CopperTrapdoor.php Outdated Show resolved Hide resolved
@IvanCraft623 IvanCraft623 merged commit 4e6b34f into pmmp:minor-next Sep 25, 2024
15 checks passed
@IvanCraft623 IvanCraft623 deleted the feat/1.21-copper-blocks branch September 25, 2024 02:25
Joshy3282 added a commit to Joshy3282/PocketMine-MP that referenced this pull request Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants