mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-01 20:46:41 +00:00
Compare commits
79 Commits
2021-02-RC
...
2021.04-RC
Author | SHA1 | Date | |
---|---|---|---|
c8b20bc255 | |||
f240a15af3 | |||
6073712fdf | |||
d11d55b218 | |||
debb95fb4c | |||
b9f7ab3ec3 | |||
2cdf1e66a6 | |||
20c2c4c96e | |||
d5238150d0 | |||
64a4e70c41 | |||
0c2f0a714c | |||
4c67553bdd | |||
ffab5e3c12 | |||
f7556a4861 | |||
385fc77771 | |||
b852ea1822 | |||
4a5a3a1a2d | |||
37762e5470 | |||
85d90090c8 | |||
09930c2d9a | |||
7ae1ab035a | |||
2bd1787663 | |||
765b7dcc4b | |||
091381a076 | |||
27dfd71b2e | |||
16e06bd932 | |||
a33c310757 | |||
df21bdfa7e | |||
d7e2c0da42 | |||
a7529b41fb | |||
c4fce3f0f9 | |||
27f5f18962 | |||
dca5e30291 | |||
09a435053e | |||
14309275fb | |||
2375e92d90 | |||
97672c2fff | |||
5837b05a35 | |||
b3b68ebd13 | |||
2dbbb5c262 | |||
e45655edbb | |||
9713fcabd6 | |||
dc10c40578 | |||
db3c190b2b | |||
2725857364 | |||
9f291f675c | |||
561c192c27 | |||
086dec28ac | |||
b03870c0aa | |||
f5c08cd28b | |||
2a87271642 | |||
3b57aec0e8 | |||
efac65bc76 | |||
9c8fe6c590 | |||
9f52cdf753 | |||
216234ea01 | |||
881dead392 | |||
ff2bca26aa | |||
89ad934aa6 | |||
d0a195647c | |||
eb05b05042 | |||
b9c1970d20 | |||
9eca9ac5b2 | |||
5b577fae07 | |||
452a8755c2 | |||
2fb8f224e7 | |||
b6a2c8e021 | |||
f0a25fde0c | |||
4324497831 | |||
14c53b7370 | |||
0396b8ad86 | |||
8ee7486afc | |||
694d9614c5 | |||
150e25072a | |||
7d990ae2c0 | |||
0dd5a26efa | |||
5c097c83cb | |||
a85dd014a0 | |||
342df43f85 |
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@ -37,6 +37,12 @@ jobs:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Java JDK
|
||||
uses: actions/setup-java@v1.4.3
|
||||
with:
|
||||
# The Java version to make available on the path. Takes a whole or semver Java version, or 1.x syntax (e.g. 1.8 => Java 8.x). Early access versions can be specified in the form of e.g. 14-ea, 14.0.0-ea, or 14.0.0-ea.28
|
||||
java-version: 11
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v1
|
||||
|
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
@ -12,6 +12,6 @@ jobs:
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
java-version: 11
|
||||
- name: Build with Maven
|
||||
run: mvn -B package --file pom.xml
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -25,6 +25,7 @@ manifest.mf
|
||||
/.idea/workspace.xml
|
||||
/.idea/uiDesigner.xml
|
||||
/.idea/libraries
|
||||
/.idea/
|
||||
*.iml
|
||||
|
||||
# Maven excludes
|
||||
|
@ -1,3 +1,3 @@
|
||||
# Contributing to TotalFreedomMod #
|
||||
# Contributing to TotalFreedomMod
|
||||
|
||||
For information about contributing to TotalFreedomMod, please see the [contributing guidelines](https://github.com/TotalFreedom/TotalFreedomMod/wiki/Contributing).
|
17
LICENSE.md
17
LICENSE.md
@ -1,4 +1,5 @@
|
||||
# TotalFreedom General License #
|
||||
# TotalFreedom General License
|
||||
|
||||
_Version 2.0, 27th February 2015_
|
||||
|
||||
Copyright (c) 2011 Steven Lawson
|
||||
@ -7,7 +8,8 @@ Copyright (c) 2012 Jerom van der Sar
|
||||
|
||||
All rights reserved.
|
||||
|
||||
##### 1. Definitions #####
|
||||
##### 1. Definitions
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by this document.
|
||||
|
||||
"Licensor" shall mean the copyright holder or entity authorised by the copyright owner that is granting the License.
|
||||
@ -30,8 +32,9 @@ All rights reserved.
|
||||
|
||||
"Redistribution" shall mean any partial or complete availability, transfer or publication of the Work from one Legal Entity to another.
|
||||
|
||||
##### 2. Grant of Copyright License #####
|
||||
Subject to the terms and conditions of this License, You are granted a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to prepare Derivative Works of, publicly display, publicly perform, inspect and redistribute the Work and such Derivative Works as long as the following conditions are met:
|
||||
##### 2. Grant of Copyright License
|
||||
|
||||
Subject to the terms and conditions of this License, You are granted a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to prepare Derivative Works of, publicly display, publicly perform, inspect and redistribute the Work and such Derivative Works as long as the following conditions are met:
|
||||
|
||||
1. Redistributions of This Software must solely occur in Source form. Redistribution in Object form is prohibited without prior written permission from the Licensor.
|
||||
|
||||
@ -47,8 +50,10 @@ All rights reserved.
|
||||
|
||||
7. Sub licensing of This Software is prohibited without prior written permission from the Licensor.
|
||||
|
||||
##### 3. Submission of Contributions #####
|
||||
##### 3. Submission of Contributions
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
##### 4. Disclaimer of Warranty #####
|
||||
##### 4. Disclaimer of Warranty
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
@ -1,16 +1,17 @@
|
||||
# TotalFreedomMod [](https://travis-ci.com/AtlasMediaGroup/TotalFreedomMod) [](https://www.codacy.com/gh/AtlasMediaGroup/TotalFreedomMod/dashboard?utm_source=github.com&utm_medium=referral&utm_content=AtlasMediaGroup/TotalFreedomMod&utm_campaign=Badge_Grade)
|
||||
# TotalFreedomMod [](https://travis-ci.com/AtlasMediaGroup/TotalFreedomMod) [](https://www.codacy.com/gh/AtlasMediaGroup/TotalFreedomMod/dashboard?utm_source=github.com&utm_medium=referral&utm_content=AtlasMediaGroup/TotalFreedomMod&utm_campaign=Badge_Grade)
|
||||
|
||||
TotalFreedomMod is a CraftBukkit server plugin designed primarily to support the [Official TotalFreedom Minecraft Server](https://totalfreedom.me/). However, you are more than welcome to adapt the source for your own server.
|
||||
|
||||
This plugin was originally coded by StevenLawson (Madgeek1450), with Jerom van der Sar (Prozza) becoming heavily involved in its development some time later. It consists of over 85 custom coded commands and a large variety of distinguishable features not included in any other plugin. The plugin has since its beginning grown immensely. Together, with the main TotalFreedom server, TotalFreedomMod has a long-standing reputation of effectiveness whilst maintaining a clear feeling of openness towards the administrators and the players themselves.
|
||||
|
||||
### Contributing ###
|
||||
### Contributing
|
||||
|
||||
Please see [CONTRIBUTING.md](CONTRIBUTING.md) if you are interested in developing TotalFreedomMod.
|
||||
|
||||
For information on how TotalFreedomMod is licensed, please see [LICENSE.md](LICENSE.md).
|
||||
|
||||
For information on our security policy and reporting an issue, please see [SECURITY.md](SECURITY.md)
|
||||
|
||||
### Compiling ###
|
||||
### Compiling
|
||||
|
||||
You need Maven to build. You'd also need to set the JDK version to Java 8 as that is the current standard as of now.
|
||||
|
@ -7,7 +7,9 @@ We currently support the code running on the "development" branch of this reposi
|
||||
In terms of plugin releases, we support the following versions:
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| ------------------- | ------------------ |
|
||||
| 2021.04 | :white_check_mark: |
|
||||
| 2021.02 | :white_check_mark: |
|
||||
| 2020.11 | :white_check_mark: |
|
||||
| 6.0.x (Pre-Release) | :x: |
|
||||
| < 2020.11 | :x: |
|
||||
|
@ -2,20 +2,16 @@
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
|
||||
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
|
||||
|
||||
<module name="Checker">
|
||||
<property name="charset" value="UTF-8"/>
|
||||
<property name="severity" value="warning"/>
|
||||
<property name="fileExtensions" value="java, properties, xml"/>
|
||||
|
||||
<module name="SuppressionFilter">
|
||||
<property name="file" value="supressions.xml"/>
|
||||
</module>
|
||||
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="IllegalTokenText">
|
||||
@ -91,7 +87,7 @@
|
||||
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ClassTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9][_]*[T]$)"/>
|
||||
<property name="format" value="(^[A-Z][a-zA-Z0-9]*$)|([A-Z][a-zA-Z0-9]*[_][a-zA-Z0-9]*$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
@ -112,7 +108,8 @@
|
||||
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="OverloadMethodsDeclarationOrder"/>
|
||||
<module name="CustomImportOrder"/><!-- http://checkstyle.sourceforge.net/config_imports.html -->
|
||||
<module name="CustomImportOrder"/>
|
||||
<!-- http://checkstyle.sourceforge.net/config_imports.html -->
|
||||
<module name="MethodParamPad"/>
|
||||
<module name="OperatorWrap">
|
||||
<property name="option" value="NL"/>
|
||||
|
10
pom.xml
10
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<artifactId>TotalFreedomMod</artifactId>
|
||||
<version>2021.02-RC02</version>
|
||||
<version>2021.04-RC02</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
@ -75,9 +75,9 @@
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>jcenter</id>
|
||||
<name>jcenter-bintray</name>
|
||||
<url>https://jcenter.bintray.com</url>
|
||||
<id>dv8tion</id>
|
||||
<name>m2-dv8tion</name>
|
||||
<url>https://m2.dv8tion.net/releases/</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
@ -191,7 +191,7 @@
|
||||
<dependency>
|
||||
<groupId>net.dv8tion</groupId>
|
||||
<artifactId>JDA</artifactId>
|
||||
<version>4.2.0_224</version>
|
||||
<version>4.2.1_255</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
@ -11,10 +10,12 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerKickEvent;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class AntiSpam extends FreedomService
|
||||
{
|
||||
|
||||
@ -22,7 +23,7 @@ public class AntiSpam extends FreedomService
|
||||
public static final int TICKS_PER_CYCLE = 2 * 10;
|
||||
//
|
||||
public BukkitTask cycleTask = null;
|
||||
List<Player> markedForDeath = new ArrayList<>();
|
||||
private Map<Player, Integer> muteCounts = new HashMap<>();
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
@ -67,24 +68,27 @@ public class AntiSpam extends FreedomService
|
||||
return;
|
||||
}
|
||||
|
||||
String message = event.getMessage().trim();
|
||||
|
||||
final FPlayer playerdata = plugin.pl.getPlayerSync(player);
|
||||
int count = muteCounts.getOrDefault(player, 0);
|
||||
int minutes = ConfigEntry.ANTISPAM_MINUTES.getInteger();
|
||||
|
||||
// Check for spam
|
||||
if (playerdata.incrementAndGetMsgCount() > MSG_PER_CYCLE)
|
||||
if (playerdata.incrementAndGetMsgCount() > MSG_PER_CYCLE && !playerdata.isMuted())
|
||||
{
|
||||
if (!markedForDeath.contains(player))
|
||||
{
|
||||
markedForDeath.add(player);
|
||||
FSync.bcastMsg(player.getName() + " was automatically kicked for spamming chat.", ChatColor.RED);
|
||||
FSync.autoEject(player, "Kicked for spamming chat.");
|
||||
count++;
|
||||
muteCounts.put(player, count);
|
||||
|
||||
int time = count * minutes;
|
||||
playerdata.setMuted(true, time);
|
||||
|
||||
FSync.bcastMsg(String.format("%s has automatically been muted for %d minutes for spamming chat.",
|
||||
player.getName(),
|
||||
time),
|
||||
ChatColor.RED);
|
||||
|
||||
playerdata.resetMsgCount();
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
else if (playerdata.incrementAndGetMsgCount() > MSG_PER_CYCLE / 2)
|
||||
{
|
||||
FUtil.playerMsg(player, "Please refrain from spamming chat.", ChatColor.GRAY);
|
||||
@ -122,10 +126,4 @@ public class AntiSpam extends FreedomService
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerKick(PlayerKickEvent event)
|
||||
{
|
||||
markedForDeath.remove(event.getPlayer());
|
||||
}
|
||||
}
|
@ -159,13 +159,10 @@ public class ChatManager extends FreedomService
|
||||
FLog.info("[ADMIN] " + sender.getName() + " " + display.getTag() + ": " + message, true);
|
||||
plugin.dc.messageAdminChatChannel(sender.getName() + " \u00BB " + message);
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.al.isAdmin(player))
|
||||
server.getOnlinePlayers().stream().filter(player -> plugin.al.isAdmin(player)).forEach(player ->
|
||||
{
|
||||
Admin admin = plugin.al.getAdmin(player);
|
||||
if (!Strings.isNullOrEmpty(admin.getAcFormat()))
|
||||
{
|
||||
if (!Strings.isNullOrEmpty(admin.getAcFormat())) {
|
||||
String format = admin.getAcFormat();
|
||||
ChatColor color = getColor(display);
|
||||
String msg = format.replace("%name%", sender.getName()).replace("%rank%", display.getAbbr()).replace("%rankcolor%", color.toString()).replace("%msg%", message);
|
||||
@ -175,8 +172,7 @@ public class ChatManager extends FreedomService
|
||||
{
|
||||
player.sendMessage("[" + ChatColor.AQUA + "ADMIN" + ChatColor.WHITE + "] " + ChatColor.DARK_RED + sender.getName() + ChatColor.DARK_GRAY + " [" + getColoredTag(display) + ChatColor.DARK_GRAY + "]" + ChatColor.WHITE + ": " + ChatColor.GOLD + FUtil.colorize(message));
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void reportAction(Player reporter, Player reported, String report)
|
||||
|
@ -246,7 +246,7 @@ public class LoginProcess extends FreedomService
|
||||
FLog.info(noteMessage);
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
{
|
||||
if (plugin.al.isAdminImpostor(p))
|
||||
if (plugin.al.isAdmin(p))
|
||||
{
|
||||
notice.send(p);
|
||||
}
|
||||
|
@ -28,7 +28,6 @@ import me.totalfreedom.totalfreedommod.command.CommandLoader;
|
||||
import me.totalfreedom.totalfreedommod.config.MainConfig;
|
||||
import me.totalfreedom.totalfreedommod.discord.Discord;
|
||||
import me.totalfreedom.totalfreedommod.freeze.Freezer;
|
||||
import me.totalfreedom.totalfreedommod.fun.CurseListener;
|
||||
import me.totalfreedom.totalfreedommod.fun.ItemFun;
|
||||
import me.totalfreedom.totalfreedommod.fun.Jumppads;
|
||||
import me.totalfreedom.totalfreedommod.fun.Landminer;
|
||||
@ -116,7 +115,6 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public Monitors mo;
|
||||
public MovementValidator mv;
|
||||
public ServerPing sp;
|
||||
public CurseListener cul;
|
||||
public ItemFun it;
|
||||
public Landminer lm;
|
||||
public MP44 mp;
|
||||
@ -368,7 +366,6 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
private void initFun()
|
||||
{
|
||||
// Fun
|
||||
cul = new CurseListener();
|
||||
it = new ItemFun();
|
||||
lm = new Landminer();
|
||||
mp = new MP44();
|
||||
|
@ -25,17 +25,9 @@ public class Admin
|
||||
private boolean active = true;
|
||||
private Rank rank = Rank.ADMIN;
|
||||
private Date lastLogin = new Date();
|
||||
|
||||
|
||||
private Boolean commandSpy = false;
|
||||
|
||||
|
||||
private Boolean potionSpy = false;
|
||||
|
||||
|
||||
private String acFormat = null;
|
||||
|
||||
|
||||
private String pteroID = null;
|
||||
|
||||
public Admin(Player player)
|
||||
|
@ -22,8 +22,7 @@ import org.bukkit.entity.Player;
|
||||
public class AdminList extends FreedomService
|
||||
{
|
||||
public static final List<String> vanished = new ArrayList<>();
|
||||
public final List<String> verifiedNoAdmin = new ArrayList<>();
|
||||
public final Map<String, List<String>> verifiedNoAdminIps = Maps.newHashMap();
|
||||
public final Map<String, List<String>> verifiedNoAdmin = Maps.newHashMap();
|
||||
private final Set<Admin> allAdmins = Sets.newHashSet(); // Includes disabled admins
|
||||
// Only active admins below
|
||||
private final Set<Admin> activeAdmins = Sets.newHashSet();
|
||||
@ -240,8 +239,7 @@ public class AdminList extends FreedomService
|
||||
|
||||
public boolean isVerifiedAdmin(Player player)
|
||||
{
|
||||
// Fix of issue FS-33
|
||||
return !verifiedNoAdmin.contains(player.getName()) || verifiedNoAdminIps.containsKey(player.getName()) && !verifiedNoAdminIps.get(player.getName()).contains(FUtil.getIp(player));
|
||||
return verifiedNoAdmin.containsKey(player.getName()) && verifiedNoAdmin.get(player.getName()).contains(FUtil.getIp(player));
|
||||
}
|
||||
|
||||
public boolean isIdentityMatched(Player player)
|
||||
@ -404,13 +402,8 @@ public class AdminList extends FreedomService
|
||||
return ipTable;
|
||||
}
|
||||
|
||||
public List<String> getVerifiedNoAdmin()
|
||||
public Map<String, List<String>> getVerifiedNoAdmin()
|
||||
{
|
||||
return verifiedNoAdmin;
|
||||
}
|
||||
|
||||
public Map<String, List<String>> getVerifiedNoAdminIps()
|
||||
{
|
||||
return verifiedNoAdminIps;
|
||||
}
|
||||
}
|
@ -169,7 +169,7 @@ public class Ban
|
||||
|
||||
public boolean isExpired()
|
||||
{
|
||||
return hasExpiry() && expiryUnix < FUtil.getUnixTime();
|
||||
return hasExpiry() && FUtil.getUnixDate(expiryUnix).before(new Date(FUtil.getUnixTime()));
|
||||
}
|
||||
|
||||
public String bakeKickMessage()
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.block.data.AnaloguePowerable;
|
||||
import org.bukkit.block.data.Powerable;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.FallingBlock;
|
||||
import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
@ -30,6 +31,7 @@ import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||
import org.bukkit.event.entity.EntitySpawnEvent;
|
||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||
import org.bukkit.event.entity.FireworkExplodeEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
@ -212,6 +214,15 @@ public class EventBlocker extends FreedomService
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onEntitySpawn(EntitySpawnEvent event)
|
||||
{
|
||||
if (!ConfigEntry.ALLOW_GRAVITY.getBoolean() && event.getEntity() instanceof FallingBlock)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onBlockPhysics(BlockPhysicsEvent event)
|
||||
{
|
||||
|
@ -1,11 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DriverManager;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.*;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@ -228,11 +224,12 @@ public class CoreProtectBridge extends FreedomService
|
||||
String database = ConfigEntry.COREPROTECT_MYSQL_DATABASE.getString();
|
||||
String url = host + ":" + port + "/" + database + "?user=" + username + "&password=" + password + "&useSSL=false";
|
||||
connection = DriverManager.getConnection("jdbc:sql://" + url);
|
||||
final Statement statement = connection.createStatement();
|
||||
final PreparedStatement statement = connection.prepareStatement("SELECT id FROM co_world WHERE world = ?");
|
||||
statement.setQueryTimeout(30);
|
||||
|
||||
// Obtain world ID from CoreProtect database
|
||||
ResultSet resultSet = statement.executeQuery("SELECT id FROM co_world WHERE world = '" + world.getName() + "'");
|
||||
statement.setString(1, world.getName());
|
||||
ResultSet resultSet = statement.executeQuery();
|
||||
String worldID = null;
|
||||
while (resultSet.next())
|
||||
{
|
||||
@ -250,7 +247,10 @@ public class CoreProtectBridge extends FreedomService
|
||||
// Iterate through each table and delete their data if the world ID matches
|
||||
for (String table : tables)
|
||||
{
|
||||
statement.executeQuery("DELETE FROM " + table + " WHERE wid = " + worldID);
|
||||
final PreparedStatement statement1 = connection.prepareStatement("DELETE FROM ? WHERE wid = ?");
|
||||
statement1.setString(1, table);
|
||||
statement1.setString(2, worldID);
|
||||
statement1.executeQuery();
|
||||
}
|
||||
|
||||
connection.close();
|
||||
|
@ -137,7 +137,7 @@ public class Command_adminworld extends FreedomCommand
|
||||
{
|
||||
return noPerms();
|
||||
}
|
||||
sender.sendMessage(ex.getMessage());
|
||||
msg(ex.getMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class Command_adventure extends FreedomCommand
|
||||
{
|
||||
if (isConsole())
|
||||
{
|
||||
sender.sendMessage("When used from the console, you must define a target player.");
|
||||
msg("When used from the console, you must define a target player.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ public class Command_adventure extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -72,8 +72,8 @@ public class Command_banip extends FreedomCommand
|
||||
{
|
||||
// Broadcast
|
||||
FLog.info(ChatColor.RED + sender.getName() + " - Banned the IP " + ip);
|
||||
String message = ChatColor.RED + sender.getName() + " - Banned " + (plugin.al.isAdmin(player) ? "the IP " + ip : "an IP");
|
||||
player.sendMessage(message);
|
||||
String message = sender.getName() + " - Banned " + (plugin.al.isAdmin(player) ? "the IP " + ip : "an IP");
|
||||
msg(player, message, ChatColor.RED);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -92,7 +92,7 @@ public class Command_blockedit extends FreedomCommand
|
||||
final Player player2 = getPlayer(args[0]);
|
||||
if (player2 == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ public class Command_blockpvp extends FreedomCommand
|
||||
final Player p = getPlayer(args[0]);
|
||||
if (p == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -42,14 +42,14 @@ public class Command_cage extends FreedomCommand
|
||||
Player player = getPlayer(args[0]);
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
final FPlayer fPlayer = plugin.pl.getPlayer(player);
|
||||
if (fPlayer.getCageData().isCaged())
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "That player is already caged.");
|
||||
msg("That player is already caged.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ public class Command_cage extends FreedomCommand
|
||||
outerMaterial = Material.matchMaterial(args[2]);
|
||||
break;
|
||||
}
|
||||
sender.sendMessage(ChatColor.RED + "Invalid block!");
|
||||
msg("Invalid block!", ChatColor.RED);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -23,7 +23,7 @@ public class Command_cartsit extends FreedomCommand
|
||||
|
||||
if (targetPlayer == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -32,7 +32,7 @@ public class Command_cartsit extends FreedomCommand
|
||||
{
|
||||
if (targetPlayer == null)
|
||||
{
|
||||
sender.sendMessage("When used from the console, you must define a target player: /cartsit <player>");
|
||||
msg("When used from the console, you must define a target player: /cartsit <player>");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ public class Command_clearchat extends FreedomCommand
|
||||
{
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
player.sendMessage("");
|
||||
msg(player, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class Command_clearinventory extends FreedomCommand
|
||||
|
||||
player.getInventory().clear();
|
||||
msg("Cleared " + player.getName() + "'s inventory.");
|
||||
player.sendMessage(sender.getName() + " has cleared your inventory.");
|
||||
msg(player, sender.getName() + " has cleared your inventory.");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -43,7 +43,7 @@ public class Command_commandlist extends FreedomCommand
|
||||
|
||||
Collections.sort(commands);
|
||||
|
||||
sender.sendMessage(StringUtils.join(commands, ", "));
|
||||
msg(StringUtils.join(commands, ", "));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ public class Command_creative extends FreedomCommand
|
||||
{
|
||||
if (isConsole())
|
||||
{
|
||||
sender.sendMessage("When used from the console, you must define a target player.");
|
||||
msg("When used from the console, you must define a target player.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ public class Command_creative extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,64 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_IN_GAME)
|
||||
@CommandParameters(description = "Curse someone - sends a cursed texture pack to the specified player.", usage = "/<command> <player>")
|
||||
public class Command_curse extends FreedomCommand
|
||||
{
|
||||
|
||||
/* The only problem with this is someone can prevent themself from being cursed by declining to download the
|
||||
resource pack. However, if they hit yes, then you can curse them whenever you want and they can't stop it unless
|
||||
they go into their server settings. and set server resource packs to prompt or disabled */
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
|
||||
if (!FUtil.isExecutive(sender.getName()))
|
||||
{
|
||||
return noPerms();
|
||||
}
|
||||
|
||||
if (args.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final Player player = getPlayer(args[0]);
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
msg(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (plugin.cul.cursedPlayers.containsKey(player))
|
||||
{
|
||||
msg("Already attempting to curse!", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
player.setResourcePack("http://play.totalfreedom.me/cursed.zip");
|
||||
msg("Attempting to curse " + player.getName(), ChatColor.GREEN);
|
||||
plugin.cul.cursedPlayers.put(player, playerSender);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getTabCompleteOptions(CommandSender sender, Command command, String alias, String[] args)
|
||||
{
|
||||
if (args.length == 1 && plugin.al.isAdmin(sender) && FUtil.isExecutive(sender.getName()))
|
||||
{
|
||||
return FUtil.getPlayerList();
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
}
|
@ -39,7 +39,8 @@ public class Command_deop extends FreedomCommand
|
||||
{
|
||||
matchedPlayerNames.add(player.getName());
|
||||
player.setOp(false);
|
||||
player.sendMessage(FreedomCommand.YOU_ARE_NOT_OP);
|
||||
msg(player, YOU_ARE_NOT_OP);
|
||||
plugin.rm.updateDisplay(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,8 @@ public class Command_deopall extends FreedomCommand
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
player.setOp(false);
|
||||
player.sendMessage(FreedomCommand.YOU_ARE_NOT_OP);
|
||||
msg(player, YOU_ARE_NOT_OP);
|
||||
plugin.rm.updateDisplay(player);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -43,7 +43,7 @@ public class Command_dispfill extends FreedomCommand
|
||||
}
|
||||
catch (NumberFormatException ex)
|
||||
{
|
||||
sender.sendMessage("Invalid radius.");
|
||||
msg("Invalid radius.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ public class Command_dispfill extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage("Skipping invalid item: " + searchItem);
|
||||
msg("Skipping invalid item: " + searchItem);
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,8 @@ public class Command_dispfill extends FreedomCommand
|
||||
{
|
||||
if (targetBlock.getType().equals(Material.DISPENSER))
|
||||
{
|
||||
sender.sendMessage("Filling dispenser @ " + FUtil.formatLocation(targetBlock.getLocation()));
|
||||
msg("Filling dispenser @ " + FUtil.formatLocation(targetBlock.getLocation()));
|
||||
plugin.cpb.getCoreProtectAPI().logContainerTransaction(sender.getName(), targetBlock.getLocation());
|
||||
setDispenserContents(targetBlock, itemsArray);
|
||||
affected++;
|
||||
}
|
||||
@ -89,7 +90,7 @@ public class Command_dispfill extends FreedomCommand
|
||||
}
|
||||
}
|
||||
|
||||
sender.sendMessage("Done. " + affected + " dispenser(s) filled.");
|
||||
msg("Done. " + affected + " dispenser(s) filled.");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -36,7 +36,7 @@ public class Command_doom extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ public class Command_gcmd extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ public class Command_hubworld extends FreedomCommand
|
||||
{
|
||||
return noPerms();
|
||||
}
|
||||
sender.sendMessage(ex.getMessage());
|
||||
msg(ex.getMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class Command_inspect extends FreedomCommand
|
||||
}
|
||||
catch (NumberFormatException e)
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "Invalid number");
|
||||
msg("Invalid number", ChatColor.RED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,19 +48,19 @@ public class Command_inspect extends FreedomCommand
|
||||
{
|
||||
if (pageIndex < 1 || pageIndex > paged.getPageCount())
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "Not a valid page number");
|
||||
msg("Not a valid page number", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage("---- " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector" + ChatColor.WHITE + " ---- ");
|
||||
msg("---- " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "Block Inspector" + ChatColor.WHITE + " ---- ", ChatColor.WHITE);
|
||||
|
||||
List<String> page = paged.getPage(pageIndex);
|
||||
for (String entries : page)
|
||||
{
|
||||
sender.sendMessage(entries);
|
||||
msg(entries);
|
||||
}
|
||||
|
||||
sender.sendMessage("Page " + pageIndex + "/" + paged.getPageCount() + " | To index through the pages, type " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "/ins history <page>");
|
||||
msg("Page " + pageIndex + "/" + paged.getPageCount() + " | To index through the pages, type " + net.md_5.bungee.api.ChatColor.of("#30ade4") + "/ins history <page>", ChatColor.WHITE);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.admin.AdminList;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
@ -14,10 +12,14 @@ import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@CommandPermissions(level = Rank.IMPOSTOR, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Lists the real names of all online players.", usage = "/<command> [-s | -i | -f | -v]", aliases = "who,lsit")
|
||||
public class Command_list extends FreedomCommand
|
||||
{
|
||||
|
||||
public boolean run(final CommandSender sender, final Player playerSender, final Command cmd, final String commandLabel, final String[] args, final boolean senderIsConsole)
|
||||
{
|
||||
if (args.length > 1)
|
||||
@ -28,9 +30,12 @@ public class Command_list extends FreedomCommand
|
||||
{
|
||||
List<String> names = new ArrayList<>();
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!plugin.al.isVanished(player.getName()))
|
||||
{
|
||||
names.add(player.getName());
|
||||
}
|
||||
}
|
||||
msg("There are " + names.size() + "/" + server.getMaxPlayers() + " players online:\n" + StringUtils.join(names, ", "), ChatColor.WHITE);
|
||||
return true;
|
||||
}
|
||||
@ -96,7 +101,8 @@ public class Command_list extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(server.getOnlinePlayers().size() - AdminList.vanished.size())
|
||||
int count = server.getOnlinePlayers().size() - AdminList.vanished.size();
|
||||
onlineStats.append(ChatColor.BLUE).append("There are ").append(ChatColor.RED).append(count < 0 ? 0 : count)
|
||||
.append(ChatColor.BLUE)
|
||||
.append(" out of a maximum ")
|
||||
.append(ChatColor.RED)
|
||||
@ -141,13 +147,13 @@ public class Command_list extends FreedomCommand
|
||||
.append(StringUtils.join(n, ChatColor.WHITE + ", "));
|
||||
if (senderIsConsole)
|
||||
{
|
||||
sender.sendMessage(ChatColor.stripColor(onlineStats.toString()));
|
||||
sender.sendMessage(ChatColor.stripColor(onlineUsers.toString()));
|
||||
msg(ChatColor.stripColor(onlineStats.toString()));
|
||||
msg(ChatColor.stripColor(onlineUsers.toString()));
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(onlineStats.toString());
|
||||
sender.sendMessage(onlineUsers.toString());
|
||||
msg(onlineStats.toString());
|
||||
msg(onlineUsers.toString());
|
||||
}
|
||||
n.clear();
|
||||
return true;
|
||||
|
@ -53,7 +53,7 @@ public class Command_lockup extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -70,7 +70,7 @@ public class Command_lockup extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class Command_manageshop extends FreedomCommand
|
||||
Player player = getPlayer(args[3]);
|
||||
if (player != null)
|
||||
{
|
||||
player.sendMessage(ChatColor.GREEN + sender.getName() + " gave you " + amount + " coins. Your new balance is " + playerData.getCoins());
|
||||
msg(player, sender.getName() + " gave you " + amount + " coins. Your new balance is " + playerData.getCoins(), ChatColor.GREEN);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -64,7 +64,7 @@ public class Command_manageshop extends FreedomCommand
|
||||
PlayerData playerData = plugin.pl.getData(player);
|
||||
playerData.setCoins(playerData.getCoins() + amount);
|
||||
plugin.pl.save(playerData);
|
||||
player.sendMessage(ChatColor.GREEN + sender.getName() + " gave you " + amount + " coins. Your new balance is " + playerData.getCoins());
|
||||
msg(player, sender.getName() + " gave you " + amount + " coins. Your new balance is " + playerData.getCoins(), ChatColor.GREEN);
|
||||
}
|
||||
msg("Successfully added " + amount + " coins to all online players.", ChatColor.GREEN);
|
||||
}
|
||||
@ -97,7 +97,7 @@ public class Command_manageshop extends FreedomCommand
|
||||
Player player = getPlayer(args[3]);
|
||||
if (player != null)
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + sender.getName() + " took " + amount + " coins from you. Your new balance is " + playerData.getCoins());
|
||||
msg(player, sender.getName() + " took " + amount + " coins from you. Your new balance is " + playerData.getCoins(), ChatColor.RED);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -111,7 +111,7 @@ public class Command_manageshop extends FreedomCommand
|
||||
playerData.setCoins(0);
|
||||
}
|
||||
plugin.pl.save(playerData);
|
||||
player.sendMessage(ChatColor.RED + sender.getName() + " took " + amount + " coins from you. Your new balance is " + playerData.getCoins());
|
||||
msg(player, sender.getName() + " took " + amount + " coins from you. Your new balance is " + playerData.getCoins(), ChatColor.RED);
|
||||
}
|
||||
msg("Successfully took " + amount + " coins from all online players.", ChatColor.GREEN);
|
||||
}
|
||||
@ -138,7 +138,7 @@ public class Command_manageshop extends FreedomCommand
|
||||
Player player = getPlayer(args[3]);
|
||||
if (player != null)
|
||||
{
|
||||
player.sendMessage(ChatColor.GREEN + sender.getName() + " set your coin balance to " + amount);
|
||||
msg(player, sender.getName() + " set your coin balance to " + amount, ChatColor.GREEN);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -183,7 +183,7 @@ public class Command_manageshop extends FreedomCommand
|
||||
Player player = getPlayer(args[3]);
|
||||
if (player != null)
|
||||
{
|
||||
player.sendMessage(ChatColor.GREEN + sender.getName() + " gave the " + item.getName() + " to you");
|
||||
msg(player, sender.getName() + " gave the " + item.getName() + " to you", ChatColor.GREEN);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -208,7 +208,7 @@ public class Command_manageshop extends FreedomCommand
|
||||
Player player = getPlayer(args[3]);
|
||||
if (player != null)
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + sender.getName() + " took the " + item.getName() + " from you");
|
||||
msg(player, sender.getName() + " took the " + item.getName() + " from you", ChatColor.RED);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -48,12 +48,12 @@ public class Command_manuallyverify extends FreedomCommand
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Manually verifying player " + player.getName(), false);
|
||||
player.setOp(true);
|
||||
player.sendMessage(YOU_ARE_OP);
|
||||
msg(player, YOU_ARE_OP);
|
||||
|
||||
if (plugin.pl.getPlayer(player).getFreezeData().isFrozen())
|
||||
{
|
||||
plugin.pl.getPlayer(player).getFreezeData().setFrozen(false);
|
||||
player.sendMessage(ChatColor.GRAY + "You have been unfrozen.");
|
||||
msg(player, "You have been unfrozen.");
|
||||
}
|
||||
|
||||
plugin.pl.verify(player, null);
|
||||
|
@ -138,7 +138,7 @@ public class Command_masterbuilderworld extends FreedomCommand
|
||||
{
|
||||
return noPerms();
|
||||
}
|
||||
sender.sendMessage(ex.getMessage());
|
||||
msg(ex.getMessage());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -129,7 +129,7 @@ public class Command_mbconfig extends FreedomCommand
|
||||
plugin.pl.verify(player, null);
|
||||
plugin.rm.updateDisplay(player);
|
||||
player.setOp(true);
|
||||
player.sendMessage(YOU_ARE_OP);
|
||||
msg(player, YOU_ARE_OP);
|
||||
}
|
||||
}
|
||||
else if (!data.isMasterBuilder())
|
||||
|
@ -65,7 +65,7 @@ public class Command_moblimiter extends FreedomCommand
|
||||
|
||||
if (ConfigEntry.MOB_LIMITER_ENABLED.getBoolean())
|
||||
{
|
||||
sender.sendMessage("Moblimiter enabled. Maximum mobcount set to: " + ConfigEntry.MOB_LIMITER_MAX.getInteger() + ".");
|
||||
msg("Moblimiter enabled. Maximum mobcount set to: " + ConfigEntry.MOB_LIMITER_MAX.getInteger() + ".");
|
||||
|
||||
msg("Dragon: " + (ConfigEntry.MOB_LIMITER_DISABLE_DRAGON.getBoolean() ? "disabled" : "enabled") + ".");
|
||||
msg("Giant: " + (ConfigEntry.MOB_LIMITER_DISABLE_GIANT.getBoolean() ? "disabled" : "enabled") + ".");
|
||||
|
@ -45,7 +45,7 @@ public class Command_mp44 extends FreedomCommand
|
||||
{
|
||||
playerdata.disarmMP44();
|
||||
|
||||
sender.sendMessage(ChatColor.GREEN + "mp44 Disarmed.");
|
||||
msg("mp44 Disarmed.", ChatColor.GREEN);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -109,7 +109,7 @@ public class Command_mute extends FreedomCommand
|
||||
final Player player = getPlayer(args[0]);
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,6 @@ import java.util.regex.Pattern;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -81,7 +80,7 @@ public class Command_nickfilter extends FreedomCommand
|
||||
|
||||
if (player == null || !plugin.al.isVanished(player.getName()) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
sender.sendMessage(ChatColor.GRAY + "Can't find player by nickname: " + displayName);
|
||||
msg("Can't find player by nickname: " + displayName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -101,7 +100,7 @@ public class Command_nickfilter extends FreedomCommand
|
||||
|
||||
if (!nickMatched)
|
||||
{
|
||||
sender.sendMessage("No nicknames replaced in command.");
|
||||
msg("No nicknames replaced in command.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -113,7 +112,7 @@ public class Command_nickfilter extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage("Sending command: \"" + newCommand + "\".");
|
||||
msg("Sending command: \"" + newCommand + "\".");
|
||||
server.dispatchCommand(sender, newCommand);
|
||||
|
||||
return true;
|
||||
|
@ -40,7 +40,8 @@ public class Command_op extends FreedomCommand
|
||||
{
|
||||
matchedPlayerNames.add(player.getName());
|
||||
player.setOp(true);
|
||||
player.sendMessage(FreedomCommand.YOU_ARE_OP);
|
||||
msg(player, YOU_ARE_OP);
|
||||
plugin.rm.updateDisplay(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ public class Command_opall extends FreedomCommand
|
||||
if (!player.isOp())
|
||||
{
|
||||
player.setOp(true);
|
||||
player.sendMessage(FreedomCommand.YOU_ARE_OP);
|
||||
msg(player, YOU_ARE_OP);
|
||||
plugin.rm.updateDisplay(player);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,8 @@ public class Command_opme extends FreedomCommand
|
||||
{
|
||||
FUtil.adminAction(sender.getName(), "Opping " + sender.getName(), false);
|
||||
sender.setOp(true);
|
||||
sender.sendMessage(FreedomCommand.YOU_ARE_OP);
|
||||
msg(YOU_ARE_OP);
|
||||
plugin.rm.updateDisplay(playerSender);
|
||||
return true;
|
||||
}
|
||||
}
|
@ -106,7 +106,7 @@ public class Command_potion extends FreedomCommand
|
||||
{
|
||||
if (!plugin.al.isAdmin(sender) && !getPlayer(args[4]).equals(getPlayer(sender.getName())))
|
||||
{
|
||||
sender.sendMessage(ChatColor.RED + "Only admins can apply potion effects to other players.");
|
||||
msg("Only admins can apply potion effects to other players.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -114,7 +114,7 @@ public class Command_potion extends FreedomCommand
|
||||
|
||||
if (target == null || plugin.al.isVanished(target.getName()) && !plugin.al.isAdmin(sender))
|
||||
{
|
||||
msg(FreedomCommand.PLAYER_NOT_FOUND, ChatColor.RED);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -122,7 +122,7 @@ public class Command_potion extends FreedomCommand
|
||||
{
|
||||
if (senderIsConsole)
|
||||
{
|
||||
sender.sendMessage("You must specify a target player when using this command from the console.");
|
||||
msg("You must specify a target player when using this command from the console.");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -130,7 +130,7 @@ public class Command_potion extends FreedomCommand
|
||||
PotionEffectType potion_effect_type = PotionEffectType.getByName(args[1]);
|
||||
if (potion_effect_type == null)
|
||||
{
|
||||
sender.sendMessage(ChatColor.AQUA + "Invalid potion effect type.");
|
||||
msg("Invalid potion effect type.", ChatColor.AQUA);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1,83 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FSync;
|
||||
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.OP, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Validates if a given account is premium, or cracked.", usage = "/<command> <player>", aliases = "prem")
|
||||
public class Command_premium extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length != 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final Player player = getPlayer(args[0]);
|
||||
final String name;
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
name = player.getName();
|
||||
}
|
||||
else
|
||||
{
|
||||
name = args[0];
|
||||
}
|
||||
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
final URL getUrl = new URL("https://api.ashcon.app/mojang/v2/user/" + name);
|
||||
final HttpURLConnection urlConnection = (HttpURLConnection)getUrl.openConnection();
|
||||
urlConnection.setRequestProperty("User-Agent", "");
|
||||
String message;
|
||||
/*old code
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream())))
|
||||
//message = (!"PREMIUM".equalsIgnoreCase(in.readLine()) ? ChatColor.RED + "No" : ChatColor.DARK_GREEN + "Yes");
|
||||
*/
|
||||
try
|
||||
{
|
||||
if (urlConnection.getResponseCode() == 200)
|
||||
{
|
||||
message = ChatColor.GREEN + "Yes";
|
||||
}
|
||||
else
|
||||
{
|
||||
message = ChatColor.RED + "No";
|
||||
}
|
||||
FSync.playerMsg(sender, "Player " + name + " is premium: " + message);
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
FSync.playerMsg(sender, ChatColor.RED + "There was an error on trying to connect to the API server");
|
||||
}
|
||||
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
FLog.severe(ex);
|
||||
msg("There was an error querying the API server.", ChatColor.RED);
|
||||
}
|
||||
}
|
||||
}.runTaskAsynchronously(plugin);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
@ -39,7 +39,7 @@ public class Command_rank extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class Command_ride extends FreedomCommand
|
||||
}
|
||||
|
||||
msg("Request accepted.");
|
||||
requester.sendMessage(ChatColor.GRAY + "Your request has been accepted.");
|
||||
msg(requester, "Your request has been accepted.");
|
||||
|
||||
if (requester.getWorld() != playerSender.getWorld())
|
||||
{
|
||||
@ -80,7 +80,7 @@ public class Command_ride extends FreedomCommand
|
||||
}
|
||||
msg("Request denied.");
|
||||
RIDE_REQUESTS.remove(playerSender);
|
||||
requester.sendMessage(ChatColor.GRAY + "Your request has been denied.");
|
||||
msg(requester, "Your request has been denied.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -123,10 +123,10 @@ public class Command_ride extends FreedomCommand
|
||||
if (playerData.getRideMode().equals("ask") && !FUtil.isExecutive(playerSender.getName()))
|
||||
{
|
||||
msg("Sent a request to the player.", ChatColor.GREEN);
|
||||
player.sendMessage(ChatColor.AQUA + sender.getName() + " has requested to ride you.");
|
||||
player.sendMessage(ChatColor.AQUA + "Type " + ChatColor.GREEN + "/ride accept" + ChatColor.AQUA + " to allow the player to ride you.");
|
||||
player.sendMessage(ChatColor.AQUA + "Type " + ChatColor.RED + "/ride deny" + ChatColor.AQUA + " to deny the player permission.");
|
||||
player.sendMessage(ChatColor.AQUA + "Request will expire in 30 seconds.");
|
||||
msg(player, sender.getName() + " has requested to ride you.", ChatColor.AQUA);
|
||||
msg(player, "Type " + ChatColor.GREEN + "/ride accept" + ChatColor.AQUA + " to allow the player to ride you.", ChatColor.AQUA);
|
||||
msg(player, "Type " + ChatColor.RED + "/ride deny" + ChatColor.AQUA + " to deny the player permission.", ChatColor.AQUA);
|
||||
msg(player, "Request will expire in 30 seconds.", ChatColor.AQUA);
|
||||
RIDE_REQUESTS.put(player, playerSender);
|
||||
|
||||
new BukkitRunnable()
|
||||
@ -139,8 +139,8 @@ public class Command_ride extends FreedomCommand
|
||||
}
|
||||
|
||||
RIDE_REQUESTS.remove(player);
|
||||
playerSender.sendMessage(ChatColor.RED + "It has been 30 seconds and " + player.getName() + " has not accepted your request.");
|
||||
player.sendMessage(ChatColor.RED + "Request expired.");
|
||||
msg(playerSender, "It has been 30 seconds and " + player.getName() + " has not accepted your request.", ChatColor.RED);
|
||||
msg(player, "Request expired.", ChatColor.RED);
|
||||
}
|
||||
}.runTaskLater(plugin, 20 * 30);
|
||||
return true;
|
||||
|
@ -220,7 +220,6 @@ public class Command_saconfig extends FreedomCommand
|
||||
if (plugin.al.isVerifiedAdmin(player))
|
||||
{
|
||||
plugin.al.verifiedNoAdmin.remove(player.getName());
|
||||
plugin.al.verifiedNoAdminIps.remove(player.getName());
|
||||
}
|
||||
|
||||
plugin.al.save(admin);
|
||||
@ -244,7 +243,7 @@ public class Command_saconfig extends FreedomCommand
|
||||
if (!player.isOp())
|
||||
{
|
||||
player.setOp(true);
|
||||
player.sendMessage(YOU_ARE_OP);
|
||||
msg(player, YOU_ARE_OP);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ public class Command_scare extends FreedomCommand
|
||||
}
|
||||
|
||||
msg("Scared " + player.getName());
|
||||
player.sendMessage(ChatColor.RED + "ZING");
|
||||
msg(player, "ZING", ChatColor.RED);
|
||||
|
||||
player.spawnParticle(Particle.MOB_APPEARANCE, player.getLocation(), 4);
|
||||
for (int i = 0; i < 10; ++i)
|
||||
|
@ -1,6 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@ -39,6 +40,12 @@ public class Command_setlever extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
if (x > 29999998 || x < -29999998 || y > 29999998 || y < -29999998 || z > 29999998 || z < -29999998)
|
||||
{
|
||||
msg("Coordinates cannot be larger than 29999998 or smaller than -29999998 blocks.");
|
||||
return true;
|
||||
}
|
||||
|
||||
World world = null;
|
||||
final String needleWorldName = args[3].trim();
|
||||
final List<World> worlds = server.getWorlds();
|
||||
@ -72,6 +79,8 @@ public class Command_setlever extends FreedomCommand
|
||||
caster.setPowered(leverOn);
|
||||
state.setBlockData(data);
|
||||
state.update();
|
||||
|
||||
plugin.cpb.getCoreProtectAPI().logInteraction(sender.getName(), leverLocation);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -21,7 +21,7 @@ public class Command_setplayerlimit extends FreedomCommand
|
||||
Player player = Bukkit.getPlayer(args[0]);
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class Command_settotalvotes extends FreedomCommand
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
player.sendMessage(ChatColor.GREEN + sender.getName() + " has set your total votes to " + votes);
|
||||
msg(player, sender.getName() + " has set your total votes to " + votes, ChatColor.GREEN);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -15,21 +15,21 @@ import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Someone being a little bitch? Smite them down...", usage = "/<command> <player> [reason] [-q]")
|
||||
@CommandParameters(description = "Someone being a little bitch? Smite them down...", usage = "/<command> <player> [reason] [-c | -q]")
|
||||
public class Command_smite extends FreedomCommand
|
||||
{
|
||||
|
||||
public static void smite(CommandSender sender, Player player)
|
||||
{
|
||||
smite(sender, player, null, false);
|
||||
smite(sender, player, null, false, false);
|
||||
}
|
||||
|
||||
public static void smite(CommandSender sender, Player player, String reason)
|
||||
{
|
||||
smite(sender, player, reason, false);
|
||||
smite(sender, player, reason, false, false);
|
||||
}
|
||||
|
||||
public static void smite(CommandSender sender, Player player, String reason, Boolean silent)
|
||||
public static void smite(CommandSender sender, Player player, String reason, Boolean silent, Boolean clearinv)
|
||||
{
|
||||
player.sendTitle(ChatColor.RED + "You've been smitten.", ChatColor.YELLOW + "Be sure to follow the rules!", 20, 100, 60);
|
||||
|
||||
@ -44,7 +44,7 @@ public class Command_smite extends FreedomCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.sendMessage(ChatColor.GRAY + "Smitten " + player.getName() + " quietly.");
|
||||
sender.sendMessage("Smitten " + player.getName() + " quietly.");
|
||||
}
|
||||
|
||||
// Deop
|
||||
@ -54,7 +54,10 @@ public class Command_smite extends FreedomCommand
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
// Clear inventory
|
||||
if (clearinv)
|
||||
{
|
||||
player.getInventory().clear();
|
||||
}
|
||||
|
||||
// Strike with lightning effect
|
||||
final Location targetPos = player.getLocation();
|
||||
@ -88,6 +91,7 @@ public class Command_smite extends FreedomCommand
|
||||
|
||||
String reason = null;
|
||||
boolean silent = false;
|
||||
boolean clearinv = false;
|
||||
if (args.length >= 2)
|
||||
{
|
||||
if (args[args.length - 1].equalsIgnoreCase("-q"))
|
||||
@ -102,6 +106,18 @@ public class Command_smite extends FreedomCommand
|
||||
reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length - 1), " ");
|
||||
}
|
||||
}
|
||||
else if (args[args.length - 1].equalsIgnoreCase("-c"))
|
||||
{
|
||||
if (args[args.length - 1].equalsIgnoreCase("-c"))
|
||||
{
|
||||
clearinv = true;
|
||||
}
|
||||
|
||||
if (args.length >= 3)
|
||||
{
|
||||
reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length - 1), " ");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " ");
|
||||
@ -112,11 +128,11 @@ public class Command_smite extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
msg(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
smite(sender, player, reason, silent);
|
||||
smite(sender, player, reason, silent, clearinv);
|
||||
|
||||
plugin.pul.logPunishment(new Punishment(player.getName(), FUtil.getIp(player), sender.getName(), PunishmentType.SMITE, reason));
|
||||
|
||||
|
@ -18,7 +18,7 @@ public class Command_spectator extends FreedomCommand
|
||||
{
|
||||
if (isConsole())
|
||||
{
|
||||
sender.sendMessage("When used from the console, you must define a target player.");
|
||||
msg("When used from the console, you must define a target player.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ public class Command_spectator extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ public class Command_survival extends FreedomCommand
|
||||
{
|
||||
if (isConsole())
|
||||
{
|
||||
sender.sendMessage("When used from the console, you must define a target player.");
|
||||
msg("When used from the console, you must define a target player.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -46,7 +46,7 @@ public class Command_survival extends FreedomCommand
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ public class Command_toggle extends FreedomCommand
|
||||
msg("- landmines");
|
||||
msg("- mp44");
|
||||
msg("- tossmob");
|
||||
msg("- gravity");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -297,6 +298,12 @@ public class Command_toggle extends FreedomCommand
|
||||
toggle("Tossmob is", ConfigEntry.TOSSMOB_ENABLED);
|
||||
break;
|
||||
}
|
||||
|
||||
case "gravity":
|
||||
{
|
||||
toggle("Block gravity is", ConfigEntry.ALLOW_GRAVITY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -320,7 +327,7 @@ public class Command_toggle extends FreedomCommand
|
||||
"waterplace", "fireplace", "lavaplace", "fluidspread", "lavadmg", "firespread", "frostwalk",
|
||||
"firework", "prelog", "lockdown", "petprotect", "entitywipe", "nonuke", "explosives", "unsafeenchs",
|
||||
"bells", "armorstands", "structureblocks", "jigsaws", "grindstones", "jukeboxes", "spawners", "4chan", "beehives",
|
||||
"respawnanchors", "autotp", "autoclear", "minecarts", "mp44", "landmines", "tossmob");
|
||||
"respawnanchors", "autotp", "autoclear", "minecarts", "mp44", "landmines", "tossmob", "gravity");
|
||||
}
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class Command_unblockcmd extends FreedomCommand
|
||||
Player player = getPlayer(args[0]);
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ public class Command_uncage extends FreedomCommand
|
||||
Player player = getPlayer(args[0]);
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -37,7 +37,7 @@ public class Command_unmute extends FreedomCommand
|
||||
final Player player = getPlayer(args[0]);
|
||||
if (player == null)
|
||||
{
|
||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
msg(PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -34,36 +34,32 @@ public class Command_verifynoadmin extends FreedomCommand
|
||||
|
||||
if (plugin.al.isAdminImpostor(player))
|
||||
{
|
||||
if (!plugin.al.verifiedNoAdmin.contains(player.getName()))
|
||||
{
|
||||
plugin.al.verifiedNoAdmin.add(player.getName());
|
||||
}
|
||||
String ip = FUtil.getIp(player);
|
||||
if (!plugin.al.verifiedNoAdminIps.containsKey(player.getName()))
|
||||
if (!plugin.al.verifiedNoAdmin.containsKey(player.getName()))
|
||||
{
|
||||
List<String> ips = new ArrayList<>();
|
||||
ips.add(ip);
|
||||
plugin.al.verifiedNoAdminIps.put(player.getName(), ips);
|
||||
plugin.al.verifiedNoAdmin.put(player.getName(), ips);
|
||||
}
|
||||
else
|
||||
{
|
||||
List<String> ips = plugin.al.verifiedNoAdminIps.get(player.getName());
|
||||
List<String> ips = plugin.al.verifiedNoAdmin.get(player.getName());
|
||||
if (!ips.contains(ip))
|
||||
{
|
||||
ips.add(ip);
|
||||
plugin.al.verifiedNoAdmin.remove(player.getName());
|
||||
plugin.al.verifiedNoAdminIps.put(player.getName(), ips);
|
||||
plugin.al.verifiedNoAdmin.put(player.getName(), ips);
|
||||
}
|
||||
}
|
||||
plugin.rm.updateDisplay(player);
|
||||
FUtil.adminAction(sender.getName(), "Verified " + player.getName() + ", without admin permissions.", true);
|
||||
player.setOp(true);
|
||||
player.sendMessage(YOU_ARE_OP);
|
||||
msg(player, YOU_ARE_OP);
|
||||
final FPlayer fPlayer = plugin.pl.getPlayer(player);
|
||||
if (fPlayer.getFreezeData().isFrozen())
|
||||
{
|
||||
fPlayer.getFreezeData().setFrozen(false);
|
||||
player.sendMessage(ChatColor.GRAY + "You have been unfrozen.");
|
||||
msg(player, "You have been unfrozen.");
|
||||
}
|
||||
msg("Verified " + player.getName() + " but didn't give them admin permissions", ChatColor.GREEN);
|
||||
}
|
||||
|
@ -1,46 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Objects;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.ONLY_CONSOLE, blockHostConsole = true)
|
||||
@CommandParameters(description = "Removes all essentials playerdata", usage = "/<command>")
|
||||
public class Command_wipeuserdata extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (!server.getPluginManager().isPluginEnabled("Essentials"))
|
||||
{
|
||||
msg("Essentials is not enabled on this server.");
|
||||
return true;
|
||||
}
|
||||
|
||||
FUtil.adminAction(sender.getName(), "Wiping Essentials and world player data", true);
|
||||
|
||||
for (World w : Bukkit.getWorlds())
|
||||
{
|
||||
if (w.getName().equals(plugin.wm.adminworld.getWorld().getName()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
FUtil.deleteFolder(new File(Objects.requireNonNull(server.getPluginManager().getPlugin("Essentials")).getDataFolder(), "userdata"));
|
||||
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(plugin.wm.flatlands.getName()).getWorldFolder().getName() + "playerdata"));
|
||||
FUtil.deleteFolder(new File(Bukkit.getServer().getWorld(plugin.wm.flatlands.getName()).getWorldFolder().getName() + "stats"));
|
||||
FUtil.deleteFolder(new File(Objects.requireNonNull(Bukkit.getServer().getWorld(w.getName())).getWorldFolder().getName() + "stats"));
|
||||
FUtil.deleteFolder(new File(Objects.requireNonNull(Bukkit.getServer().getWorld(w.getName())).getWorldFolder().getName() + "playerdata"));
|
||||
msg("Deleted all player data.");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
@ -34,6 +34,7 @@ public enum ConfigEntry
|
||||
ALLOW_RESPAWN_ANCHORS(Boolean.class, "allow.respawnanchors"),
|
||||
AUTO_TP(Boolean.class, "allow.auto_tp"),
|
||||
AUTO_CLEAR(Boolean.class, "allow.auto_clear"),
|
||||
ALLOW_GRAVITY(Boolean.class, "allow.gravity"),
|
||||
//
|
||||
BLOCKED_CHATCODES(String.class, "blocked_chatcodes"),
|
||||
//
|
||||
@ -57,7 +58,7 @@ public enum ConfigEntry
|
||||
SERVER_LOGIN_SUBTITLE(String.class, "server.login_title.subtitle"),
|
||||
SERVER_OWNERS(List.class, "server.owners"),
|
||||
SERVER_EXECUTIVES(List.class, "server.executives"),
|
||||
SERVER_ASSTISTANT_EXECUTIVES(List.class, "server.assistant_executives"),
|
||||
SERVER_ASSISTANT_EXECUTIVES(List.class, "server.assistant_executives"),
|
||||
SERVER_MASTER_BUILDER_MANAGEMENT(List.class, "server.master_builder_management"),
|
||||
SERVER_BAN_URL(String.class, "server.ban_url"),
|
||||
SERVER_INDEFBAN_URL(String.class, "server.indefban_url"),
|
||||
@ -162,7 +163,8 @@ public enum ConfigEntry
|
||||
MASTER_BUILDER_INFO(List.class, "masterbuilderinfo"),
|
||||
AUTO_ENTITY_WIPE(Boolean.class, "auto_wipe"),
|
||||
TOGGLE_CHAT(Boolean.class, "toggle_chat"),
|
||||
DEVELOPER_MODE(Boolean.class, "developer_mode");
|
||||
DEVELOPER_MODE(Boolean.class, "developer_mode"),
|
||||
ANTISPAM_MINUTES(Integer.class, "antispam_minutes");
|
||||
//
|
||||
private final Class<?> type;
|
||||
private final String configName;
|
||||
|
@ -13,6 +13,8 @@ import java.util.Objects;
|
||||
import java.util.SplittableRandom;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.ScheduledThreadPoolExecutor;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.security.auth.login.LoginException;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
@ -60,6 +62,7 @@ public class Discord extends FreedomService
|
||||
public ScheduledThreadPoolExecutor RATELIMIT_EXECUTOR;
|
||||
public List<CompletableFuture<Message>> sentMessages = new ArrayList<>();
|
||||
public Boolean enabled = false;
|
||||
private final Pattern DISCORD_MENTION_PATTERN = Pattern.compile("(<@!?([0-9]{16,20})>)");
|
||||
|
||||
public static String getMD5(String string)
|
||||
{
|
||||
@ -408,6 +411,15 @@ public class Discord extends FreedomService
|
||||
message = StringUtils.remove(message, "§");
|
||||
}
|
||||
|
||||
|
||||
Matcher DISCORD_MENTION_MATCHER = DISCORD_MENTION_PATTERN.matcher(message);
|
||||
|
||||
while (DISCORD_MENTION_MATCHER.find())
|
||||
{
|
||||
String mention = DISCORD_MENTION_MATCHER.group(1);
|
||||
message = message.replace(mention, mention.replace("@",""));
|
||||
}
|
||||
|
||||
if (enabled && !chat_channel_id.isEmpty())
|
||||
{
|
||||
CompletableFuture<Message> sentMessage = Objects.requireNonNull(bot.getTextChannelById(chat_channel_id)).sendMessage(deformat(message)).submit(true);
|
||||
@ -433,6 +445,15 @@ public class Discord extends FreedomService
|
||||
message = StringUtils.remove(message, "§");
|
||||
}
|
||||
|
||||
|
||||
Matcher DISCORD_MENTION_MATCHER = DISCORD_MENTION_PATTERN.matcher(message);
|
||||
|
||||
while (DISCORD_MENTION_MATCHER.find())
|
||||
{
|
||||
String mention = DISCORD_MENTION_MATCHER.group(1);
|
||||
message = message.replace(mention, mention.replace("@",""));
|
||||
}
|
||||
|
||||
if (enabled && !chat_channel_id.isEmpty())
|
||||
{
|
||||
CompletableFuture<Message> sentMessage = Objects.requireNonNull(bot.getTextChannelById(chat_channel_id)).sendMessage(deformat(message)).submit(true);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package me.totalfreedom.totalfreedommod.discord;
|
||||
|
||||
import com.google.common.base.Strings;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
@ -18,10 +19,10 @@ import net.md_5.bungee.api.chat.ComponentBuilder;
|
||||
import net.md_5.bungee.api.chat.TextComponent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class DiscordToAdminChatListener extends ListenerAdapter
|
||||
{
|
||||
|
||||
DiscordToMinecraftListener dtml = new DiscordToMinecraftListener();
|
||||
|
||||
public static net.md_5.bungee.api.ChatColor getColor(Displayable display)
|
||||
@ -36,100 +37,107 @@ public class DiscordToAdminChatListener extends ListenerAdapter
|
||||
{
|
||||
Member member = event.getMember();
|
||||
String tag = dtml.getDisplay(member);
|
||||
StringBuilder message = new StringBuilder(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_AQUA + "Discord" + ChatColor.DARK_GRAY + "] " + ChatColor.RESET);
|
||||
Message msg = event.getMessage();
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
String mediamessage = ChatColor.YELLOW + "[Media]";
|
||||
|
||||
StringBuilder logmessage = new StringBuilder(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_AQUA + "Discord" + ChatColor.DARK_GRAY + "] " + ChatColor.RESET);
|
||||
String lm = ChatColor.DARK_RED + member.getEffectiveName() + " "
|
||||
+ ChatColor.DARK_GRAY + tag + ChatColor.DARK_GRAY
|
||||
+ ChatColor.WHITE + ": " + ChatColor.GOLD + FUtil.colorize(msg.getContentDisplay());
|
||||
logmessage.append(lm);
|
||||
|
||||
if (!msg.getAttachments().isEmpty())
|
||||
{
|
||||
if (TotalFreedomMod.getPlugin().al.isAdmin(player))
|
||||
|
||||
logmessage.append(mediamessage); // Actually for logging...
|
||||
|
||||
}
|
||||
FLog.info(logmessage.toString());
|
||||
|
||||
Bukkit.getOnlinePlayers().stream().filter(player -> TotalFreedomMod.getPlugin().al.isAdmin(player)).forEach(player ->
|
||||
{
|
||||
StringBuilder message = new StringBuilder(ChatColor.DARK_GRAY + "[" + ChatColor.DARK_AQUA + "Discord" + ChatColor.DARK_GRAY + "] " + ChatColor.RESET);
|
||||
|
||||
ComponentBuilder builder = new ComponentBuilder(message.toString());
|
||||
|
||||
Admin admin = TotalFreedomMod.getPlugin().al.getAdmin(player);
|
||||
String format = admin.getAcFormat();
|
||||
if (format != null)
|
||||
if (!Strings.isNullOrEmpty(format))
|
||||
{
|
||||
Displayable display = TotalFreedomMod.getPlugin().rm.getDisplay(player);
|
||||
Displayable display = getDisplay(member);
|
||||
net.md_5.bungee.api.ChatColor color = getColor(display);
|
||||
String m = format.replace("%name%", member.getEffectiveName())
|
||||
.replace("%rank%", getDisplay(member))
|
||||
.replace("%rank%", display.getAbbr())
|
||||
.replace("%rankcolor%", color.toString())
|
||||
.replace("%msg%", FUtil.colorize(msg.getContentDisplay()));
|
||||
message.append(FUtil.colorize(m));
|
||||
builder.append(FUtil.colorize(m));
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
String m = ChatColor.DARK_RED + member.getEffectiveName() + " "
|
||||
+ ChatColor.DARK_GRAY + tag + ChatColor.DARK_GRAY
|
||||
+ ChatColor.WHITE + ": " + ChatColor.GOLD + FUtil.colorize(msg.getContentDisplay());
|
||||
message.append(m);
|
||||
}
|
||||
}
|
||||
builder.append(m);
|
||||
}
|
||||
|
||||
ComponentBuilder builder = new ComponentBuilder(message.toString());
|
||||
if (!msg.getAttachments().isEmpty())
|
||||
{
|
||||
for (Message.Attachment attachment : msg.getAttachments())
|
||||
{
|
||||
if (attachment.getUrl() == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
TextComponent text = new TextComponent(ChatColor.YELLOW + "[Media]");
|
||||
TextComponent text = new TextComponent(mediamessage);
|
||||
text.setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, attachment.getUrl()));
|
||||
if (!msg.getContentDisplay().isEmpty())
|
||||
{
|
||||
builder.append(" ");
|
||||
}
|
||||
builder.append(text);
|
||||
message.append("[Media]"); // for logging
|
||||
}
|
||||
}
|
||||
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (TotalFreedomMod.getPlugin().al.isAdmin(player))
|
||||
{
|
||||
player.spigot().sendMessage(builder.create());
|
||||
}
|
||||
}
|
||||
FLog.info(message.toString());
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Needed to display tags in custom AC messages
|
||||
public String getDisplay(Member member)
|
||||
public Displayable getDisplay(Member member)
|
||||
{
|
||||
Guild server = Discord.bot.getGuildById(ConfigEntry.DISCORD_SERVER_ID.getString());
|
||||
// Server Owner
|
||||
if (member.getRoles().contains(server.getRoleById(ConfigEntry.DISCORD_SERVER_OWNER_ROLE_ID.getString())))
|
||||
{
|
||||
return Title.OWNER.getAbbr();
|
||||
return Title.OWNER;
|
||||
}
|
||||
// Developers
|
||||
else if (member.getRoles().contains(server.getRoleById(ConfigEntry.DISCORD_DEVELOPER_ROLE_ID.getString())))
|
||||
{
|
||||
return Title.DEVELOPER.getAbbr();
|
||||
return Title.DEVELOPER;
|
||||
}
|
||||
// Executives
|
||||
else if (member.getRoles().contains(server.getRoleById(ConfigEntry.DISCORD_EXECUTIVE_ROLE_ID.getString())))
|
||||
{
|
||||
return Title.EXECUTIVE.getAbbr();
|
||||
return Title.EXECUTIVE;
|
||||
}
|
||||
// Senior Admins
|
||||
else if (member.getRoles().contains(server.getRoleById(ConfigEntry.DISCORD_SENIOR_ADMIN_ROLE_ID.getString())))
|
||||
{
|
||||
return Rank.SENIOR_ADMIN.getAbbr();
|
||||
return Rank.SENIOR_ADMIN;
|
||||
}
|
||||
// Admins
|
||||
else if (member.getRoles().contains(server.getRoleById(ConfigEntry.DISCORD_NEW_ADMIN_ROLE_ID.getString())))
|
||||
{
|
||||
return Rank.ADMIN.getAbbr();
|
||||
return Rank.ADMIN;
|
||||
}
|
||||
// Master Builders
|
||||
else if (member.getRoles().contains(server.getRoleById(ConfigEntry.DISCORD_MASTER_BUILDER_ROLE_ID.getString())))
|
||||
{
|
||||
return Title.MASTER_BUILDER.getAbbr();
|
||||
return Title.MASTER_BUILDER;
|
||||
}
|
||||
// OP, returning null breaks?
|
||||
else
|
||||
{
|
||||
return Rank.OP.getAbbr();
|
||||
return Rank.OP;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
package me.totalfreedom.totalfreedommod.fun;
|
||||
|
||||
import java.util.HashMap;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerResourcePackStatusEvent;
|
||||
import static org.bukkit.event.player.PlayerResourcePackStatusEvent.Status;
|
||||
|
||||
public class CurseListener extends FreedomService
|
||||
{
|
||||
public HashMap<Player, Player> cursedPlayers = new HashMap<Player, Player>();
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onStop()
|
||||
{
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onResourcePackStatus(PlayerResourcePackStatusEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
PlayerResourcePackStatusEvent.Status cursed = event.getStatus();
|
||||
Player cursedBy = cursedPlayers.get(player);
|
||||
if (cursed.equals(Status.ACCEPTED))
|
||||
{
|
||||
cursedBy.sendMessage(ChatColor.GREEN + "Casting curse on " + player.getName() + "...");
|
||||
}
|
||||
else if (cursed.equals(Status.DECLINED))
|
||||
{
|
||||
cursedBy.sendMessage(ChatColor.RED + "Failed to start cast on " + player.getName() + "!");
|
||||
cursedPlayers.remove(player);
|
||||
}
|
||||
else if (cursed.equals(Status.SUCCESSFULLY_LOADED))
|
||||
{
|
||||
cursedBy.sendMessage(ChatColor.GREEN + "Successfully cursed + " + player.getName() + "!");
|
||||
cursedPlayers.remove(player);
|
||||
}
|
||||
else if (cursed.equals(Status.FAILED_DOWNLOAD))
|
||||
{
|
||||
cursedBy.sendMessage(ChatColor.RED + "Failed to cast curse on " + player.getName() + "!");
|
||||
cursedPlayers.remove(player);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
package me.totalfreedom.totalfreedommod.httpd.module;
|
||||
|
||||
import java.util.Collection;
|
||||
import me.totalfreedom.totalfreedommod.admin.Admin;
|
||||
import me.totalfreedom.totalfreedommod.admin.AdminList;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.httpd.NanoHTTPD;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
@ -10,6 +10,8 @@ import org.bukkit.entity.Player;
|
||||
import org.json.simple.JSONArray;
|
||||
import org.json.simple.JSONObject;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class Module_list extends HTTPDModule
|
||||
{
|
||||
|
||||
@ -86,6 +88,8 @@ public class Module_list extends HTTPDModule
|
||||
}
|
||||
}
|
||||
|
||||
int count = server.getOnlinePlayers().size() - AdminList.vanished.size();
|
||||
|
||||
// for future refernce - any multi-worded ranks are to be delimited by underscores in the json; eg. senior_admins
|
||||
responseObject.put("owners", owners);
|
||||
responseObject.put("executives", executives);
|
||||
@ -95,7 +99,7 @@ public class Module_list extends HTTPDModule
|
||||
responseObject.put("master_builders", masterbuilders);
|
||||
responseObject.put("operators", operators);
|
||||
responseObject.put("imposters", imposters);
|
||||
responseObject.put("online", server.getOnlinePlayers().size());
|
||||
responseObject.put("online", count < 0 ? 0 : count);
|
||||
responseObject.put("max", server.getMaxPlayers());
|
||||
|
||||
final NanoHTTPD.Response response = new NanoHTTPD.Response(NanoHTTPD.Response.Status.OK, NanoHTTPD.MIME_JSON, responseObject.toString());
|
||||
@ -108,7 +112,9 @@ public class Module_list extends HTTPDModule
|
||||
|
||||
final Collection<? extends Player> onlinePlayers = Bukkit.getOnlinePlayers();
|
||||
|
||||
body.append("<p>There are ").append(onlinePlayers.size()).append("/").append(Bukkit.getMaxPlayers()).append(" players online:</p>\r\n");
|
||||
int count = onlinePlayers.size() - AdminList.vanished.size();
|
||||
body.append("<p>There are ").append(count < 0 ? 0 : count).append("/")
|
||||
.append(Bukkit.getMaxPlayers()).append(" players online:</p>\r\n");
|
||||
|
||||
body.append("<ul>\r\n");
|
||||
|
||||
|
@ -117,10 +117,4 @@ public class PermissionManager extends FreedomService
|
||||
setPermissions(player);
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onPlayerJoin(PlayerJoinEvent event)
|
||||
{
|
||||
setPermissions(event.getPlayer());
|
||||
}
|
||||
}
|
@ -289,7 +289,7 @@ public class FPlayer
|
||||
return unmuteTask != null;
|
||||
}
|
||||
|
||||
public void setMuted(boolean muted)
|
||||
public void setMuted(boolean muted, int minutes)
|
||||
{
|
||||
FUtil.cancel(unmuteTask);
|
||||
plugin.mu.MUTED_PLAYERS.remove(getPlayer().getName());
|
||||
@ -324,7 +324,12 @@ public class FPlayer
|
||||
plugin.mu.MUTED_PLAYERS.remove(getName());
|
||||
}
|
||||
}
|
||||
}.runTaskLater(plugin, AUTO_PURGE_TICKS);
|
||||
}.runTaskLater(plugin, minutes * (60L * 20L));
|
||||
}
|
||||
|
||||
public void setMuted(boolean muted)
|
||||
{
|
||||
setMuted(muted, 5);
|
||||
}
|
||||
|
||||
public BukkitTask getLockupScheduleID()
|
||||
|
@ -62,6 +62,11 @@ public class RankManager extends FreedomService
|
||||
return Title.EXECUTIVE;
|
||||
}
|
||||
|
||||
if (ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getList().contains(player.getName()) && plugin.al.isAdmin(player))
|
||||
{
|
||||
return Title.ASSTEXEC;
|
||||
}
|
||||
|
||||
if (plugin.al.isVerifiedAdmin(player))
|
||||
{
|
||||
return Title.VERIFIED_ADMIN;
|
||||
|
@ -71,9 +71,12 @@ public class FUtil
|
||||
"458de06f-36a5-4e1b-aaa6-ec1d1751c5b6", // SupItsDillon
|
||||
"c8e5af82-6aba-4dd7-83e8-474381380cc9", // Paldiu
|
||||
"38ea7c82-7bdc-4f48-b7fd-0e93fc26813d", // AwesomePinch
|
||||
"ba5aafba-9012-418f-9819-a7020d591068" // TFTWPhoenix
|
||||
"ba5aafba-9012-418f-9819-a7020d591068", // TFTWPhoenix
|
||||
"d6dd9740-40db-45f5-ab16-4ee16a633009", // Abhi
|
||||
"2e06e049-24c8-42e4-8bcf-d35372af31e6", // unsuperiordev
|
||||
"f97c0d7b-6413-4558-a409-88f09a8f9adb" // videogamesm12
|
||||
);
|
||||
public static final List<String> DEVELOPER_NAMES = Arrays.asList("Madgeek1450", "Prozza", "WickedGamingUK", "Wild1145", "aggelosQQ", "scripthead", "CoolJWB", "elmon_", "speednt", "SupItsDillon", "Paldiu", "AwesomePinch", "TFTWPhoenix");
|
||||
public static final List<String> DEVELOPER_NAMES = Arrays.asList("Madgeek1450", "Prozza", "WickedGamingUK", "Wild1145", "aggelosQQ", "scripthead", "CoolJWB", "elmon_", "speednt", "SupItsDillon", "Paldiu", "AwesomePinch", "TFTWPhoenix","abhithedev", "unsuperiordev", "videogamesm12");
|
||||
public static final Map<String, ChatColor> CHAT_COLOR_NAMES = new HashMap<>();
|
||||
public static final List<ChatColor> CHAT_COLOR_POOL = Arrays.asList(
|
||||
ChatColor.DARK_RED,
|
||||
@ -137,7 +140,7 @@ public class FUtil
|
||||
|
||||
public static boolean isExecutive(String name)
|
||||
{
|
||||
return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name) || ConfigEntry.SERVER_ASSTISTANT_EXECUTIVES.getStringList().contains(name);
|
||||
return ConfigEntry.SERVER_OWNERS.getStringList().contains(name) || ConfigEntry.SERVER_EXECUTIVES.getStringList().contains(name) || ConfigEntry.SERVER_ASSISTANT_EXECUTIVES.getStringList().contains(name);
|
||||
}
|
||||
|
||||
public static boolean isDeveloper(Player player)
|
||||
@ -605,12 +608,12 @@ public class FUtil
|
||||
|
||||
public static Date getUnixDate(long unix)
|
||||
{
|
||||
return new Date(unix * 1000);
|
||||
return new Date(unix);
|
||||
}
|
||||
|
||||
public static long getUnixTime()
|
||||
{
|
||||
return System.currentTimeMillis() / 1000L;
|
||||
return Instant.now().toEpochMilli();
|
||||
}
|
||||
|
||||
public static long getUnixTime(Date date)
|
||||
@ -620,7 +623,7 @@ public class FUtil
|
||||
return 0;
|
||||
}
|
||||
|
||||
return date.getTime() / 1000L;
|
||||
return date.getTime();
|
||||
}
|
||||
|
||||
public static String getNMSVersion()
|
||||
|
@ -139,7 +139,7 @@ public class WorldRestrictions extends FreedomService
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
if (command.equals("coreprotect") || command.equals("core") || command.equals("co"))
|
||||
if (command.equalsIgnoreCase("coreprotect") || command.equalsIgnoreCase("core") || command.equalsIgnoreCase("co"))
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + "Only " + allowed + " are allowed to use CoreProtect here.");
|
||||
event.setCancelled(true);
|
||||
|
@ -226,6 +226,7 @@ allow:
|
||||
respawnanchors: false
|
||||
auto_tp: false
|
||||
auto_clear: false
|
||||
gravity: false
|
||||
|
||||
# Blocked commands:
|
||||
#
|
||||
@ -737,3 +738,6 @@ blocked_chatcodes: '&0,&k,&m,&n'
|
||||
|
||||
# Enables certain things like debug logs and console bypasses
|
||||
developer_mode: false
|
||||
|
||||
# AntiSpam Time (minutes)
|
||||
antispam_minutes: 2
|
||||
|
@ -1,9 +1,7 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE suppressions PUBLIC
|
||||
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
|
||||
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
|
||||
|
||||
<suppressions>
|
||||
<suppress files="Metrics\.java" checks="[a-zA-Z0-9]*"/>
|
||||
<suppress files="NanoHTTPD\.java" checks="[a-zA-Z0-9]*"/>
|
||||
|
Reference in New Issue
Block a user