diff --git a/build.gradle b/build.gradle index 2bf43e5..6a39c0b 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.0' +version '2.2.1' 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 6fc1242..eedb5e1 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.0", 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.1", dependencies = @Dependency(id = "pixelmon"), authors = "BlakeAnderson/SimonFlash, LoneWolffy, RainbowChild", description = "Trade your pokemon for a random replacement!") public class WonderTrade { private static WonderTrade instance; 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 9d43278..6ba530c 100644 --- a/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Utils.java +++ b/src/main/java/com/mcsimonflash/wondertrade/sponge/internal/Utils.java @@ -162,6 +162,8 @@ public static long getCooldown(Player player) { public static void trade(Player player, int slot) { PartyStorage storage = getPartyStorage(player); Pokemon pokemon = storage.get(slot); + //to stop ghost entities + storage.retrieveAll(); if (pokemon.isEgg() && !(Config.allowEggs || player.hasPermission("wondertrade.trade.eggbypass")) ){ player.sendMessage(WonderTrade.getPrefix().concat(parseText(WonderTrade.getMessage(player.getLocale(), "wondertrade.trade.no-eggs").toString()))); @@ -198,6 +200,8 @@ public static void trade(Player player, int slot) { public static void trade(Player player, int box, int position) { PCStorage storage = getPCStorage(player); Pokemon pokemon = storage.getBox(box).get(position); + //to stop ghost entities + getPartyStorage(player).retrieveAll(); if (pokemon.isEgg() && !(Config.allowEggs || player.hasPermission("wondertrade.trade.eggbypass")) ){ player.sendMessage(WonderTrade.getPrefix().concat(parseText(WonderTrade.getMessage(player.getLocale(), "wondertrade.trade.no-eggs").toString()))); @@ -309,7 +313,10 @@ public static String getShortDesc(Pokemon pokemon) { builder.append(" ").append(getPokemonSpecialTexture(pokemon).getTranslatedName().getUnformattedComponentText()); } else if(!pokemon.getCustomTexture().isEmpty() && pokemon.getCustomTexture() != null){ - builder.append(" ").append(pokemon.getCustomTexture()); + builder.append(" ").append(capitalizeFirstLetter(pokemon.getCustomTexture())); + } + if(pokemon.getPersistentData().hasKey("entity-particles:particle")){ + builder.append(" ").append(capitalizeFirstLetter(pokemon.getPersistentData().getString("entity-particles:particle"))); } if(pokemon.getFormEnum() == RegionalForms.ALOLAN || pokemon.getFormEnum() == RegionalForms.GALARIAN){ builder.append(" ").append(pokemon.getFormEnum().getTranslatedName().getUnformattedComponentText()); @@ -414,13 +421,13 @@ public static String getDesc(Pokemon pokemon) { builder.append(" %3$s- ") .append(WonderTrade.getMessage(Locales.DEFAULT, "wondertrade.ui.pokesprite.lore.customtexturelabel")) .append(" : %3$s") - .append(pokemon.getCustomTexture()).append("\n"); + .append(capitalizeFirstLetter(pokemon.getCustomTexture())).append("\n"); } if (pokemon.getPersistentData().hasKey("entity-particles:particle")){ builder.append(" %3$s- ") .append(WonderTrade.getMessage(Locales.DEFAULT, "wondertrade.ui.pokesprite.lore.entityparticles")) .append(" : %3$s") - .append(pokemon.getPersistentData().getString("entity-particles:particle")).append("\n"); + .append(capitalizeFirstLetter(pokemon.getPersistentData().getString("entity-particles:particle"))).append("\n"); } builder.append(" %1$s- ") @@ -673,4 +680,8 @@ public static Task createCooldownTaskForPlayer(Player player, long time){ .delay(time, TimeUnit.MILLISECONDS) .submit(WonderTrade.getContainer()); } + + public static String capitalizeFirstLetter(String string){ + return string.substring(0,1).toUpperCase() + string.substring(1); + } } \ No newline at end of file