Compare commits

..

29 Commits

Author SHA1 Message Date
PiggyPiglet
163bd98bb1 fix cf metrics 2026-02-20 21:06:30 +08:00
PiggyPiglet
ad7a884a0a merge 2026-02-20 21:06:02 +08:00
PiggyPiglet
2ee162d590 Merge branch 'hytale' into hytale-curseforge 2026-02-17 18:08:51 +08:00
PiggyPiglet
666ece6d3c Merge branch 'hytale' into hytale-curseforge 2026-02-17 18:06:36 +08:00
PiggyPiglet
40594a2df0 Merge branch 'hytale' into hytale-curseforge 2026-02-17 17:46:37 +08:00
PiggyPiglet
ced298b5c1 1.0.7 dev 2026-02-14 21:00:27 +08:00
PiggyPiglet
1bd6446eb4 Merge branch 'hytale' into hytale-curseforge 2026-02-14 20:57:07 +08:00
PiggyPiglet
f3e9f37543 Add curseforge to version 2026-02-14 18:10:19 +08:00
PiggyPiglet
fcb321b77b Merge branch 'hytale' into hytale-curseforge 2026-02-14 18:09:35 +08:00
PiggyPiglet
5d71ef9f12 Merge branch 'hytale' into hytale-curseforge 2026-02-09 00:05:08 +08:00
PiggyPiglet
914fe2c8b7 Merge branch 'hytale' into hytale-curseforge 2026-02-08 21:37:05 +08:00
PiggyPiglet
e3e32f5688 Merge branch 'hytale' into hytale-curseforge 2026-02-02 21:41:15 +08:00
PiggyPiglet
dae0b96002 Merge branch 'hytale' into hytale-curseforge 2026-02-02 21:39:16 +08:00
PiggyPiglet
36995a0916 Merge branch 'hytale' into hytale-curseforge 2026-02-02 21:02:38 +08:00
PiggyPiglet
798ca2ea10 Merge branch 'hytale' into hytale-curseforge 2026-02-02 20:57:12 +08:00
PiggyPiglet
07c6e292b3 Merge branch 'hytale' into hytale-curseforge 2026-02-02 20:34:18 +08:00
PiggyPiglet
59d916966c Merge branch 'hytale' into hytale-curseforge 2026-02-02 20:07:32 +08:00
PiggyPiglet
d4c64fc17e Merge branch 'hytale' into hytale-curseforge 2026-02-02 15:35:40 +08:00
Funnycube
395c743b41 comment out dormant code 2026-02-02 17:58:02 +11:00
PiggyPiglet
4b015a9076 Merge branch 'hytale' into hytale-curseforge 2026-01-30 22:18:13 +08:00
PiggyPiglet
7952702abd Merge branch 'hytale' into hytale-curseforge 2026-01-30 22:17:24 +08:00
PiggyPiglet
c11904d9c9 Merge branch 'hytale' into hytale-curseforge 2026-01-30 20:58:59 +08:00
PiggyPiglet
b869b98338 Merge branch 'hytale' into hytale-curseforge 2026-01-30 20:55:13 +08:00
PiggyPiglet
a01e6abab8 Merge branch 'hytale' into hytale-curseforge 2026-01-30 20:53:33 +08:00
PiggyPiglet
e8716e57ff Merge branch 'hytale' into hytale-curseforge 2026-01-30 20:03:06 +08:00
PiggyPiglet
8f9c52940c Merge branch 'hytale' into hytale-curseforge 2026-01-30 18:22:18 +08:00
PiggyPiglet
7edc94bc35 Update download/update messages to be clearer 2026-01-30 18:21:23 +08:00
PiggyPiglet
b06bc23465 Merge branch 'hytale' into hytale-curseforge 2026-01-30 18:15:33 +08:00
PiggyPiglet
ffd115296c eCloud disabled PAPI for CurseForge 2026-01-30 18:11:12 +08:00
7 changed files with 30 additions and 235 deletions

View File

@@ -7,7 +7,7 @@ plugins {
}
group = "at.helpch"
version = "1.0.8-DEV-${System.getProperty("BUILD_NUMBER")}"
version = "1.0.7-CurseForge"
description = "An awesome placeholder provider!"

View File

