Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1bef38046 | ||
|
|
ee237f9c58 | ||
|
|
0a80518755 | ||
|
|
134859fea0 | ||
|
|
5c267d500a | ||
|
|
4c9735583c | ||
|
|
739d9cfffb | ||
|
|
4301d83e91 | ||
|
|
84d5c5e665 | ||
|
|
cd8ed5a823 | ||
|
|
795ead57bf | ||
|
|
910cdaf992 | ||
|
|
85c02d3402 | ||
|
|
7e5e5162c3 | ||
|
|
09417d0834 |
@@ -597,7 +597,10 @@ public interface Config extends Cloneable, PlaceholderInjectable {
|
||||
*/
|
||||
default double getDoubleFromExpression(@NotNull String path,
|
||||
@NotNull PlaceholderContext context) {
|
||||
return NumberUtils.evaluateExpression(this.getString(path), context.withInjectableContext(this));
|
||||
return Objects.requireNonNullElseGet(
|
||||
this.getDoubleOrNull(path),
|
||||
() -> NumberUtils.evaluateExpression(this.getString(path), context.withInjectableContext(this))
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,6 +48,10 @@ object ArgParserHead : LookupArgParser {
|
||||
return null
|
||||
}
|
||||
|
||||
if (meta.owningPlayer!!.name.equals("null", true) || meta.owningPlayer!!.name == null) {
|
||||
return null
|
||||
}
|
||||
|
||||
return "head:${meta.owningPlayer?.name}"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ import org.bukkit.block.Block
|
||||
import org.bukkit.entity.LivingEntity
|
||||
import org.bukkit.entity.Player
|
||||
import org.kingdoms.constants.group.Kingdom
|
||||
import org.kingdoms.constants.group.model.relationships.StandardRelationAttribute
|
||||
import org.kingdoms.constants.land.Land
|
||||
import org.kingdoms.constants.land.location.SimpleChunkLocation
|
||||
import org.kingdoms.constants.player.KingdomPlayer
|
||||
import org.kingdoms.constants.player.StandardKingdomPermission
|
||||
import org.kingdoms.managers.PvPManager
|
||||
import org.kingdoms.managers.land.BuildingProcessor
|
||||
|
||||
class AntigriefKingdoms : AntigriefIntegration {
|
||||
override fun canBreakBlock(
|
||||
@@ -21,34 +21,35 @@ class AntigriefKingdoms : AntigriefIntegration {
|
||||
if (kp.isAdmin) {
|
||||
return true
|
||||
}
|
||||
val kingdom: Kingdom = kp.kingdom ?: return false
|
||||
val land = Land.getLand(block) ?: return true
|
||||
val permission = if (land.isNexusLand) {
|
||||
StandardKingdomPermission.NEXUS_BUILD
|
||||
} else StandardKingdomPermission.BUILD
|
||||
|
||||
return if (!kp.hasPermission(permission)) {
|
||||
return BuildingProcessor(
|
||||
player,
|
||||
kp,
|
||||
SimpleChunkLocation.of(block),
|
||||
false
|
||||
} else kingdom.hasAttribute(land.kingdom, StandardRelationAttribute.BUILD)
|
||||
).process().isSuccessful
|
||||
}
|
||||
|
||||
override fun canCreateExplosion(
|
||||
player: Player,
|
||||
location: Location
|
||||
): Boolean {
|
||||
val land = Land.getLand(location) ?: return true
|
||||
if (!land.isClaimed) {
|
||||
return true
|
||||
}
|
||||
val kingdom: Kingdom = land.kingdom
|
||||
return kingdom.isMember(player)
|
||||
return canBreakBlock(player, location.block)
|
||||
}
|
||||
|
||||
override fun canPlaceBlock(
|
||||
player: Player,
|
||||
block: Block
|
||||
): Boolean {
|
||||
return canBreakBlock(player, block)
|
||||
val kp: KingdomPlayer = KingdomPlayer.getKingdomPlayer(player)
|
||||
if (kp.isAdmin) {
|
||||
return true
|
||||
}
|
||||
return BuildingProcessor(
|
||||
player,
|
||||
kp,
|
||||
SimpleChunkLocation.of(block),
|
||||
true
|
||||
).process().isSuccessful
|
||||
}
|
||||
|
||||
override fun canInjure(
|
||||
|
||||
@@ -17,7 +17,7 @@ class CustomEntitiesMythicMobs : CustomEntitiesIntegration {
|
||||
CustomEntity(
|
||||
key,
|
||||
{
|
||||
val entityId = api.getMythicMobInstance(it)?.type?.entityType?.name ?: return@CustomEntity false
|
||||
val entityId = api.getMythicMobInstance(it)?.type?.internalName ?: return@CustomEntity false
|
||||
entityId.equals(id, ignoreCase = true)
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version = 6.65.1
|
||||
version = 6.65.2
|
||||
plugin-name = eco
|
||||
kotlin.code.style = official
|
||||
Binary file not shown.
Reference in New Issue
Block a user