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,
|
default double getDoubleFromExpression(@NotNull String path,
|
||||||
@NotNull PlaceholderContext context) {
|
@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
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (meta.owningPlayer!!.name.equals("null", true) || meta.owningPlayer!!.name == null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
return "head:${meta.owningPlayer?.name}"
|
return "head:${meta.owningPlayer?.name}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,11 +6,11 @@ import org.bukkit.block.Block
|
|||||||
import org.bukkit.entity.LivingEntity
|
import org.bukkit.entity.LivingEntity
|
||||||
import org.bukkit.entity.Player
|
import org.bukkit.entity.Player
|
||||||
import org.kingdoms.constants.group.Kingdom
|
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.Land
|
||||||
|
import org.kingdoms.constants.land.location.SimpleChunkLocation
|
||||||
import org.kingdoms.constants.player.KingdomPlayer
|
import org.kingdoms.constants.player.KingdomPlayer
|
||||||
import org.kingdoms.constants.player.StandardKingdomPermission
|
|
||||||
import org.kingdoms.managers.PvPManager
|
import org.kingdoms.managers.PvPManager
|
||||||
|
import org.kingdoms.managers.land.BuildingProcessor
|
||||||
|
|
||||||
class AntigriefKingdoms : AntigriefIntegration {
|
class AntigriefKingdoms : AntigriefIntegration {
|
||||||
override fun canBreakBlock(
|
override fun canBreakBlock(
|
||||||
@@ -21,34 +21,35 @@ class AntigriefKingdoms : AntigriefIntegration {
|
|||||||
if (kp.isAdmin) {
|
if (kp.isAdmin) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
val kingdom: Kingdom = kp.kingdom ?: return false
|
return BuildingProcessor(
|
||||||
val land = Land.getLand(block) ?: return true
|
player,
|
||||||
val permission = if (land.isNexusLand) {
|
kp,
|
||||||
StandardKingdomPermission.NEXUS_BUILD
|
SimpleChunkLocation.of(block),
|
||||||
} else StandardKingdomPermission.BUILD
|
|
||||||
|
|
||||||
return if (!kp.hasPermission(permission)) {
|
|
||||||
false
|
false
|
||||||
} else kingdom.hasAttribute(land.kingdom, StandardRelationAttribute.BUILD)
|
).process().isSuccessful
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun canCreateExplosion(
|
override fun canCreateExplosion(
|
||||||
player: Player,
|
player: Player,
|
||||||
location: Location
|
location: Location
|
||||||
): Boolean {
|
): Boolean {
|
||||||
val land = Land.getLand(location) ?: return true
|
return canBreakBlock(player, location.block)
|
||||||
if (!land.isClaimed) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
val kingdom: Kingdom = land.kingdom
|
|
||||||
return kingdom.isMember(player)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun canPlaceBlock(
|
override fun canPlaceBlock(
|
||||||
player: Player,
|
player: Player,
|
||||||
block: Block
|
block: Block
|
||||||
): Boolean {
|
): 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(
|
override fun canInjure(
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class CustomEntitiesMythicMobs : CustomEntitiesIntegration {
|
|||||||
CustomEntity(
|
CustomEntity(
|
||||||
key,
|
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)
|
entityId.equals(id, ignoreCase = true)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version = 6.65.1
|
version = 6.65.2
|
||||||
plugin-name = eco
|
plugin-name = eco
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
Binary file not shown.
Reference in New Issue
Block a user