@@ -53,108 +53,16 @@ public final class CommandECloudDownload extends PlaceholderCommand {
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
@NotNull final CommandSender sender, @NotNull final String alias,
@NotNull @Unmodifiable final List<String> params) {
if (params.isEmpty()) {
sender.sendMessage(Message.raw("You must supply the name of an expansion.").color(Color.RED));
// Msg.msg(sender,
// "&cYou must supply the name of an expansion.");
return;
}
final Message message = Message.raw("""
Expansion downloads have been disabled to meet CurseForge's policy requirements.
This limitation is imposed by the platform, not PlaceholderAPI.
""").color(Color.RED)
.insert(Message.raw("Please download expansions manually from ").color(Color.RED).insert(Message.raw("ecloud.placeholderapi.com").link("https://ecloud.placeholderapi.com").bold(true).italic(true).color(Color.WHITE)))
.insert(Message.raw(" or install the full version of PlaceholderAPI from ").color(Color.RED))
.insert(Message.raw("placeholderapi.com/downloads").link("https://placeholderapi.com/downloads").bold(true).italic(true).color(Color.WHITE));
if (isBlockedExpansion(params.get(0))) {
sender.sendMessage(Message.raw("This expansion can't be downloaded.").color(Color.RED));
// Msg.msg(sender,
// "&cThis expansion can't be downloaded.");
return;
}
final CloudExpansion expansion = plugin.cloudExpansionManager()
.findCloudExpansionByName(params.get(0)).orElse(null);
if (expansion == null) {
sender.sendMessage(Message.raw("Failed to find an expansion named: ").color(Color.GREEN).insert(Message.raw(params.get(0)).color(Color.WHITE)));
// Msg.msg(sender,
// "&cFailed to find an expansion named: &f" + params.get(0));
return;
}
final CloudExpansion.Version version;
if (params.size() < 2) {
version = expansion.getVersion(expansion.getLatestVersion());
if (version == null) {
sender.sendMessage(Message.raw("Could not find latest version for expansion.").color(Color.RED));
// Msg.msg(sender,
// "&cCould not find latest version for expansion.");
return;
}
} else {
version = expansion.getVersion(params.get(1));
if (version == null) {
sender.sendMessage(Message.raw("Could not find specified version: ").color(Color.RED)
.insert(Message.raw(params.get(0) + "\n").color(Color.WHITE))
.insert(Message.raw("Available versions: ").color(Color.LIGHT_GRAY))
.insert(Message.raw(expansion.getAvailableVersions().toString()).color(Color.WHITE)));
// Msg.msg(sender,
// "&cCould not find specified version: &f" + params.get(1),
// "&7Available versions: &f" + expansion.getAvailableVersions());
return;
}
}
if (!version.isVerified()) {
sender.sendMessage(Message.raw("The expansion: '").color(Color.RED)
.insert(Message.raw(params.get(0)).color(Color.WHITE))
.insert(Message.raw("' is not verified and can only be downloaded manually from ").color(Color.RED))
.insert(Message.raw("https://ecloud.placeholderapi.com").color(Color.WHITE)));
// Msg.msg(sender, "&cThe expansion '&f" + params.get(0) + "&c' is not verified and can only be downloaded manually from &fhttps://ecloud.placeholderapi.com");
return;
}
plugin.cloudExpansionManager().downloadExpansion(expansion, version)
.whenComplete((file, exception) -> {
if (exception != null) {
sender.sendMessage(Message.raw("Failed to download expansion: ").color(Color.RED).insert(Message.raw(exception.getMessage()).color(Color.WHITE)));
// Msg.msg(sender,
// "&cFailed to download expansion: &f" + exception.getMessage());
return;
}
sender.sendMessage(Message.raw("Successfully downloaded expansion ").color(Color.GREEN)
.insert(Message.raw(expansion.getName() + " [" + version.getVersion() + "] ").color(Color.WHITE))
.insert(Message.raw("to file: ").color(Color.GREEN))
.insert(Message.raw(file.getName()).color(Color.WHITE))
.insert(Message.raw("\nMake sure to type ").color(Color.GREEN))
.insert(Message.raw("/papi reload ").color(Color.GREEN))
.insert(Message.raw("to enable your new expansion!").color(Color.WHITE)));
// Msg.msg(sender,
// "&aSuccessfully downloaded expansion &f" + expansion.getName() + " [" + version
// .getVersion() + "] &ato file: &f" + file.getName(),
// "&aMake sure to type &f/papi reload &ato enable your new expansion!");
plugin.cloudExpansionManager().load();
});
sender.sendMessage(message);
}
// @Override
// public void complete(@NotNull final PlaceholderAPIPlugin plugin,
// @NotNull final CommandSender sender, @NotNull final String alias,
// @NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
// if (params.size() > 2) {
// return;
// }
//
// if (params.size() <= 1) {
// final Stream<String> names = plugin.getCloudExpansionManager().getCloudExpansions().values()
// .stream().map(CloudExpansion::getName).map(name -> name.replace(' ', '_'));
// suggestByParameter(names, suggestions, params.isEmpty() ? null : params.get(0));
// return;
// }
//
// final Optional<CloudExpansion> expansion = plugin.getCloudExpansionManager()
// .findCloudExpansionByName(params.get(0));
// if (!expansion.isPresent()) {
// return;
// }
//
// suggestByParameter(expansion.get().getAvailableVersions().stream(), suggestions, params.get(1));
// }
}

