more formatting again

This commit is contained in:
aPunch 2012-01-22 02:02:49 -06:00
parent 4341327c3c
commit 596fa0e74b
3 changed files with 6 additions and 15 deletions

View File

@ -34,7 +34,7 @@ public class EventListen implements Listener {
if (!manager.isNPC(event.getEntity()))
return;
event.setCancelled(true); // TODO: implement damage handlers
event.setCancelled(true);
if (event instanceof EntityDamageByEntityEvent) {
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
if (e.getDamager() instanceof Player) {

View File

@ -52,14 +52,13 @@ public class Settings {
}
private final YamlStorage config;
private final DataKey root;
public Settings(Citizens plugin) {
config = new YamlStorage(plugin.getDataFolder() + File.separator + "config.yml");
root = config.getKey("");
}
public void load() {
DataKey root = config.getKey("");
for (Setting setting : Setting.values()) {
if (!root.keyExists(setting.getPath())) {
Messaging.log("Writing default setting: '" + setting.getPath() + "'");

View File

@ -16,7 +16,7 @@ public class ByIdArray<T> implements Iterable<T> {
public ByIdArray(int capacity) {
if (capacity < 0)
throw new IllegalArgumentException("illegal capacity");
throw new IllegalArgumentException("Illegal capacity: cannot be below 0.");
elementData = new Object[capacity];
}
@ -49,14 +49,6 @@ public class ByIdArray<T> implements Iterable<T> {
return (T) elementData[index];
}
/*
* @SuppressWarnings("unchecked") public T[] toArray(T[] a) { if (a.length <
* size) // Make a new array of a's runtime type, but my contents: return
* (T[]) Arrays.copyOf(elementData, size, a.getClass());
* System.arraycopy(elementData, 0, a, 0, size); if (a.length > size)
* a[size] = null; return a; }
*/
@Override
public Iterator<T> iterator() {
return new Iterator<T>() {
@ -73,9 +65,9 @@ public class ByIdArray<T> implements Iterable<T> {
T next = (T) elementData[idx];
if (next == null || idx > highest)
throw new NoSuchElementException();
do {
do
idx++;
} while (idx != highest + 1 && elementData[idx] == null);
while (idx != highest + 1 && elementData[idx] == null);
return next;
}
@ -88,7 +80,7 @@ public class ByIdArray<T> implements Iterable<T> {
public void put(int index, T t) {
if (t == null)
throw new IllegalArgumentException("t cannot be null");
throw new IllegalArgumentException("'t' cannot be null.");
++modCount;
if (index > highest)
highest = index;