mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-30 06:33:56 +01:00
use spaces
This commit is contained in:
parent
51e0313cb6
commit
acbecb8c56
@ -13,7 +13,8 @@
|
||||
|
||||
<!-- Compile the code -->
|
||||
<target name="dist" depends="init" description="compile the source">
|
||||
<javac srcdir="${src}" destdir="${build}" debug="on" debuglevel="lines,vars,source" includeantruntime="false" encoding="Cp1252">
|
||||
<javac srcdir="${src}" destdir="${build}" debug="on"
|
||||
debuglevel="lines,vars,source" includeantruntime="false" encoding="Cp1252">
|
||||
<classpath>
|
||||
<pathelement path="${lib}" />
|
||||
<pathelement location="${lib}/bukkit-1.1-R1-SNAPSHOT.jar" />
|
||||
|
@ -27,7 +27,7 @@ public class EventListen implements Listener {
|
||||
/*
|
||||
* Entity events
|
||||
*/
|
||||
@EventHandler()
|
||||
@EventHandler
|
||||
public void onEntityDamage(EntityDamageEvent event) {
|
||||
if (event.isCancelled() || !CitizensAPI.getNPCManager().isNPC(event.getEntity()))
|
||||
return;
|
||||
@ -41,7 +41,7 @@ public class EventListen implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler()
|
||||
@EventHandler
|
||||
public void onEntityTarget(EntityTargetEvent event) {
|
||||
if (event.isCancelled() || !CitizensAPI.getNPCManager().isNPC(event.getEntity())
|
||||
|| !(event.getTarget() instanceof Player))
|
||||
@ -54,7 +54,7 @@ public class EventListen implements Listener {
|
||||
/*
|
||||
* World events
|
||||
*/
|
||||
@EventHandler()
|
||||
@EventHandler
|
||||
public void onChunkLoad(ChunkLoadEvent event) {
|
||||
for (int id : toRespawn) {
|
||||
NPC npc = CitizensAPI.getNPCManager().getNPC(id);
|
||||
@ -63,7 +63,7 @@ public class EventListen implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler()
|
||||
@EventHandler
|
||||
public void onChunkUnload(ChunkUnloadEvent event) {
|
||||
if (event.isCancelled())
|
||||
return;
|
||||
|
@ -129,7 +129,7 @@ public class CitizensNPC implements NPC {
|
||||
@Override
|
||||
public void spawn(Location loc) {
|
||||
if (isSpawned()) {
|
||||
System.out.println("The NPC is already spawned.");
|
||||
Messaging.debug("The NPC is already spawned.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -147,7 +147,7 @@ public class CitizensNPC implements NPC {
|
||||
@Override
|
||||
public void despawn() {
|
||||
if (!isSpawned()) {
|
||||
System.out.println("The NPC is already despawned.");
|
||||
Messaging.debug("The NPC is already despawned.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -171,15 +171,10 @@ public class CitizensNPC implements NPC {
|
||||
}
|
||||
|
||||
private class Factory {
|
||||
private final Map<Class<? extends Trait>, Trait> created = new HashMap<Class<? extends Trait>, Trait>();
|
||||
|
||||
public <T extends Trait> T create(Class<T> clazz) {
|
||||
if (created.containsKey(clazz)) {
|
||||
return clazz.cast(created.get(clazz));
|
||||
}
|
||||
try {
|
||||
Trait trait = clazz.newInstance();
|
||||
created.put(clazz, trait);
|
||||
return clazz.cast(trait);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
|
@ -13,7 +13,7 @@ public class NPCNetworkManager extends NetworkManager {
|
||||
super(socket, string, netHandler);
|
||||
|
||||
try {
|
||||
// the field above the 3 synchronized lists.
|
||||
// the field above the 3 synchronized lists
|
||||
Field f = NetworkManager.class.getDeclaredField("l");
|
||||
f.setAccessible(true);
|
||||
f.set(this, false);
|
||||
|
Loading…
Reference in New Issue
Block a user