TotalFreedomMod 7.0.0

This commit is contained in:
Telesphoreo 2021-10-08 17:54:21 -05:00
parent 1906933ec8
commit 12cf195e55
9 changed files with 23 additions and 19 deletions

View File

@ -106,7 +106,7 @@ dependencies {
implementation('org.junit.jupiter:junit-jupiter:5.8.1') implementation('org.junit.jupiter:junit-jupiter:5.8.1')
implementation('org.projectlombok:lombok:1.18.20') implementation('org.projectlombok:lombok:1.18.20')
compileOnly('org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT') compileOnly('org.spigotmc:spigot:1.17.1-R0.1-SNAPSHOT')
compileOnly('me.totalfreedom:bukkittelnet:4.6') compileOnly('me.totalfreedom:BukkitTelnet:4.6.1')
compileOnly('me.totalfreedom:TF-LibsDisguises:10.0.26-SNAPSHOT') compileOnly('me.totalfreedom:TF-LibsDisguises:10.0.26-SNAPSHOT')
compileOnly('com.sk89q.worldedit:worldedit-bukkit:7.3.0-SNAPSHOT') compileOnly('com.sk89q.worldedit:worldedit-bukkit:7.3.0-SNAPSHOT')
compileOnly('net.essentialsx:EssentialsX:2.19.0') compileOnly('net.essentialsx:EssentialsX:2.19.0')
@ -161,7 +161,7 @@ tasks.withType(Checkstyle) {
reports { reports {
xml.required = false xml.required = false
html.required = true html.required = true
html.stylesheet resources.text.fromFile('config/xsl/checkstyle-custom.xsl') html.stylesheet resources.text.fromFile('config/xsl/checkstyle.xsl')
} }
} }

View File

@ -46,12 +46,12 @@ public class Pterodactyl extends FreedomService
if (!admin.isActive() || admin.getRank() != Rank.SENIOR_ADMIN) if (!admin.isActive() || admin.getRank() != Rank.SENIOR_ADMIN)
{ {
FLog.debug("Disabling ptero acc"); FLog.debug("Disabling Pterodactyl account");
removeAccountFromServer(id); removeAccountFromServer(id);
return; return;
} }
FLog.debug("Enabling ptero acc"); FLog.debug("Enabling Pterodactyl account");
addAccountToServer(id); addAccountToServer(id);
} }
@ -101,15 +101,13 @@ public class Pterodactyl extends FreedomService
public void restartServer() public void restartServer()
{ {
ClientServer server = clientAPI.retrieveServerByIdentifier(IDENTIFIER).execute(); clientAPI.retrieveServerByIdentifier(IDENTIFIER).flatMap(ClientServer::restart).execute();
server.setPower(PowerAction.RESTART).execute();
} }
public void fionnTheServer() public void fionnTheServer()
{ {
ClientServer server = clientAPI.retrieveServerByIdentifier(IDENTIFIER).execute(); clientAPI.retrieveServerByIdentifier(IDENTIFIER).flatMap(ClientServer::stop).execute();
server.setPower(PowerAction.STOP).execute(); plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, () -> clientAPI.retrieveServerByIdentifier(IDENTIFIER).flatMap(ClientServer::kill).execute(), 0, 60);
plugin.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, () -> server.setPower(PowerAction.KILL).execute(), 0, 60);
} }
public String getURL() public String getURL()

View File

@ -54,6 +54,7 @@ import org.bukkit.generator.ChunkGenerator;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPlugin;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.spigotmc.SpigotCommand;
import org.spigotmc.SpigotConfig; import org.spigotmc.SpigotConfig;
public class TotalFreedomMod extends JavaPlugin public class TotalFreedomMod extends JavaPlugin
@ -217,8 +218,8 @@ public class TotalFreedomMod extends JavaPlugin
// Metrics @ https://bstats.org/plugin/bukkit/TotalFreedomMod/2966 // Metrics @ https://bstats.org/plugin/bukkit/TotalFreedomMod/2966
new Metrics(this, 2966); new Metrics(this, 2966);
// little workaround to stop spigot from autorestarting - causing AMP to detach from process. // Revert AMP changes
SpigotConfig.config.set("settings.restart-on-crash", false); SpigotConfig.config.set("settings.restart-on-crash", true);
} }
@Override @Override

View File

@ -287,7 +287,6 @@ public class CoreProtectBridge extends FreedomService
if (block != null) if (block != null)
{ {
event.setCancelled(true); event.setCancelled(true);
List<String[]> lookup = coreProtect.blockLookup(block, -1);
int cooldownTime = 3; int cooldownTime = 3;
@ -302,6 +301,8 @@ public class CoreProtectBridge extends FreedomService
} }
} }
List<String[]> lookup = coreProtect.blockLookup(block, -1);
if (!plugin.al.isAdmin(player)) if (!plugin.al.isAdmin(player))
{ {
cooldown.put(player.getName(), System.currentTimeMillis()); cooldown.put(player.getName(), System.currentTimeMillis());

View File

@ -8,7 +8,7 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH) @CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Restart the server", usage = "/<command>") @CommandParameters(description = "Fionn the server", usage = "/<command>")
public class Command_fionn extends FreedomCommand public class Command_fionn extends FreedomCommand
{ {
@Override @Override

View File

@ -12,7 +12,7 @@ import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitRunnable;
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH) @CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
@CommandParameters(description = "Restart the server", usage = "/<command> [reason]") @CommandParameters(description = "Restart the server", usage = "/<command> [reason]", aliases="tfmrestart")
public class Command_restart extends FreedomCommand public class Command_restart extends FreedomCommand
{ {
private static final Map<CommandSender, String> RESTART_CONFIRM = new HashMap<>(); private static final Map<CommandSender, String> RESTART_CONFIRM = new HashMap<>();

View File

@ -38,7 +38,6 @@ public class Command_stop extends FreedomCommand
return true; return true;
} }
msg("Warning: You're about to stop the server. Type /stop again to confirm you want to do this."); msg("Warning: You're about to stop the server. Type /stop again to confirm you want to do this.");
STOP_CONFIRM.put(sender, reason); STOP_CONFIRM.put(sender, reason);

View File

@ -85,18 +85,23 @@ discord:
# Owner role ID # Owner role ID
server_owner_role_id: '' server_owner_role_id: ''
# Pterodactyl # Pterodactyl (requires Discord verification to be enabled)
ptero: ptero:
# URL - do not leave a trailing forward slash # URL - do not leave a trailing forward slash
url: '' url: ''
# The default email domain used to set email addresses for new users - do not include the @ # The default email domain used to set email addresses for new users - do not include the @
default_email_domain: 'example.com' default_email_domain: 'example.com'
# Server UUID # Long Server UUID (for example: abf9a712-6c5a-4504-b4bc-37f1061b8801)
# Do NOT give the short Server UUID
server_uuid: '' server_uuid: ''
# Admin panel API key # Admin panel API key
# Create this key by going to Settings > Application API > Create New
# Make sure you give it Users and Servers permissions
admin_key: '' admin_key: ''
# Server API key # Client API key
server_key: '' # Create a new user and add them as a subuser to the server with all control and subuser privileges.
# Then, login to the new user account and go to User Settings. Click on API Credentials and create a new one.
client_key: ''
# The shop # The shop
shop: shop: