Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5ecae0a366 | ||
|
|
5de4914fd7 |
@@ -3,10 +3,12 @@ package com.willfp.eco.core.placeholder.context;
|
||||
import com.willfp.eco.core.placeholder.InjectablePlaceholder;
|
||||
import com.willfp.eco.core.placeholder.PlaceholderInjectable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -67,4 +69,24 @@ public class MergedInjectableContext implements PlaceholderInjectable {
|
||||
|
||||
return injections;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(@Nullable final Object o) {
|
||||
if (this == o) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(o instanceof MergedInjectableContext that)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(baseContext, that.baseContext)
|
||||
&& Objects.equals(additionalContext, that.additionalContext)
|
||||
&& Objects.equals(extraInjections, that.extraInjections);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(baseContext, additionalContext, extraInjections);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,6 +251,21 @@ open class EcoConfig(
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return Objects.hash(values, configType, injections)
|
||||
/*
|
||||
The keys are completely redundant, as they are only used to prevent
|
||||
duplicate keys in the map. Therefore, we can ignore them and just
|
||||
hash the actual placeholder values.
|
||||
*/
|
||||
|
||||
var injectionHash = 0
|
||||
|
||||
for (injection in injections.values) {
|
||||
injectionHash = injectionHash * 31 + injection.hashCode()
|
||||
}
|
||||
|
||||
return Objects.hash(
|
||||
values,
|
||||
configType
|
||||
) + injectionHash
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ class EcoExtensionLoader(
|
||||
val pluginVersion = Version(extensionYml.getStringOrNull("plugin-version") ?: "0.0.0")
|
||||
val pluginName = extensionYml.getStringOrNull("plugin")
|
||||
|
||||
if (pluginName != null && pluginName.equals(this.plugin.description.name, ignoreCase = true)) {
|
||||
if (pluginName != null && !pluginName.equals(this.plugin.description.name, ignoreCase = true)) {
|
||||
throw ExtensionLoadException("${extensionJar.name} is only compatible with $pluginName!")
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import java.util.concurrent.TimeUnit
|
||||
class DelegatedExpressionHandler(
|
||||
plugin: EcoPlugin,
|
||||
private val handler: ExpressionHandler
|
||||
): ExpressionHandler {
|
||||
) : ExpressionHandler {
|
||||
private val evaluationCache: Cache<Int, Double> = Caffeine.newBuilder()
|
||||
.expireAfterWrite(plugin.configYml.getInt("math-cache-ttl").toLong(), TimeUnit.MILLISECONDS)
|
||||
.build()
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
version = 6.57.0
|
||||
version = 6.57.1
|
||||
plugin-name = eco
|
||||
kotlin.code.style = official
|
||||
Reference in New Issue
Block a user