Skip to content

Commit

Permalink
PvPcraft rebrand
Browse files Browse the repository at this point in the history
  • Loading branch information
MoonSoD committed Feb 21, 2021
1 parent 4ae7032 commit 422df4e
Show file tree
Hide file tree
Showing 73 changed files with 126 additions and 151 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.realized.tm.api;

import java.util.UUID;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.api.TokenManager;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
Expand All @@ -18,7 +18,7 @@
public class TMAPI {

private static TokenManager getApi() {
return TokenManagerPlugin.getInstance();
return PcTokenManagerPlugin.getInstance();
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import me.realized.tokenmanager.util.NumberUtil;
import me.realized.tokenmanager.util.Reloadable;
import me.realized.tokenmanager.util.StringUtil;
import org.bstats.bukkit.Metrics;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
Expand All @@ -34,18 +33,15 @@
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.plugin.java.JavaPlugin;
import org.inventivetalent.update.spiget.SpigetUpdate;
import org.inventivetalent.update.spiget.UpdateCallback;
import org.inventivetalent.update.spiget.comparator.VersionComparator;

public class TokenManagerPlugin extends JavaPlugin implements TokenManager, Listener {
public class PcTokenManagerPlugin extends JavaPlugin implements TokenManager, Listener {

private static final int RESOURCE_ID = 8610;
private static final String ADMIN_UPDATE_MESSAGE = "&9[TM] &bTokenManager &fv%s &7is now available for download! Download at: &c%s";
private static final String RESOURCE_URL = "https://www.spigotmc.org/resources/tokenmanager.8610/";

@Getter
private static TokenManagerPlugin instance;
private static PcTokenManagerPlugin instance;

private final List<Loadable> loadables = new ArrayList<>();
private int lastLoad;
Expand Down Expand Up @@ -86,31 +82,10 @@ public void onEnable() {
new TMCommand(this).register();
new TokenCommand(this).register();

new Metrics(this);

if (!configuration.isCheckForUpdates()) {
return;
}

final SpigetUpdate updateChecker = new SpigetUpdate(this, RESOURCE_ID);
updateChecker.setVersionComparator(VersionComparator.SEM_VER_SNAPSHOT);
updateChecker.checkForUpdate(new UpdateCallback() {
@Override
public void updateAvailable(final String newVersion, final String downloadUrl, final boolean hasDirectDownload) {
TokenManagerPlugin.this.updateAvailable = true;
TokenManagerPlugin.this.newVersion = newVersion;
Log.info("===============================================");
Log.info("An update for " + getName() + " is available!");
Log.info("Download " + getName() + " v" + newVersion + " here:");
Log.info(RESOURCE_URL);
Log.info("===============================================");
}

@Override
public void upToDate() {
Log.info("No updates were available. You are on the latest version!");
}
});
getServer().getPluginManager().registerEvents(this, this);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

public final class Permissions {

private static final String PREFIX = "tokenmanager.";
private static final String PREFIX = "pctokenmanager.";

public static final String CMD_TOKEN = PREFIX + "use";
public static final String CMD_ADMIN = PREFIX + "admin";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.realized.tokenmanager.command;

import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.config.Config;
import me.realized.tokenmanager.data.DataManager;
import me.realized.tokenmanager.shop.ShopConfig;
Expand All @@ -9,20 +9,20 @@
import me.realized.tokenmanager.util.profile.ProfileUtil;
import org.bukkit.command.CommandSender;

public abstract class BaseCommand extends AbstractCommand<TokenManagerPlugin> {
public abstract class BaseCommand extends AbstractCommand<PcTokenManagerPlugin> {

protected final Config config;
protected final ShopConfig shopConfig;
protected final ShopManager shopManager;
protected final DataManager dataManager;
protected final boolean online;

public BaseCommand(final TokenManagerPlugin plugin, final String name, final String permission, final boolean playerOnly) {
public BaseCommand(final PcTokenManagerPlugin plugin, final String name, final String permission, final boolean playerOnly) {
this(plugin, name, null, permission, 0, playerOnly);
}

public BaseCommand(final TokenManagerPlugin plugin, final String name, final String usage, final String permission, final int length,
final boolean playerOnly, final String... aliases) {
public BaseCommand(final PcTokenManagerPlugin plugin, final String name, final String usage, final String permission, final int length,
final boolean playerOnly, final String... aliases) {
super(plugin, name, usage, permission, length, playerOnly, aliases);
this.config = plugin.getConfiguration();
this.shopConfig = plugin.getShopConfig();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package me.realized.tokenmanager.command.commands;

import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.command.commands.subcommands.GiveAllCommand;
import me.realized.tokenmanager.command.commands.subcommands.OfflineCommand;
Expand All @@ -13,8 +13,8 @@

public class TMCommand extends BaseCommand {

public TMCommand(final TokenManagerPlugin plugin) {
super(plugin, "tm", Permissions.CMD_ADMIN, false);
public TMCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "pctm", Permissions.CMD_ADMIN, false);
child(
new OfflineCommand(plugin, ModifyType.ADD, "give"),
new OfflineCommand(plugin, ModifyType.REMOVE, "delete", "take"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.OptionalLong;
import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.command.commands.subcommands.BalanceCommand;
import me.realized.tokenmanager.command.commands.subcommands.SellCommand;
Expand All @@ -17,8 +17,8 @@

public class TokenCommand extends BaseCommand {

public TokenCommand(final TokenManagerPlugin plugin) {
super(plugin, "token", Permissions.CMD_TOKEN, false);
public TokenCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "pctoken", Permissions.CMD_TOKEN, false);
child(
new BalanceCommand(plugin),
new SendCommand(plugin),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import java.util.OptionalLong;
import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import org.bukkit.Bukkit;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;

public class BalanceCommand extends BaseCommand {

public BalanceCommand(final TokenManagerPlugin plugin) {
public BalanceCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "balance", "balance", null, 1, false, "bal", "money");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.Collection;
import java.util.OptionalLong;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.util.NumberUtil;
import org.bukkit.Bukkit;
Expand All @@ -11,7 +11,7 @@

public class GiveAllCommand extends BaseCommand {

public GiveAllCommand(final TokenManagerPlugin plugin) {
public GiveAllCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "giveall", "giveall <amount>", null, 2, false, "sendall");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.util.OptionalLong;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.util.NumberUtil;
import me.realized.tokenmanager.util.profile.ProfileUtil;
Expand Down Expand Up @@ -42,7 +42,7 @@ public long apply(final long balance, final long amount) {

private final ModifyType type;

public OfflineCommand(final TokenManagerPlugin plugin, final ModifyType type, final String... aliases) {
public OfflineCommand(final PcTokenManagerPlugin plugin, final ModifyType type, final String... aliases) {
super(plugin, type.name().toLowerCase(), type.name().toLowerCase() + " <username> <amount>", null, 3, false, aliases);
this.type = type;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.shop.Shop;
import me.realized.tokenmanager.shop.gui.guis.ShopGui;
Expand All @@ -14,7 +14,7 @@

public class OpenCommand extends BaseCommand {

public OpenCommand(final TokenManagerPlugin plugin) {
public OpenCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "open", "open <username> <shop>", null, 3, false, "show");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.List;
import java.util.Optional;
import java.util.stream.Collectors;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.util.Loadable;
import me.realized.tokenmanager.util.Reloadable;
Expand All @@ -12,7 +12,7 @@

public class ReloadCommand extends BaseCommand {

public ReloadCommand(final TokenManagerPlugin plugin) {
public ReloadCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "reload", "reload", null, 1, false, "rl");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.OptionalLong;
import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.api.event.TMSellAllEvent;
import me.realized.tokenmanager.api.event.TMSellHandEvent;
import me.realized.tokenmanager.command.BaseCommand;
Expand All @@ -14,7 +14,7 @@

public class SellCommand extends BaseCommand {

public SellCommand(final TokenManagerPlugin plugin) {
public SellCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "sell", "sell", Permissions.CMD_SELL, 1, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.List;
import java.util.OptionalLong;
import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.api.event.TMTokenSendEvent;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.event.TokenReceiveEvent;
Expand All @@ -18,7 +18,7 @@ public class SendCommand extends BaseCommand {

private static final List<String> TAB_AMOUNTS = Arrays.asList("5", "10", "25", "50", "75", "100", "500", "1000");

public SendCommand(final TokenManagerPlugin plugin) {
public SendCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "send", "send <username> <amount>", Permissions.CMD_SEND, 3, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.Optional;
import java.util.stream.Collectors;
import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.shop.Shop;
import me.realized.tokenmanager.shop.gui.guis.ShopGui;
Expand All @@ -14,7 +14,7 @@

public class ShopCommand extends BaseCommand {

public ShopCommand(final TokenManagerPlugin plugin) {
public ShopCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "shop", "shop <name>", Permissions.CMD_SHOP, plugin.getConfiguration().isOpenSelectedEnabled() ? 1 : 2, true);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

import java.util.stream.Collectors;
import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.shop.Shop;
import org.apache.commons.lang.StringUtils;
import org.bukkit.command.CommandSender;

public class ShopsCommand extends BaseCommand {

public ShopsCommand(final TokenManagerPlugin plugin) {
public ShopsCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "shops", "shops", Permissions.CMD_SHOP, 1, false);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import java.util.List;
import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import me.realized.tokenmanager.data.database.Database.TopElement;
import org.bukkit.command.CommandSender;

public class TopCommand extends BaseCommand {

public TopCommand(final TokenManagerPlugin plugin) {
public TopCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "top", "top", Permissions.CMD_TOP, 1, false, "balancetop");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package me.realized.tokenmanager.command.commands.subcommands;

import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

public class TransferCommand extends BaseCommand {

public TransferCommand(final TokenManagerPlugin plugin) {
public TransferCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "transfer", "transfer", null, 1, false);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package me.realized.tokenmanager.command.commands.subcommands;

import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender;

public class VersionCommand extends BaseCommand {

public VersionCommand(final TokenManagerPlugin plugin) {
public VersionCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "version", "version", null, 1, false, "v");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import java.util.OptionalLong;
import me.realized.tokenmanager.Permissions;
import me.realized.tokenmanager.TokenManagerPlugin;
import me.realized.tokenmanager.PcTokenManagerPlugin;
import me.realized.tokenmanager.command.BaseCommand;
import org.apache.commons.lang.WordUtils;
import org.bukkit.command.CommandSender;
Expand All @@ -12,7 +12,7 @@

public class WorthCommand extends BaseCommand {

public WorthCommand(final TokenManagerPlugin plugin) {
public WorthCommand(final PcTokenManagerPlugin plugin) {
super(plugin, "worth", "worth", Permissions.CMD_WORTH, 1, true);
}

Expand Down
Loading

0 comments on commit 422df4e

Please sign in to comment.