Minor Cleanup bee and tree commands

This commit is contained in:
mezz committed 2014-12-14 14:46:25 -08:00
1 parent d8beaa92b9
commit 3d4ba15751
9 files changed
+18 -27

No files matched your search

@@ -51,7 +51,7 @@ public class BeeModeHelper implements ICommandModeHelper {
}
@Override
public ArrayList<String> getDescription(String modeName) {
public Iterable<String> getDescription(String modeName) {
IBeekeepingMode mode = PluginApiculture.beeInterface.getBeekeepingMode(modeName);
return mode.getDescription();
}
@@ -51,11 +51,6 @@ public class BeeStatsSaveHelper implements IStatsSaveHelper {
statistics.add("");
}
@Override
public String getModeName(World world) {
return PluginApiculture.beeInterface.getBeekeepingMode(world).getName();
}
@Override
public Collection<IAlleleSpecies> getSpecies() {
Collection<IAlleleSpecies> species = new ArrayList<IAlleleSpecies>();
@@ -26,7 +26,7 @@ public class CommandBee extends SubCommand {
ICommandModeHelper modeHelper = new BeeModeHelper();
addChildCommand(new CommandMode(modeHelper));
addChildCommand(new CommandSaveStats(saveHelper));
addChildCommand(new CommandSaveStats(saveHelper, modeHelper));
addChildCommand(new CommandBeeGive());
}
}
@@ -27,7 +27,7 @@ public class CommandTree extends SubCommand {
addChildCommand(new CommandTreeSpawn("spawnTree", new TreeSpawner()));
addChildCommand(new CommandTreeSpawn("spawnForest", new ForestSpawner()));
addChildCommand(new CommandMode(modeHelper));
addChildCommand(new CommandSaveStats(saveHelper));
addChildCommand(new CommandSaveStats(saveHelper, modeHelper));
}
}
@@ -51,7 +51,7 @@ public class TreeModeHelper implements ICommandModeHelper {
}
@Override
public ArrayList<String> getDescription(String modeName) {
public Iterable<String> getDescription(String modeName) {
ITreekeepingMode mode = PluginArboriculture.treeInterface.getTreekeepingMode(modeName);
return mode.getDescription();
}
@@ -36,11 +36,6 @@ public class TreeStatsSaveHelper implements IStatsSaveHelper {
public void addExtraInfo(Collection<String> statistics, IBreedingTracker breedingTracker) {
}
@Override
public String getModeName(World world) {
return PluginArboriculture.treeInterface.getTreekeepingMode(world).getName();
}
@Override
public Collection<IAlleleSpecies> getSpecies() {
Collection<IAlleleSpecies> species = new ArrayList<IAlleleSpecies>();
@@ -37,17 +37,22 @@ import forestry.core.utils.StringUtil;
public final class CommandSaveStats extends SubCommand {
private final String discoveredSymbol;
private final String blacklistedSymbol;
private final String notCountedSymbol;
private final IStatsSaveHelper saveHelper;
public CommandSaveStats(IStatsSaveHelper saveHelper) {
super("save");
private static final String discoveredSymbol;
private static final String blacklistedSymbol;
private static final String notCountedSymbol;
static {
discoveredSymbol = StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.discovered.symbol");
blacklistedSymbol = StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.blacklisted.symbol");
notCountedSymbol = StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.notCounted.symbol");
}
private final IStatsSaveHelper saveHelper;
private final ICommandModeHelper modeHelper;
public CommandSaveStats(IStatsSaveHelper saveHelper, ICommandModeHelper modeHelper) {
super("save");
this.saveHelper = saveHelper;
this.modeHelper = modeHelper;
}
@Override
@@ -76,7 +81,7 @@ public final class CommandSaveStats extends SubCommand {
String date = DateFormat.getInstance().format(new Date());
statistics.add(StatCollector.translateToLocalFormatted(saveHelper.getUnlocalizedSaveStatsString(), player.getDisplayName(), date));
statistics.add("");
statistics.add(StatCollector.translateToLocalFormatted("for.chat.command.forestry.stats.save.mode", saveHelper.getModeName(world)));
statistics.add(StatCollector.translateToLocalFormatted("for.chat.command.forestry.stats.save.mode", modeHelper.getModeName(world)));
statistics.add("");
IBreedingTracker tracker = saveHelper.getBreedingTracker(world, player.getGameProfile());
@@ -10,8 +10,6 @@
******************************************************************************/
package forestry.core.commands;
import java.util.ArrayList;
import net.minecraft.world.World;
public interface ICommandModeHelper {
@@ -22,5 +20,5 @@ public interface ICommandModeHelper {
String getModeName(World world);
void setMode(World world, String modeName);
ArrayList<String> getDescription(String modeName);
Iterable<String> getDescription(String modeName);
}
@@ -25,8 +25,6 @@ public interface IStatsSaveHelper {
void addExtraInfo(Collection<String> statistics, IBreedingTracker breedingTracker);
String getModeName(World world);
Collection<IAlleleSpecies> getSpecies();
String getFileSuffix();