mirror of
https://github.com/TotalFreedomMC/TF-Marriage.git
synced 2025-07-28 00:15:35 +00:00
refactor
This commit is contained in:
parent
24b43d47d3
commit
e55633d0a2
48 changed files with 299 additions and 306 deletions
15
pom.xml
15
pom.xml
|
@ -44,11 +44,6 @@
|
|||
<id>jitpack.io</id>
|
||||
<url>https://jitpack.io</url>
|
||||
</repository>
|
||||
|
||||
<repository>
|
||||
<id>telesphoreo-repo</id>
|
||||
<url>https://telesphoreo.me/repo/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
|
@ -93,11 +88,17 @@
|
|||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>me.totalfreedom</groupId>
|
||||
<groupId>com.github.AtlasMediaGroup</groupId>
|
||||
<artifactId>TotalFreedomMod</artifactId>
|
||||
<version>2020.9</version>
|
||||
<version>development-0be2aa718f-1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.googlecode.json-simple</groupId>
|
||||
<artifactId>json-simple</artifactId>
|
||||
<version>1.1.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<profiles>
|
||||
|
|
|
@ -5,19 +5,15 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class TFM
|
||||
{
|
||||
public class TFM {
|
||||
private TotalFreedomMod totalFreedomMod = null;
|
||||
|
||||
public TotalFreedomMod getTFM()
|
||||
{
|
||||
if (totalFreedomMod != null)
|
||||
{
|
||||
public TotalFreedomMod getTFM() {
|
||||
if (totalFreedomMod != null) {
|
||||
return totalFreedomMod;
|
||||
}
|
||||
Plugin plugin = Bukkit.getPluginManager().getPlugin("TotalFreedomMod");
|
||||
if (plugin != null && plugin.isEnabled())
|
||||
{
|
||||
if (plugin != null && plugin.isEnabled()) {
|
||||
TotalFreedomMod tfm = (TotalFreedomMod) plugin;
|
||||
totalFreedomMod = tfm;
|
||||
return totalFreedomMod;
|
||||
|
@ -26,8 +22,7 @@ public class TFM
|
|||
return null;
|
||||
}
|
||||
|
||||
public boolean isStaff(Player player)
|
||||
{
|
||||
return getTFM().sl.isStaff(player);
|
||||
public boolean isAdmin(Player player) {
|
||||
return getTFM().al.isAdmin(player);
|
||||
}
|
||||
}
|
|
@ -16,8 +16,7 @@ public class CommandChatSpy extends Command {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (!marriage.getTFM().isStaff(player))
|
||||
{
|
||||
if (!marriage.getTFM().isAdmin(player)) {
|
||||
sender.sendMessage(ChatColor.RED + "You are not permitted to use this command.");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -27,8 +27,7 @@ public class CommandPriest extends Command {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (!marriage.getTFM().isStaff(player))
|
||||
{
|
||||
if (!marriage.getTFM().isAdmin(player)) {
|
||||
sender.sendMessage(ChatColor.RED + "You are not permitted to use this command.");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -22,8 +22,7 @@ public class CommandReload extends Command {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (!marriage.getTFM().isStaff(player))
|
||||
{
|
||||
if (!marriage.getTFM().isAdmin(player)) {
|
||||
sender.sendMessage(ChatColor.RED + "You are not permitted to use this command.");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -18,11 +18,11 @@ public class CommandUpdate extends Command {
|
|||
|
||||
@Override
|
||||
public void execute() {
|
||||
if (!marriage.getTFM().isStaff(player))
|
||||
{
|
||||
if (!marriage.getTFM().isAdmin(player)) {
|
||||
sender.sendMessage(ChatColor.RED + "You are not permitted to use this command.");
|
||||
return;
|
||||
}
|
||||
|
||||
final Updater updater = ((MarriageCore) marriage).getUpdater();
|
||||
final Version version = updater.getNewVersion();
|
||||
if (version == null) {
|
||||
|
|
|
@ -40,8 +40,7 @@ public abstract class MarriageBase implements Marriage {
|
|||
Bukkit.getPluginManager().registerEvents(listener, plugin);
|
||||
}
|
||||
|
||||
public TFM getTFM()
|
||||
{
|
||||
public TFM getTFM() {
|
||||
return tfm;
|
||||
}
|
||||
|
||||
|
|
|
@ -74,7 +74,8 @@ public class ChatListener implements Listener {
|
|||
|
||||
if (Settings.FORCE_FORMAT.value()) {
|
||||
format = "{marriage_status}" + format; // Enforce marriage format
|
||||
} if(Settings.FORCE_GENDER_FORMAT.value()) {
|
||||
}
|
||||
if (Settings.FORCE_GENDER_FORMAT.value()) {
|
||||
format = "{marriage_gender}" + format;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@ public class PlayerListener implements Listener {
|
|||
// Verify damaged entity is player
|
||||
if (!(e0 instanceof Player)) {
|
||||
return;
|
||||
} if(!(e1 instanceof Player) && !(e1 instanceof Projectile)) {
|
||||
}
|
||||
if (!(e1 instanceof Player) && !(e1 instanceof Projectile)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@ public class BConfig extends YamlConfiguration {
|
|||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException e) {
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue