mirror of
https://github.com/TotalFreedomMC/ZeroTelnetClient.git
synced 2024-12-23 00:35:22 +00:00
Resolve compatibility issues with JRE 7.
Change settings file name.
This commit is contained in:
parent
051a53ab21
commit
7c148988f9
7 changed files with 53 additions and 7 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,2 +1,2 @@
|
||||||
/target/
|
/target/
|
||||||
settings.xml
|
/btc_settings.xml
|
||||||
|
|
|
@ -32,7 +32,7 @@ import org.xml.sax.SAXException;
|
||||||
|
|
||||||
public class BTC_ConfigLoader
|
public class BTC_ConfigLoader
|
||||||
{
|
{
|
||||||
private static final String SETTINGS_FILE = "settings.xml";
|
private static final String SETTINGS_FILE = "btc_settings.xml";
|
||||||
|
|
||||||
private final ServerEntry.ServerEntryList servers = new ServerEntry.ServerEntryList();
|
private final ServerEntry.ServerEntryList servers = new ServerEntry.ServerEntryList();
|
||||||
private final PlayerCommandEntry.PlayerCommandEntryList playerCommands = new PlayerCommandEntry.PlayerCommandEntryList();
|
private final PlayerCommandEntry.PlayerCommandEntryList playerCommands = new PlayerCommandEntry.PlayerCommandEntryList();
|
||||||
|
@ -44,7 +44,7 @@ public class BTC_ConfigLoader
|
||||||
|
|
||||||
public boolean load(boolean verbose)
|
public boolean load(boolean verbose)
|
||||||
{
|
{
|
||||||
File settings = new File("settings.xml");
|
File settings = new File(SETTINGS_FILE);
|
||||||
|
|
||||||
if (!settings.exists())
|
if (!settings.exists())
|
||||||
{
|
{
|
||||||
|
|
|
@ -112,6 +112,12 @@ public class BTC_PlayerListDecoder
|
||||||
{
|
{
|
||||||
return array.getJSONObject(index++);
|
return array.getJSONObject(index++);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void remove()
|
||||||
|
{
|
||||||
|
throw new UnsupportedOperationException();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
*/
|
*/
|
||||||
package me.StevenLawson.BukkitTelnetClient;
|
package me.StevenLawson.BukkitTelnetClient;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.UnsupportedLookAndFeelException;
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package me.StevenLawson.BukkitTelnetClient;
|
package me.StevenLawson.BukkitTelnetClient;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
@ -49,7 +50,15 @@ public abstract class ConfigEntry
|
||||||
final Element itemElement = (Element) itemNode;
|
final Element itemElement = (Element) itemNode;
|
||||||
for (final Method method : getClass().getDeclaredMethods())
|
for (final Method method : getClass().getDeclaredMethods())
|
||||||
{
|
{
|
||||||
final ParameterSetter annotation = method.getDeclaredAnnotation(ParameterSetter.class);
|
ParameterSetter annotation = null;
|
||||||
|
for (Annotation _annotation : method.getDeclaredAnnotations())
|
||||||
|
{
|
||||||
|
if (_annotation instanceof ParameterSetter)
|
||||||
|
{
|
||||||
|
annotation = (ParameterSetter) _annotation;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (annotation == null)
|
if (annotation == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -90,7 +99,15 @@ public abstract class ConfigEntry
|
||||||
|
|
||||||
for (final Method method : getClass().getDeclaredMethods())
|
for (final Method method : getClass().getDeclaredMethods())
|
||||||
{
|
{
|
||||||
final ParameterGetter annotation = method.getDeclaredAnnotation(ParameterGetter.class);
|
ParameterGetter annotation = null;
|
||||||
|
for (Annotation _annotation : method.getDeclaredAnnotations())
|
||||||
|
{
|
||||||
|
if (_annotation instanceof ParameterGetter)
|
||||||
|
{
|
||||||
|
annotation = (ParameterGetter) _annotation;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (annotation == null)
|
if (annotation == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package me.StevenLawson.BukkitTelnetClient;
|
package me.StevenLawson.BukkitTelnetClient;
|
||||||
|
|
||||||
|
import java.lang.annotation.Annotation;
|
||||||
import java.lang.reflect.*;
|
import java.lang.reflect.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
@ -55,7 +56,15 @@ public abstract class ConfigEntryList<E extends ConfigEntry>
|
||||||
|
|
||||||
for (final Method method : getEntryClass().getDeclaredMethods())
|
for (final Method method : getEntryClass().getDeclaredMethods())
|
||||||
{
|
{
|
||||||
final ParameterGetter annotation = method.getDeclaredAnnotation(ParameterGetter.class);
|
ParameterGetter annotation = null;
|
||||||
|
for (Annotation _annotation : method.getDeclaredAnnotations())
|
||||||
|
{
|
||||||
|
if (_annotation instanceof ParameterGetter)
|
||||||
|
{
|
||||||
|
annotation = (ParameterGetter) _annotation;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (annotation == null)
|
if (annotation == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -114,7 +123,15 @@ public abstract class ConfigEntryList<E extends ConfigEntry>
|
||||||
final Element itemElement = (Element) itemNode;
|
final Element itemElement = (Element) itemNode;
|
||||||
for (final Method method : getEntryClass().getDeclaredMethods())
|
for (final Method method : getEntryClass().getDeclaredMethods())
|
||||||
{
|
{
|
||||||
final ParameterSetter annotation = method.getDeclaredAnnotation(ParameterSetter.class);
|
ParameterSetter annotation = null;
|
||||||
|
for (Annotation _annotation : method.getDeclaredAnnotations())
|
||||||
|
{
|
||||||
|
if (_annotation instanceof ParameterSetter)
|
||||||
|
{
|
||||||
|
annotation = (ParameterSetter) _annotation;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (annotation == null)
|
if (annotation == null)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -74,6 +74,10 @@
|
||||||
<name>Seen IP</name>
|
<name>Seen IP</name>
|
||||||
<format>seen $TARGET_IP</format>
|
<format>seen $TARGET_IP</format>
|
||||||
</playerCommand>
|
</playerCommand>
|
||||||
|
<playerCommand>
|
||||||
|
<name>Clear Nickname</name>
|
||||||
|
<format>nick $TARGET_NAME off</format>
|
||||||
|
</playerCommand>
|
||||||
</playerCommands>
|
</playerCommands>
|
||||||
<favoriteButtons>
|
<favoriteButtons>
|
||||||
<favoriteButton>
|
<favoriteButton>
|
Loading…
Reference in a new issue