Add PlayerFlowerPotManipulateEvent#2448
Conversation
| + com.destroystokyo.paper.event.player.PlayerFlowerPotManipulateEvent event = new com.destroystokyo.paper.event.player.PlayerFlowerPotManipulateEvent(player, bukkitblock, whichitem, placing); | ||
| + player.getServer().getPluginManager().callEvent(event); | ||
| + | ||
| + if (event.isCancelled()) { |
There was a problem hiding this comment.
Just test the result of callEvent, as it handles event cancellation already.
| + // Paper start | ||
| + org.bukkit.entity.Player player = (org.bukkit.entity.Player) entityhuman.getBukkitEntity(); | ||
| + boolean placing = flag1; | ||
| + org.bukkit.block.Block bukkitblock = org.bukkit.craftbukkit.block.CraftBlock.at(world, blockposition); |
There was a problem hiding this comment.
Starting here, this is extremely verbose with fully-qualified classes. Try using imports when you are using the same class more than once.
|
I suggest you use imports in BlockFlowerPot.java as currently the implementation of the event is very hard to read. |
|
Additionally master is not accepting new feature PRs, only the 1.14 branch is. You need to port this patch to the 1.14 branch and then submit a new PR. |
According to https://papermc.io/forums/t/july-project-status-update/1391 they aren't formally feature-freezing the master branch (Minecraft 1.13.2). So on that note what should I do? |
|
Although its not documented here, it has been talked about on the discord and PRs will only be accepted for 1.13 if they are bug fixes or also PR'd for 1.14. |
|
Alright then that is what I will do. |
Added an event for when a player places an item in or takes an item out of a flower pot.
This is a revisit to an old PR I had submitted nearly 3 years ago but wasn't able to finish because of an issue with server-side code that handles event cancellation.