Added some debug messages
This commit is contained in:
parent
9ece3e6d5d
commit
bf43f88d9b
|
|
@ -57,6 +57,8 @@ public class VillagerUI extends JavaPlugin {
|
|||
new BukkitRunnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (Config.DEBUG)
|
||||
Logger.info("Syncing users.");
|
||||
EconUser.getEconUsers().forEach(econUser -> {
|
||||
econUser.removePoints();
|
||||
econUser.syncPoints();
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ public final class Config extends AbstractConfig {
|
|||
public static String NOT_ENOUGH_ITEMS = "<red>You only have don't have enough <type> you need at least <amount>.</red>";
|
||||
public static String PURCHASED_ITEM = "<green>You bought <amount> <item> for <price>!</green>";
|
||||
public static String SOLD_ITEM = "<green>You sold <amount> <item> for <price>!</green>";
|
||||
|
||||
private static void loadMessages() {
|
||||
NOT_ENOUGH_MONEY = config.getString("messages.not-enough-money", NOT_ENOUGH_MONEY);
|
||||
NOT_ENOUGH_ITEMS = config.getString("messages.not-enough-items", NOT_ENOUGH_ITEMS);
|
||||
|
|
@ -97,6 +98,12 @@ public final class Config extends AbstractConfig {
|
|||
SOLD_ITEM = config.getString("messages.sold-item", SOLD_ITEM);
|
||||
}
|
||||
|
||||
public static boolean DEBUG = false;
|
||||
|
||||
private static void loadSettings() {
|
||||
DEBUG = config.getBoolean("settings.debug", DEBUG);
|
||||
}
|
||||
|
||||
private static void loadVillagerTypes() {
|
||||
VillagerType.clearVillagerTypes();
|
||||
ConfigurationSection configurationSection = config.getConfigurationSection("villager-types");
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.alttd.events;
|
||||
|
||||
import com.alttd.VillagerUI;
|
||||
import com.alttd.config.Config;
|
||||
import com.alttd.database.Queries;
|
||||
import com.alttd.objects.EconUser;
|
||||
import com.alttd.util.Logger;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerJoinEvent;
|
||||
|
|
@ -21,6 +23,9 @@ public class LoginEvent implements Listener {
|
|||
int minutes = Queries.getMinutesSinceUpdated(uuid);
|
||||
|
||||
user.removePoints(minutes * 2);
|
||||
if (Config.DEBUG)
|
||||
Logger.info("Loaded EconUser for % and removed % points",
|
||||
event.getPlayer().getName(), String.valueOf(minutes * 2));
|
||||
}
|
||||
}.runTask(VillagerUI.getInstance());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user