View File

@@ -48,123 +48,20 @@ public final class CommandECloudUpdate extends PlaceholderCommand {
setPermissions("placeholderapi.ecloud.*", "placeholderapi.ecloud.update");
}
private static CompletableFuture<List<@Nullable Class<? extends PlaceholderExpansion>>> downloadAndDiscover(
@NotNull final List<CloudExpansion> expansions, @NotNull final PlaceholderAPIPlugin plugin) {
return expansions.stream()
.map(expansion -> plugin.cloudExpansionManager()
.downloadExpansion(expansion, expansion.getVersion()))
.map(future -> future.thenCompose(plugin.localExpansionManager()::findExpansionInFile))
.collect(Futures.collector());
}
@Override
public void evaluate(@NotNull final PlaceholderAPIPlugin plugin,
@NotNull final CommandSender sender, @NotNull final String alias,
@NotNull @Unmodifiable final List<String> params) {
if (params.isEmpty()) {
sender.sendMessage(Message.raw("You must define 'all' or the name of an expansion to update.").color(Color.RED));
// Msg.msg(sender,
// "&cYou must define 'all' or the name of an expansion to update.");
return;
}
final Message message = Message.raw("""
Expansion downloads have been disabled to meet CurseForge's policy requirements.
This limitation is imposed by the platform, not PlaceholderAPI.
""").color(Color.RED)
.insert(Message.raw("Please download expansions manually from ").color(Color.RED).insert(Message.raw("ecloud.placeholderapi.com").link("https://ecloud.placeholderapi.com").bold(true).italic(true).color(Color.WHITE)))
.insert(Message.raw(" or install the full version of PlaceholderAPI from ").color(Color.RED))
.insert(Message.raw("placeholderapi.com/downloads").link("https://placeholderapi.com/downloads").bold(true).italic(true).color(Color.WHITE));
final boolean multiple = params.get(0).equalsIgnoreCase("all");
final List<CloudExpansion> expansions = new ArrayList<>();
// gather target expansions
if (multiple) {
expansions.addAll(plugin.cloudExpansionManager().getCloudExpansionsInstalled().values());
} else {
plugin.cloudExpansionManager().findCloudExpansionByName(params.get(0))
.ifPresent(expansions::add);
}
// remove the ones that are the latest version
expansions.removeIf(expansion -> !expansion.shouldUpdate());
if (expansions.isEmpty()) {
sender.sendMessage(Message.raw("No updates available for " + (!multiple ? "this expansion." : "your active expansions.")).color(Color.RED));
// Msg.msg(sender,
// "&cNo updates available for " + (!multiple ? "this expansion."
// : "your active expansions."));
return;
}
Message expansionList = Message.raw("[").color(Color.GRAY);
for (int i = 0; i < expansions.size(); i++) {
if (i > 0) {
expansionList = expansionList.insert(Message.raw(", ").color(Color.LIGHT_GRAY));
}
expansionList = expansionList.insert(Message.raw(expansions.get(i).getName()).color(Color.ORANGE));
}
expansionList = expansionList.insert(Message.raw("]").color(Color.GRAY));
sender.sendMessage(Message.raw("Updating expansions: ").color(Color.GREEN)
.insert(expansionList));
// Msg.msg(sender,
// "&aUpdating expansions: " + expansions.stream().map(CloudExpansion::getName)
// .collect(Collectors.joining("&7, &6", "&8[&6", "&8]&r")));
Futures.onMainThread(plugin, downloadAndDiscover(expansions, plugin), (classes, exception) -> {
if (exception != null) {
sender.sendMessage(Message.raw("Failed to update expansions: ").color(Color.RED).insert(Message.raw(exception.getMessage()).color(Color.YELLOW)));
// Msg.msg(sender,
// "&cFailed to update expansions: &e" + exception.getMessage());
return;
}
sender.sendMessage(Message.raw("Successfully downloaded updates, registering new versions.").color(Color.GREEN));
// Msg.msg(sender,
// "&aSuccessfully downloaded updates, registering new versions.");
final List<PlaceholderExpansion> registered = classes.stream()
.filter(Objects::nonNull)
.map(plugin.localExpansionManager()::register)
.filter(Optional::isPresent)
.map(Optional::get)
.toList();
Message registeredMessage = Message.raw("Registered expansions:\n").color(Color.LIGHT_GRAY);
for (int i = 0; i < registered.size(); i++) {
final PlaceholderExpansion expansion = registered.get(i);
registeredMessage = registeredMessage
.insert(Message.raw(" ").color(Color.LIGHT_GRAY))
.insert(Message.raw(expansion.getName()).color(Color.GREEN))
.insert(Message.raw(" ").color(Color.LIGHT_GRAY))
.insert(Message.raw(expansion.getVersion()).color(Color.WHITE));
if (i < registered.size() - 1) {
registeredMessage = registeredMessage.insert(Message.raw("\n"));
}
}
sender.sendMessage(registeredMessage);
// Msg.msg(sender,
// "&7Registered expansions:", message);
});
sender.sendMessage(message);
}
// @Override
// public void complete(@NotNull final PlaceholderAPIPlugin plugin,
// @NotNull final CommandSender sender, @NotNull final String alias,
// @NotNull @Unmodifiable final List<String> params, @NotNull final List<String> suggestions) {
// if (params.size() > 1) {
// return;
// }
//
// final List<CloudExpansion> installed = Lists
// .newArrayList(plugin.getCloudExpansionManager().getCloudExpansionsInstalled().values());
// installed.removeIf(expansion -> !expansion.shouldUpdate());
//
// if (!installed.isEmpty() && (params.isEmpty() || "all"
// .startsWith(params.get(0).toLowerCase(Locale.ROOT)))) {
// suggestions.add("all");
// }
//
// suggestByParameter(
// installed.stream().map(CloudExpansion::getName).map(name -> name.replace(" ", "_")),
// suggestions, params.isEmpty() ? null : params.get(0));
// }
}

