Compare commits

..

15 Commits

Author SHA1 Message Date
Auxilor
f1bef38046 Updated to 6.65.2 2023-07-16 13:03:50 +01:00
Auxilor
ee237f9c58 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	eco-api/src/main/java/com/willfp/eco/core/config/interfaces/Config.java
2023-07-16 13:01:28 +01:00
Auxilor
0a80518755 Merge remote-tracking branch 'origin/develop' into develop 2023-07-13 15:17:13 +01:00
Auxilor
134859fea0 Extremely obvious optimisation to expression parsing 2023-07-13 15:16:23 +01:00
_OfTeN_
5c267d500a Fixed head arg parser breaking back serialization when used with texture 2023-07-12 23:42:52 +03:00
Auxilor
4c9735583c Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	eco-core/core-plugin/src/main/kotlin/com/willfp/eco/internal/spigot/math/ExpressionHandlers.kt
2023-07-10 15:07:15 +01:00
Auxilor
739d9cfffb Optimised Config#getDoubleFromExpression for constant values 2023-07-06 17:35:52 +01:00
Auxilor
4301d83e91 Removed ItemMetaProxy, can be reimplemented much better without NMS 2023-07-06 17:33:44 +01:00
Auxilor
84d5c5e665 Merge branch 'master' into develop 2023-07-05 15:33:07 +01:00
_OfTeN_
cd8ed5a823 Implemented ItemMetaProxy with an ability to set/get trim from the 1.20 armor meta
Added an ArgParserTrim to add trims to armor via item lookup strings
2023-06-24 16:38:10 +03:00
_OfTeN_
795ead57bf Fixed MythicMobs mob test predicate 2023-06-23 11:24:03 +03:00
_OfTeN_
910cdaf992 Updated KingdomsX antigrief integration 2023-06-23 10:41:15 +03:00
_OfTeN_
85c02d3402 Merge remote-tracking branch 'origin/master' into develop 2023-06-23 09:42:26 +03:00
Auxilor
7e5e5162c3 LazyPlaceholderTranslationExpressionHandler now uses a regular map rather than a caffeine cache 2023-06-18 22:03:48 +02:00
Auxilor
09417d0834 Expressions that are just numbers will be immediately converted rather than being evaluated 2023-06-18 21:11:14 +02:00
6 changed files with 28 additions and 20 deletions

View File

@@ -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))
);
}
/**

View File

@@ -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}"
}
}

View File

@@ -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(

View File

@@ -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)
},
{

View File

@@ -1,3 +1,3 @@
version = 6.65.1
version = 6.65.2
plugin-name = eco
kotlin.code.style = official