Skip to content

Commit

Permalink
smol patch - version bump to 2.2.1
Browse files Browse the repository at this point in the history
fixes Auras string not being appended into a pokemon's name description
capitalizes the first character of CustomTexture and Aura names for presentation purposes
stops ghost-entity pokemon due to trading a pokemon away while it was still sent out (retrieves all before trading)
  • Loading branch information
FriendlyRainbowAnimal committed Jun 30, 2020
1 parent 0f974b2 commit 0180cac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 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.0'
version '2.2.1'
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.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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())));
Expand Down Expand Up @@ -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())));
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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- ")
Expand Down Expand Up @@ -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);
}
}

0 comments on commit 0180cac

Please sign in to comment.