mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 02:55:45 +01:00
more formatting again
This commit is contained in:
parent
4341327c3c
commit
596fa0e74b
@ -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) {
|
||||
|
@ -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() + "'");
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user