Author SHA1 Message Date
NotAlexNoyle dacff125bd Exclude CODEOWNERS from language statistics 2026-10-29 16:18:50 -04:00
NotAlexNoyle 889bac4387 Add CODEOWNERS (one staff approval) 2026-10-29 16:18:50 -04:00
NotAlexNoyle f9bd8274f5 Fix version metadata 2026-05-25 11:17:16 -04:00
NotAlexNoyle ae41e96752 2026 style update 2026-05-04 12:33:25 -04:00
NotAlexNoyle 4876601e69 Update config 2026-05-04 02:13:02 -04:00
NotAlexNoyle 19aed20a45 Fix description variable 2026-04-01 04:56:08 -04:00
NotAlexNoyle 0bf3eceac8 Update shadow to 8.3.9 2026-03-30 04:29:42 -04:00
NotAlexNoyle 1eeda5f9c5 Update MOTD 2026-03-24 12:58:48 -04:00
NotAlexNoyle a131a5b5bf Update client support motd to 1.21.11 2026-03-18 12:40:57 -04:00
NotAlexNoyle c9b76c9c8f Add upstream 2026-03-16 04:22:44 -04:00
NotAlexNoyle 4766b3d8cb Formatting 2026-03-16 04:21:38 -04:00
NotAlexNoyle 07dc8a749e Merge pull request #2 from true-og/codex/remove-player-caching-and-update-project-name
Remove player caching, drop IP storage, and rebrand to AdvancedServerList-OG
2026-03-16 04:19:32 -04:00
NotAlexNoyle ddd4d9cb88 Remove player caching and rebrand to AdvancedServerList-OG 2026-03-16 04:19:20 -04:00
NotAlexNoyle 93d118a2ef Merge pull request #1 from true-og/codex/include-server-icon-in-jar
Copy bundled server-icon.png into favicons folder on startup
2026-03-16 02:20:54 -04:00
22 changed files with 50 additions and 416 deletions

No files matched your search

