Remove some google libs imports

This commit is contained in:
filoghost 2014-12-21 15:15:06 +01:00
parent 2e1e184bb4
commit 19c1a356f7
5 changed files with 16 additions and 15 deletions

View File

@ -24,7 +24,7 @@ public class AlignCommand extends HologramSubCommand {
@Override @Override
public String getPossibleArguments() { public String getPossibleArguments() {
return "<X|Y|Z|XZ> <hologram> <referenceHologram>"; return "<X | Y | Z | XZ> <hologram> <referenceHologram>";
} }
@Override @Override
@ -58,7 +58,7 @@ public class AlignCommand extends HologramSubCommand {
} }
hologram.teleport(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ()); hologram.teleport(loc.getWorld(), loc.getX(), loc.getY(), loc.getZ());
hologram.despawnEntities(); hologram.despawnEntities();
hologram.refreshAll(); hologram.refreshAll();
HologramDatabase.saveHologram(hologram); HologramDatabase.saveHologram(hologram);

View File

@ -9,8 +9,6 @@ import java.net.URL;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import net.minecraft.util.com.google.common.collect.Lists;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -27,6 +25,7 @@ import com.gmail.filoghost.holographicdisplays.image.ImageMessage;
import com.gmail.filoghost.holographicdisplays.object.NamedHologram; import com.gmail.filoghost.holographicdisplays.object.NamedHologram;
import com.gmail.filoghost.holographicdisplays.object.NamedHologramManager; import com.gmail.filoghost.holographicdisplays.object.NamedHologramManager;
import com.gmail.filoghost.holographicdisplays.util.FileUtils; import com.gmail.filoghost.holographicdisplays.util.FileUtils;
import com.gmail.filoghost.holographicdisplays.util.Utils;
public class ReadimageCommand extends HologramSubCommand { public class ReadimageCommand extends HologramSubCommand {
@ -52,7 +51,7 @@ public class ReadimageCommand extends HologramSubCommand {
boolean append = false; boolean append = false;
List<String> newArgs = Lists.newArrayList(); List<String> newArgs = Utils.newList();
for (int i = 0; i < args.length; i++) { for (int i = 0; i < args.length; i++) {
if (args[i].equalsIgnoreCase("-a") || args[i].equalsIgnoreCase("-append")) { if (args[i].equalsIgnoreCase("-a") || args[i].equalsIgnoreCase("-append")) {

View File

@ -12,7 +12,7 @@ import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.plugin.Plugin; import org.bukkit.plugin.Plugin;
import com.google.common.base.Joiner; import com.gmail.filoghost.holographicdisplays.util.Utils;
/** /**
* Just a bunch of static varibles to hold the settings. * Just a bunch of static varibles to hold the settings.
@ -89,13 +89,13 @@ public class Configuration {
if (needsSave) { if (needsSave) {
config.options().header(Joiner.on('\n').join( config.options().header(Utils.join(new String[] {
".", ".",
". Read the tutorial at: http://dev.bukkit.org/bukkit-plugins/holographic-displays/", ". Read the tutorial at: http://dev.bukkit.org/bukkit-plugins/holographic-displays/",
".", ".",
". Plugin created by filoghost.", ". Plugin created by filoghost.",
"." "."},
)); "\n"));
config.options().copyHeader(true); config.options().copyHeader(true);
try { try {
config.save(configFile); config.save(configFile);
@ -108,7 +108,7 @@ public class Configuration {
spaceBetweenLines = config.getDouble(ConfigNode.SPACE_BETWEEN_LINES.getPath()); spaceBetweenLines = config.getDouble(ConfigNode.SPACE_BETWEEN_LINES.getPath());
updateNotification = config.getBoolean(ConfigNode.UPDATE_NOTIFICATION.getPath()); updateNotification = config.getBoolean(ConfigNode.UPDATE_NOTIFICATION.getPath());
imageSymbol = StringConverter.toReadableFormat(config.getString(ConfigNode.IMAGES_SYMBOL.getPath())); imageSymbol = StringConverter.toReadableFormat(config.getString(ConfigNode.IMAGES_SYMBOL.getPath()));
transparencySymbol = StringConverter.toReadableFormat(config.getString(ConfigNode.TRANSPARENCY_SPACE.getPath())); transparencySymbol = StringConverter.toReadableFormat(config.getString(ConfigNode.TRANSPARENCY_SPACE.getPath()));
bungeeRefreshSeconds = config.getInt(ConfigNode.BUNGEE_REFRESH_SECONDS.getPath()); bungeeRefreshSeconds = config.getInt(ConfigNode.BUNGEE_REFRESH_SECONDS.getPath());
useRedisBungee = config.getBoolean(ConfigNode.BUNGEE_USE_REDIS_BUNGEE.getPath()); useRedisBungee = config.getBoolean(ConfigNode.BUNGEE_USE_REDIS_BUNGEE.getPath());
@ -145,5 +145,5 @@ public class Configuration {
plugin.getLogger().warning("The maximum interval for pinging BungeeCord's servers is 60 seconds. It has been automatically set."); plugin.getLogger().warning("The maximum interval for pinging BungeeCord's servers is 60 seconds. It has been automatically set.");
bungeeRefreshSeconds = 60; bungeeRefreshSeconds = 60;
} }
} }
} }

View File

@ -7,7 +7,6 @@ import java.util.regex.Pattern;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import com.google.common.collect.Maps;
public class ItemUtils { public class ItemUtils {
@ -21,7 +20,7 @@ public class ItemUtils {
static { static {
// Default material names are ugly. // Default material names are ugly.
Map<String, Material> tempMap = Maps.newHashMap(); Map<String, Material> tempMap = Utils.newMap();
tempMap.put("iron bar", Material.IRON_FENCE); tempMap.put("iron bar", Material.IRON_FENCE);
tempMap.put("iron bars", Material.IRON_FENCE); tempMap.put("iron bars", Material.IRON_FENCE);

View File

@ -75,8 +75,8 @@ public class Utils extends Object {
public static String join(String[] elements, String separator, int startIndex, int endIndex) { public static String join(String[] elements, String separator, int startIndex, int endIndex) {
Validator.isTrue(startIndex > 0 && startIndex < elements.length, "startIndex out of bounds"); Validator.isTrue(startIndex >= 0 && startIndex < elements.length, "startIndex out of bounds");
Validator.isTrue(endIndex > 0 && endIndex <= elements.length, "endIndex out of bounds"); Validator.isTrue(endIndex >= 0 && endIndex <= elements.length, "endIndex out of bounds");
Validator.isTrue(startIndex <= endIndex, "startIndex lower than endIndex"); Validator.isTrue(startIndex <= endIndex, "startIndex lower than endIndex");
StringBuilder result = new StringBuilder(); StringBuilder result = new StringBuilder();
@ -95,6 +95,9 @@ public class Utils extends Object {
return result.toString(); return result.toString();
} }
public static String join(String[] elements, String separator) {
return join(elements, separator, 0, elements.length);
}
public static String join(List<String> elements, String separator, int startIndex, int size) { public static String join(List<String> elements, String separator, int startIndex, int size) {
return join(elements.toArray(new String[elements.size()]), separator, startIndex, size); return join(elements.toArray(new String[elements.size()]), separator, startIndex, size);