mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-06-12 13:53:54 +00:00
master
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod;
|
||||
|
||||
import com.sk89q.worldedit.bukkit.BukkitConfiguration;
|
||||
import java.io.File;
|
||||
import me.totalfreedom.totalfreedommod.banning.PermbanList;
|
||||
import me.totalfreedom.totalfreedommod.config.YamlConfig;
|
||||
@ -9,7 +8,6 @@ import me.totalfreedom.totalfreedommod.punishments.PunishmentList;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.util.FileUtil;
|
||||
import org.yaml.snakeyaml.Yaml;
|
||||
|
||||
public class BackupManager extends FreedomService
|
||||
{
|
||||
|
@ -276,7 +276,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
|
||||
fsh.startServices();
|
||||
|
||||
FLog.info("Started " + fsh.getServiceAmount() + "services.");
|
||||
FLog.info("Started " + fsh.getServiceAmount() + " services.");
|
||||
|
||||
timer.update();
|
||||
FLog.info("Version " + pluginVersion + " for " + ServerInterface.COMPILE_NMS_VERSION + " enabled in " + timer.getTotal() + "ms");
|
||||
|
@ -20,7 +20,6 @@ import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
|
||||
public class AdminList extends FreedomService
|
||||
{
|
||||
|
@ -11,13 +11,21 @@ import org.bukkit.Material;
|
||||
import org.bukkit.attribute.Attribute;
|
||||
import org.bukkit.attribute.AttributeModifier;
|
||||
import org.bukkit.block.data.AnaloguePowerable;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Powerable;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.block.*;
|
||||
import org.bukkit.event.block.BlockBurnEvent;
|
||||
import org.bukkit.event.block.BlockDispenseEvent;
|
||||
import org.bukkit.event.block.BlockFromToEvent;
|
||||
import org.bukkit.event.block.BlockGrowEvent;
|
||||
import org.bukkit.event.block.BlockIgniteEvent;
|
||||
import org.bukkit.event.block.BlockPhysicsEvent;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.event.block.BlockRedstoneEvent;
|
||||
import org.bukkit.event.block.LeavesDecayEvent;
|
||||
import org.bukkit.event.entity.EntityCombustEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDeathEvent;
|
||||
@ -27,7 +35,6 @@ import org.bukkit.event.entity.FireworkExplodeEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.material.Redstone;
|
||||
|
||||
public class EventBlocker extends FreedomService
|
||||
{
|
||||
|
@ -5,7 +5,6 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.Groups;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Biome;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
|
@ -12,6 +12,7 @@ import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.CommandSender;
|
||||
@ -19,7 +20,6 @@ import org.bukkit.command.SimpleCommandMap;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.SimplePluginManager;
|
||||
|
||||
public class CommandBlocker extends FreedomService
|
||||
|
@ -1,16 +1,15 @@
|
||||
package me.totalfreedom.totalfreedommod.bridge;
|
||||
|
||||
import me.libraryaddict.disguise.BlockedDisguises;
|
||||
import me.libraryaddict.disguise.DisguiseAPI;
|
||||
import me.libraryaddict.disguise.LibsDisguises;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.libraryaddict.disguise.BlockedDisguises;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class LibsDisguisesBridge extends FreedomService
|
||||
{
|
||||
|
||||
private LibsDisguises libsDisguisesPlugin = null;
|
||||
|
||||
@Override
|
||||
|
@ -6,12 +6,12 @@ import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
|
||||
public class VanishBridge extends FreedomService
|
||||
{
|
||||
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
@ -29,7 +29,11 @@ public class VanishBridge extends FreedomService
|
||||
Displayable display = plugin.rm.getDisplay(player);
|
||||
String tag = display.getColoredTag();
|
||||
|
||||
if (!event.isSilent())
|
||||
if (event.isSilent())
|
||||
{
|
||||
plugin.al.messageAllAdmins(ChatColor.GOLD + player.getName() + " silently unvanished.");
|
||||
}
|
||||
else
|
||||
{
|
||||
FUtil.bcastMsg(plugin.rm.craftLoginMessage(event.getPlayer(), null));
|
||||
plugin.dc.messageChatChannel("**" + player.getName() + " joined the server" + "**");
|
||||
@ -47,7 +51,11 @@ public class VanishBridge extends FreedomService
|
||||
public void onPlayerVanish(PlayerHideEvent event)
|
||||
{
|
||||
Player player = event.getPlayer();
|
||||
if (!event.isSilent())
|
||||
if (event.isSilent())
|
||||
{
|
||||
plugin.al.messageAllAdmins(ChatColor.GOLD + player.getName() + " silently vanished.");
|
||||
}
|
||||
else
|
||||
{
|
||||
plugin.dc.messageChatChannel("**" + player.getName() + " left the server" + "**");
|
||||
}
|
||||
|
@ -2,7 +2,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.admin.AdminList;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -16,13 +16,13 @@ public class Command_linkreddit extends FreedomCommand
|
||||
{
|
||||
if (!plugin.rd.enabled)
|
||||
{
|
||||
msg("The reddit system is currently disabled.", ChatColor.RED);
|
||||
msg("The Reddit system is currently disabled.", ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (getData(playerSender).getRedditUsername() != null)
|
||||
{
|
||||
msg("Your reddit account is already linked.");
|
||||
msg("Your Reddit account is already linked.");
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -38,11 +38,11 @@ public class Command_linkreddit extends FreedomCommand
|
||||
|
||||
try
|
||||
{
|
||||
plugin.rd.sendModMessage(username, "Link Code", "Please run the following in-game to link your reddit account: /linkreddit code " + code);
|
||||
plugin.rd.sendModMessage(username, "Link Code", "Please run the following in-game to link your Reddit account: /linkreddit code " + code);
|
||||
}
|
||||
catch (ApiException e)
|
||||
{
|
||||
msg("Could not find a reddit account by the name of " + args[0], ChatColor.RED);
|
||||
msg("Could not find a Reddit account by the name of " + args[0], ChatColor.RED);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ public class Command_linkreddit extends FreedomCommand
|
||||
return true;
|
||||
}
|
||||
|
||||
msg("Successfully linked the reddit account " + username + " to your Minecraft account.", ChatColor.GREEN);
|
||||
msg("Successfully linked the Reddit account " + username + " to your Minecraft account.", ChatColor.GREEN);
|
||||
if (plugin.rd.updateFlair(playerSender))
|
||||
{
|
||||
msg("Your flair has been updated.", ChatColor.GREEN);
|
||||
|
@ -4,7 +4,6 @@ import de.myzelyam.api.vanish.VanishAPI;
|
||||
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;
|
||||
import me.totalfreedom.totalfreedommod.rank.Displayable;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
|
@ -2,7 +2,6 @@ package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.admin.AdminList;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
@ -1,6 +1,5 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
|
@ -1,11 +1,9 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import java.nio.channels.FileLock;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.rank.Rank;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
|
@ -11,7 +11,6 @@ import static org.bukkit.event.player.PlayerResourcePackStatusEvent.Status;
|
||||
|
||||
public class CurseListener extends FreedomService
|
||||
{
|
||||
|
||||
public HashMap<Player, Player> cursedPlayers = new HashMap<Player, Player>();
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +26,6 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class Reddit extends FreedomService
|
||||
{
|
||||
|
||||
private final String SUBREDDIT_NAME = ConfigEntry.REDDIT_SUBREDDIT_NAME.getString();
|
||||
private final String USERNAME = ConfigEntry.REDDIT_USERNAME.getString();
|
||||
private final String PASSWORD = ConfigEntry.REDDIT_PASSWORD.getString();
|
||||
@ -53,7 +52,7 @@ public class Reddit extends FreedomService
|
||||
@Override
|
||||
public void onStart()
|
||||
{
|
||||
enabled = !Strings.isNullOrEmpty(ConfigEntry.REDDIT_CLIENT_ID.getString());
|
||||
enabled = ConfigEntry.REDDIT_CLIENT_ID.getString() == null;
|
||||
if (!enabled)
|
||||
{
|
||||
return;
|
||||
@ -68,14 +67,14 @@ public class Reddit extends FreedomService
|
||||
}
|
||||
catch (NoClassDefFoundError e)
|
||||
{
|
||||
FLog.warning("The JRAW plugin is not installed, therefore the reddit service cannot start.");
|
||||
FLog.warning("The JRAW plugin is not installed, therefore the Reddit service cannot start.");
|
||||
FLog.warning("To resolve this error, please download the latest JRAW from: https://github.com/TFPatches/Minecraft-JRAW/releases");
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
catch (NullPointerException e)
|
||||
{
|
||||
FLog.warning("Invalid reddit credentials specified, please double check everything in the config.");
|
||||
FLog.warning("Invalid Reddit credentials specified, please double check everything in the config.");
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
@ -163,7 +162,7 @@ public class Reddit extends FreedomService
|
||||
Displayable display = plugin.rm.getDisplay(player);
|
||||
if (username == null)
|
||||
{
|
||||
FLog.debug("No reddit account");
|
||||
FLog.debug("No Reddit account");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -222,5 +221,4 @@ public class Reddit extends FreedomService
|
||||
flairNameList.put(Title.MASTER_BUILDER, "Master Builder");
|
||||
flairNameList.put(Title.DONATOR, "Premium");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import java.util.List;
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.PlayerData;
|
||||
import me.totalfreedom.totalfreedommod.util.FLog;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@ -19,7 +20,6 @@ import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemFlag;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
@ -28,7 +28,6 @@ import org.bukkit.scheduler.BukkitTask;
|
||||
|
||||
public class Shop extends FreedomService
|
||||
{
|
||||
|
||||
private BukkitTask reactions;
|
||||
public String reactionString = "";
|
||||
public Date reactionStartTime;
|
||||
@ -48,7 +47,6 @@ public class Shop extends FreedomService
|
||||
|
||||
public void startReactionTimer()
|
||||
{
|
||||
|
||||
long interval = ConfigEntry.SHOP_REACTIONS_INTERVAL.getInteger() * 20L;
|
||||
|
||||
reactions = new BukkitRunnable()
|
||||
@ -70,6 +68,12 @@ public class Shop extends FreedomService
|
||||
|
||||
public void startReaction()
|
||||
{
|
||||
if (!ConfigEntry.SHOP_ENABLED.getBoolean())
|
||||
{
|
||||
FLog.debug("The shop is not enabled, therefore a reaction did not start.");
|
||||
return;
|
||||
}
|
||||
|
||||
reactionString = FUtil.randomString(ConfigEntry.SHOP_REACTIONS_STRING_LENGTH.getInteger());
|
||||
|
||||
FUtil.bcastMsg(prefix + ChatColor.AQUA + "Enter the code above to win " + ChatColor.GOLD + coinsPerReactionWin + ChatColor.AQUA + " coins!", false);
|
||||
@ -86,6 +90,7 @@ public class Shop extends FreedomService
|
||||
{
|
||||
double seconds = 30;
|
||||
double max = seconds;
|
||||
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
@ -133,7 +138,7 @@ public class Shop extends FreedomService
|
||||
reactions.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getShopPrefix()
|
||||
{
|
||||
return FUtil.colorize(ConfigEntry.SHOP_PREFIX.getString());
|
||||
@ -223,7 +228,7 @@ public class Shop extends FreedomService
|
||||
ItemStack itemStack = new ItemStack(Material.FIRE_CHARGE);
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.setDisplayName(ChatColor.RED + "Fire Ball");
|
||||
itemMeta.setLore(Arrays.asList(ChatColor.GOLD+ "Yeet this at people"));
|
||||
itemMeta.setLore(Arrays.asList(ChatColor.GOLD + "Yeet this at people"));
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
return itemStack;
|
||||
}
|
||||
@ -259,18 +264,6 @@ public class Shop extends FreedomService
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public ItemStack getMagicalSaddle()
|
||||
{
|
||||
ItemStack itemStack = new ItemStack(Material.SADDLE);
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
itemMeta.setDisplayName(ChatColor.DARK_GREEN + "Magical Saddle");
|
||||
itemMeta.setLore(Arrays.asList(ChatColor.GREEN + "Ride anything you want..."));
|
||||
itemMeta.addEnchant(Enchantment.DURABILITY, 1, true);
|
||||
itemMeta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
return itemStack;
|
||||
}
|
||||
|
||||
public boolean canAfford(int price, int coins)
|
||||
{
|
||||
if (coins >= price)
|
||||
@ -333,7 +326,7 @@ public class Shop extends FreedomService
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player) event.getWhoClicked();
|
||||
Player player = (Player)event.getWhoClicked();
|
||||
PlayerData playerData = plugin.pl.getData(player);
|
||||
int price = shopItem.getCost();
|
||||
int coins = playerData.getCoins();
|
||||
@ -355,7 +348,6 @@ public class Shop extends FreedomService
|
||||
{
|
||||
player.sendMessage(ChatColor.GREEN + "Run " + shopItem.getCommand() + " to get one!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public ShopItem getShopItem(int slot)
|
||||
|
@ -2,17 +2,13 @@ package me.totalfreedom.totalfreedommod.world;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.FreedomService;
|
||||
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
import org.bukkit.event.weather.ThunderChangeEvent;
|
||||
import org.bukkit.event.weather.WeatherChangeEvent;
|
||||
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
|
||||
|
Reference in New Issue
Block a user