+1
View File
@@ -0,0 +1 @@
.gitea/CODEOWNERS linguist-detectable=false
+3
View File
@@ -0,0 +1,3 @@
# Pull requests request review from the eligible staff team(s).
# One approval from either an Admin or Developer satisfies branch protection.
* @trueog/Admins @trueog/Developers
+10 -116
View File
@@ -1,121 +1,15 @@
# AdvancedServerList
# AdvancedServerList-OG
[AdvancedServerList](https://codeberg.org/Andre601/AdvancedServerList) is a plugin that allows you to customize your server's MOTD, favicon, Player count text and player count hover displayed in a player's multiplayer server list based on conditions and priorities.
AdvancedServerList-OG is the TrueOG-maintained variant of [AdvancedServerList](https://codeberg.org/Andre601/AdvancedServerList) for Purpur 1.19.4.
This branch builds using gradle for Purpur 1.19.4. Maintained for [TrueOG Network](https://trueog.net/)
## What is different from normal AdvancedServerList?
## Downloads
- Uses TrueOG's live config files and branding.
- Player caching is fully removed.
- No IP addresses are stored.
- Player placeholders are not part of this OG variant.
- Build/project naming is changed to `AdvancedServerList-OG`.
<a href="https://modrinth.com/plugin/advancedserverlist" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact/available/modrinth_vector.svg" height="46" alt="modrinth" title="Available on Modrinth">
</a>
<br>
<!--
<a href="https://hangar.papermc.io/Andre_601/AdvancedServerList" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact/available/hangar_vector.svg" height="46" alt="hangar" title="Available on Hangar">
</a>
-->
## Notes
## Supported Platforms
<a href="https://papermc.io" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/paper_vector.svg" height="64" alt="platform-paper" title="Tested on Paper">
</a>
<a href="https://www.spigotmc.org" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/bungeecord_vector.svg" height="64" alt="platform-bungeecord" title="Tested on BungeeCord">
</a>
<a href="https://www.papermc.io" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/waterfall_vector.svg" height="64" alt="platform-waterfall" title="Tested on Waterfall">
</a>
<a href="https://velocitypowered.com" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/supported/velocity_vector.svg" height="64" alt="platform-velocity" title="Tested on Velocity">
</a>
## What is a Server List Profile?
A Server List Profile refers to a YAML file located in the plugin's `profiles` directory.
It allows you to configure specific aspects of the server display in the MC-Client's multiplayer server list, such as the MOTD, player count text, player count hover or Favicon.
> [*Read More*][profiles]
### Conditions
Thanks to conditions can you determine when a profile should be displayed in the player's server list, to allow displaying specific text (i.e. a warning when they are using an outdated version).
When multiple profiles exist that have valid conditions will the one with the highest priority (Higher number = higher priority) be selected. Having no conditions makes it automatically true.
> [*Read More*][conditions]
### Placeholders
Placeholders can be used within conditions to further customize them. They can also be used in any other text option to display their respective values.
The format is `${<target> <identifier>}` which was adopted from BungeeTabListPlus. Depending on what platform you use the plugin on are only specific placeholders available.
If you're a plugin dev can you even add your own custom placeholders through AdvancedServerList's own API.
> [*Read More*][placeholders]
### Formatting
The plugin uses the MiniMessage format for a consistent, easy way of formatting your text.
Only certain options are usable for each option. As an example does motd support HEX colours and gradients, while the other options only support default colour codes.
> [*Read More*][minimessage]
## Dependencies
All listed dependencies are optional.
| Dependency | Platforms |
|-------------------|----------------------|
| [PlaceholderAPI] | Paper |
| [ViaVersion] | Paper |
| [PAPIProxyBridge] | BungeeCord, Velocity |
| [Maintenance] | All |
## Statistics
This plugin sends statistics to [bStats] to display.
You can disable this in the global bStats config file located in `/plugins/bstats/`
- [BungeeCord][bstats-bungee]
- [Paper/Spigot][bstats-spigot]
- [Velocity][bstats-velocity]
## Screenshots
<a href="https://modrinth.com/plugin/advancedserverlist/gallery" target="_blank">
<img src="https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/documentation/modrinth-gallery_vector.svg" height="64" alt="gallery" title="Check out the Gallery">
</a>
## Support
<a href="https://discord.gg/6dazXp6" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/discord-singular_vector.svg" height="64" alt="discord" title="Join my Discord Server">
</a>
<a href="https://app.revolt.chat/invite/74TpERXA" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/revolt-singular_vector.svg" height="64" alt="revolt" title="Join my Revolt Server">
</a>
<a href="https://blobfox.coffee/@andre_601" target="_blank">
<img src="https://cdn.jsdelivr.net/gh/Andre601/devins-badges@13e0142/assets/compact-minimal/social/mastodon-singular_vector.svg" height="64" alt="mastodon" title="Chat with me on Mastodon">
</a>
<!-- Links -->
[profiles]: https://asl.andre601.ch/profiles/
[conditions]: https://asl.andre601.ch/profiles/#condition
[placeholders]: https://asl.andre601.ch/profiles/placeholders/
[minimessage]: https://asl.andre601.ch/profiles/formatting/
[modrinth]: https://modrinth.com/plugin/advancedserverlist
[placeholderapi]: https://hangar.papermc.io/HelpChat/PlaceholderAPI
[viaversion]: https://hangar.papermc.io/ViaVersion/ViaVersion
[papiproxybridge]: https://hangar.papermc.io/William278/PAPIProxyBridge
[maintenance]: https://hangar.papermc.io/kennytv/Maintenance
[bstats]: https://bstats.org
[bstats-bungee]: https://bstats.org/plugin/bungeecord/AdvancedServerList/15585
[bstats-spigot]: https://bstats.org/plugin/bukkit/AdvancedServerList/15584
[bstats-velocity]: https://bstats.org/plugin/velocity/AdvancedServerList/15587
[gallery]: https://modrinth.com/mod/advancedserverlist/gallery
This project keeps the same general MOTD/profile system focus as AdvancedServerList, while matching TrueOG deployment and branding requirements.
+13 -6
View File
@@ -20,7 +20,7 @@ plugins {
id("java")
id("java-library")
id("com.diffplug.spotless") version "7.0.4"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("com.gradleup.shadow") version "8.3.9"
eclipse
}
@@ -28,12 +28,14 @@ java { sourceCompatibility = JavaVersion.VERSION_17 }
group = "ch.andre601.advancedserverlist"
version = "4.0.0"
description = "Customize your MOTD"
val apiVersion by extra("v3.2.0")
val configVersion by extra(3)
subprojects {
apply(plugin = "java-library")
apply(plugin = "com.github.johnrengelman.shadow")
apply(plugin = "com.gradleup.shadow")
apply(plugin = "com.diffplug.spotless")
java {
@@ -45,9 +47,15 @@ subprojects {
}
tasks.named<ProcessResources>("processResources") {
val props = mapOf("version" to version, "apiVersion" to rootProject.extra["apiVersion"])
val props =
mapOf(
"version" to rootProject.version.toString(),
"apiVersion" to rootProject.extra["apiVersion"],
"configVersion" to rootProject.extra["configVersion"],
"description" to rootProject.description
)
inputs.properties(props)
filesMatching("plugin.yml") { expand(props) }
filesMatching(listOf("plugin.yml", "paper-plugin.yml", "config.yml", "version.properties")) { expand(props) }
from("${rootProject.projectDir}/LICENSE") { into("/") }
}
@@ -84,5 +92,4 @@ subprojects {
}
}
tasks.jar { archiveClassifier.set("part") }
tasks.jar { enabled = false }
+1 -1
View File
@@ -20,7 +20,7 @@
plugins {
id("java-library")
id("com.github.johnrengelman.shadow")
id("com.gradleup.shadow")
}
val apiVersion: String by rootProject.extra
@@ -96,9 +96,6 @@ public class AdvancedServerList<F> {
}
public void disable() {
getPlugin().getPluginLogger().info("Saving playercache.json file...");
getPlayerHandler().save();
if (updateChecker != null) {
getPlugin().getPluginLogger().info("Disabling Update Checker...");
updateChecker.disable();
@@ -111,10 +108,6 @@ public class AdvancedServerList<F> {
plugin.clearFaviconCache();
}
public void clearPlayerCache() {
getPlayerHandler().clearCache();
}
private void load() {
printBanner();
resolveVersion();
@@ -155,7 +148,7 @@ public class AdvancedServerList<F> {
plugin.loadEvents();
getPlugin().getPluginLogger().info("Events loaded!");
getPlugin().getPluginLogger().info("Loading playercache.json...");
getPlugin().getPluginLogger().info("Loading live player handling...");
getPlayerHandler().load();
getPlugin().getPluginLogger().info("AdvancedServerList is ready!");
@@ -38,7 +38,6 @@ public class CommandHandler {
public CommandHandler(AdvancedServerList<?> core) {
subCommands.add(new Help());
subCommands.add(new Reload(core));
subCommands.add(new ClearCache(core));
}
public void handle(CmdSender sender, String[] args) {
@@ -78,8 +77,6 @@ public class CommandHandler {
sender.sendMsg("<aqua>/asl <white>help <grey>- Shows this help");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>reload <grey>- Reloads the config.yml and profiles");
sender.sendMsg();
sender.sendMsg("<aqua>/asl <white>clearCache <grey>- Clears the Player and Favicon cache");
}
}
@@ -114,28 +111,4 @@ public class CommandHandler {
sender.sendPrefixedMsg("<green>Reload complete!");
}
}
private static class ClearCache extends PluginCommand {
private final AdvancedServerList<?> core;
public ClearCache(AdvancedServerList<?> core) {
super("clearCache");
this.core = core;
}
@Override
public void handle(CmdSender sender) {
sender.sendPrefixedMsg("Clearing caches...");
core.clearFaviconCache();
sender.sendPrefixedMsg("<green>Successfully cleared Favicon Cache!");
core.clearPlayerCache();
sender.sendPrefixedMsg("<green>Successfully cleared Player Cache!");
sender.sendPrefixedMsg("<green>Cache clearing complete!");
}
}
}
@@ -27,8 +27,8 @@ package ch.andre601.advancedserverlist.core.interfaces.commands;
public interface CmdSender {
String prefix = "<grey>[<gradient:aqua:white>AdvancedServerList</gradient>] ";
String errorPrefix = "<grey>[<gradient:dark_red:red>AdvancedServerList</gradient>] ";
String prefix = "<grey>[<gradient:aqua:white>AdvancedServerList-OG</gradient>] ";
String errorPrefix = "<grey>[<gradient:dark_red:red>AdvancedServerList-OG</gradient>] ";
boolean hasPermission(String permission);
@@ -28,142 +28,42 @@ package ch.andre601.advancedserverlist.core.profiles.players;
import ch.andre601.advancedserverlist.core.AdvancedServerList;
import ch.andre601.advancedserverlist.core.interfaces.PluginLogger;
import ch.andre601.advancedserverlist.core.objects.CachedPlayer;
import com.google.gson.Gson;
import io.leangen.geantyref.TypeToken;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.lang.reflect.Type;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.*;
import java.util.UUID;
public class PlayerHandler {
private final AdvancedServerList<?> core;
private final PluginLogger logger;
private final Path cache;
private final Type listType = new TypeToken<ArrayList<CachedPlayer>>() {}.getType();
private final Gson gson = new Gson();
// UUID of MHF_Question
private final UUID defaultUUID = UUID.fromString("606e2ff0-ed77-4842-9d6c-e1d3321c7838");
private List<CachedPlayer> cachedPlayers = new ArrayList<>();
private CachedPlayer defaultPlayer = null;
public PlayerHandler(AdvancedServerList<?> core) {
this.core = core;
this.logger = core.getPlugin().getPluginLogger();
this.cache = core.getPlugin().getFolderPath().resolve("playercache.json");
}
public void load() {
if (!cache.toFile().exists()) {
logger.info("No playercache.json file present. Skipping...");
return;
}
if (core.getFileHandler().getBoolean("disableCache")) {
logger.info("'disable_cache' is set to true. Skipping playercache.json loading...");
return;
}
try {
BufferedReader reader = Files.newBufferedReader(cache);
cachedPlayers = gson.fromJson(reader, listType);
reader.close();
} catch (IOException ex) {
logger.warn("Encountered IOException while reading the playercache.json file!", ex);
return;
}
// In case Gson messes up... I guess.
if (cachedPlayers == null) {
logger.warn("Couldn't load players from playercache.json file. Is the JSON valid?");
// Create new ArrayList instance to avoid further issues.
cachedPlayers = new ArrayList<>();
return;
}
logger.info("Loaded %d players into cache!", cachedPlayers.size());
}
public void save() {
if (cachedPlayers.isEmpty()) {
logger.info("No players in cache to save. Skipping...");
return;
}
if (core.getFileHandler().getBoolean("disableCache")) {
logger.info("'disable_cache' is set to true. Skipping saving of cached players...");
return;
}
try (BufferedWriter writer = Files.newBufferedWriter(cache, StandardCharsets.UTF_8)) {
gson.toJson(cachedPlayers, listType, writer);
logger.info("Successfully saved playercache.json file.");
} catch (IOException ex) {
logger.warn("Encountered IOException while saving cached players to playercache.json!", ex);
}
}
public void addPlayer(String ip, String name, UUID uuid) {
if (contains(ip) || core.getFileHandler().getBoolean("disableCache")) return;
cachedPlayers.add(new CachedPlayer(ip, name, uuid));
logger.info("Player cache is disabled in AdvancedServerList-OG. Skipping...");
}
public CachedPlayer getCachedPlayer(String key) {
if (!contains(key) || core.getFileHandler().getBoolean("disableCache")) return getDefaultPlayer();
for (CachedPlayer player : cachedPlayers) {
if (player.getIp().equals(key)) return player;
}
return getDefaultPlayer();
}
public CachedPlayer getCachedPlayer(UUID uuid) {
for (CachedPlayer player : cachedPlayers) {
if (player.getUuid().equals(uuid)) return player;
}
return getDefaultPlayer();
}
public void clearCache() {
cachedPlayers.clear();
defaultPlayer = null;
}
private boolean contains(String ip) {
for (CachedPlayer player : cachedPlayers) {
if (player.getIp().equals(ip)) return true;
}
return false;
}
private CachedPlayer getDefaultPlayer() {
if (defaultPlayer != null) return defaultPlayer;
return (defaultPlayer = new CachedPlayer(
"0.0.0.0",
core.getFileHandler().getString("Anonymous", "unknownPlayer", "name"),
convertToUUID(core.getFileHandler().getString(defaultUUID.toString(), "unknownPlayer", "uuid"))));
}
private UUID convertToUUID(String uuid) {
try {
return UUID.fromString(uuid);
} catch (IllegalArgumentException ex) {
// This is always a valid UUID.
return defaultUUID;
}
return (defaultPlayer = new CachedPlayer("0.0.0.0", "Anonymous", defaultUUID));
}
}
+1 -24
View File
@@ -1,26 +1,3 @@
#
# Used for when AdvancedServerList doesn't have a cached player to use for player placeholders.
#
unknownPlayer:
#
# The name to use. Defaults to Anonymous.
#
name: "Anonymous"
#
# The UUID to use. Defaults to 606e2ff0-ed77-4842-9d6c-e1d3321c7838 (UUID of MHF_Question).
#
uuid: "606e2ff0-ed77-4842-9d6c-e1d3321c7838"
#
# Should the Caching of players be disabled?
#
# When set to true will AdvancedServerList not load any players from the cache.data file (if present) nor save any to it.
# Placeholders that rely on the player being cached (such as ${player name}) will not work while this option is enabled.
#
# Defaults to false when not present.
#
disableCache: false
#
# Should AdvancedServerList check for new versions?
#
@@ -48,4 +25,4 @@ debug: false
# This is used internally to determine if the config needs to be migrated.
# Changing or even removing this option could result in your config being broken.
#
config-version: ${plugin.config.version}
config-version: ${configVersion}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

+2 -3
View File
@@ -61,8 +61,8 @@ priority: 1
# Read more: https://asl.andre601.ch/profiles/#motd
#
motd:
- '<bold><green>True<red>OG</bold> <yellow>Network</yellow> <rainbow>1.19 TEST SERVER</rainbow> <gold>[<bold>1.8.0</bold>-<bold>1.20.4</bold>]'
- '<dark_aqua>SMP <dark_red>♥ <red>Duels <dark_red>♥ <light_purple>Splegg <dark_red>♥ <dark_purple>The Herobrine <dark_red>♥ <dark_green>Build Battle'
- '<bold><green>True<red>OG</bold> <yellow>Network</yellow> <aqua>》<rainbow>1.19 Public Beta</rainbow><aqua>《 <gold>[1.8.0-1.21.11]'
- '<dark_green>SMP <dark_red>♥ <red>Duels <dark_red>♥ <light_purple>Splegg <dark_red>♥ <dark_purple>The Herobrine <dark_red>♥ <dark_aqua>Build Battle'
#
# Allows you to set a global (Default) favicon for this server list profile.
@@ -104,7 +104,6 @@ playerCount:
hover:
- '<dark_purple><bold>Server Jar:</bold> Purpur 1.19.4'
- '<yellow><bold>Host:</bold> Hetzner Falkenstein, DE'
- '<dark_red>♥ <aqua><bold>ad astra per aspera</bold> <dark_red>♥'
#
# Modifies the text that usually displays '<online>/<max>'
#
+2 -2
View File
@@ -23,5 +23,5 @@
#
#
version=${plugin.version}
config-version=${plugin.config.version}
version=${version}
config-version=${configVersion}
+2 -3
View File
@@ -18,7 +18,7 @@
plugins {
id("java-library")
id("com.github.johnrengelman.shadow")
id("com.gradleup.shadow")
}
val apiVersion: String by rootProject.extra
@@ -27,14 +27,13 @@ dependencies {
implementation(project(":core"))
implementation("ch.andre601.asl-api:platform-bukkit:3.2.0")
compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.5")
compileOnly("com.viaversion:viaversion-api:4.9.2")
}
tasks.withType<JavaCompile>().configureEach { dependsOn(project(":core").tasks.named("jar")) }
tasks.shadowJar {
archiveBaseName.set("AdvancedServerList")
archiveBaseName.set("AdvancedServerList-OG")
archiveClassifier.set("")
destinationDirectory.set(rootProject.layout.buildDirectory.dir("libs"))
relocate("org.bstats", "ch.andre601.advancedserverlist.spigot.depends.bstats")
@@ -33,8 +33,6 @@ import ch.andre601.advancedserverlist.paper.commands.CmdAdvancedServerList;
import ch.andre601.advancedserverlist.paper.listeners.LoadEvent;
import ch.andre601.advancedserverlist.paper.logging.PaperLogger;
import ch.andre601.advancedserverlist.paper.objects.WorldCache;
import ch.andre601.advancedserverlist.paper.objects.placeholders.PaperPlayerPlaceholders;
import ch.andre601.advancedserverlist.paper.objects.placeholders.PaperServerPlaceholders;
import java.nio.file.Path;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;
@@ -62,7 +60,7 @@ public class PaperCore extends JavaPlugin implements PluginCore<CachedServerIcon
}
}
this.core = AdvancedServerList.init(this, new PaperPlayerPlaceholders(), new PaperServerPlaceholders());
this.core = AdvancedServerList.init(this);
}
@Override
@@ -39,7 +39,7 @@ public class CmdAdvancedServerList extends Command {
super(
"advancedserverlist",
"Main command of the plugin",
"/asl [reload|help|clearCache]",
"/asl [reload|help]",
Collections.singletonList("asl"));
this.plugin = plugin;
}
@@ -1,53 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.paper.listeners;
import ch.andre601.advancedserverlist.paper.PaperCore;
import java.net.InetSocketAddress;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
public class JoinEvent implements Listener {
private final PaperCore plugin;
public JoinEvent(PaperCore plugin) {
this.plugin = plugin;
Bukkit.getPluginManager().registerEvents(this, plugin);
}
@EventHandler
public void onJoin(PlayerJoinEvent event) {
InetSocketAddress address = event.getPlayer().getAddress();
if (address == null) return;
Player player = event.getPlayer();
plugin.getCore().getPlayerHandler().addPlayer(address.getHostString(), player.getName(), player.getUniqueId());
}
}
@@ -42,7 +42,6 @@ public class LoadEvent implements Listener {
@EventHandler
public void onLoad(ServerLoadEvent event) {
new JoinEvent(plugin);
new PingEvent(plugin);
new WorldEvents(plugin);
@@ -1,53 +0,0 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Andre_601
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
package ch.andre601.advancedserverlist.paper.objects.placeholders;
import ch.andre601.advancedserverlist.api.PlaceholderProvider;
import ch.andre601.advancedserverlist.api.objects.GenericPlayer;
import ch.andre601.advancedserverlist.api.objects.GenericServer;
import ch.andre601.advancedserverlist.paper.objects.impl.PaperPlayerImpl;
public class PaperPlayerPlaceholders extends PlaceholderProvider {
public PaperPlayerPlaceholders() {
super("player");
}
@Override
public String parsePlaceholder(String placeholder, GenericPlayer player, GenericServer server) {
if (!(player instanceof PaperPlayerImpl paperPlayer)) return null;
return switch (placeholder) {
case "name" -> paperPlayer.getName();
case "protocol" -> String.valueOf(paperPlayer.getProtocol());
case "uuid" -> paperPlayer.getUUID().toString();
case "hasPlayedBefore" -> String.valueOf(paperPlayer.hasPlayedBefore());
case "isBanned" -> String.valueOf(paperPlayer.isBanned());
case "isWhitelisted" -> String.valueOf(paperPlayer.isWhitelisted());
default -> null;
};
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
name: 'AdvancedServerList'
name: 'AdvancedServerList-OG'
author: 'Andre_601'
version: '${version}'
description: '${description}'
@@ -23,7 +23,7 @@ dependencies:
# The below stuff is NOT used by Paper plugin.
commands:
advancedserverlist:
description: 'Main command of AdvancedServerList'
description: 'Main command of AdvancedServerList-OG'
usage: '/<command> [help|reload]'
aliases:
- 'asl'
+3 -6
View File
@@ -2,7 +2,7 @@
# This file is kept for Folia support.
#
name: 'AdvancedServerList'
name: 'AdvancedServerList-OG'
author: 'Andre_601'
version: '${version}'
description: 'Customize your MOTD'
@@ -23,8 +23,8 @@ softdepend:
commands:
advancedserverlist:
description: 'Main command of AdvancedServerList'
usage: '/<command> [help|reload|clearCache]'
description: 'Main command of AdvancedServerList-OG'
usage: '/<command> [help|reload]'
aliases:
- 'asl'
permission: 'advancedserverlist.admin'
@@ -52,6 +52,3 @@ permissions:
advancedserverlist.command.reload:
description: 'Grants access to /asl reload'
default: op
advancedserverlist.command.clearcache:
description: 'Clears the Player and Favicon cache'
default: op
+2 -2
View File
@@ -22,7 +22,7 @@
~ SOFTWARE.
*/
rootProject.name = "AdvancedServerList"
rootProject.name = "AdvancedServerList-OG"
include(":core", ":paper")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
@@ -31,7 +31,7 @@ dependencyResolutionManagement {
gradlePluginPortal()
maven { url = uri("https://codeberg.org/api/packages/Andre601/maven/") }
maven { url = uri("https://jitpack.io/") }
maven { url = uri("https://repo.william278.net/releases/") }
maven { url = uri("https://repo.william278.net/releases/") }
maven { url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") }
maven { url = uri("https://repo.papermc.io/repository/maven-public/") }
maven { url = uri("https://repo.extendedclip.com/content/repositories/placeholderapi/") }