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

@@ -9,16 +9,14 @@ import noppes.npcs.constants.AiMutex;
import java.util.Random;
public class EntityAIFindShade extends EntityAIBase
{
public class EntityAIFindShade extends EntityAIBase {
private EntityCreature theCreature;
private double shelterX;
private double shelterY;
private double shelterZ;
private World theWorld;
public EntityAIFindShade(EntityCreature par1EntityCreature)
{
public EntityAIFindShade(EntityCreature par1EntityCreature) {
this.theCreature = par1EntityCreature;
this.theWorld = par1EntityCreature.worldObj;
this.setMutexBits(AiMutex.PASSIVE);
@@ -27,26 +25,17 @@ public class EntityAIFindShade extends EntityAIBase
/**
* Returns whether the EntityAIBase should begin execution.
*/
public boolean shouldExecute()
{
if (!this.theWorld.isDaytime())
{
public boolean shouldExecute() {
if (!this.theWorld.isDaytime()) {
return false;
}
else if (!this.theWorld.canBlockSeeTheSky(MathHelper.floor_double(this.theCreature.posX), (int)this.theCreature.boundingBox.minY, MathHelper.floor_double(this.theCreature.posZ)))
{
} else if (!this.theWorld.canBlockSeeTheSky(MathHelper.floor_double(this.theCreature.posX), (int) this.theCreature.boundingBox.minY, MathHelper.floor_double(this.theCreature.posZ))) {
return false;
}
else
{
} else {
Vec3 var1 = this.findPossibleShelter();
if (var1 == null)
{
if (var1 == null) {
return false;
}
else
{
} else {
this.shelterX = var1.xCoord;
this.shelterY = var1.yCoord;
this.shelterZ = var1.zCoord;
@@ -58,33 +47,28 @@ public class EntityAIFindShade extends EntityAIBase
/**
* Returns whether an in-progress EntityAIBase should continue executing
*/
public boolean continueExecuting()
{
public boolean continueExecuting() {
return !this.theCreature.getNavigator().noPath();
}
/**
* Execute a one shot task or start executing a continuous task
*/
public void startExecuting()
{
public void startExecuting() {
this.theCreature.getNavigator().tryMoveToXYZ(this.shelterX, this.shelterY, this.shelterZ, 1.0D);
}
private Vec3 findPossibleShelter()
{
private Vec3 findPossibleShelter() {
Random var1 = this.theCreature.getRNG();
for (int var2 = 0; var2 < 10; ++var2)
{
int var3 = MathHelper.floor_double(this.theCreature.posX + (double)var1.nextInt(20) - 10.0D);
int var4 = MathHelper.floor_double(this.theCreature.boundingBox.minY + (double)var1.nextInt(6) - 3.0D);
int var5 = MathHelper.floor_double(this.theCreature.posZ + (double)var1.nextInt(20) - 10.0D);
for (int var2 = 0; var2 < 10; ++var2) {
int var3 = MathHelper.floor_double(this.theCreature.posX + (double) var1.nextInt(20) - 10.0D);
int var4 = MathHelper.floor_double(this.theCreature.boundingBox.minY + (double) var1.nextInt(6) - 3.0D);
int var5 = MathHelper.floor_double(this.theCreature.posZ + (double) var1.nextInt(20) - 10.0D);
float light = this.theWorld.getLightBrightness(var3, var4, var5) - 0.5F;
if (!this.theWorld.canBlockSeeTheSky(var3, var4, var5) && light < 0.0F)
{
return Vec3.createVectorHelper((double)var3, (double)var4, (double)var5);
if (!this.theWorld.canBlockSeeTheSky(var3, var4, var5) && light < 0.0F) {
return Vec3.createVectorHelper((double) var3, (double) var4, (double) var5);
}
}