Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Trophonix committed Dec 27, 2018
1 parent b878ed9 commit b8aa2c0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/trophonix/tradeplus/TradePlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.trophonix.tradeplus.util.Sounds;
import de.themoep.idconverter.IdMappings;
import de.themoep.idconverter.IdMappings.Mapping;
import org.bukkit.DyeColor;
import org.bukkit.Material;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/trophonix/tradeplus/commands/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

import java.util.List;

public abstract class Command {
abstract class Command {

private List<String> aliases;

public Command(List<String> aliases) {
Command(List<String> aliases) {
this.aliases = aliases;
}

Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/trophonix/tradeplus/extras/Extra.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
public abstract class Extra {

public final ItemStack icon;
final String name;
private final String name;
final Player player1;
final Player player2;
final double increment;
final ItemStack theirIcon;
final double taxPercent;
public double value1 = 0, value2 = 0;
double max1;
double max2;
long lastUpdatedMax = System.currentTimeMillis();
private double max1;
private double max2;
private long lastUpdatedMax = System.currentTimeMillis();
double increment1;
double increment2;

Expand Down Expand Up @@ -96,7 +96,7 @@ public void onClick(Player player, ClickType click) {
if (value2 > max2) value2 = max2;
}

public abstract double getMax(Player player);
protected abstract double getMax(Player player);

public abstract void onTradeEnd();

Expand Down
16 changes: 7 additions & 9 deletions src/main/java/com/trophonix/tradeplus/util/ItemFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,13 @@ public static ItemStack replaceInMeta(ItemStack item, String... replace) {
item = item.clone();
ItemMeta meta = item.getItemMeta();
for (int i = 0; i < replace.length; i += 2) {
if (replace.length > i) {
String toReplace = replace[i];
String replaceWith = replace[i + 1];
meta.setDisplayName(meta.getDisplayName().replace(toReplace, replaceWith));
List<String> lore = meta.hasLore() ? meta.getLore() : Collections.emptyList();
for (int j = 0; j < lore.size(); j++)
lore.set(j, lore.get(j).replace(toReplace, replaceWith));
meta.setLore(lore);
}
String toReplace = replace[i];
String replaceWith = replace[i + 1];
meta.setDisplayName(meta.getDisplayName().replace(toReplace, replaceWith));
List<String> lore = meta.hasLore() ? meta.getLore() : Collections.emptyList();
for (int j = 0; j < lore.size(); j++)
lore.set(j, lore.get(j).replace(toReplace, replaceWith));
meta.setLore(lore);
}
item.setItemMeta(meta);
return item;
Expand Down

0 comments on commit b8aa2c0

Please sign in to comment.