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

feat: implements mace item #6468

Open
wants to merge 5 commits into
base: stable
Choose a base branch
from
Open

feat: implements mace item #6468

wants to merge 5 commits into from

Conversation

AzaleeX
Copy link

@AzaleeX AzaleeX commented Oct 20, 2024

Introduction

Added a new weapon class, the Mace, which functions both as a tool and a weapon with specific properties. This implementation includes changes to the item serialization system and new constants to support the Mace.

https://minecraft.wiki/w/Mace

Relevant issues

  • No specific issues mentioned.

Changes

API changes

Added API for the Mace weapon in several files, including ItemSerializerDeserializerRegistrar.php and ItemTypeIds.php.

Behavioural changes

Introduced the behaviour of the Mace, which has a 1.5x faster mining rate when used on blocks, and takes damage when attacking entities or breaking blocks.

Backwards compatibility

  • No noted backwards-incompatible changes.

Screenshot

image

Note

Don't worry i also implement the compass recovery
image

Follow-up

Prepare unit tests or in-game playtesting sessions to confirm that the Mace functions as intended.

Caution

What's missing at the moment is item crafting and the main function for calculating damage based on the height of an entity.

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

  • Writing PHPUnit tests (commit these in the tests/phpunit folder)
  • Playtesting using a Minecraft client (provide screenshots or a video)
  • Writing a test plugin (provide the code and sample output)

@KnosTx
Copy link

KnosTx commented Oct 28, 2024

  1. Smash particles that increase per distance fallen
  2. Damage to the entity increased per distance fallen
  3. Knock back to nearby entities to the smashed entity
  4. The player falling motion is reset when smashing something
  5. And there is a sound from the mace item

@@ -324,8 +324,9 @@ private function __construct(){
public const SPIRE_ARMOR_TRIM_SMITHING_TEMPLATE = 20285;
public const PITCHER_POD = 20286;
public const NAME_TAG = 20287;
public const MACE = 20289;

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why from 20297 straight to 20289?

Copy link
Contributor

@jasonw4331 jasonw4331 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mace should be implemented as a single tool, not as a tiered tool. The item should be autogenerated where applicible. Please make the requested changes and request a re-review.

@@ -40,5 +40,6 @@ private function __construct(){
public const AXE = 1 << 3;
public const SHEARS = 1 << 4;
public const HOE = 1 << 5;
public const MACE = 1 << 6;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tool type only must be added here for variants like diamond and iron versions of the item.


public const FIRST_UNUSED_ITEM_ID = 20288;
public const FIRST_UNUSED_ITEM_ID = 20290;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should be autogenerated using the composer script included with pocketmine's build tools.

use pocketmine\block\BlockToolType;
use pocketmine\entity\Entity;

class Mace extends TieredTool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extending TieredTool implies variants of the tool such as an Iron Mace or Diamond Mace item, which does not exist.

Copy link

@KnosTx KnosTx Nov 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I have ever. In pull request #6446

@@ -47,6 +48,7 @@ enum ToolTier{
case IRON;
case DIAMOND;
case NETHERITE;
case MACE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be obvious MACE is not a tier which can be applied to existing tools in the game.

@jasonw4331 jasonw4331 added Category: Gameplay Related to Minecraft gameplay experience Status: Waiting on Author Type: Enhancement Contributes features or other improvements to PocketMine-MP labels Nov 4, 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 Status: Waiting on Author Type: Enhancement Contributes features or other improvements to PocketMine-MP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants