Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e094a1e934 | ||
|
|
26c07a20e7 | ||
|
|
ad68e1efef | ||
|
|
d8c3a3befa | ||
|
|
aa52dcdf94 | ||
|
|
9d3ba7ea88 | ||
|
|
e2b417af74 | ||
|
|
77394d3038 | ||
|
|
fcc7f82b38 | ||
|
|
396f4dac44 |
@@ -16,7 +16,7 @@
|
||||
# Information for development
|
||||
|
||||
## Javadoc
|
||||
The 6.0.0 Javadoc can be found [here](https://javadoc.jitpack.io/com/willfp/eco/6.0.0/javadoc/)
|
||||
The 6.8.0 Javadoc can be found [here](https://javadoc.jitpack.io/com/willfp/eco/6.8.0/javadoc/)
|
||||
|
||||
## Plugin Information
|
||||
|
||||
@@ -31,7 +31,6 @@ depend:
|
||||
eco is available from any of these places:
|
||||
|
||||
- [GitHub](https://github.com/Auxilor/eco/releases)
|
||||
- [Spigot](https://www.spigotmc.org/resources/eco.87955/)
|
||||
- [Polymart](https://polymart.org/resource/eco.773)
|
||||
- [Build it locally](https://github.com/Auxilor/eco#build-locally).
|
||||
|
||||
@@ -72,7 +71,7 @@ Maven:
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Replace `Tag` with a release tag for eco, eg `6.0.0`.
|
||||
Replace `Tag` with a release tag for eco, eg `6.8.0`.
|
||||
|
||||
## Build locally:
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ import java.util.stream.Collectors;
|
||||
@SuppressWarnings("unused")
|
||||
public abstract class EcoPlugin extends JavaPlugin {
|
||||
/**
|
||||
* The spigot resource ID of the plugin.
|
||||
* The polymart resource ID of the plugin.
|
||||
*/
|
||||
@Getter
|
||||
private final int resourceId;
|
||||
@@ -169,14 +169,14 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
private final ProxyFactory proxyFactory;
|
||||
|
||||
/**
|
||||
* Create a new plugin without a specified color, proxy support, spigot, or bStats.
|
||||
* Create a new plugin without a specified color, proxy support, polymart, or bStats.
|
||||
*/
|
||||
protected EcoPlugin() {
|
||||
this("&f");
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new plugin without proxy support, spigot, or bStats.
|
||||
* Create a new plugin without proxy support, polymart, or bStats.
|
||||
*
|
||||
* @param color The color.
|
||||
*/
|
||||
@@ -186,7 +186,7 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
|
||||
|
||||
/**
|
||||
* Create a new plugin unlinked to spigot and bStats.
|
||||
* Create a new plugin unlinked to polymart and bStats.
|
||||
*
|
||||
* @param proxyPackage The package where proxy implementations are stored.
|
||||
* @param color The color of the plugin (used in messages, using standard formatting)
|
||||
@@ -199,7 +199,7 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
/**
|
||||
* Create a new plugin without proxy or extension support.
|
||||
*
|
||||
* @param resourceId The spigot resource ID for the plugin.
|
||||
* @param resourceId The polymart resource ID for the plugin.
|
||||
* @param bStatsId The bStats resource ID for the plugin.
|
||||
* @param color The color of the plugin (used in messages, using standard formatting)
|
||||
*/
|
||||
@@ -212,7 +212,7 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
/**
|
||||
* Create a new plugin without proxy support.
|
||||
*
|
||||
* @param resourceId The spigot resource ID for the plugin.
|
||||
* @param resourceId The polymart resource ID for the plugin.
|
||||
* @param bStatsId The bStats resource ID for the plugin.
|
||||
* @param color The color of the plugin (used in messages, using standard formatting)
|
||||
* @param supportingExtensions If the plugin supports extensions.
|
||||
@@ -227,7 +227,7 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
/**
|
||||
* Create a new plugin without extension support.
|
||||
*
|
||||
* @param resourceId The spigot resource ID for the plugin.
|
||||
* @param resourceId The polymart resource ID for the plugin.
|
||||
* @param bStatsId The bStats resource ID for the plugin.
|
||||
* @param proxyPackage The package where proxy implementations are stored.
|
||||
* @param color The color of the plugin (used in messages, using standard formatting)
|
||||
@@ -242,7 +242,7 @@ public abstract class EcoPlugin extends JavaPlugin {
|
||||
/**
|
||||
* Create a new plugin.
|
||||
*
|
||||
* @param resourceId The spigot resource ID for the plugin.
|
||||
* @param resourceId The polymart resource ID for the plugin.
|
||||
* @param bStatsId The bStats resource ID for the plugin.
|
||||
* @param proxyPackage The package where proxy implementations are stored.
|
||||
* @param color The color of the plugin (used in messages, using standard formatting)
|
||||
|
||||
@@ -150,7 +150,6 @@ public class Display {
|
||||
* @param player The player.
|
||||
* @param args The args.
|
||||
*/
|
||||
@SuppressWarnings("checkstyle:FinalParameters")
|
||||
@ApiStatus.Internal
|
||||
public static void callDisplayModule(@NotNull final DisplayModule module,
|
||||
@NotNull final ItemStack itemStack,
|
||||
|
||||
@@ -31,7 +31,9 @@ public class UpdateChecker extends PluginDependent<EcoPlugin> {
|
||||
public void getVersion(@NotNull final Consumer<? super String> consumer) {
|
||||
this.getPlugin().getScheduler().runAsync(() -> {
|
||||
try {
|
||||
InputStream inputStream = new URL("https://api.spigotmc.org/legacy/update.php?resource=" + this.getPlugin().getResourceId()).openStream();
|
||||
InputStream inputStream = new URL(
|
||||
"https://api.polymart.org/v1/getResourceInfoSimple?key=version&resource_id=" + this.getPlugin().getResourceId()
|
||||
).openStream();
|
||||
Scanner scanner = new Scanner(inputStream);
|
||||
|
||||
if (scanner.hasNext()) {
|
||||
|
||||
@@ -26,7 +26,7 @@ import static net.md_5.bungee.api.ChatColor.COLOR_CHAR;
|
||||
* Utilities / API methods for strings.
|
||||
*/
|
||||
@UtilityClass
|
||||
public class StringUtils {
|
||||
public class StringUtils {
|
||||
/**
|
||||
* Regexes for gradients.
|
||||
*/
|
||||
@@ -34,6 +34,8 @@ public class StringUtils {
|
||||
.add(Pattern.compile("<GRADIENT:([0-9A-Fa-f]{6})>(.*?)</GRADIENT:([0-9A-Fa-f]{6})>", Pattern.CASE_INSENSITIVE))
|
||||
.add(Pattern.compile("<GRADIENT:#([0-9A-Fa-f]{6})>(.*?)</GRADIENT:#([0-9A-Fa-f]{6})>", Pattern.CASE_INSENSITIVE))
|
||||
.add(Pattern.compile("<G:([0-9A-Fa-f]{6})>(.*?)</G:([0-9A-Fa-f]{6})>", Pattern.CASE_INSENSITIVE))
|
||||
.add(Pattern.compile("<G:#([0-9A-Fa-f]{6})>(.*?)</G:#([0-9A-Fa-f]{6})>", Pattern.CASE_INSENSITIVE))
|
||||
.add(Pattern.compile("<G#([0-9A-Fa-f]{6})>(.*?)</G#([0-9A-Fa-f]{6})>", Pattern.CASE_INSENSITIVE))
|
||||
.add(Pattern.compile("<#:([0-9A-Fa-f]{6})>(.*?)</#:([0-9A-Fa-f]{6})>"))
|
||||
.add(Pattern.compile("\\{#:([0-9A-Fa-f]{6})}(.*?)\\{/#:([0-9A-Fa-f]{6})}"))
|
||||
.build();
|
||||
@@ -334,10 +336,14 @@ public class StringUtils {
|
||||
* @return The JSON String.
|
||||
*/
|
||||
@NotNull
|
||||
public String legacyToJson(@NotNull final String legacy) {
|
||||
public String legacyToJson(@Nullable final String legacy) {
|
||||
String processed = legacy;
|
||||
if (legacy == null) {
|
||||
processed = "";
|
||||
}
|
||||
return GsonComponentSerializer.gson().serialize(
|
||||
Component.empty().decoration(TextDecoration.ITALIC, false).append(
|
||||
LEGACY_COMPONENT_SERIALIZER.deserialize(legacy)
|
||||
LEGACY_COMPONENT_SERIALIZER.deserialize(processed)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ dependencies {
|
||||
compileOnly 'com.github.TechFortress:GriefPrevention:16.14.0'
|
||||
compileOnly 'com.massivecraft:Factions:1.6.9.5-U0.5.10'
|
||||
compileOnly 'com.github.cryptomorin:kingdoms:1.10.14'
|
||||
compileOnly 'com.github.TownyAdvanced:Towny:0.96.2.0'
|
||||
compileOnly 'com.github.TownyAdvanced:Towny:0.97.1.0'
|
||||
compileOnly 'com.github.angeschossen:LandsAPI:4.7.3'
|
||||
compileOnly 'fr.neatmonster:nocheatplus:3.16.1-SNAPSHOT'
|
||||
compileOnly 'com.github.jiangdashao:matrix-api-repo:317d4635fd'
|
||||
|
||||
@@ -40,7 +40,7 @@ import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.inventory.meta.SkullMeta
|
||||
|
||||
abstract class EcoSpigotPlugin : EcoPlugin(
|
||||
87955,
|
||||
773,
|
||||
10043,
|
||||
"com.willfp.eco.proxy",
|
||||
"&a"
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.willfp.eco.spigot.integrations.antigrief
|
||||
|
||||
import com.palmergames.bukkit.towny.TownyAPI
|
||||
import com.palmergames.bukkit.towny.TownyUniverse
|
||||
import com.palmergames.bukkit.towny.`object`.Town
|
||||
import com.palmergames.bukkit.towny.`object`.TownyPermission
|
||||
import com.palmergames.bukkit.towny.`object`.WorldCoord
|
||||
import com.palmergames.bukkit.towny.utils.PlayerCacheUtil
|
||||
import com.willfp.eco.core.integrations.antigrief.AntigriefWrapper
|
||||
import org.bukkit.Location
|
||||
@@ -67,22 +65,8 @@ class AntigriefTowny : AntigriefWrapper {
|
||||
true
|
||||
}
|
||||
}
|
||||
if (victim is Player) {
|
||||
try {
|
||||
val town: Town = WorldCoord.parseWorldCoord(victim.getLocation()).townBlock.town
|
||||
return town.isPVP
|
||||
} catch (ignored: Exception) {
|
||||
// If exception, no town was found, thus return true.
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
val town: Town = WorldCoord.parseWorldCoord(victim.location).townBlock.town
|
||||
return town.hasMobs()
|
||||
} catch (ignored: Exception) {
|
||||
// If exception, no town was found, thus return true.
|
||||
}
|
||||
}
|
||||
return true
|
||||
val townBlock = TownyAPI.getInstance().getTownBlock(victim.location) ?: return true
|
||||
return townBlock.permissions.pvp
|
||||
}
|
||||
|
||||
override fun getPluginName(): String {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
version = 6.8.0
|
||||
version = 6.8.3
|
||||
plugin-name = eco
|
||||
Reference in New Issue
Block a user