This commit is contained in:
TomTom 2023-10-22 18:51:48 +02:00
parent 504f45c03f
commit 0d970619a1
4 changed files with 7 additions and 4 deletions

View File

@ -120,9 +120,6 @@ allprojects {
relocate("com.artillexstudios.axapi", "com.artillexstudios.axminions.libs.axapi") relocate("com.artillexstudios.axapi", "com.artillexstudios.axminions.libs.axapi")
relocate("org.h2", "com.artillexstudios.axminions.libs.h2") relocate("org.h2", "com.artillexstudios.axminions.libs.h2")
relocate("org.jetbrains.kotlin", "com.artillexstudios.axminions.libs.kotlin") relocate("org.jetbrains.kotlin", "com.artillexstudios.axminions.libs.kotlin")
relocate("net.kyori", "com.artillexstudios.axminions.libs.kyori")
relocate("revxrsal.commands", "com.artillexstudios.axminions.libs.lamp")
relocate("org.apache.commons.math3", "com.artillexstudios.axminions.libs.math")
} }
} }

View File

@ -169,7 +169,7 @@ class MinionInventoryListener : Listener {
} }
@EventHandler @EventHandler
fun onInventoryClosEvent(event: InventoryCloseEvent) { fun onInventoryCloseEvent(event: InventoryCloseEvent) {
val holder = event.inventory.holder as? Minion ?: return val holder = event.inventory.holder as? Minion ?: return
holder.removeOpenInventory(event.inventory) holder.removeOpenInventory(event.inventory)

View File

@ -28,6 +28,7 @@ class MinionPlaceListener : Listener {
if (event.item == null) return if (event.item == null) return
if (!event.item!!.hasItemMeta()) return if (!event.item!!.hasItemMeta()) return
if (!AxMinionsPlugin.integrations.getProtectionIntegration().canBuildAt(event.player, event.clickedBlock!!.location)) return
val type = event.item!!.itemMeta!!.persistentDataContainer.get(Keys.MINION_TYPE, PersistentDataType.STRING) ?: return val type = event.item!!.itemMeta!!.persistentDataContainer.get(Keys.MINION_TYPE, PersistentDataType.STRING) ?: return
val minionType = MinionTypes.valueOf(type) ?: return val minionType = MinionTypes.valueOf(type) ?: return
event.isCancelled = true event.isCancelled = true

View File

@ -7,12 +7,17 @@ import com.artillexstudios.axminions.api.utils.fastFor
import com.artillexstudios.axminions.api.warnings.Warnings import com.artillexstudios.axminions.api.warnings.Warnings
import com.artillexstudios.axminions.minions.MinionTicker import com.artillexstudios.axminions.minions.MinionTicker
import com.artillexstudios.axminions.nms.NMSHandler import com.artillexstudios.axminions.nms.NMSHandler
import java.util.UUID
import kotlin.math.roundToInt import kotlin.math.roundToInt
import org.bukkit.Bukkit
import org.bukkit.Material import org.bukkit.Material
import org.bukkit.block.Skull
import org.bukkit.enchantments.Enchantment import org.bukkit.enchantments.Enchantment
import org.bukkit.entity.LivingEntity import org.bukkit.entity.LivingEntity
import org.bukkit.entity.Player import org.bukkit.entity.Player
import org.bukkit.entity.Tameable import org.bukkit.entity.Tameable
import org.bukkit.profile.PlayerProfile
import org.bukkit.profile.PlayerTextures
class SlayerMinionType : MinionType("slayer", AxMinionsPlugin.INSTANCE.getResource("minions/slayer.yml")!!) { class SlayerMinionType : MinionType("slayer", AxMinionsPlugin.INSTANCE.getResource("minions/slayer.yml")!!) {