This commit is contained in:
AverageGithub 2024-02-18 18:07:34 +01:00
parent ee7726100c
commit 869efed819
2 changed files with 10 additions and 1 deletions

View File

@ -35,7 +35,14 @@ class MinionPlaceListener : Listener {
val item = event.item ?: return
var meta = item.itemMeta ?: return
if (!AxMinionsPlugin.integrations.getProtectionIntegration().canBuildAt(event.player, event.clickedBlock!!.location)) return
if (!AxMinionsPlugin.integrations.getProtectionIntegration().canBuildAt(event.player, event.clickedBlock!!.location)) {
if (Config.DEBUG()) {
event.player.sendMessage(
"Could not place due to protection hook!"
)
}
return
}
val level = meta.persistentDataContainer.get(Keys.LEVEL, PersistentDataType.INTEGER) ?: 0
val stats = meta.persistentDataContainer.get(Keys.STATISTICS, PersistentDataType.LONG) ?: 0
if (Config.PLACE_PERMISSION() && !event.player.hasPermission("axminions.place.${minionType.getName()}")) {

View File

@ -605,6 +605,7 @@ class Minion(
linkedInventory?.remove(it)
return
}
setTool(ItemStack(Material.AIR))
} else {
setTool(ItemStack(Material.AIR))
}
@ -653,6 +654,7 @@ class Minion(
linkedInventory?.remove(it)
return canUseTool()
}
setTool(ItemStack(Material.AIR))
} else {
setTool(ItemStack(Material.AIR))
}