View File

@@ -98,7 +98,7 @@ public final class PlaceholderAPIConfig {
}
@NotNull
public ConcurrentHashMap<String, Object> expansions() {
public Map<String, Object> expansions() {
return expansions;
}

View File

@@ -24,7 +24,6 @@ import at.helpch.placeholderapi.PlaceholderAPIPlugin;
import org.jetbrains.annotations.NotNull;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Implementing this interface allows {@link at.helpch.placeholderapi.expansion.PlaceholderExpansion PlaceholderExpansions}
@@ -44,31 +43,20 @@ import java.util.concurrent.ConcurrentHashMap;
* @author Ryan McCarthy
*/
public interface Configurable<T> {
@NotNull
Class<T> provideConfigType();
@NotNull
T provideDefault();
@SuppressWarnings("unchecked")
@NotNull
default T getConfig() {
if (!(this instanceof PlaceholderExpansion exp)) {
return provideDefault();
if (this instanceof PlaceholderExpansion exp) {
return (T) PlaceholderAPIPlugin.instance().configManager().config().expansions().computeIfAbsent(exp.getIdentifier(), s -> provideDefault());
}
final ConcurrentHashMap<String, Object> expansionConfigs = PlaceholderAPIPlugin.instance().configManager().config().expansions();
final String key = exp.getIdentifier();
final Object existing = expansionConfigs.get(key);
if (existing != null) {
return (T) existing;
}
final T def = provideDefault();
final Object conf = expansionConfigs.putIfAbsent(key, def);
return (T) (conf != null ? conf : def);
return provideDefault();
}
// /**

View File

@@ -263,12 +263,14 @@ public final class CloudExpansionManager {
}));
});
}
/*
public boolean isDownloading(@NotNull final CloudExpansion expansion) {
return await.containsKey(toIndexName(expansion));
}
@NotNull
@NotNull
public CompletableFuture<File> downloadExpansion(@NotNull final CloudExpansion expansion,
@NotNull final CloudExpansion.Version version) {
final CompletableFuture<File> previous = await.get(toIndexName(expansion));
@@ -304,7 +306,7 @@ public final class CloudExpansionManager {
await.put(toIndexName(expansion), download);
return download;
}
} */
private static final class LoggingThreadFactory implements ThreadFactory {
private final ThreadFactory backing = Executors.defaultThreadFactory();

View File

@@ -40,7 +40,7 @@ public class MetricsManager {
public void send() {
final String pluginVersion = main.getManifest().getVersion().toString();
final String serverVersion = ManifestUtil.getImplementationVersion();
final boolean usingEcloud = main.configManager().config().cloudEnabled();
final boolean usingEcloud = false;
final List<String> expansionsUsed = main.localExpansionManager().getExpansions().stream()
.map(PlaceholderExpansion::getName)
.toList();