Buffer messages to send to Spam channel. Fix World Shop Purchase update
bug.
This commit is contained in:
parent
d4746ac28e
commit
480bd4f9f3
Binary file not shown.
@ -265,6 +265,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
public static LootLogger Loot_Logger; //The logger for Loot.
|
public static LootLogger Loot_Logger; //The logger for Loot.
|
||||||
public static AutoUpdatePlugin pluginupdater;
|
public static AutoUpdatePlugin pluginupdater;
|
||||||
public static boolean restarting_server=false;
|
public static boolean restarting_server=false;
|
||||||
|
public static List<String> log_messages=new ArrayList<String>();
|
||||||
|
|
||||||
long LastClearStructureTime = 0;
|
long LastClearStructureTime = 0;
|
||||||
|
|
||||||
@ -476,6 +477,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
adjustServerTime(10);
|
adjustServerTime(10);
|
||||||
//WORK IN PROGRESS: Lamp updating code TO GO HERE.
|
//WORK IN PROGRESS: Lamp updating code TO GO HERE.
|
||||||
|
|
||||||
|
sendAllLoggedMessagesToSpam();
|
||||||
|
|
||||||
//SAVE SERVER SETTINGS.
|
//SAVE SERVER SETTINGS.
|
||||||
if (getServerTickTime()-LASTSERVERCHECK>=SERVERCHECKERTICKS) { //15 MINUTES (DEFAULT)
|
if (getServerTickTime()-LASTSERVERCHECK>=SERVERCHECKERTICKS) { //15 MINUTES (DEFAULT)
|
||||||
saveOurData();
|
saveOurData();
|
||||||
@ -781,6 +784,15 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
TwosideSpleefGames.TickEvent();
|
TwosideSpleefGames.TickEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void sendAllLoggedMessagesToSpam() {
|
||||||
|
StringBuilder finalstring = new StringBuilder();
|
||||||
|
for (int i=0;i<TwosideKeeper.log_messages.size();i++) {
|
||||||
|
finalstring.append(TwosideKeeper.log_messages.get(i));
|
||||||
|
}
|
||||||
|
TwosideKeeper.log_messages.clear();
|
||||||
|
DiscordMessageSender.sendRawMessageDiscord(finalstring.toString());
|
||||||
|
}
|
||||||
|
|
||||||
private double subtractVanillaArmorBar(ItemStack[] armorContents) {
|
private double subtractVanillaArmorBar(ItemStack[] armorContents) {
|
||||||
double lostamt = 0.0d;
|
double lostamt = 0.0d;
|
||||||
for (int i=0;i<armorContents.length;i++) {
|
for (int i=0;i<armorContents.length;i++) {
|
||||||
@ -6177,7 +6189,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
|
|||||||
|
|
||||||
public static void log(String logmessage, int loglv) {
|
public static void log(String logmessage, int loglv) {
|
||||||
if (LOGGING_LEVEL>=loglv) {
|
if (LOGGING_LEVEL>=loglv) {
|
||||||
DiscordMessageSender.sendToSpam(ChatColor.stripColor(logmessage));
|
log_messages.add(ChatColor.stripColor(logmessage));
|
||||||
switch (loglv) {
|
switch (loglv) {
|
||||||
case 0: {
|
case 0: {
|
||||||
//Only game breaking messages appear in level 0.
|
//Only game breaking messages appear in level 0.
|
||||||
|
@ -252,7 +252,11 @@ public class WorldShopManager {
|
|||||||
//Use this as the next world shop.
|
//Use this as the next world shop.
|
||||||
TwosideKeeper.log("Found item for slot "+i, 5);
|
TwosideKeeper.log("Found item for slot "+i, 5);
|
||||||
shop.UpdateItem(shopchest.getInventory().getItem(i));
|
shop.UpdateItem(shopchest.getInventory().getItem(i));
|
||||||
shop.UpdateAmount(GenericFunctions.CountItems(shopchest.getInventory(), shopchest.getInventory().getItem(i)));
|
if (WorldShop.isPurchaseShopSign(s)) {
|
||||||
|
shop.UpdateAmount(GenericFunctions.CountEmptySpace(shopchest.getInventory(), shopchest.getInventory().getItem(i)));
|
||||||
|
} else {
|
||||||
|
shop.UpdateAmount(GenericFunctions.CountItems(shopchest.getInventory(), shopchest.getInventory().getItem(i)));
|
||||||
|
}
|
||||||
founditem=true;
|
founditem=true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user