Skip to content

Commit

Permalink
more smol patchs - version bump to 2.2.2
Browse files Browse the repository at this point in the history
fixes reloading not saving the pool first incorrectly, small problem but it effected me in testing!
adds egg count support to the interval announcement via "<eggs>"
  • Loading branch information
FriendlyRainbowAnimal committed Jul 2, 2020
1 parent 0180cac commit fc231aa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -66,6 +66,7 @@ public void onShutdown(GameStoppingServerEvent event) {

@Listener
public void onReload(GameReloadEvent event) {
TradeConfig.saveConfig();
messages.reload();
Utils.initialize();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand All @@ -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());
Expand Down

0 comments on commit fc231aa

Please sign in to comment.