Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9aa465844d | ||
|
|
a692fbee01 |
@@ -87,8 +87,7 @@ allprojects {
|
|||||||
|
|
||||||
shadowJar {
|
shadowJar {
|
||||||
relocate('org.bstats', 'com.willfp.eco.shaded.bstats')
|
relocate('org.bstats', 'com.willfp.eco.shaded.bstats')
|
||||||
relocate('net.kyori.adventure.text.minimessage', 'com.willfp.eco.shaded.adventure.minimessage')
|
relocate('net.kyori.adventure.text.minimessage', 'com.willfp.eco.shaded.minimessage')
|
||||||
relocate('net.kyori.adventure.platform', 'com.willfp.eco.shaded.adventure.platform')
|
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
|
|||||||
@@ -6,14 +6,18 @@ group 'com.willfp'
|
|||||||
version rootProject.version
|
version rootProject.version
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
// Adventure
|
||||||
|
compileOnly 'net.kyori:adventure-platform-bukkit:4.0.0'
|
||||||
|
compileOnly 'net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT'
|
||||||
|
compileOnly 'net.kyori:adventure-api:4.9.1'
|
||||||
|
compileOnly 'net.kyori:adventure-text-serializer-gson:4.8.1'
|
||||||
|
compileOnly 'net.kyori:adventure-text-serializer-legacy:4.8.1'
|
||||||
|
|
||||||
|
// Other
|
||||||
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
|
compileOnly 'org.spigotmc:spigot-api:1.17.1-R0.1-SNAPSHOT'
|
||||||
compileOnly 'org.apache.maven:maven-artifact:3.0.3'
|
compileOnly 'org.apache.maven:maven-artifact:3.0.3'
|
||||||
compileOnly 'com.comphenix.protocol:ProtocolLib:4.6.0-SNAPSHOT'
|
compileOnly 'com.comphenix.protocol:ProtocolLib:4.6.0-SNAPSHOT'
|
||||||
compileOnly 'com.google.code.gson:gson:2.8.7'
|
compileOnly 'com.google.code.gson:gson:2.8.7'
|
||||||
compileOnly 'net.kyori:adventure-text-serializer-gson:4.8.1'
|
|
||||||
compileOnly 'net.kyori:adventure-text-serializer-legacy:4.8.1'
|
|
||||||
compileOnly 'net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT'
|
|
||||||
compileOnly 'net.kyori:adventure-platform-bukkit:4.0.0'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
java {
|
||||||
@@ -25,8 +29,8 @@ build.dependsOn publishToMavenLocal
|
|||||||
|
|
||||||
publishing {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
shadow(MavenPublication) {
|
shadow(MavenPublication) { publication ->
|
||||||
from components.java
|
project.shadow.component(publication)
|
||||||
artifactId 'eco'
|
artifactId 'eco'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.willfp.eco.util;
|
package com.willfp.eco.util;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
|
import com.willfp.eco.core.Prerequisite;
|
||||||
import com.willfp.eco.core.integrations.placeholder.PlaceholderManager;
|
import com.willfp.eco.core.integrations.placeholder.PlaceholderManager;
|
||||||
import lombok.experimental.UtilityClass;
|
import lombok.experimental.UtilityClass;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
@@ -251,9 +252,11 @@ public class StringUtils {
|
|||||||
processedMessage = PlaceholderManager.translatePlaceholders(processedMessage, player);
|
processedMessage = PlaceholderManager.translatePlaceholders(processedMessage, player);
|
||||||
}
|
}
|
||||||
processedMessage = translateGradients(processedMessage);
|
processedMessage = translateGradients(processedMessage);
|
||||||
processedMessage = translateMiniMessage(processedMessage);
|
|
||||||
processedMessage = translateHexColorCodes(processedMessage);
|
processedMessage = translateHexColorCodes(processedMessage);
|
||||||
processedMessage = ChatColor.translateAlternateColorCodes('&', processedMessage);
|
processedMessage = ChatColor.translateAlternateColorCodes('&', processedMessage);
|
||||||
|
if (Prerequisite.HAS_PAPER.isMet()) {
|
||||||
|
processedMessage = translateMiniMessage(processedMessage);
|
||||||
|
}
|
||||||
return processedMessage;
|
return processedMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ version rootProject.version
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'org.bstats:bstats-bukkit:1.7'
|
implementation 'org.bstats:bstats-bukkit:1.7'
|
||||||
implementation 'net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT'
|
implementation('net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT') {
|
||||||
implementation 'net.kyori:adventure-platform-bukkit:4.0.0'
|
exclude group: 'net.kyori', module: 'adventure-api'
|
||||||
|
}
|
||||||
|
compileOnly 'net.kyori:adventure-platform-bukkit:4.0.0'
|
||||||
compileOnly 'net.kyori:adventure-api:4.9.1'
|
compileOnly 'net.kyori:adventure-api:4.9.1'
|
||||||
compileOnly 'net.kyori:adventure-text-serializer-gson:4.8.1'
|
compileOnly 'net.kyori:adventure-text-serializer-gson:4.8.1'
|
||||||
compileOnly 'net.kyori:adventure-text-serializer-legacy:4.8.1'
|
compileOnly 'net.kyori:adventure-text-serializer-legacy:4.8.1'
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ abstract class EcoSpigotPlugin : EcoPlugin(
|
|||||||
// AntiGrief
|
// AntiGrief
|
||||||
IntegrationLoader("WorldGuard") { AntigriefManager.register(AntigriefWorldGuard()) },
|
IntegrationLoader("WorldGuard") { AntigriefManager.register(AntigriefWorldGuard()) },
|
||||||
IntegrationLoader("GriefPrevention") { AntigriefManager.register(AntigriefGriefPrevention()) },
|
IntegrationLoader("GriefPrevention") { AntigriefManager.register(AntigriefGriefPrevention()) },
|
||||||
IntegrationLoader("GriefDefender") { AntigriefManager.register(AntigriefGriefDefender()) },
|
|
||||||
IntegrationLoader("FactionsUUID") { AntigriefManager.register(AntigriefFactionsUUID()) },
|
IntegrationLoader("FactionsUUID") { AntigriefManager.register(AntigriefFactionsUUID()) },
|
||||||
IntegrationLoader("Towny") { AntigriefManager.register(AntigriefTowny()) },
|
IntegrationLoader("Towny") { AntigriefManager.register(AntigriefTowny()) },
|
||||||
IntegrationLoader("Lands") { AntigriefManager.register(AntigriefLands(this)) },
|
IntegrationLoader("Lands") { AntigriefManager.register(AntigriefLands(this)) },
|
||||||
|
|||||||
@@ -1,81 +0,0 @@
|
|||||||
package com.willfp.eco.spigot.integrations.antigrief
|
|
||||||
|
|
||||||
import com.flowpowered.math.vector.Vector3i
|
|
||||||
import com.griefdefender.api.GriefDefender
|
|
||||||
import com.griefdefender.api.data.PlayerData
|
|
||||||
import com.griefdefender.api.permission.flag.Flags
|
|
||||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
|
||||||
import org.bukkit.Location
|
|
||||||
import org.bukkit.block.Block
|
|
||||||
import org.bukkit.entity.LivingEntity
|
|
||||||
import org.bukkit.entity.Player
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
class AntigriefGriefDefender : AntigriefWrapper {
|
|
||||||
override fun canBreakBlock(player: Player, block: Block): Boolean {
|
|
||||||
val data = GriefDefender.getCore().getPlayerData(player.world.uid, player.uniqueId) ?: return true
|
|
||||||
|
|
||||||
val claim = GriefDefender.getCore().getClaimAt(Vector3i(block.location.x, block.location.y, block.location.z))
|
|
||||||
?: return true
|
|
||||||
|
|
||||||
return if (data.canIgnoreClaim(claim)) {
|
|
||||||
true
|
|
||||||
} else {
|
|
||||||
claim.getActiveFlagPermissionValue(Flags.BLOCK_BREAK, data.user, Collections.emptySet(), true).asBoolean()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canCreateExplosion(player: Player, location: Location): Boolean {
|
|
||||||
val data = GriefDefender.getCore().getPlayerData(player.world.uid, player.uniqueId) ?: return true
|
|
||||||
|
|
||||||
val claim = GriefDefender.getCore().getClaimAt(Vector3i(location.x, location.y, location.z)) ?: return true
|
|
||||||
|
|
||||||
return if (data.canIgnoreClaim(claim)) {
|
|
||||||
true
|
|
||||||
} else {
|
|
||||||
claim.getActiveFlagPermissionValue(Flags.EXPLOSION_BLOCK, data.user, Collections.emptySet(), true)
|
|
||||||
.asBoolean()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canPlaceBlock(player: Player, block: Block): Boolean {
|
|
||||||
|
|
||||||
val data: PlayerData = GriefDefender.getCore().getPlayerData(player.world.uid, player.uniqueId) ?: return true
|
|
||||||
|
|
||||||
val claim =
|
|
||||||
GriefDefender.getCore().getClaimAt(Vector3i(block.location.x, block.location.y, block.location.z))
|
|
||||||
?: return true
|
|
||||||
|
|
||||||
return if (data.canIgnoreClaim(claim)) {
|
|
||||||
true
|
|
||||||
} else {
|
|
||||||
claim.getActiveFlagPermissionValue(Flags.BLOCK_PLACE, data.user, Collections.emptySet(), true)
|
|
||||||
.asBoolean()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canInjure(player: Player, victim: LivingEntity): Boolean {
|
|
||||||
|
|
||||||
val data = GriefDefender.getCore().getPlayerData(player.world.uid, player.uniqueId) ?: return true
|
|
||||||
|
|
||||||
if (data.canIgnoreClaim(data.currentClaim)) {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
return if (victim is Player) {
|
|
||||||
val vicData = GriefDefender.getCore().getPlayerData(victim.world.uid, victim.uniqueId)
|
|
||||||
if (vicData != null) {
|
|
||||||
data.canPvp(data.currentClaim) && data.canPvp(vicData.currentClaim)
|
|
||||||
} else data.canPvp(data.currentClaim)
|
|
||||||
} else {
|
|
||||||
val claim =
|
|
||||||
GriefDefender.getCore().getClaimAt(Vector3i(victim.location.x, victim.location.y, victim.location.z))
|
|
||||||
claim?.getActiveFlagPermissionValue(Flags.ENTITY_DAMAGE, data.user, Collections.emptySet(), true)
|
|
||||||
?.asBoolean() ?: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun getPluginName(): String {
|
|
||||||
return "GriefDefender"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -24,12 +24,11 @@ softdepend:
|
|||||||
- ShopGUIPlus
|
- ShopGUIPlus
|
||||||
- ItemsAdder
|
- ItemsAdder
|
||||||
- Oraxen
|
- Oraxen
|
||||||
- HeadDatabase
|
|
||||||
- GriefDefender
|
|
||||||
libraries:
|
libraries:
|
||||||
- org.reflections:reflections:0.9.12
|
- 'org.reflections:reflections:0.9.12'
|
||||||
- org.apache.maven:maven-artifact:3.0.3
|
- 'org.apache.maven:maven-artifact:3.0.3'
|
||||||
- org.jetbrains.kotlin:kotlin-stdlib:1.5.31
|
- 'org.jetbrains.kotlin:kotlin-stdlib:1.5.31'
|
||||||
- net.kyori:adventure-api:4.9.1
|
- 'net.kyori:adventure-platform-bukkit:4.0.0'
|
||||||
- net.kyori:adventure-text-serializer-gson:4.8.1
|
- 'net.kyori:adventure-api:4.9.1'
|
||||||
- net.kyori:adventure-text-serializer-legacy:4.8.1
|
- 'net.kyori:adventure-text-serializer-gson:4.8.1'
|
||||||
|
- 'net.kyori:adventure-text-serializer-legacy:4.8.1'
|
||||||
@@ -1,2 +1,2 @@
|
|||||||
version = 6.9.2
|
version = 6.9.3
|
||||||
plugin-name = eco
|
plugin-name = eco
|
||||||
Reference in New Issue
Block a user