diff --git a/build.gradle b/build.gradle index 6a39c0b..a8c76b2 100644 --- a/build.gradle +++ b/build.gradle @@ -22,7 +22,7 @@ plugins { apply plugin: 'net.minecraftforge.gradle.forge' group 'com.mcsimonflash.wondertrade.sponge' -version '2.2.1' +version '2.2.2' ext.spongeversion = '7.2.0-SNAPSHOT' ext.teslaversion = '1.1.6' diff --git a/src/main/java/com/mcsimonflash/wondertrade/sponge/WonderTrade.java b/src/main/java/com/mcsimonflash/wondertrade/sponge/WonderTrade.java index eedb5e1..00c38f1 100644 --- a/src/main/java/com/mcsimonflash/wondertrade/sponge/WonderTrade.java +++ b/src/main/java/com/mcsimonflash/wondertrade/sponge/WonderTrade.java @@ -24,7 +24,7 @@ import java.nio.file.Path; import java.util.Locale; -@Plugin(id = "wondertrades", name = "WonderTradeSponge", version = "2.2.1", dependencies = @Dependency(id = "pixelmon"), authors = "BlakeAnderson/SimonFlash, LoneWolffy, RainbowChild", description = "Trade your pokemon for a random replacement!") +@Plugin(id = "wondertrades", name = "WonderTradeSponge", version = "2.2.2", dependencies = @Dependency(id = "pixelmon"), authors = "BlakeAnderson/SimonFlash, LoneWolffy, RainbowChild", description = "Trade your pokemon for a random replacement!") public class WonderTrade { private static WonderTrade instance; @@ -66,6 +66,7 @@ public void onShutdown(GameStoppingServerEvent event) { @Listener public void onReload(GameReloadEvent event) { + TradeConfig.saveConfig(); messages.reload(); Utils.initialize(); } diff --git a/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Config.java b/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Config.java index 41c1666..2dc28d7 100644 --- a/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Config.java +++ b/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Config.java @@ -86,7 +86,7 @@ public static void load() { TradeConfig.configFile = WonderTrade.getDirectory().resolve("storage").resolve("trades.pool").toFile(); if(!TradeConfig.configFile.exists()){ Manager.fillPool(startup && regenOnRestart, regenOverwritePlayers); - TradeConfig.loadConfig(); + TradeConfig.saveConfig(); } else{ TradeConfig.loadConfig(); diff --git a/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/TradeConfig.java b/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/TradeConfig.java index 9b12ab9..dec9615 100644 --- a/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/TradeConfig.java +++ b/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/TradeConfig.java @@ -1,19 +1,12 @@ package com.mcsimonflash.wondertrade.sponge.internal; -import com.google.gson.Gson; import com.mcsimonflash.wondertrade.sponge.WonderTrade; import com.mcsimonflash.wondertrade.sponge.data.TradeEntry; import com.pixelmonmod.pixelmon.Pixelmon; -import com.pixelmonmod.pixelmon.api.storage.PCStorage; -import com.pixelmonmod.pixelmon.api.storage.PartyStorage; -import com.pixelmonmod.pixelmon.api.storage.PokemonStorage; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; -import ninja.leaping.configurate.ConfigurationNode; -import ninja.leaping.configurate.gson.GsonConfigurationLoader; import java.io.*; -import java.nio.file.Path; import java.time.LocalDateTime; import java.time.ZoneOffset; diff --git a/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Utils.java b/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Utils.java index 6ba530c..ac0dc5f 100644 --- a/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Utils.java +++ b/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Utils.java @@ -74,8 +74,11 @@ public static void initialize() { if (Config.announceInt > 0) { announcementTask = Task.builder() .execute(t -> { - int shinies = 0, ultrabeasts = 0, legendaries = 0; + int eggs = 0, shinies = 0, ultrabeasts = 0, legendaries = 0; for (TradeEntry entry : Manager.trades) { + if (entry.getPokemon().isEgg()) { + eggs++; + } if (entry.getPokemon().isShiny()) { shinies++; } @@ -87,7 +90,7 @@ public static void initialize() { } } //Intentionally don't add prefix to this message to offer servers full configurability of their message. (Hope to see multi-line usage!) - Sponge.getServer().getBroadcastChannel().send(WonderTrade.getMessage(Locales.DEFAULT, "wondertrade.announcement", "pool-size", Config.poolSize, "shinies", shinies, "ultrabeasts", ultrabeasts, "legendaries", legendaries).toText()); + Sponge.getServer().getBroadcastChannel().send(WonderTrade.getMessage(Locales.DEFAULT, "wondertrade.announcement", "pool-size", Config.poolSize, "eggs", eggs, "shinies", shinies, "ultrabeasts", ultrabeasts, "legendaries", legendaries).toText()); }) .interval(Config.announceInt, TimeUnit.MILLISECONDS) .submit(WonderTrade.getContainer());