mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2025-07-01 13:14:43 +02:00
fix: Add entity cap check of armor stands & end crystals into player interact listener (#4654)
When cancelled in the creature spawn event and placed by a player, the player will lose the armor stand / end crystal item from their inventory. This PR aims to fix this by moving the verification whether the entity should be cancelled up to the spawn egg right click, this way the item is not touched.
This commit is contained in:
@ -354,13 +354,17 @@ public class BukkitEntityUtil {
|
||||
}
|
||||
|
||||
public static boolean checkEntity(Entity entity, Plot plot) {
|
||||
return checkEntity(entity.getType(), plot);
|
||||
}
|
||||
|
||||
public static boolean checkEntity(EntityType type, Plot plot) {
|
||||
if (plot == null || !plot.hasOwner() || plot.getFlags().isEmpty() && plot.getArea()
|
||||
.getFlagContainer().getFlagMap().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final com.sk89q.worldedit.world.entity.EntityType entityType =
|
||||
BukkitAdapter.adapt(entity.getType());
|
||||
BukkitAdapter.adapt(type);
|
||||
|
||||
if (EntityCategories.PLAYER.contains(entityType)) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user