mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 20:46:41 +00:00
Compare commits
2 Commits
ptero-upda
...
2021.05
Author | SHA1 | Date | |
---|---|---|---|
86a8e21d06 | |||
da37ca52fa |
43
.github/workflows/downstream.yml
vendored
43
.github/workflows/downstream.yml
vendored
@ -1,43 +0,0 @@
|
|||||||
# This is a basic workflow to help you get started with Actions
|
|
||||||
|
|
||||||
name: Downstream Branch Updates
|
|
||||||
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '20 7 * * *'
|
|
||||||
# scheduled at 07:00 every Monday and Thursday
|
|
||||||
|
|
||||||
workflow_dispatch: # click the button on Github repo!
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
sync_with_upstream:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Sync main with upstream latest
|
|
||||||
|
|
||||||
steps:
|
|
||||||
# Step 1: run a standard checkout action, provided by github
|
|
||||||
- name: Checkout main
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
ref: main
|
|
||||||
# submodules: 'recursive' ### may be needed in your situation
|
|
||||||
|
|
||||||
# Step 2: run this sync action - specify the upstream repo, upstream branch to sync with, and target sync branch
|
|
||||||
- name: Pull (Fast-Forward) upstream changes
|
|
||||||
id: sync
|
|
||||||
uses: aormsby/Fork-Sync-With-Upstream-action@v2.1
|
|
||||||
with:
|
|
||||||
upstream_repository: AtlasMediaGroup/TotalFreedomMod
|
|
||||||
upstream_branch: main
|
|
||||||
target_branch: main
|
|
||||||
git_pull_args: --ff-only # optional arg use, defaults to simple 'pull'
|
|
||||||
|
|
||||||
# Step 3: Display a message if 'sync' step had new commits (simple test)
|
|
||||||
- name: Check for new commits
|
|
||||||
if: steps.sync.outputs.has_new_commits
|
|
||||||
run: echo "There were new commits."
|
|
||||||
|
|
||||||
# Step 4: Print a helpful timestamp for your records (not required, just nice)
|
|
||||||
- name: Timestamp
|
|
||||||
run: date
|
|
36
SECURITY.md
36
SECURITY.md
@ -2,34 +2,18 @@
|
|||||||
|
|
||||||
## Supported Versions
|
## Supported Versions
|
||||||
|
|
||||||
We currently support the code running on the "main" branch and "development" branch of this repository. This is supported in addition to those formal releases, but note anything not yet released should be treated as in-development.
|
We currently support the code running on the "development" branch of this repository. This is supported in addition to those formal releases, but note anything not yet released should be treated as in-development.
|
||||||
|
|
||||||
In terms of plugin releases, our support matrix is as follows:
|
In terms of plugin releases, we support the following versions:
|
||||||
|
|
||||||
### Actively Supported
|
| Version | Supported |
|
||||||
These versions are currently actively supported by our team, and you should expect security patches where appropriate for these versions.
|
| ------------------- | ------------------ |
|
||||||
|
| 2021.04 | :white_check_mark: |
|
||||||
| Version | Supported | Support End: |
|
| 2021.02 | :white_check_mark: |
|
||||||
| ------------------- | ------------------ | ------------------------------ |
|
| 2020.11 | :white_check_mark: |
|
||||||
| 2021.05 | :white_check_mark: | No Earlier than August 2021 |
|
| 6.0.x (Pre-Release) | :x: |
|
||||||
|
| < 2020.11 | :x: |
|
||||||
### Legacy Supported
|
| < 5.x | :x: |
|
||||||
These versions are no longer under active development, however we will look to release critical secuirty patches where appropriate.
|
|
||||||
|
|
||||||
| Version | Supported | Support End: |
|
|
||||||
| ------------------- | ------------------ | ------------ |
|
|
||||||
| 2021.04 | :white_check_mark: | July 2021 |
|
|
||||||
|
|
||||||
### No Longer Supported
|
|
||||||
These versions are no longer supported at all. It is strongly advised to update if you are running any of these versions.
|
|
||||||
|
|
||||||
| Version | Supported | Support Ended: |
|
|
||||||
| ------------------- | ------------------ | ------------------- |
|
|
||||||
| 2021.02 | :x: | 6 June 2021 |
|
|
||||||
| 2020.11 | :x: | 3 May 2021 |
|
|
||||||
| 6.0.x (Pre-Release) | :x: | December 2020 |
|
|
||||||
| < 2020.11 | :x: | December 2020 |
|
|
||||||
| < 5.x | :x: | December 2020 |
|
|
||||||
|
|
||||||
## Reporting a Vulnerability
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
53
pom.xml
53
pom.xml
@ -39,11 +39,6 @@
|
|||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
|
||||||
<id>apache-snapshots</id>
|
|
||||||
<url>https://repository.apache.org/content/repositories/snapshots/</url>
|
|
||||||
</repository>
|
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>jitpack.io</id>
|
<id>jitpack.io</id>
|
||||||
<url>https://jitpack.io</url>
|
<url>https://jitpack.io</url>
|
||||||
@ -111,13 +106,13 @@
|
|||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>ess-repo</id>
|
<id>rayzr-repo</id>
|
||||||
<url>https://ci.ender.zone/plugin/repository/everything/</url>
|
<url>https://cdn.rawgit.com/Rayzr522/maven-repo/master/</url>
|
||||||
</repository>
|
</repository>
|
||||||
|
|
||||||
<repository>
|
<repository>
|
||||||
<id>mattmalec-repo</id>
|
<id>ess-repo</id>
|
||||||
<url>https://repo.mattmalec.com/repository/releases</url>
|
<url>https://ci.ender.zone/plugin/repository/everything/</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
@ -154,7 +149,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bstats</groupId>
|
<groupId>org.bstats</groupId>
|
||||||
<artifactId>bstats-bukkit</artifactId>
|
<artifactId>bstats-bukkit</artifactId>
|
||||||
<version>2.2.1</version>
|
<version>1.8</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@ -196,21 +191,21 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.dv8tion</groupId>
|
<groupId>net.dv8tion</groupId>
|
||||||
<artifactId>JDA</artifactId>
|
<artifactId>JDA</artifactId>
|
||||||
<version>4.3.0_277</version>
|
<version>4.2.1_255</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.coreprotect</groupId>
|
<groupId>net.coreprotect</groupId>
|
||||||
<artifactId>coreprotect</artifactId>
|
<artifactId>coreprotect</artifactId>
|
||||||
<version>19.5</version>
|
<version>19.3</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.sk89q.worldguard</groupId>
|
<groupId>com.sk89q.worldguard</groupId>
|
||||||
<artifactId>worldguard-bukkit</artifactId>
|
<artifactId>worldguard-bukkit</artifactId>
|
||||||
<version>7.0.5</version>
|
<version>7.0.4</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@ -221,6 +216,13 @@
|
|||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>me.rayzr522</groupId>
|
||||||
|
<artifactId>jsonmessage</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.vexsoftware</groupId>
|
<groupId>com.github.vexsoftware</groupId>
|
||||||
<artifactId>votifier</artifactId>
|
<artifactId>votifier</artifactId>
|
||||||
@ -269,26 +271,12 @@
|
|||||||
<version>3.1.1</version>
|
<version>3.1.1</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.mattmalec</groupId>
|
|
||||||
<artifactId>Pterodactyl4J</artifactId>
|
|
||||||
<version>2.BETA_47</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
|
||||||
<version>3.3.0-SNAPSHOT</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter</artifactId>
|
<artifactId>junit-jupiter</artifactId>
|
||||||
<version>5.4.2</version>
|
<version>5.4.2</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.eclipse.sisu</groupId>
|
<groupId>org.eclipse.sisu</groupId>
|
||||||
<artifactId>org.eclipse.sisu.inject</artifactId>
|
<artifactId>org.eclipse.sisu.inject</artifactId>
|
||||||
@ -323,7 +311,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>pl.project13.maven</groupId>
|
<groupId>pl.project13.maven</groupId>
|
||||||
<artifactId>git-commit-id-plugin</artifactId>
|
<artifactId>git-commit-id-plugin</artifactId>
|
||||||
<version>4.0.5</version>
|
<version>4.0.2</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>get-the-git-infos</id>
|
<id>get-the-git-infos</id>
|
||||||
@ -436,12 +424,10 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
<!-- Shade -->
|
<!-- Shade -->
|
||||||
<!-- NOTE: This should only be temporary. This will need to be updated when a stable build comes out
|
|
||||||
that supports Java 16 -->
|
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-shade-plugin</artifactId>
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
<version>3.3.0-SNAPSHOT</version>
|
<version>3.2.4</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>package</phase>
|
<phase>package</phase>
|
||||||
@ -453,7 +439,8 @@
|
|||||||
<relocations>
|
<relocations>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>io.papermc.lib</pattern>
|
<pattern>io.papermc.lib</pattern>
|
||||||
<shadedPattern>me.totalfreedom.totalfreedommod.paperlib</shadedPattern>
|
<shadedPattern>me.totalfreedom.totalfreedommod.paperlib
|
||||||
|
</shadedPattern> <!-- Replace this -->
|
||||||
</relocation>
|
</relocation>
|
||||||
<relocation>
|
<relocation>
|
||||||
<pattern>org.bstats</pattern>
|
<pattern>org.bstats</pattern>
|
||||||
@ -467,11 +454,11 @@
|
|||||||
<include>commons-codec:commons-codec</include>
|
<include>commons-codec:commons-codec</include>
|
||||||
<include>org.reflections:reflections</include>
|
<include>org.reflections:reflections</include>
|
||||||
<include>org.javassist:javassist</include>
|
<include>org.javassist:javassist</include>
|
||||||
|
<include>me.rayzr522:jsonmessage</include>
|
||||||
<include>io.papermc:paperlib</include>
|
<include>io.papermc:paperlib</include>
|
||||||
<include>com.github.speedxx:Mojangson</include>
|
<include>com.github.speedxx:Mojangson</include>
|
||||||
<include>org.bstats:bstats-bukkit</include>
|
<include>org.bstats:bstats-bukkit</include>
|
||||||
<include>org.jetbrains:annotations</include>
|
<include>org.jetbrains:annotations</include>
|
||||||
<include>com.mattmalec:Pterodactyl4J</include>
|
|
||||||
</includes>
|
</includes>
|
||||||
</artifactSet>
|
</artifactSet>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
@ -85,10 +85,6 @@ public class AutoEject extends FreedomService
|
|||||||
player.kickPlayer(kickMessage);
|
player.kickPlayer(kickMessage);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
{
|
|
||||||
FLog.warning("Unrecognized EjectMethod " + method.name() + " found, defaulting to STRIKE_THREE");
|
|
||||||
}
|
|
||||||
case STRIKE_THREE:
|
case STRIKE_THREE:
|
||||||
{
|
{
|
||||||
plugin.bm.addBan(Ban.forPlayerFuzzy(player, Bukkit.getConsoleSender(), null, kickMessage));
|
plugin.bm.addBan(Ban.forPlayerFuzzy(player, Bukkit.getConsoleSender(), null, kickMessage));
|
||||||
|
@ -25,6 +25,11 @@ public class CommandSpy extends FreedomService
|
|||||||
{
|
{
|
||||||
if (plugin.al.isAdmin(player) && plugin.al.getAdmin(player).getCommandSpy())
|
if (plugin.al.isAdmin(player) && plugin.al.getAdmin(player).getCommandSpy())
|
||||||
{
|
{
|
||||||
|
if (plugin.al.isAdmin(event.getPlayer()) && !plugin.al.isSeniorAdmin(player))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (player != event.getPlayer())
|
if (player != event.getPlayer())
|
||||||
{
|
{
|
||||||
FUtil.playerMsg(player, event.getPlayer().getName() + ": " + event.getMessage());
|
FUtil.playerMsg(player, event.getPlayer().getName() + ": " + event.getMessage());
|
||||||
|
@ -2,8 +2,6 @@ package me.totalfreedom.totalfreedommod;
|
|||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
|
||||||
import me.totalfreedom.totalfreedommod.util.Groups;
|
import me.totalfreedom.totalfreedommod.util.Groups;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
@ -35,10 +33,7 @@ public class EntityWiper extends FreedomService
|
|||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
if (ConfigEntry.AUTO_ENTITY_WIPE.getBoolean())
|
wipeEntities(false);
|
||||||
{
|
|
||||||
wipeEntities(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}.runTaskTimer(plugin, 600L, 600L); // 30 second delay after startup + run every 30 seconds
|
}.runTaskTimer(plugin, 600L, 600L); // 30 second delay after startup + run every 30 seconds
|
||||||
}
|
}
|
||||||
|
@ -4,6 +4,7 @@ import io.papermc.lib.PaperLib;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
import me.rayzr522.jsonmessage.JSONMessage;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||||
|
@ -1,30 +1,26 @@
|
|||||||
package me.totalfreedom.totalfreedommod;
|
package me.totalfreedom.totalfreedommod;
|
||||||
|
|
||||||
import com.mattmalec.pterodactyl4j.Permission;
|
import java.io.IOException;
|
||||||
import com.mattmalec.pterodactyl4j.PowerAction;
|
import java.util.Arrays;
|
||||||
import com.mattmalec.pterodactyl4j.PteroAction;
|
import java.util.List;
|
||||||
import com.mattmalec.pterodactyl4j.PteroBuilder;
|
|
||||||
import com.mattmalec.pterodactyl4j.application.entities.ApplicationUser;
|
|
||||||
import com.mattmalec.pterodactyl4j.application.entities.PteroApplication;
|
|
||||||
import com.mattmalec.pterodactyl4j.application.managers.UserAction;
|
|
||||||
import com.mattmalec.pterodactyl4j.client.entities.ClientServer;
|
|
||||||
import com.mattmalec.pterodactyl4j.client.entities.ClientSubuser;
|
|
||||||
import com.mattmalec.pterodactyl4j.client.entities.PteroClient;
|
|
||||||
import joptsimple.internal.Strings;
|
import joptsimple.internal.Strings;
|
||||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||||
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
|
import me.totalfreedom.totalfreedommod.util.Response;
|
||||||
|
import org.json.simple.JSONObject;
|
||||||
|
import org.json.simple.parser.ParseException;
|
||||||
|
|
||||||
public class Pterodactyl extends FreedomService
|
public class Pterodactyl extends FreedomService
|
||||||
{
|
{
|
||||||
|
|
||||||
public final String URL = ConfigEntry.PTERO_URL.getString();
|
public final String URL = ConfigEntry.PTERO_URL.getString();
|
||||||
|
private final String SERVER_KEY = ConfigEntry.PTERO_SERVER_KEY.getString();
|
||||||
private final String ADMIN_KEY = ConfigEntry.PTERO_ADMIN_KEY.getString();
|
private final String ADMIN_KEY = ConfigEntry.PTERO_ADMIN_KEY.getString();
|
||||||
private final String CLIENT_KEY = ConfigEntry.PTERO_CLIENT_KEY.getString();
|
private final List<String> SERVER_HEADERS = Arrays.asList("Accept:Application/vnd.pterodactyl.v1+json", "Content-Type:application/json", "Authorization:Bearer " + SERVER_KEY);
|
||||||
private final String IDENTIFIER = ConfigEntry.PTERO_SERVER_UUID.getString();
|
private final List<String> ADMIN_HEADERS = Arrays.asList("Accept:Application/vnd.pterodactyl.v1+json", "Content-Type:application/json", "Authorization:Bearer " + ADMIN_KEY);
|
||||||
private final PteroApplication adminAPI = PteroBuilder.createApplication(URL, ADMIN_KEY);
|
|
||||||
private final PteroClient clientAPI = PteroBuilder.createClient(URL, CLIENT_KEY);
|
|
||||||
private final ClientServer server = clientAPI.retrieveServerByIdentifier(IDENTIFIER).execute();
|
|
||||||
|
|
||||||
private boolean enabled = !Strings.isNullOrEmpty(URL);
|
private boolean enabled = !Strings.isNullOrEmpty(URL);
|
||||||
|
|
||||||
@ -47,60 +43,163 @@ public class Pterodactyl extends FreedomService
|
|||||||
|
|
||||||
if (!admin.isActive() || admin.getRank() != Rank.SENIOR_ADMIN)
|
if (!admin.isActive() || admin.getRank() != Rank.SENIOR_ADMIN)
|
||||||
{
|
{
|
||||||
FLog.debug("Disabling Pterodactyl account");
|
FLog.debug("Disabling ptero acc");
|
||||||
removeAccountFromServer(id);
|
removeAccountFromServer(id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
FLog.debug("Enabling Pterodactyl account");
|
FLog.debug("Enabling ptero acc");
|
||||||
addAccountToServer(id);
|
addAccountToServer(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public String createAccount(String username, String password)
|
public String createAccount(String username, String password)
|
||||||
{
|
{
|
||||||
UserAction action = adminAPI.getUserManager().createUser()
|
JSONObject json = new JSONObject();
|
||||||
.setUserName(username)
|
json.put("username", username);
|
||||||
.setEmail(username.toLowerCase() + "@" + ConfigEntry.PTERO_DEFAULT_EMAIL_DOMAIN.getString())
|
json.put("password", password);
|
||||||
.setFirstName(username)
|
json.put("email", username.toLowerCase() + "@" + ConfigEntry.PTERO_DEFAULT_EMAIL_DOMAIN.getString());
|
||||||
.setLastName("\u200E") // Required - make it appear empty
|
json.put("first_name", username);
|
||||||
.setPassword(password);
|
json.put("last_name", "\u200E"); // required, so I made it appear empty
|
||||||
|
|
||||||
|
Response response;
|
||||||
|
JSONObject jsonResponse;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response = FUtil.sendRequest(URL + "/api/application/users", "POST", ADMIN_HEADERS, json.toJSONString());
|
||||||
|
jsonResponse = response.getJSONMessage();
|
||||||
|
}
|
||||||
|
catch (IOException | ParseException e)
|
||||||
|
{
|
||||||
|
FLog.severe(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ((JSONObject)jsonResponse.get("attributes")).get("id").toString();
|
||||||
|
|
||||||
return action.execute().getId();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteAccount(String id)
|
public boolean deleteAccount(String id)
|
||||||
{
|
{
|
||||||
ApplicationUser username = adminAPI.retrieveUserById(id).execute();
|
JSONObject json = new JSONObject();
|
||||||
PteroAction<Void> action = adminAPI.getUserManager().deleteUser(username);
|
try
|
||||||
action.execute();
|
{
|
||||||
|
return FUtil.sendRequest(URL + "/api/application/users/" + id, "DELETE", ADMIN_HEADERS, json.toJSONString()).getCode() == 204;
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
FLog.severe(e);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void addAccountToServer(String id)
|
public void addAccountToServer(String id)
|
||||||
{
|
{
|
||||||
ApplicationUser username = adminAPI.retrieveUserById(id).execute();
|
String url = URL + "/api/client/servers/" + ConfigEntry.PTERO_SERVER_UUID.getString() + "/users";
|
||||||
String email = username.getEmail();
|
|
||||||
PteroAction<ClientServer> server = clientAPI.retrieveServerByIdentifier(IDENTIFIER);
|
JSONObject userData = getUserData(id);
|
||||||
server.execute().getSubuserManager().createUser()
|
if (userData == null)
|
||||||
.setEmail(email)
|
{
|
||||||
.setPermissions(Permission.CONTROL_PERMISSIONS).execute();
|
FLog.severe("The Pterodactyl user with the ID of " + id + " was not found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("email", userData.get("email").toString());
|
||||||
|
json.put("permissions", Arrays.asList("control.console", "control.start", "control.restart", "control.stop", "control.kill"));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FUtil.sendRequest(url, "POST", SERVER_HEADERS, json.toJSONString());
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
FLog.severe(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeAccountFromServer(String id)
|
public void removeAccountFromServer(String id)
|
||||||
{
|
{
|
||||||
ApplicationUser username = adminAPI.retrieveUserById(id).execute();
|
JSONObject userData = getUserData(id);
|
||||||
PteroAction<ClientServer> server = clientAPI.retrieveServerByIdentifier(IDENTIFIER);
|
if (userData == null)
|
||||||
ClientSubuser clientSubuser = server.execute().getSubuser(username.getUUID()).retrieve().execute();
|
{
|
||||||
server.execute().getSubuserManager().deleteUser(clientSubuser).execute();
|
FLog.severe("The Pterodactyl user with the ID of " + id + " was not found");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String url = URL + "/api/client/servers/" + ConfigEntry.PTERO_SERVER_UUID.getString() + "/users/" + userData.get("uuid");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FUtil.sendRequest(url, "DELETE", SERVER_HEADERS, null);
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
FLog.severe(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stopServer()
|
public JSONObject getUserData(String id)
|
||||||
{
|
{
|
||||||
clientAPI.setPower(server, PowerAction.STOP).execute();
|
Response response;
|
||||||
|
JSONObject jsonResponse;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
response = FUtil.sendRequest(URL + "/api/application/users/" + id, "GET", ADMIN_HEADERS, null);
|
||||||
|
jsonResponse = response.getJSONMessage();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (IOException | ParseException e)
|
||||||
|
{
|
||||||
|
FLog.severe(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (JSONObject)jsonResponse.get("attributes");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void restartServer()
|
// API patch function on users doesnt work rn, it throws 500 errors, so it's probably not written yet
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public void setPassword(String id, String password)
|
||||||
{
|
{
|
||||||
clientAPI.setPower(server, PowerAction.RESTART).execute();
|
JSONObject json = new JSONObject();
|
||||||
|
json.put("password", password);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
FUtil.sendRequest(URL + "/api/application/users/" + id, "PATCH", ADMIN_HEADERS, json.toJSONString());
|
||||||
|
}
|
||||||
|
catch (IOException e)
|
||||||
|
{
|
||||||
|
FLog.severe(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getURL()
|
||||||
|
{
|
||||||
|
return URL;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getServerKey()
|
||||||
|
{
|
||||||
|
return SERVER_KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAdminKey()
|
||||||
|
{
|
||||||
|
return ADMIN_KEY;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getServerHeaders()
|
||||||
|
{
|
||||||
|
return SERVER_HEADERS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAdminHeaders()
|
||||||
|
{
|
||||||
|
return ADMIN_HEADERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isEnabled()
|
public boolean isEnabled()
|
||||||
|
@ -43,7 +43,6 @@ public class IndefiniteBan implements IConfig
|
|||||||
@Override
|
@Override
|
||||||
public void saveTo(ConfigurationSection cs)
|
public void saveTo(ConfigurationSection cs)
|
||||||
{
|
{
|
||||||
// The indefinite ban list is only intended to be modified manually. It is not intended to save.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -171,11 +171,6 @@ public class BlockBlocker extends FreedomService
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Groups.BANNERS.contains(event.getBlockPlaced().getType()))
|
if (Groups.BANNERS.contains(event.getBlockPlaced().getType()))
|
||||||
|
@ -36,9 +36,10 @@ public class InteractBlocker extends FreedomService
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
case LEFT_CLICK_AIR:
|
||||||
|
case LEFT_CLICK_BLOCK:
|
||||||
{
|
{
|
||||||
// Do nothing
|
//
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -157,11 +158,6 @@ public class InteractBlocker extends FreedomService
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,8 +1,6 @@
|
|||||||
package me.totalfreedom.totalfreedommod.command;
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
|
||||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -77,11 +75,9 @@ public class Command_blockcmd extends FreedomCommand
|
|||||||
FPlayer playerdata = plugin.pl.getPlayer(player);
|
FPlayer playerdata = plugin.pl.getPlayer(player);
|
||||||
if (!playerdata.allCommandsBlocked())
|
if (!playerdata.allCommandsBlocked())
|
||||||
{
|
{
|
||||||
FUtil.adminAction(sender.getName(), "Blocking all commands for " + player.getName(), true);
|
|
||||||
playerdata.setCommandsBlocked(true);
|
playerdata.setCommandsBlocked(true);
|
||||||
|
FUtil.adminAction(sender.getName(), "Blocking all commands for " + player.getName(), true);
|
||||||
msg("Blocked commands for " + player.getName() + ".");
|
msg("Blocked commands for " + player.getName() + ".");
|
||||||
|
|
||||||
plugin.pul.logPunishment(new Punishment(player.getName(), FUtil.getIp(player), sender.getName(), PunishmentType.BLOCKCMD, null));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package me.totalfreedom.totalfreedommod.command;
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
|
||||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
@ -130,8 +128,6 @@ public class Command_blockedit extends FreedomCommand
|
|||||||
|
|
||||||
msg(player2, "Your block modification abilities have been blocked.", ChatColor.RED);
|
msg(player2, "Your block modification abilities have been blocked.", ChatColor.RED);
|
||||||
msg("Blocked all block modification abilities for " + player2.getName());
|
msg("Blocked all block modification abilities for " + player2.getName());
|
||||||
|
|
||||||
plugin.pul.logPunishment(new Punishment(player2.getName(), FUtil.getIp(player2), sender.getName(), PunishmentType.BLOCKEDIT, null));
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package me.totalfreedom.totalfreedommod.command;
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
|
||||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
@ -127,7 +125,6 @@ public class Command_blockpvp extends FreedomCommand
|
|||||||
{
|
{
|
||||||
Command_smite.smite(sender, p, reason);
|
Command_smite.smite(sender, p, reason);
|
||||||
}
|
}
|
||||||
plugin.pul.logPunishment(new Punishment(p.getName(), FUtil.getIp(p), sender.getName(), PunishmentType.BLOCKPVP, null));
|
|
||||||
|
|
||||||
msg(p, "Your PVP has been disabled.", ChatColor.RED);
|
msg(p, "Your PVP has been disabled.", ChatColor.RED);
|
||||||
msg("Disabled PVP for " + p.getName());
|
msg("Disabled PVP for " + p.getName());
|
||||||
|
@ -5,8 +5,6 @@ import java.util.Arrays;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
|
||||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -85,22 +83,9 @@ public class Command_cage extends FreedomCommand
|
|||||||
msg("Invalid block!", ChatColor.RED);
|
msg("Invalid block!", ChatColor.RED);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outerMaterial == Material.PLAYER_HEAD)
|
|
||||||
{
|
|
||||||
FUtil.adminAction(sender.getName(), "Caging " + player.getName() + " in " + skullName, true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FUtil.adminAction(sender.getName(), "Caging " + player.getName(), true);
|
|
||||||
}
|
|
||||||
|
|
||||||
Location location = player.getLocation().clone().add(0.0, 1.0, 0.0);
|
Location location = player.getLocation().clone().add(0.0, 1.0, 0.0);
|
||||||
|
|
||||||
if (skullName != null)
|
if (skullName != null)
|
||||||
@ -111,9 +96,17 @@ public class Command_cage extends FreedomCommand
|
|||||||
{
|
{
|
||||||
fPlayer.getCageData().cage(location, outerMaterial, innerMaterial);
|
fPlayer.getCageData().cage(location, outerMaterial, innerMaterial);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
|
|
||||||
plugin.pul.logPunishment(new Punishment(player.getName(), FUtil.getIp(player), sender.getName(), PunishmentType.CAGE, null));
|
if (outerMaterial == Material.PLAYER_HEAD)
|
||||||
|
{
|
||||||
|
FUtil.adminAction(sender.getName(), "Caging " + player.getName() + " in " + skullName, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FUtil.adminAction(sender.getName(), "Caging " + player.getName(), true);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,12 +64,6 @@ public class Command_entitywipe extends FreedomCommand
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == EntityType.PLAYER)
|
|
||||||
{
|
|
||||||
msg("Player entities cannot be purged.", ChatColor.RED);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!getAllEntities().contains(type))
|
if (!getAllEntities().contains(type))
|
||||||
{
|
{
|
||||||
msg(FUtil.formatName(type.name()) + " is an entity, however: it is a mob.", ChatColor.RED);
|
msg(FUtil.formatName(type.name()) + " is an entity, however: it is a mob.", ChatColor.RED);
|
||||||
|
@ -23,12 +23,12 @@ public class Command_freeze extends FreedomCommand
|
|||||||
|
|
||||||
if (!gFreeze)
|
if (!gFreeze)
|
||||||
{
|
{
|
||||||
FUtil.adminAction(sender.getName(), "Unfreezing all players", false);
|
FUtil.adminAction(sender.getName(), "Disabling global player freeze", false);
|
||||||
msg("Players are now free to move.");
|
msg("Players are now free to move.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
FUtil.adminAction(sender.getName(), "Freezing all players", false);
|
FUtil.adminAction(sender.getName(), "Enabling global player freeze", false);
|
||||||
for (Player player : server.getOnlinePlayers())
|
for (Player player : server.getOnlinePlayers())
|
||||||
{
|
{
|
||||||
if (!isAdmin(player))
|
if (!isAdmin(player))
|
||||||
|
@ -35,8 +35,8 @@ public class Command_manageshop extends FreedomCommand
|
|||||||
}
|
}
|
||||||
switch (args[1])
|
switch (args[1])
|
||||||
{
|
{
|
||||||
|
|
||||||
case "add":
|
case "add":
|
||||||
{
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int amount = Math.max(0, Math.min(1000000, Integer.parseInt(args[2])));
|
int amount = Math.max(0, Math.min(1000000, Integer.parseInt(args[2])));
|
||||||
@ -75,9 +75,7 @@ public class Command_manageshop extends FreedomCommand
|
|||||||
msg("Invalid number: " + args[2], ChatColor.RED);
|
msg("Invalid number: " + args[2], ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
case "remove":
|
case "remove":
|
||||||
{
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int amount = Math.max(0, Math.min(1000000, Integer.parseInt(args[2])));
|
int amount = Math.max(0, Math.min(1000000, Integer.parseInt(args[2])));
|
||||||
@ -124,9 +122,7 @@ public class Command_manageshop extends FreedomCommand
|
|||||||
msg("Invalid number: " + args[2], ChatColor.RED);
|
msg("Invalid number: " + args[2], ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
case "set":
|
case "set":
|
||||||
{
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
int amount = Math.max(0, Math.min(1000000, Integer.parseInt(args[2])));
|
int amount = Math.max(0, Math.min(1000000, Integer.parseInt(args[2])));
|
||||||
@ -151,11 +147,6 @@ public class Command_manageshop extends FreedomCommand
|
|||||||
msg("Invalid number: " + args[2], ChatColor.RED);
|
msg("Invalid number: " + args[2], ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args[0].equals("items"))
|
else if (args[0].equals("items"))
|
||||||
|
@ -116,12 +116,8 @@ public class Command_notes extends FreedomCommand
|
|||||||
msg("Cleared " + count + " notes.", ChatColor.GREEN);
|
msg("Cleared " + count + " notes.", ChatColor.GREEN);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
package me.totalfreedom.totalfreedommod.command;
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
|
||||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -58,13 +56,11 @@ public class Command_orbit extends FreedomCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FUtil.adminAction(sender.getName(), "Orbiting " + player.getName(), false);
|
|
||||||
|
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
playerdata.startOrbiting(strength);
|
playerdata.startOrbiting(strength);
|
||||||
player.setVelocity(new Vector(0, strength, 0));
|
|
||||||
|
|
||||||
plugin.pul.logPunishment(new Punishment(player.getName(), FUtil.getIp(player), sender.getName(), PunishmentType.ORBIT, null));
|
player.setVelocity(new Vector(0, strength, 0));
|
||||||
|
FUtil.adminAction(sender.getName(), "Orbiting " + player.getName(), false);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -17,9 +17,11 @@ import org.bukkit.entity.Player;
|
|||||||
@CommandParameters(description = "Manage your Pterodactyl panel account", usage = "/<command> <create | delete>")
|
@CommandParameters(description = "Manage your Pterodactyl panel account", usage = "/<command> <create | delete>")
|
||||||
public class Command_panel extends FreedomCommand
|
public class Command_panel extends FreedomCommand
|
||||||
{
|
{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!plugin.ptero.isEnabled())
|
if (!plugin.ptero.isEnabled())
|
||||||
{
|
{
|
||||||
msg("Pterodactyl integration is currently disabled.", ChatColor.RED);
|
msg("Pterodactyl integration is currently disabled.", ChatColor.RED);
|
||||||
@ -30,7 +32,7 @@ public class Command_panel extends FreedomCommand
|
|||||||
|
|
||||||
if (playerData.getDiscordID() == null)
|
if (playerData.getDiscordID() == null)
|
||||||
{
|
{
|
||||||
msg("You must have a linked Discord account.", ChatColor.RED);
|
msg("You must have a linked discord account.", ChatColor.RED);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,11 +63,13 @@ public class Command_panel extends FreedomCommand
|
|||||||
}
|
}
|
||||||
|
|
||||||
plugin.ptero.addAccountToServer(id);
|
plugin.ptero.addAccountToServer(id);
|
||||||
|
|
||||||
admin.setPteroID(id);
|
admin.setPteroID(id);
|
||||||
plugin.al.save(admin);
|
plugin.al.save(admin);
|
||||||
plugin.al.updateTables();
|
plugin.al.updateTables();
|
||||||
|
|
||||||
plugin.dc.sendPteroInfo(playerData, username, password);
|
plugin.dc.sendPteroInfo(playerData, username, password);
|
||||||
msg("Successfully created your Pterodactyl account. Check your DMs from " + plugin.dc.formatBotTag() + " on Discord to get your credentials.", ChatColor.GREEN);
|
msg("Successfully created your Pterodactyl account. Check your DMs from " + plugin.dc.formatBotTag() + " on discord to get your credentials.", ChatColor.GREEN);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("delete"))
|
else if (args[0].equalsIgnoreCase("delete"))
|
||||||
@ -79,10 +83,18 @@ public class Command_panel extends FreedomCommand
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.ptero.deleteAccount(admin.getPteroID());
|
boolean deleted = plugin.ptero.deleteAccount(admin.getPteroID());
|
||||||
|
|
||||||
|
if (!deleted)
|
||||||
|
{
|
||||||
|
msg("Failed to delete your Pterodactyl account.", ChatColor.RED);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
admin.setPteroID(null);
|
admin.setPteroID(null);
|
||||||
plugin.al.save(admin);
|
plugin.al.save(admin);
|
||||||
plugin.al.updateTables();
|
plugin.al.updateTables();
|
||||||
|
|
||||||
msg("Successfully deleted your Pterodactyl account.", ChatColor.GREEN);
|
msg("Successfully deleted your Pterodactyl account.", ChatColor.GREEN);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,6 @@ public class Command_potion extends FreedomCommand
|
|||||||
switch (args.length)
|
switch (args.length)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
{
|
|
||||||
if (args[0].equalsIgnoreCase("list"))
|
if (args[0].equalsIgnoreCase("list"))
|
||||||
{
|
{
|
||||||
List<String> potionEffectTypeNames = new ArrayList<>();
|
List<String> potionEffectTypeNames = new ArrayList<>();
|
||||||
@ -59,10 +58,8 @@ public class Command_potion extends FreedomCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
{
|
|
||||||
if (args[0].equalsIgnoreCase("clear"))
|
if (args[0].equalsIgnoreCase("clear"))
|
||||||
{
|
{
|
||||||
Player target = playerSender;
|
Player target = playerSender;
|
||||||
@ -98,11 +95,9 @@ public class Command_potion extends FreedomCommand
|
|||||||
msg("Cleared all active potion effects " + (!target.equals(playerSender) ? "from player " + target.getName() + "." : "from yourself."), ChatColor.AQUA);
|
msg("Cleared all active potion effects " + (!target.equals(playerSender) ? "from player " + target.getName() + "." : "from yourself."), ChatColor.AQUA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
case 5:
|
case 5:
|
||||||
{
|
|
||||||
if (args[0].equalsIgnoreCase("add"))
|
if (args[0].equalsIgnoreCase("add"))
|
||||||
{
|
{
|
||||||
Player target = playerSender;
|
Player target = playerSender;
|
||||||
@ -172,11 +167,8 @@ public class Command_potion extends FreedomCommand
|
|||||||
+ (!target.equals(playerSender) ? " to player " + target.getName() + "." : " to yourself."), ChatColor.AQUA);
|
+ (!target.equals(playerSender) ? " to player " + target.getName() + "." : " to yourself."), ChatColor.AQUA);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -187,17 +179,14 @@ public class Command_potion extends FreedomCommand
|
|||||||
switch (args.length)
|
switch (args.length)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
{
|
|
||||||
List<String> arguments = new ArrayList<>(Arrays.asList("list", "clear", "add"));
|
List<String> arguments = new ArrayList<>(Arrays.asList("list", "clear", "add"));
|
||||||
if (plugin.al.isAdmin(sender))
|
if (plugin.al.isAdmin(sender))
|
||||||
{
|
{
|
||||||
arguments.add("clearall");
|
arguments.add("clearall");
|
||||||
}
|
}
|
||||||
return arguments;
|
return arguments;
|
||||||
}
|
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
{
|
|
||||||
if (args[0].equals("clear"))
|
if (args[0].equals("clear"))
|
||||||
{
|
{
|
||||||
if (plugin.al.isAdmin(sender))
|
if (plugin.al.isAdmin(sender))
|
||||||
@ -210,28 +199,22 @@ public class Command_potion extends FreedomCommand
|
|||||||
return getAllPotionTypes();
|
return getAllPotionTypes();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
{
|
|
||||||
if (args[0].equals("add"))
|
if (args[0].equals("add"))
|
||||||
{
|
{
|
||||||
return Collections.singletonList("<duration>");
|
return Collections.singletonList("<duration>");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case 4:
|
case 4:
|
||||||
{
|
|
||||||
if (args[0].equals("add"))
|
if (args[0].equals("add"))
|
||||||
{
|
{
|
||||||
return Collections.singletonList("<amplifier>");
|
return Collections.singletonList("<amplifier>");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case 5:
|
case 5:
|
||||||
{
|
|
||||||
if (plugin.al.isAdmin(sender))
|
if (plugin.al.isAdmin(sender))
|
||||||
{
|
{
|
||||||
if (args[0].equals("add"))
|
if (args[0].equals("add"))
|
||||||
@ -240,12 +223,6 @@ public class Command_potion extends FreedomCommand
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
@ -1,77 +0,0 @@
|
|||||||
package me.totalfreedom.totalfreedommod.command;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.bukkit.ChatColor;
|
|
||||||
import org.bukkit.command.Command;
|
|
||||||
import org.bukkit.command.CommandSender;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
import org.bukkit.scheduler.BukkitRunnable;
|
|
||||||
|
|
||||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
|
||||||
@CommandParameters(description = "Restart the server", usage = "/<command> [reason]")
|
|
||||||
public class Command_restart extends FreedomCommand
|
|
||||||
{
|
|
||||||
private static final Map<CommandSender, String> RESTART_CONFIRM = new HashMap<>();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
|
|
||||||
{
|
|
||||||
if (!plugin.ptero.isEnabled())
|
|
||||||
{
|
|
||||||
msg("Pterodactyl integration is currently disabled.", ChatColor.RED);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
String reason = "Server is restarting!";
|
|
||||||
|
|
||||||
if (args.length != 0)
|
|
||||||
{
|
|
||||||
reason = StringUtils.join(args, " ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sender.getName().equals("CONSOLE"))
|
|
||||||
{
|
|
||||||
restart(reason);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (RESTART_CONFIRM.containsKey(sender))
|
|
||||||
{
|
|
||||||
restart(RESTART_CONFIRM.get(sender));
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
msg("Warning: You're about to restart the server. Type /restart again to confirm you want to do this.");
|
|
||||||
|
|
||||||
RESTART_CONFIRM.put(sender, reason);
|
|
||||||
new BukkitRunnable()
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
if (RESTART_CONFIRM.containsKey(sender))
|
|
||||||
{
|
|
||||||
RESTART_CONFIRM.remove(sender);
|
|
||||||
msg("Restart request expired.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}.runTaskLater(plugin, 15 * 20);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void restart(String reason)
|
|
||||||
{
|
|
||||||
FUtil.bcastMsg("Server is restarting!", ChatColor.LIGHT_PURPLE);
|
|
||||||
|
|
||||||
for (Player player : server.getOnlinePlayers())
|
|
||||||
{
|
|
||||||
player.kickPlayer(ChatColor.LIGHT_PURPLE + reason);
|
|
||||||
}
|
|
||||||
|
|
||||||
RESTART_CONFIRM.remove(sender);
|
|
||||||
plugin.ptero.restartServer();
|
|
||||||
}
|
|
||||||
}
|
|
@ -20,6 +20,7 @@ public class Command_stop extends FreedomCommand
|
|||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
{
|
{
|
||||||
|
|
||||||
String reason = "Server is going offline, come back in about 20 seconds.";
|
String reason = "Server is going offline, come back in about 20 seconds.";
|
||||||
|
|
||||||
if (args.length != 0)
|
if (args.length != 0)
|
||||||
@ -38,6 +39,7 @@ 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);
|
||||||
@ -67,13 +69,6 @@ public class Command_stop extends FreedomCommand
|
|||||||
|
|
||||||
STOP_CONFIRM.remove(sender);
|
STOP_CONFIRM.remove(sender);
|
||||||
|
|
||||||
if (plugin.ptero.isEnabled())
|
server.shutdown();
|
||||||
{
|
|
||||||
plugin.ptero.stopServer();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
server.shutdown();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,11 +105,6 @@ public class Command_tag extends FreedomCommand
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.length >= 2)
|
else if (args.length >= 2)
|
||||||
@ -284,11 +279,6 @@ public class Command_tag extends FreedomCommand
|
|||||||
msg("Tag set to '" + outputTag + ChatColor.GRAY + "'." + (save ? " (Saved)" : "") + from + to);
|
msg("Tag set to '" + outputTag + ChatColor.GRAY + "'." + (save ? " (Saved)" : "") + from + to);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -16,12 +16,6 @@ import org.bukkit.entity.Player;
|
|||||||
@CommandParameters(description = "Toggles TotalFreedomMod settings", usage = "/<command> [option] [value] [value]")
|
@CommandParameters(description = "Toggles TotalFreedomMod settings", usage = "/<command> [option] [value] [value]")
|
||||||
public class Command_toggle extends FreedomCommand
|
public class Command_toggle extends FreedomCommand
|
||||||
{
|
{
|
||||||
private final List<String> toggles = Arrays.asList(
|
|
||||||
"waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk",
|
|
||||||
"firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke [range] [count]",
|
|
||||||
"explosives [radius]", "unsafeenchs", "bells", "armorstands", "structureblocks", "jigsaws", "grindstones",
|
|
||||||
"jukeboxes", "spawners", "4chan", "beehives", "respawnanchors", "autotp", "autoclear", "minecarts", "mp44",
|
|
||||||
"landmines", "tossmob", "gravity");
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||||
@ -29,10 +23,38 @@ public class Command_toggle extends FreedomCommand
|
|||||||
if (args.length == 0)
|
if (args.length == 0)
|
||||||
{
|
{
|
||||||
msg("Available toggles: ");
|
msg("Available toggles: ");
|
||||||
for (String toggle : toggles)
|
msg("- waterplace");
|
||||||
{
|
msg("- fireplace");
|
||||||
msg("- " + toggle);
|
msg("- lavaplace");
|
||||||
}
|
msg("- fluidspread");
|
||||||
|
msg("- lavadmg");
|
||||||
|
msg("- firespread");
|
||||||
|
msg("- frostwalk");
|
||||||
|
msg("- firework");
|
||||||
|
msg("- prelog");
|
||||||
|
msg("- lockdown");
|
||||||
|
msg("- petprotect");
|
||||||
|
msg("- entitywipe");
|
||||||
|
msg("- nonuke [range] [count]");
|
||||||
|
msg("- explosives [radius]");
|
||||||
|
msg("- unsafeenchs");
|
||||||
|
msg("- bells");
|
||||||
|
msg("- armorstands");
|
||||||
|
msg("- structureblocks");
|
||||||
|
msg("- jigsaws");
|
||||||
|
msg("- grindstones");
|
||||||
|
msg("- jukeboxes");
|
||||||
|
msg("- spawners");
|
||||||
|
msg("- 4chan");
|
||||||
|
msg("- beehives");
|
||||||
|
msg("- respawnanchors");
|
||||||
|
msg("- autotp");
|
||||||
|
msg("- autoclear");
|
||||||
|
msg("- minecarts");
|
||||||
|
msg("- landmines");
|
||||||
|
msg("- mp44");
|
||||||
|
msg("- tossmob");
|
||||||
|
msg("- gravity");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -282,16 +304,6 @@ public class Command_toggle extends FreedomCommand
|
|||||||
toggle("Block gravity is", ConfigEntry.ALLOW_GRAVITY);
|
toggle("Block gravity is", ConfigEntry.ALLOW_GRAVITY);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
msg("Available toggles: ");
|
|
||||||
for (String toggle : toggles)
|
|
||||||
{
|
|
||||||
msg("- " + toggle);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
package me.totalfreedom.totalfreedommod.command;
|
package me.totalfreedom.totalfreedommod.command;
|
||||||
|
|
||||||
import me.totalfreedom.totalfreedommod.punishments.Punishment;
|
|
||||||
import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
|
|
||||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
|
||||||
import org.apache.commons.lang.ArrayUtils;
|
import org.apache.commons.lang.ArrayUtils;
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -56,28 +53,25 @@ public class Command_warn extends FreedomCommand
|
|||||||
|
|
||||||
String warnReason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " ");
|
String warnReason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " ");
|
||||||
player.sendTitle(ChatColor.RED + "You've been warned.", ChatColor.YELLOW + "Reason: " + warnReason, 20, 100, 60);
|
player.sendTitle(ChatColor.RED + "You've been warned.", ChatColor.YELLOW + "Reason: " + warnReason, 20, 100, 60);
|
||||||
msg(player, ChatColor.RED + "[WARNING] You received a warning from " + sender.getName() + ": " + warnReason);
|
msg(ChatColor.GREEN + "You have successfully warned " + player.getName());
|
||||||
plugin.pl.getPlayer(player).incrementWarnings(quiet);
|
|
||||||
plugin.pul.logPunishment(new Punishment(player.getName(), FUtil.getIp(player), sender.getName(), PunishmentType.WARN, warnReason));
|
|
||||||
|
|
||||||
if (quiet)
|
if (quiet)
|
||||||
{
|
{
|
||||||
msg("You have successfully warned " + player.getName() + " quietly.");
|
msg("Warned " + player.getName() + " quietly");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
String adminNotice = ChatColor.RED +
|
|
||||||
sender.getName() +
|
|
||||||
" - " +
|
|
||||||
"Warning: " +
|
|
||||||
player.getName() +
|
|
||||||
" - Reason: " +
|
|
||||||
ChatColor.YELLOW +
|
|
||||||
warnReason;
|
|
||||||
plugin.al.messageAllAdmins(adminNotice);
|
|
||||||
|
|
||||||
msg("You have successfully warned " + player.getName() + ".");
|
msg(player, ChatColor.RED + "[WARNING] You received a warning from " + sender.getName() + ": " + warnReason);
|
||||||
}
|
String adminNotice = ChatColor.RED +
|
||||||
|
sender.getName() +
|
||||||
|
" - " +
|
||||||
|
"Warning: " +
|
||||||
|
player.getName() +
|
||||||
|
" - Reason: " +
|
||||||
|
ChatColor.YELLOW +
|
||||||
|
warnReason;
|
||||||
|
plugin.al.messageAllAdmins(adminNotice);
|
||||||
|
plugin.pl.getPlayer(player).incrementWarnings();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -91,7 +91,7 @@ public enum ConfigEntry
|
|||||||
PTERO_DEFAULT_EMAIL_DOMAIN(String.class, "ptero.default_email_domain"),
|
PTERO_DEFAULT_EMAIL_DOMAIN(String.class, "ptero.default_email_domain"),
|
||||||
PTERO_SERVER_UUID(String.class, "ptero.server_uuid"),
|
PTERO_SERVER_UUID(String.class, "ptero.server_uuid"),
|
||||||
PTERO_ADMIN_KEY(String.class, "ptero.admin_key"),
|
PTERO_ADMIN_KEY(String.class, "ptero.admin_key"),
|
||||||
PTERO_CLIENT_KEY(String.class, "ptero.client_key"),
|
PTERO_SERVER_KEY(String.class, "ptero.server_key"),
|
||||||
//
|
//
|
||||||
SHOP_ENABLED(Boolean.class, "shop.enabled"),
|
SHOP_ENABLED(Boolean.class, "shop.enabled"),
|
||||||
SHOP_TITLE(String.class, "shop.title"),
|
SHOP_TITLE(String.class, "shop.title"),
|
||||||
|
@ -128,7 +128,7 @@ public class ItemFun extends FreedomService
|
|||||||
|
|
||||||
LivingEntity livingEntity = (LivingEntity)event.getRightClicked();
|
LivingEntity livingEntity = (LivingEntity)event.getRightClicked();
|
||||||
EntityType entityType = livingEntity.getType();
|
EntityType entityType = livingEntity.getType();
|
||||||
if (entityType != fPlayer.mobThrowerCreature())
|
if (!(entityType == fPlayer.mobThrowerCreature()))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -304,11 +304,6 @@ public class ItemFun extends FreedomService
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ public class Landminer extends FreedomService
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.getLocation().distanceSquared(location) > (landmine.radius * landmine.radius))
|
if (!(player.getLocation().distanceSquared(location) <= (landmine.radius * landmine.radius)))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -79,20 +79,11 @@ public class Module_list extends HTTPDModule
|
|||||||
switch (admin.getRank())
|
switch (admin.getRank())
|
||||||
{
|
{
|
||||||
case ADMIN:
|
case ADMIN:
|
||||||
{
|
|
||||||
admins.add(player.getName());
|
admins.add(player.getName());
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case SENIOR_ADMIN:
|
case SENIOR_ADMIN:
|
||||||
{
|
|
||||||
senioradmins.add(player.getName());
|
senioradmins.add(player.getName());
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -51,20 +51,11 @@ public class Module_players extends HTTPDModule
|
|||||||
switch (admin.getRank())
|
switch (admin.getRank())
|
||||||
{
|
{
|
||||||
case ADMIN:
|
case ADMIN:
|
||||||
{
|
|
||||||
admins.add(username);
|
admins.add(username);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case SENIOR_ADMIN:
|
case SENIOR_ADMIN:
|
||||||
{
|
|
||||||
senioradmins.add(username);
|
senioradmins.add(username);
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
// Do nothing
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -429,19 +429,14 @@ public class FPlayer
|
|||||||
this.warningCount = warningCount;
|
this.warningCount = warningCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void incrementWarnings(boolean quiet)
|
public void incrementWarnings()
|
||||||
{
|
{
|
||||||
this.warningCount++;
|
this.warningCount++;
|
||||||
|
|
||||||
if (this.warningCount % 2 == 0)
|
if (this.warningCount % 2 == 0)
|
||||||
{
|
{
|
||||||
Player p = getPlayer();
|
Player p = getPlayer();
|
||||||
|
p.getWorld().strikeLightning(p.getLocation());
|
||||||
if (!quiet)
|
|
||||||
{
|
|
||||||
p.getWorld().strikeLightning(p.getLocation());
|
|
||||||
}
|
|
||||||
|
|
||||||
FUtil.playerMsg(p, ChatColor.RED + "You have been warned at least twice now, make sure to read the rules at " + ConfigEntry.SERVER_BAN_URL.getString());
|
FUtil.playerMsg(p, ChatColor.RED + "You have been warned at least twice now, make sure to read the rules at " + ConfigEntry.SERVER_BAN_URL.getString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,5 @@ public enum PunishmentType
|
|||||||
KICK,
|
KICK,
|
||||||
TEMPBAN,
|
TEMPBAN,
|
||||||
BAN,
|
BAN,
|
||||||
DOOM,
|
DOOM
|
||||||
WARN,
|
|
||||||
CAGE,
|
|
||||||
BLOCKEDIT,
|
|
||||||
BLOCKPVP,
|
|
||||||
BLOCKCMD,
|
|
||||||
ORBIT
|
|
||||||
}
|
}
|
||||||
|
@ -85,23 +85,18 @@ discord:
|
|||||||
# Owner role ID
|
# Owner role ID
|
||||||
server_owner_role_id: ''
|
server_owner_role_id: ''
|
||||||
|
|
||||||
# Pterodactyl (requires Discord verification to be enabled)
|
# Pterodactyl
|
||||||
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'
|
||||||
# Long Server UUID (for example: abf9a712-6c5a-4504-b4bc-37f1061b8801)
|
# Server UUID
|
||||||
# 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: ''
|
||||||
# Client API key
|
# Server API key
|
||||||
# Create a new user and add them as a subuser to the server with all control privileges.
|
server_key: ''
|
||||||
# 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:
|
||||||
|
@ -1,50 +1,16 @@
|
|||||||
#
|
#
|
||||||
# TotalFreedomMod 5.5 Permissions
|
# TotalFreedomMod Permissions
|
||||||
# by ZeroEpoch1969
|
# by ZeroEpoch1969
|
||||||
#
|
#
|
||||||
|
|
||||||
# Note that every group inherits the previous groups' permissions
|
# Note that every group inherits the previous groups' permissions
|
||||||
# Meaning Telnet Admins have the permissions of Operators and Super Admins, and etc
|
# Meaning Senior Admins have the permissions of Operators and Admins, and etc
|
||||||
|
|
||||||
# This is used to remove all permission begging with the root node
|
# This is used to remove all permission begging with the root node
|
||||||
# This is useful when a plugin gives all permissions to a player because they are opped
|
# This is useful when a plugin gives all permissions to a player because they are opped
|
||||||
remove:
|
remove:
|
||||||
- "voxelsniper"
|
- "voxelsniper"
|
||||||
- "bending.admin"
|
- "bending"
|
||||||
- "bending.ability.Cleanse"
|
|
||||||
- "worldedit.brush.apply"
|
|
||||||
- "essentials.near.exclude"
|
|
||||||
- "plots.admin"
|
|
||||||
- "plots.debugroadregen"
|
|
||||||
- "plots.debugclaimtest"
|
|
||||||
- "plots.debugpaste"
|
|
||||||
- "plots.debugallowunsafe"
|
|
||||||
- "plots.debugloadtest"
|
|
||||||
- "plots.debugsavetest"
|
|
||||||
- "plots.cluster"
|
|
||||||
#Crackshot
|
|
||||||
- "crackshot.bypass.all"
|
|
||||||
#NetworkManager
|
|
||||||
- "networkmanager.*"
|
|
||||||
- "networkmanager.notify.joinbanned"
|
|
||||||
- "networkmanager.notify.*"
|
|
||||||
- "networkmanager.announce.global"
|
|
||||||
- "networkmanager.announce"
|
|
||||||
- "networkmanager.chatlock"
|
|
||||||
- "networkmanager.clearchat.bypass"
|
|
||||||
- "networkmanager.clearchat.*"
|
|
||||||
- "networkmanager.notify.ticket.new"
|
|
||||||
- "networkmanager.lookup"
|
|
||||||
- "networkmanager.maintenance.*"
|
|
||||||
- "networkmanager.permissions"
|
|
||||||
- "networkmanager.reports"
|
|
||||||
- "networkmanager.tickets"
|
|
||||||
- "networkmanager.chatlock.bypass"
|
|
||||||
- "networkmanager.anticaps.bypass"
|
|
||||||
- "networkmanager.antispam.bypass"
|
|
||||||
- "networkmanager.commandblocker.bypass"
|
|
||||||
- "networkmanager.tags.*"
|
|
||||||
|
|
||||||
|
|
||||||
# Operator permission nodes
|
# Operator permission nodes
|
||||||
operators:
|
operators:
|
||||||
@ -70,10 +36,7 @@ operators:
|
|||||||
- "worldedit.removebelow"
|
- "worldedit.removebelow"
|
||||||
- "worldedit.removenear"
|
- "worldedit.removenear"
|
||||||
- "worldedit.replacenear"
|
- "worldedit.replacenear"
|
||||||
- "worldedit.brush.*"
|
|
||||||
- "worldedit.global-mask"
|
|
||||||
- "worldedit.fill"
|
|
||||||
- "worldedit.fill.recursive"
|
|
||||||
# LibsDisguises
|
# LibsDisguises
|
||||||
- "libsdisguises.noactionbar"
|
- "libsdisguises.noactionbar"
|
||||||
|
|
||||||
@ -83,66 +46,6 @@ operators:
|
|||||||
- "worldguard.region.removemember.own.*"
|
- "worldguard.region.removemember.own.*"
|
||||||
- "worldguard.region.info.*"
|
- "worldguard.region.info.*"
|
||||||
|
|
||||||
# Bending
|
|
||||||
- "bending.command.add"
|
|
||||||
- "bending.command.bind"
|
|
||||||
- "bending.command.check"
|
|
||||||
- "bending.command.choose"
|
|
||||||
- "bending.command.rechoose"
|
|
||||||
- "bending.command.clear"
|
|
||||||
- "bending.command.copy"
|
|
||||||
- "bending.command.display"
|
|
||||||
- "bending.command.help"
|
|
||||||
- "bending.command.invincible"
|
|
||||||
- "bending.command.preset"
|
|
||||||
- "bending.command.preset.list"
|
|
||||||
- "bending.command.preset.create"
|
|
||||||
- "bending.command.preset.delete"
|
|
||||||
- "bending.command.preset.bind"
|
|
||||||
- "bending.command.preset.bind.assign"
|
|
||||||
- "bending.command.preset.bind.external"
|
|
||||||
- "bending.command.toggle"
|
|
||||||
- "bending.command.version"
|
|
||||||
- "bending.command.who"
|
|
||||||
- "bending.earth"
|
|
||||||
- "bending.air"
|
|
||||||
- "bending.fire"
|
|
||||||
- "bending.water"
|
|
||||||
- "bending.water.bloodbending.anytime"
|
|
||||||
- "bending.ability.AvatarState"
|
|
||||||
- "bending.command.add.chi"
|
|
||||||
- "bending.command.choose.chi"
|
|
||||||
- "bending.ability.Paralyze"
|
|
||||||
- "bending.ability.RapidPunch"
|
|
||||||
- "bending.ability.Smokescreen"
|
|
||||||
- "bending.ability.WarriorStance"
|
|
||||||
- "bending.ability.AcrobatStance"
|
|
||||||
- "bending.ability.QuickStrike"
|
|
||||||
- "bending.ability.SwiftKick"
|
|
||||||
- "bending.ability.ChiCombo"
|
|
||||||
- "bending.chi.passive"
|
|
||||||
- "bending.ability.MetalClips.throw"
|
|
||||||
- "bending.ability.AirCombo"
|
|
||||||
- "bending.ability.Flight"
|
|
||||||
- "bending.ability.WaterCombo"
|
|
||||||
- "bending.ability.EarthCombo"
|
|
||||||
- "bending.ability.FireCombo"
|
|
||||||
- "bending.ability.ChiCombo"
|
|
||||||
- "bending.air.passive"
|
|
||||||
- "bending.chi.passive"
|
|
||||||
- "bending.earth.passive"
|
|
||||||
- "bending.fire.passive"
|
|
||||||
- "bending.water.passive"
|
|
||||||
# NetworkManager
|
|
||||||
- "networkmanager.chatlog"
|
|
||||||
- "networkmanager.find"
|
|
||||||
- "networkmanager.gtps"
|
|
||||||
- "networkmanager.lookup"
|
|
||||||
- "networkmanager.slashserver.*"
|
|
||||||
- "networkmanager.notification.join"
|
|
||||||
- "networkmanager.party.nolimit"
|
|
||||||
- "networkmanager.tabcompletechat"
|
|
||||||
|
|
||||||
# Master Builder permission nodes
|
# Master Builder permission nodes
|
||||||
master_builders:
|
master_builders:
|
||||||
- "worldedit.tool.*"
|
- "worldedit.tool.*"
|
||||||
@ -159,22 +62,10 @@ master_builders:
|
|||||||
|
|
||||||
# Admin permission nodes
|
# Admin permission nodes
|
||||||
admins:
|
admins:
|
||||||
|
- "coreprotect.*"
|
||||||
- "worldedit.*"
|
- "worldedit.*"
|
||||||
- "worldguard.*"
|
- "worldguard.*"
|
||||||
- "bending.admin.remove"
|
- "bending.*"
|
||||||
- "bending.command.toggle.all"
|
|
||||||
- "bending.admin.toggle"
|
|
||||||
- "bending.command.reload"
|
|
||||||
- "plots.cluster"
|
|
||||||
- "networkmanager.adminchat"
|
|
||||||
- "networkmanager.announce.server"
|
|
||||||
- "networkmanager.socialspy"
|
|
||||||
- "networkmanager.fullproxy.bypass"
|
|
||||||
- "networkmanager.lookup.ip"
|
|
||||||
#Crackshot
|
|
||||||
- "crackshot.bypass.all"
|
|
||||||
|
|
||||||
# Senior Admin permission nodes
|
# Senior Admin permission nodes
|
||||||
senior_admins:
|
senior_admins: []
|
||||||
- "bending.admin.permaremove"
|
|
||||||
- "bending.ability.Cleanse"
|
|
||||||
|
Reference in New Issue
Block a user