diff --git a/config/checkstyle/checkstyle.xml b/config/checkstyle/checkstyle.xml
index 9f66bb7f..a6e4407a 100644
--- a/config/checkstyle/checkstyle.xml
+++ b/config/checkstyle/checkstyle.xml
@@ -45,7 +45,7 @@
-->
-
+
@@ -66,6 +66,7 @@
+
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/EcoSpigotPlugin.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/EcoSpigotPlugin.kt
index 59d77bdd..cac9c012 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/EcoSpigotPlugin.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/EcoSpigotPlugin.kt
@@ -28,11 +28,11 @@ import org.bukkit.entity.Player
import org.bukkit.event.Listener
import org.bukkit.inventory.meta.SkullMeta
-abstract class EcoSpigotPlugin: EcoPlugin(
- 87955,
- 10043,
- "com.willfp.eco.proxy",
- "&a"
+abstract class EcoSpigotPlugin : EcoPlugin(
+ 87955,
+ 10043,
+ "com.willfp.eco.proxy",
+ "&a"
) {
init {
Display.setFinalizeKey(namespacedKeyFactory.create("finalized"))
@@ -57,41 +57,48 @@ abstract class EcoSpigotPlugin: EcoPlugin(
}
override fun loadIntegrationLoaders(): List {
- return listOf( // AntiGrief
- IntegrationLoader("WorldGuard") { AntigriefManager.register(AntigriefWorldGuard()) },
- IntegrationLoader("GriefPrevention") { AntigriefManager.register(AntigriefGriefPrevention()) },
- IntegrationLoader("FactionsUUID") { AntigriefManager.register(AntigriefFactionsUUID()) },
- IntegrationLoader("Towny") { AntigriefManager.register(AntigriefTowny()) },
- IntegrationLoader("Lands") { AntigriefManager.register(AntigriefLands(this)) },
- IntegrationLoader("Kingdoms") { AntigriefManager.register(AntigriefKingdoms()) },
- IntegrationLoader("CombatLogX") {
- val pluginManager = Bukkit.getPluginManager()
- val combatLogXPlugin = pluginManager.getPlugin("CombatLogX") ?: return@IntegrationLoader
- val pluginVersion = combatLogXPlugin.description.version
- if (pluginVersion.startsWith("10")) {
- AntigriefManager.register(AntigriefCombatLogXV10())
- }
- if (pluginVersion.startsWith("11")) {
- AntigriefManager.register(AntigriefCombatLogXV11())
- }
- }, // Anticheat
- IntegrationLoader("AAC5") { AnticheatManager.register(this, AnticheatAAC()) },
- IntegrationLoader("Matrix") { AnticheatManager.register(this, AnticheatMatrix()) },
- IntegrationLoader("NoCheatPlus") { AnticheatManager.register(this, AnticheatNCP()) },
- IntegrationLoader("Spartan") { AnticheatManager.register(this, AnticheatSpartan()) },
- IntegrationLoader("Vulcan") { AnticheatManager.register(this, AnticheatVulcan()) }, // Custom Items
- IntegrationLoader("Oraxen") { CustomItemsManager.register(CustomItemsOraxen()) }, // Misc
- IntegrationLoader("mcMMO") { McmmoManager.register(McmmoIntegrationImpl()) }
+ return listOf(
+ // AntiGrief
+ IntegrationLoader("WorldGuard") { AntigriefManager.register(AntigriefWorldGuard()) },
+ IntegrationLoader("GriefPrevention") { AntigriefManager.register(AntigriefGriefPrevention()) },
+ IntegrationLoader("FactionsUUID") { AntigriefManager.register(AntigriefFactionsUUID()) },
+ IntegrationLoader("Towny") { AntigriefManager.register(AntigriefTowny()) },
+ IntegrationLoader("Lands") { AntigriefManager.register(AntigriefLands(this)) },
+ IntegrationLoader("Kingdoms") { AntigriefManager.register(AntigriefKingdoms()) },
+ IntegrationLoader("CombatLogX") {
+ val pluginManager = Bukkit.getPluginManager()
+ val combatLogXPlugin = pluginManager.getPlugin("CombatLogX") ?: return@IntegrationLoader
+ val pluginVersion = combatLogXPlugin.description.version
+ if (pluginVersion.startsWith("10")) {
+ AntigriefManager.register(AntigriefCombatLogXV10())
+ }
+ if (pluginVersion.startsWith("11")) {
+ AntigriefManager.register(AntigriefCombatLogXV11())
+ }
+ },
+
+ // Anticheat
+ IntegrationLoader("AAC5") { AnticheatManager.register(this, AnticheatAAC()) },
+ IntegrationLoader("Matrix") { AnticheatManager.register(this, AnticheatMatrix()) },
+ IntegrationLoader("NoCheatPlus") { AnticheatManager.register(this, AnticheatNCP()) },
+ IntegrationLoader("Spartan") { AnticheatManager.register(this, AnticheatSpartan()) },
+ IntegrationLoader("Vulcan") { AnticheatManager.register(this, AnticheatVulcan()) },
+
+ // Custom Items
+ IntegrationLoader("Oraxen") { CustomItemsManager.register(CustomItemsOraxen()) },
+
+ // Misc
+ IntegrationLoader("mcMMO") { McmmoManager.register(McmmoIntegrationImpl()) }
)
}
override fun loadPacketAdapters(): List {
val adapters = mutableListOf(
- PacketAutoRecipe(this),
- PacketChat(this),
- PacketSetCreativeSlot(this),
- PacketSetSlot(this),
- PacketWindowItems(this)
+ PacketAutoRecipe(this),
+ PacketChat(this),
+ PacketSetCreativeSlot(this),
+ PacketSetSlot(this),
+ PacketWindowItems(this)
)
if (!configYml.getBool("disable-display-on-villagers")) {
@@ -103,15 +110,15 @@ abstract class EcoSpigotPlugin: EcoPlugin(
override fun loadListeners(): List {
return listOf(
- NaturalExpGainListeners(),
- ArmorListener(),
- DispenserArmorListener(),
- EntityDeathByEntityListeners(this),
- ShapedRecipeListener(this),
- PlayerJumpListeners(),
- GUIListener(this),
- ArrowDataListener(this),
- ArmorChangeEventListeners(this)
+ NaturalExpGainListeners(),
+ ArmorListener(),
+ DispenserArmorListener(),
+ EntityDeathByEntityListeners(this),
+ ShapedRecipeListener(this),
+ PlayerJumpListeners(),
+ GUIListener(this),
+ ArrowDataListener(this),
+ ArmorChangeEventListeners(this)
)
}
}
\ No newline at end of file
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/EntityDeathByEntityListeners.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/EntityDeathByEntityListeners.kt
index cdbb9a67..a35adc7d 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/EntityDeathByEntityListeners.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/EntityDeathByEntityListeners.kt
@@ -13,18 +13,18 @@ import java.util.concurrent.atomic.AtomicReference
class EntityDeathByEntityListeners(
plugin: EcoPlugin
) : PluginDependent(plugin), Listener {
- private val events = HashSet();
+ private val events = HashSet()
@EventHandler(priority = EventPriority.HIGH)
fun onEntityDamage(event: EntityDamageByEntityEvent) {
if ((event.entity !is LivingEntity)) {
- return;
+ return
}
val victim = event.entity as LivingEntity
if (victim.health > event.finalDamage) {
- return;
+ return
}
val builtEvent = EntityDeathByEntityBuilder()
@@ -51,15 +51,15 @@ class EntityDeathByEntityListeners(
}
if (atomicBuiltEvent.get() == null) {
- return;
+ return
}
- val builtEvent = atomicBuiltEvent.get();
- events.remove(builtEvent);
+ val builtEvent = atomicBuiltEvent.get()
+ events.remove(builtEvent)
builtEvent.drops = drops
builtEvent.xp = xp
builtEvent.deathEvent = event
- builtEvent.push();
+ builtEvent.push()
}
}
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/NaturalExpGainBuilder.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/NaturalExpGainBuilder.kt
index 70f16066..3cc12637 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/NaturalExpGainBuilder.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/NaturalExpGainBuilder.kt
@@ -7,7 +7,7 @@ import org.bukkit.Location
import org.bukkit.event.player.PlayerExpChangeEvent
internal class NaturalExpGainBuilder(var reason: BuildReason) {
- var cancelled = false
+ private var cancelled = false
var event: PlayerExpChangeEvent? = null
var location: Location? = null
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/PlayerJumpListeners.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/PlayerJumpListeners.kt
index 470e93fd..caba7fba 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/PlayerJumpListeners.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/eventlisteners/PlayerJumpListeners.kt
@@ -27,7 +27,7 @@ class PlayerJumpListeners : Listener {
jumpVelocity = FORMAT.format(jumpVelocity.toDouble()).replace(',', '.').toFloat()
if (event.player.location.block.type != Material.LADDER && PREVIOUS_PLAYERS_ON_GROUND.contains(player.uniqueId)
&& !player.isOnGround
- && java.lang.Float.compare(player.velocity.y.toFloat(), jumpVelocity) == 0
+ && player.velocity.y.toFloat().compareTo(jumpVelocity) == 0
) {
Bukkit.getPluginManager().callEvent(PlayerJumpEvent(event))
}
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/anticheat/AnticheatAAC.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/anticheat/AnticheatAAC.kt
index f46e1d7a..5f0d4692 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/anticheat/AnticheatAAC.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/anticheat/AnticheatAAC.kt
@@ -6,15 +6,10 @@ import me.konsolas.aac.api.AACExemption
import org.bukkit.Bukkit
import org.bukkit.entity.Player
import org.bukkit.event.Listener
-import java.util.*
class AnticheatAAC : AnticheatWrapper, Listener {
private val ecoExemption = AACExemption("eco")
- private val api = Objects.requireNonNull(
- Bukkit.getServicesManager().load(
- AACAPI::class.java
- )
- )!!
+ private val api = Bukkit.getServicesManager().load(AACAPI::class.java)!!
override fun getPluginName(): String {
return "AAC"
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefCombatLogXV10.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefCombatLogXV10.kt
index 238ea28a..ac228434 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefCombatLogXV10.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefCombatLogXV10.kt
@@ -12,7 +12,8 @@ import org.bukkit.entity.LivingEntity
import org.bukkit.entity.Player
class AntigriefCombatLogXV10 : AntigriefWrapper {
- private val instance: ICombatLogX?
+ private val instance: ICombatLogX = Bukkit.getPluginManager().getPlugin("CombatLogX") as ICombatLogX
+
override fun canBreakBlock(
player: Player,
block: Block
@@ -43,12 +44,12 @@ class AntigriefCombatLogXV10 : AntigriefWrapper {
}
// Only run checks if the NewbieHelper expansion is installed on the server.
- val expansionManager = instance!!.expansionManager
+ val expansionManager = instance.expansionManager
val optionalExpansion = expansionManager.getExpansionByName("NewbieHelper")
if (optionalExpansion.isPresent) {
val expansion = optionalExpansion.get()
val newbieHelper: NewbieHelper = expansion as NewbieHelper
- val pvpListener: ListenerPVP = newbieHelper.getPVPListener()
+ val pvpListener: ListenerPVP = newbieHelper.pvpListener
return pvpListener.isPVPEnabled(player) && pvpListener.isPVPEnabled(victim)
}
return true
@@ -58,7 +59,4 @@ class AntigriefCombatLogXV10 : AntigriefWrapper {
return "CombatLogX"
}
- init {
- instance = Bukkit.getPluginManager().getPlugin("CombatLogX") as ICombatLogX?
- }
}
\ No newline at end of file
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefCombatLogXV11.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefCombatLogXV11.kt
index 0f01b857..f3a59769 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefCombatLogXV11.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefCombatLogXV11.kt
@@ -12,7 +12,7 @@ import org.bukkit.entity.LivingEntity
import org.bukkit.entity.Player
class AntigriefCombatLogXV11 : AntigriefWrapper {
- private val instance: ICombatLogX?
+ private val instance: ICombatLogX = Bukkit.getPluginManager().getPlugin("CombatLogX") as ICombatLogX
override fun canBreakBlock(
player: Player,
block: Block
@@ -43,16 +43,15 @@ class AntigriefCombatLogXV11 : AntigriefWrapper {
}
// Only run checks if the NewbieHelper expansion is installed on the server.
- val expansionManager = instance!!.expansionManager
+ val expansionManager = instance.expansionManager
val optionalExpansion = expansionManager.getExpansion("NewbieHelper")
if (optionalExpansion.isPresent) {
val expansion = optionalExpansion.get()
val newbieHelperExpansion: NewbieHelperExpansion = expansion as NewbieHelperExpansion
- val protectionManager: ProtectionManager = newbieHelperExpansion.getProtectionManager()
- val pvpManager: PVPManager = newbieHelperExpansion.getPVPManager()
- val victimPlayer = victim
- val victimProtected: Boolean = protectionManager.isProtected(victimPlayer)
- val victimDisabledPvP: Boolean = pvpManager.isDisabled(victimPlayer)
+ val protectionManager: ProtectionManager = newbieHelperExpansion.protectionManager
+ val pvpManager: PVPManager = newbieHelperExpansion.pvpManager
+ val victimProtected: Boolean = protectionManager.isProtected(victim)
+ val victimDisabledPvP: Boolean = pvpManager.isDisabled(victim)
val playerDisabledPvp: Boolean = pvpManager.isDisabled(player)
return !victimProtected && !victimDisabledPvP && !playerDisabledPvp
}
@@ -63,7 +62,4 @@ class AntigriefCombatLogXV11 : AntigriefWrapper {
return "CombatLogX"
}
- init {
- instance = Bukkit.getPluginManager().getPlugin("CombatLogX") as ICombatLogX?
- }
}
\ No newline at end of file
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefFactionsUUID.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefFactionsUUID.kt
index 1b640481..8e1567c8 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefFactionsUUID.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefFactionsUUID.kt
@@ -17,7 +17,7 @@ class AntigriefFactionsUUID : AntigriefWrapper {
val flocation = FLocation(block.location)
val faction: Faction = Board.getInstance().getFactionAt(flocation)
return if (!faction.hasAccess(fplayer, PermissibleAction.DESTROY)) {
- fplayer.isAdminBypassing()
+ fplayer.isAdminBypassing
} else true
}
@@ -38,7 +38,7 @@ class AntigriefFactionsUUID : AntigriefWrapper {
val flocation = FLocation(block.location)
val faction: Faction = Board.getInstance().getFactionAt(flocation)
return if (!faction.hasAccess(fplayer, PermissibleAction.BUILD)) {
- fplayer.isAdminBypassing()
+ fplayer.isAdminBypassing
} else true
}
@@ -50,12 +50,12 @@ class AntigriefFactionsUUID : AntigriefWrapper {
val flocation = FLocation(victim.location)
val faction: Faction = Board.getInstance().getFactionAt(flocation)
if (victim is Player) {
- if (faction.isPeaceful()) {
- return fplayer.isAdminBypassing()
+ if (faction.isPeaceful) {
+ return fplayer.isAdminBypassing
}
} else {
if (faction.hasAccess(fplayer, PermissibleAction.DESTROY)) {
- return fplayer.isAdminBypassing()
+ return fplayer.isAdminBypassing
}
}
return true
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefGriefPrevention.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefGriefPrevention.kt
index db051158..54dbc5d5 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefGriefPrevention.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefGriefPrevention.kt
@@ -13,7 +13,7 @@ class AntigriefGriefPrevention : AntigriefWrapper {
player: Player,
block: Block
): Boolean {
- val claim: Claim = GriefPrevention.instance.dataStore.getClaimAt(block.location, false, null)
+ val claim: Claim? = GriefPrevention.instance.dataStore.getClaimAt(block.location, false, null)
return if (claim != null) {
claim.allowBreak(player, block.type) == null
} else true
@@ -23,17 +23,15 @@ class AntigriefGriefPrevention : AntigriefWrapper {
player: Player,
location: Location
): Boolean {
- val claim: Claim = GriefPrevention.instance.dataStore.getClaimAt(location, false, null)
- return if (claim != null) {
- claim.areExplosivesAllowed
- } else true
+ val claim: Claim? = GriefPrevention.instance.dataStore.getClaimAt(location, false, null)
+ return claim?.areExplosivesAllowed ?: true
}
override fun canPlaceBlock(
player: Player,
block: Block
): Boolean {
- val claim: Claim = GriefPrevention.instance.dataStore.getClaimAt(block.location, false, null)
+ val claim: Claim? = GriefPrevention.instance.dataStore.getClaimAt(block.location, false, null)
return if (claim != null) {
claim.allowBuild(player, block.type) == null
} else true
@@ -43,11 +41,11 @@ class AntigriefGriefPrevention : AntigriefWrapper {
player: Player,
victim: LivingEntity
): Boolean {
- val claim: Claim = GriefPrevention.instance.dataStore.getClaimAt(victim.location, false, null)
+ val claim: Claim? = GriefPrevention.instance.dataStore.getClaimAt(victim.location, false, null)
return if (victim is Player) {
claim == null
} else {
- if (claim != null && claim.ownerID != null) {
+ if (claim?.ownerID != null) {
claim.ownerID == player.uniqueId
} else true
}
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefKingdoms.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefKingdoms.kt
index f73d0af3..95163c72 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefKingdoms.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefKingdoms.kt
@@ -18,10 +18,10 @@ class AntigriefKingdoms : AntigriefWrapper {
block: Block
): Boolean {
val kp: KingdomPlayer = KingdomPlayer.getKingdomPlayer(player)
- if (kp.isAdmin()) {
+ if (kp.isAdmin) {
return true
}
- val kingdom: Kingdom = kp.getKingdom() ?: return false
+ val kingdom: Kingdom = kp.kingdom ?: return false
val land = Land.getLand(block) ?: return true
val permission: DefaultKingdomPermission =
if (land.isNexusLand) DefaultKingdomPermission.NEXUS_BUILD else DefaultKingdomPermission.BUILD
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefTowny.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefTowny.kt
index a8216a55..f2be455d 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefTowny.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/antigrief/AntigriefTowny.kt
@@ -18,7 +18,7 @@ class AntigriefTowny : AntigriefWrapper {
player: Player,
block: Block
): Boolean {
- val world = TownyUniverse.getInstance().worldMap[block.location.world!!.name] ?: return true
+ TownyUniverse.getInstance().worldMap[block.location.world!!.name] ?: return true
return if (TownyAPI.getInstance().isWilderness(block)) {
true
} else PlayerCacheUtil.getCachePermission(
@@ -39,7 +39,7 @@ class AntigriefTowny : AntigriefWrapper {
player: Player,
location: Location
): Boolean {
- val world = TownyUniverse.getInstance().worldMap[location.world!!.name] ?: return true
+ TownyUniverse.getInstance().worldMap[location.world?.name] ?: return true
return if (TownyAPI.getInstance().isWilderness(location)) {
true
} else PlayerCacheUtil.getCachePermission(player, location, Material.TNT, TownyPermission.ActionType.ITEM_USE)
@@ -49,7 +49,7 @@ class AntigriefTowny : AntigriefWrapper {
player: Player,
block: Block
): Boolean {
- val world = TownyUniverse.getInstance().worldMap[block.location.world!!.name] ?: return true
+ TownyUniverse.getInstance().worldMap[block.location.world?.name] ?: return true
return if (TownyAPI.getInstance().isWilderness(block)) {
true
} else PlayerCacheUtil.getCachePermission(player, block.location, block.type, TownyPermission.ActionType.BUILD)
@@ -59,7 +59,7 @@ class AntigriefTowny : AntigriefWrapper {
player: Player,
victim: LivingEntity
): Boolean {
- val world = TownyUniverse.getInstance().worldMap[victim.location.world!!.name] ?: return true
+ val world = TownyUniverse.getInstance().worldMap[victim.location.world?.name] ?: return true
if (TownyAPI.getInstance().isWilderness(victim.location)) {
return if (victim is Player) {
world.isPVP
@@ -69,14 +69,14 @@ class AntigriefTowny : AntigriefWrapper {
}
if (victim is Player) {
try {
- val town: Town = WorldCoord.parseWorldCoord(victim.getLocation()).getTownBlock().getTown()
- return town.isPVP()
+ val town: Town = WorldCoord.parseWorldCoord(victim.getLocation()).townBlock.town
+ return town.isPVP
} catch (ignored: Exception) {
// If exception, no town was found, thus return true.
}
} else {
try {
- val town: Town = WorldCoord.parseWorldCoord(victim.location).getTownBlock().getTown()
+ val town: Town = WorldCoord.parseWorldCoord(victim.location).townBlock.town
return town.hasMobs()
} catch (ignored: Exception) {
// If exception, no town was found, thus return true.
diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/customitems/CustomItemsOraxen.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/customitems/CustomItemsOraxen.kt
index b09ba489..c7baaf0b 100644
--- a/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/customitems/CustomItemsOraxen.kt
+++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/eco/spigot/integrations/customitems/CustomItemsOraxen.kt
@@ -13,9 +13,9 @@ class CustomItemsOraxen : CustomItemsWrapper {
for (item in OraxenItems.getItems()) {
val stack = item.build()
val id: String = OraxenItems.getIdByItem(item)
- val key: NamespacedKey = NamespacedKeyUtils.create("oraxen", id.toLowerCase())
+ val key: NamespacedKey = NamespacedKeyUtils.create("oraxen", id.lowercase())
CustomItem(
- key, Predicate { test: ItemStack? ->
+ key, Predicate { test: ItemStack ->
val oraxenId: String = OraxenItems.getIdByItem(test) ?: return@Predicate false
oraxenId.equals(id, ignoreCase = true)
},