mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-13 18:14:38 +02:00
More Cleanup :: add TODO comments
This commit is contained in:
@@ -48,7 +48,7 @@ public interface IUser extends OfflinePlayer, CommandSender, IStorageObjectHolde
|
||||
|
||||
Location getHome(Location loc);
|
||||
|
||||
//boolean isHidden();
|
||||
//boolean isHidden(); TODO: implement this?
|
||||
ITeleport getTeleport();
|
||||
|
||||
void checkCooldown(UserData.TimestampType cooldownType, double cooldown, boolean set, IPermission bypassPermission) throws CooldownException;
|
||||
|
@@ -18,7 +18,7 @@ public class Commandgetpos extends EssentialsCommand
|
||||
final Location mainPlayerLoc = mainPlayer.getLocation();
|
||||
if (args.length > 0 && Permissions.GETPOS_OTHERS.isAuthorized(user))
|
||||
{
|
||||
//todo permissions
|
||||
//TODO: permissions
|
||||
final IUser otherUser = ess.getUserMap().matchUser(args[0], false);
|
||||
if (mainPlayer.canSee(otherUser.getPlayer()) || Permissions.LIST_HIDDEN.isAuthorized(user))
|
||||
{
|
||||
|
@@ -100,7 +100,7 @@ public class Commandrecipe extends EssentialsCommand
|
||||
}
|
||||
else
|
||||
{
|
||||
final HashMap<Material, String> colorMap = new HashMap<Material, String>(); //Might be better as an Enum
|
||||
final HashMap<Material, String> colorMap = new HashMap<Material, String>(); //TODO: Might be better as an Enum
|
||||
int i = 1;
|
||||
for (Character c : "abcdefghi".toCharArray()) // TODO: Faster to use new char[] { 'a','b','c','d','e','f','g','h','i' } ?
|
||||
{
|
||||
|
@@ -409,7 +409,7 @@ public class EssentialsCommandHandler implements ICommandHandler, TabExecutor
|
||||
final String altString = pc.getPlugin().getName() + ":" + pc.getLabel();
|
||||
if (ess.getSettings().isDebug())
|
||||
{
|
||||
LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + altString);
|
||||
LOGGER.log(Level.INFO, "Essentials: Alternative command " + label + " found, using " + altString); //TODO: TL key?
|
||||
}
|
||||
disabledList.put(label, altString);
|
||||
}
|
||||
|
@@ -48,7 +48,6 @@ public class Methods
|
||||
addMethod("iConomy", new net.ess3.economy.register.methods.iCo6());
|
||||
addMethod("iConomy", new net.ess3.economy.register.methods.iCo5());
|
||||
addMethod("BOSEconomy", new net.ess3.economy.register.methods.BOSE7());
|
||||
Dependencies.add("MultiCurrency");
|
||||
addMethod("Vault", new net.ess3.economy.register.methods.VaultEco());
|
||||
}
|
||||
|
||||
|
@@ -14,6 +14,7 @@ import net.ess3.Teleport;
|
||||
import net.ess3.api.*;
|
||||
import net.ess3.craftbukkit.InventoryWorkaround;
|
||||
import net.ess3.economy.register.Method;
|
||||
import net.ess3.economy.register.Methods;
|
||||
import net.ess3.permissions.Permissions;
|
||||
import net.ess3.utils.DateUtil;
|
||||
import net.ess3.utils.FormatUtil;
|
||||
@@ -238,7 +239,7 @@ public class User extends UserBase implements IUser
|
||||
}
|
||||
catch (IllegalArgumentException e)
|
||||
{
|
||||
ess.getLogger().info("Playerlist for " + name + " was not updated. Use a shorter displayname prefix.");
|
||||
ess.getLogger().info("Playerlist for " + name + " was not updated. Use a shorter displayname prefix."); //TODO: TL key?
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,9 +249,6 @@ public class User extends UserBase implements IUser
|
||||
final Boolean changeDisplayname = ess.getSettings().getData().getChat().getChangeDisplayname();
|
||||
|
||||
if (isOnline() && (changeDisplayname == true || (changeDisplayname == null && ess.getPlugin().isModuleEnabled("Chat"))))
|
||||
{
|
||||
;
|
||||
}
|
||||
{
|
||||
setDisplayNick();
|
||||
}
|
||||
@@ -259,16 +257,16 @@ public class User extends UserBase implements IUser
|
||||
@Override
|
||||
public double getMoney()
|
||||
{
|
||||
if (ess.getPaymentMethod().hasMethod())
|
||||
if (Methods.hasMethod())
|
||||
{
|
||||
try
|
||||
{
|
||||
final Method method = ess.getPaymentMethod().getMethod();
|
||||
final Method method = Methods.getMethod();
|
||||
if (!method.hasAccount(this.getName()))
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
final Method.MethodAccount account = ess.getPaymentMethod().getMethod().getAccount(this.getName());
|
||||
final Method.MethodAccount account = Methods.getMethod().getAccount(this.getName());
|
||||
return account.balance();
|
||||
}
|
||||
catch (Throwable ex)
|
||||
@@ -281,16 +279,16 @@ public class User extends UserBase implements IUser
|
||||
@Override
|
||||
public void setMoney(final double value)
|
||||
{
|
||||
if (ess.getPaymentMethod().hasMethod())
|
||||
if (Methods.hasMethod())
|
||||
{
|
||||
try
|
||||
{
|
||||
final Method method = ess.getPaymentMethod().getMethod();
|
||||
final Method method = Methods.getMethod();
|
||||
if (!method.hasAccount(this.getName()))
|
||||
{
|
||||
throw new Exception();
|
||||
}
|
||||
final Method.MethodAccount account = ess.getPaymentMethod().getMethod().getAccount(this.getName());
|
||||
final Method.MethodAccount account = Methods.getMethod().getAccount(this.getName());
|
||||
account.set(value);
|
||||
}
|
||||
catch (Throwable ex)
|
||||
|
@@ -315,7 +315,7 @@ public abstract class UserBase extends AsyncStorageObjectHolder<UserData> implem
|
||||
for (Location location : worldHomes)
|
||||
{
|
||||
final double d = loc.distanceSquared(location);
|
||||
if (d < distance) // Shouldnt this just use Double.isInfinite(v); rather than create a new Double of maxval?
|
||||
if (d < distance) // TODO: Shouldnt this just use Double.isInfinite(v); rather than create a new Double of maxval?
|
||||
{
|
||||
target = location;
|
||||
distance = d;
|
||||
|
@@ -6,7 +6,6 @@ import net.ess3.storage.*;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
|
||||
//maybe replace HashSets/HashMaps with Enums
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class UserData implements StorageObject
|
||||
|
@@ -34,7 +34,7 @@ public class KeywordReplacer implements IText
|
||||
String displayName, ipAddress, balance, mails, world;
|
||||
String worlds, online, unique, playerlist, date, time;
|
||||
String worldTime12, worldTime24, worldDate, plugins;
|
||||
String userName, address, version; //unused?
|
||||
String userName, address, version; //TODO: unused?
|
||||
if (sender instanceof IUser)
|
||||
{
|
||||
final IUser user = (IUser)sender;
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package net.ess3;
|
||||
|
||||
import java.io.*;
|
||||
import org.bukkit.Location;
|
||||
import net.ess3.settings.Settings;
|
||||
import net.ess3.settings.geoip.GeoIP;
|
||||
import net.ess3.storage.ObjectLoadException;
|
||||
@@ -9,6 +8,7 @@ import net.ess3.storage.StorageObject;
|
||||
import net.ess3.storage.YamlStorageReader;
|
||||
import net.ess3.storage.YamlStorageWriter;
|
||||
import net.ess3.utils.ExecuteTimer;
|
||||
import org.bukkit.Location;
|
||||
import org.junit.Test;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class StorageTest extends EssentialsTest
|
||||
ext.mark("load empty settings");
|
||||
final ByteArrayInputStream bais3 = new ByteArrayInputStream(new byte[0]);
|
||||
final Reader reader3 = new InputStreamReader(bais3);
|
||||
final Settings settings3 = new YamlStorageReader(reader3, null).load(Settings.class);
|
||||
final Settings settings3 = new YamlStorageReader(reader3, null).load(Settings.class); //TODO: unused?
|
||||
ext.mark("load empty settings (class cached)");
|
||||
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
final PrintWriter writer = new PrintWriter(baos);
|
||||
@@ -98,7 +98,7 @@ public class StorageTest extends EssentialsTest
|
||||
ext.mark("reload file");
|
||||
final ByteArrayInputStream bais4 = new ByteArrayInputStream(written);
|
||||
final Reader reader4 = new InputStreamReader(bais4);
|
||||
final net.ess3.user.UserData userdata4 = new YamlStorageReader(reader4, null).load(net.ess3.user.UserData.class);
|
||||
final net.ess3.user.UserData userdata4 = new YamlStorageReader(reader4, null).load(net.ess3.user.UserData.class); //TODO: unused?
|
||||
ext.mark("reload file (cached)");
|
||||
System.out.println(userdata.toString());
|
||||
System.out.println(userdata2.toString());
|
||||
@@ -125,7 +125,7 @@ public class StorageTest extends EssentialsTest
|
||||
ext.mark("load empty geoip");
|
||||
final ByteArrayInputStream bais3 = new ByteArrayInputStream(new byte[0]);
|
||||
final Reader reader3 = new InputStreamReader(bais3);
|
||||
final GeoIP geoip3 = new YamlStorageReader(reader3, null).load(GeoIP.class);
|
||||
final GeoIP geoip3 = new YamlStorageReader(reader3, null).load(GeoIP.class); //TODO: unused?
|
||||
ext.mark("load empty geoip (class cached)");
|
||||
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
final PrintWriter writer = new PrintWriter(baos);
|
||||
|
@@ -15,7 +15,7 @@ public class UserTest extends EssentialsTest
|
||||
base1 = ess.getUserMap().getUser("testPlayer1");
|
||||
}
|
||||
|
||||
private void should(String what)
|
||||
private void should(String what) //TODO: unused/implement this?
|
||||
{
|
||||
System.out.println(getName() + " should " + what);
|
||||
}
|
||||
|
@@ -18,6 +18,7 @@ public class Essentials extends JavaPlugin
|
||||
Bukkit.getLogger().info("You can remove this compatibility plugin, when all plugins are updated to Essentials-3");
|
||||
//TODO: Update files to new 3.0 format
|
||||
//TODO: Move Eco Api here
|
||||
//TODO: write update methods for itemmeta
|
||||
IPlugin plugin = (IPlugin)getServer().getPluginManager().getPlugin("Essentials-3");
|
||||
ess = plugin.getEssentials();
|
||||
updateSettings();
|
||||
|
@@ -27,7 +27,6 @@ public interface ISettings
|
||||
|
||||
int getChatRadius();
|
||||
|
||||
|
||||
double getCommandCost(String label);
|
||||
|
||||
String getCurrencySymbol();
|
||||
@@ -68,7 +67,6 @@ public interface ISettings
|
||||
|
||||
int getHomeLimit(String set);
|
||||
|
||||
|
||||
boolean getSortListByGroups();
|
||||
|
||||
int getSpawnMobLimit();
|
||||
@@ -81,7 +79,6 @@ public interface ISettings
|
||||
|
||||
boolean hidePermissionlessHelp();
|
||||
|
||||
|
||||
boolean isCommandDisabled(String label);
|
||||
|
||||
boolean isCommandOverridden(String name);
|
||||
|
@@ -321,7 +321,7 @@ public final class Settings implements ISettings
|
||||
|
||||
private Map<String, MessageFormat> chatFormats = Collections.synchronizedMap(new HashMap<String, MessageFormat>());
|
||||
|
||||
/*@Override
|
||||
/*@Override //TODO: implement this
|
||||
public MessageFormat getChatFormat(String group)
|
||||
{
|
||||
MessageFormat mFormat = chatFormats.get(group);
|
||||
|
@@ -29,7 +29,7 @@ class UpdateUserFiles
|
||||
name = getRealName(name);
|
||||
if (name.equals(BROKENNAME))
|
||||
{
|
||||
ess.getLogger().warning("Could not convert player " + origName);
|
||||
ess.getLogger().log(Level.WARNING, "Could not convert player {0}", origName);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@@ -619,7 +619,7 @@ public class UserData
|
||||
return lastLoginAddress;
|
||||
}
|
||||
|
||||
private void _setLastLoginAddress(String address) //unused method
|
||||
private void _setLastLoginAddress(String address) //TODO: unused method?
|
||||
{
|
||||
lastLoginAddress = address;
|
||||
config.setProperty("ipAddress", address);
|
||||
@@ -651,7 +651,7 @@ public class UserData
|
||||
return ret;
|
||||
}
|
||||
|
||||
private boolean newplayer; //unused variable
|
||||
private boolean newplayer; //TODO: unused variable?
|
||||
private String geolocation;
|
||||
|
||||
private String _getGeoLocation()
|
||||
|
@@ -40,7 +40,7 @@ public class EssentialsAntiBuildListener implements Listener
|
||||
{
|
||||
final Player user = event.getPlayer();
|
||||
final Block block = event.getBlockPlaced();
|
||||
//final int typeId = block.getTypeId(); unused?
|
||||
final int typeId = block.getTypeId(); //TODO: unused?
|
||||
final Material type = block.getType();
|
||||
|
||||
if (antib.getSettings().getData().isDisableBuild() && !Permissions.BUILD.isAuthorized(user) && !Permissions.PLACEMENT.isAuthorized(user, block))
|
||||
@@ -74,7 +74,7 @@ public class EssentialsAntiBuildListener implements Listener
|
||||
{
|
||||
final Player user = event.getPlayer();
|
||||
final Block block = event.getBlock();
|
||||
//final int typeId = block.getTypeId(); unused?
|
||||
final int typeId = block.getTypeId(); //TODO: unused?
|
||||
final Material type = block.getType();
|
||||
|
||||
if (antib.getSettings().getData().isDisableBuild() && !Permissions.BUILD.isAuthorized(user) && !Permissions.BREAK.isAuthorized(user, block))
|
||||
|
@@ -70,7 +70,7 @@ public class EssentialsLocalChatEvent extends Event implements Cancellable
|
||||
|
||||
public void setFormat(final String format)
|
||||
{
|
||||
// Oh for a better way to do this!
|
||||
//TODO: Oh for a better way to do this!
|
||||
try
|
||||
{
|
||||
String.format(format, player, message);
|
||||
|
@@ -102,7 +102,7 @@ public class EssentialsExtra extends JavaPlugin
|
||||
return handler.onCommand(cs, this, label, args);
|
||||
}
|
||||
});
|
||||
getLogger().info("Loaded command " + commandName);
|
||||
getLogger().info("Loaded command " + commandName); //TODO: tl key?
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@@ -41,7 +41,7 @@ public class EmergencyListener implements Listener
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
public void onPlayerJoin(final PlayerJoinEvent event)
|
||||
{
|
||||
event.getPlayer().sendMessage("Essentials Protect is in emergency mode. Check your log for errors.");
|
||||
event.getPlayer().sendMessage("Essentials Protect is in emergency mode. Check your log for errors."); //TODO: tl this
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOW)
|
||||
|
@@ -43,9 +43,9 @@ public class EssentialsProtect extends JavaPlugin implements IProtect
|
||||
|
||||
for (Player player : getServer().getOnlinePlayers())
|
||||
{
|
||||
player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors.");
|
||||
player.sendMessage("Essentials Protect is in emergency mode. Check your log for errors."); //TODO: tl this
|
||||
}
|
||||
LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essenials Protect is in emergency mode now.");
|
||||
LOGGER.log(Level.SEVERE, "Essentials not installed or failed to load. Essenials Protect is in emergency mode now."); //TODO: tl this
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -21,7 +21,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class EssentialsSign
|
||||
{
|
||||
private static final Set<Material> EMPTY_SET = new HashSet<Material>(); // Would an Enum be better here?
|
||||
private static final Set<Material> EMPTY_SET = new HashSet<Material>();
|
||||
protected transient final String signName;
|
||||
|
||||
public EssentialsSign(final String signName)
|
||||
|
@@ -35,6 +35,6 @@ public class SignConfig implements StorageObject
|
||||
public int getSignUsePerSecond()
|
||||
{
|
||||
|
||||
return signUsesPerSecond > 0 ? signUsesPerSecond : 1; //This needs to be ported from 2.9
|
||||
return signUsesPerSecond > 0 ? signUsesPerSecond : 1; //TODO: This needs to be ported from 2.9
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,7 @@ public class SignFree extends EssentialsSign
|
||||
}
|
||||
|
||||
item.setAmount(item.getType().getMaxStackSize());
|
||||
InventoryWorkaround.addItems(player.getPlayer().getInventory(), item); //Netbeans doesn't seem to like the addItems call, even though it appears valid.
|
||||
InventoryWorkaround.addItems(player.getPlayer().getInventory(), item); //TODO: Netbeans doesn't seem to like the addItems call, even though it appears valid.
|
||||
player.sendMessage("Item added to your inventory.");
|
||||
player.getPlayer().updateInventory();
|
||||
//TODO: wait for a fix in bukkit
|
||||
|
@@ -43,7 +43,7 @@ public class SignGameMode extends EssentialsSign
|
||||
}
|
||||
charge.isAffordableFor(player);
|
||||
|
||||
//this needs to be fixed
|
||||
//TODO: this needs to be fixed
|
||||
player.getPlayer().setGameMode(player.getPlayer().getGameMode() == GameMode.SURVIVAL ? GameMode.CREATIVE : GameMode.SURVIVAL);
|
||||
player.sendMessage(_("gameMode", _(player.getPlayer().getGameMode().toString().toLowerCase(Locale.ENGLISH)), player.getPlayer().getDisplayName()));
|
||||
charge.charge(player);
|
||||
|
Reference in New Issue
Block a user