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 Saddle & Horse Armor #6307

Open
wants to merge 13 commits into
base: minor-next
Choose a base branch
from

Conversation

pandaa-be
Copy link
Contributor

@pandaa-be pandaa-be commented Mar 24, 2024

Introduction

Implement Saddle & Horse Armor.

(Currently this is just for cosmetic because there are no mobs in pocketmine but I need this for my mob plugin :P)

Changes

API changes

VanillaItems::SADDLE()
VanillaItems::LEATHER_HORSE_ARMOR()
VanillaItems::IRON_HORSE_ARMOR()
VanillaItems::DIAMOND_HORSE_ARMOR()
VanillaItems::GOLDEN_HORSE_ARMOR()

Tested LEATHER_HORSE_ARMOR custom colour with following code:

> 	public function onJoin(PlayerJoinEvent $event): void{
> 		$player = $event->getPlayer();
> 		$inventory = $player->getInventory();
> 
> 		$inventory->clearAll();
> 
> 		$inventory->addItem(VanillaItems::LEATHER_HORSE_ARMOR()->setCustomColor(new Color(500, 100, 254)));
> 		$inventory->addItem(VanillaItems::LEATHER_HORSE_ARMOR());
> 		$inventory->addItem(VanillaItems::IRON_HORSE_ARMOR());
> 		$inventory->addItem(VanillaItems::DIAMOND_HORSE_ARMOR());
> 		$inventory->addItem(VanillaItems::GOLDEN_HORSE_ARMOR());
> 		$inventory->addItem(VanillaItems::SADDLE());
> 	}

Tests

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

  • Playtesting using a Minecraft client
    image

@ShockedPlot7560 ShockedPlot7560 added Category: Gameplay Related to Minecraft gameplay experience Type: Enhancement Contributes features or other improvements to PocketMine-MP Status: Incomplete Work in progress labels Mar 25, 2024
@pandaa-be
Copy link
Contributor Author

Is it enough if it stays as it is now (as I said, there are no mobs) or should I add the Horse Armor to Living::attack() anyway?

Copy link
Member

@ShockedPlot7560 ShockedPlot7560 left a comment

Choose a reason for hiding this comment

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

You need to regenerate the static functions

@pandaa-be
Copy link
Contributor Author

You need to regenerate the static functions

for whatever reason i can't run the file on my laptop.

can do that when i am back at the pc 👌

@pandaa-be
Copy link
Contributor Author

image

Is it enough if it stays as it is now (as I said, there are no mobs) or should I do more?

@pandaa-be pandaa-be marked this pull request as ready for review March 26, 2024 10:44
@pandaa-be pandaa-be marked this pull request as draft March 26, 2024 10:45
@pandaa-be pandaa-be marked this pull request as ready for review March 26, 2024 10:55
@pandaa-be pandaa-be changed the title Implement Saddle & Horse Armor (wip) Implement Saddle & Horse Armor Mar 26, 2024
@ShockedPlot7560
Copy link
Member

As the PR name and objective is to add these items and not the horse logics, its enough.

@ShockedPlot7560 ShockedPlot7560 removed the Status: Incomplete Work in progress label Mar 26, 2024
src/item/HorseArmor.php Outdated Show resolved Hide resolved
src/item/HorseArmor.php Outdated Show resolved Hide resolved
@ipad54
Copy link
Contributor

ipad54 commented Mar 26, 2024

Cauldron behaviour is also missing. In vanilla, leather armour can be dyed in cauldron.

@pandaa-be
Copy link
Contributor Author

Cauldron behaviour is also missing. In vanilla, leather armour can be dyed in cauldron.

Jup but this is currently not implemented in pocketmine and I don´t feel like it is something for this pr..

@ipad54
Copy link
Contributor

ipad54 commented Mar 26, 2024

Jup but this is currently not implemented in pocketmine and I don´t feel like it is something for this pr..

What do you mean? Cauldron is implemented

@pandaa-be
Copy link
Contributor Author

image

prove that it works

src/block/WaterCauldron.php Outdated Show resolved Hide resolved
src/item/HorseArmor.php Outdated Show resolved Hide resolved
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.

None yet

4 participants