Proper Reformating

This commit is contained in:
Kam committed 2025-03-13 17:14:45 -04:00
1 parent ce75880aba
commit 180d257024
1179 files changed
+59847 -61583

No files matched your search

@@ -6,68 +6,70 @@ import noppes.npcs.entity.EntityNPCInterface;
import java.util.List;
public class JobFollower extends JobInterface{
public EntityNPCInterface following = null;
private int ticks = 40;
private int range = 20;
public String name = "";
public class JobFollower extends JobInterface {
public EntityNPCInterface following = null;
private int ticks = 40;
private int range = 20;
public String name = "";
public JobFollower(EntityNPCInterface npc) {
super(npc);
}
public JobFollower(EntityNPCInterface npc) {
super(npc);
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
compound.setString("FollowingEntityName", name);
return compound;
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
compound.setString("FollowingEntityName", name);
return compound;
}
@Override
public void readFromNBT(NBTTagCompound compound) {
name = compound.getString("FollowingEntityName");
}
@Override
public boolean aiShouldExecute() {
if(npc.isAttacking())
return false;
ticks--;
if(ticks > 0)
return false;
ticks = 10;
following = null;
List<EntityNPCInterface> list = npc.worldObj.getEntitiesWithinAABB(EntityNPCInterface.class, npc.boundingBox.expand(getRange(), getRange(), getRange()));
for(EntityNPCInterface entity : list){
if(entity == npc || entity.isKilled())
continue;
if(entity.display.name.equalsIgnoreCase(name)){
following = entity;
break;
}
}
return false;
}
private int getRange(){
if(range > ConfigMain.NpcNavRange)
return ConfigMain.NpcNavRange;
return range;
}
public boolean isFollowing(){
return following != null;
}
@Override
public void readFromNBT(NBTTagCompound compound) {
name = compound.getString("FollowingEntityName");
public void reset() {
}
public void resetTask() {
following = null;
}
}
public boolean hasOwner() {
return !name.isEmpty();
}
@Override
public boolean aiShouldExecute() {
if (npc.isAttacking())
return false;
ticks--;
if (ticks > 0)
return false;
ticks = 10;
following = null;
List<EntityNPCInterface> list = npc.worldObj.getEntitiesWithinAABB(EntityNPCInterface.class, npc.boundingBox.expand(getRange(), getRange(), getRange()));
for (EntityNPCInterface entity : list) {
if (entity == npc || entity.isKilled())
continue;
if (entity.display.name.equalsIgnoreCase(name)) {
following = entity;
break;
}
}
return false;
}
private int getRange() {
if (range > ConfigMain.NpcNavRange)
return ConfigMain.NpcNavRange;
return range;
}
public boolean isFollowing() {
return following != null;
}
public void reset() {
}
public void resetTask() {
following = null;
}
public boolean hasOwner() {
return !name.isEmpty();
}
}