mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-26 02:13:04 +00:00
Proper Reformating
This commit is contained in:
1 parent
ce75880aba
commit
180d257024
1179 files changed
+59847
-61583
No files matched your search
@@ -5,28 +5,25 @@ import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.ai.EntityAIDoorInteract;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
public class EntityAIBustDoor extends EntityAIDoorInteract
|
||||
{
|
||||
public class EntityAIBustDoor extends EntityAIDoorInteract {
|
||||
private int breakingTime;
|
||||
private int field_75358_j = -1;
|
||||
|
||||
public EntityAIBustDoor(EntityLiving par1EntityLiving){
|
||||
public EntityAIBustDoor(EntityLiving par1EntityLiving) {
|
||||
super(par1EntityLiving);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the EntityAIBase should begin execution.
|
||||
*/
|
||||
public boolean shouldExecute()
|
||||
{
|
||||
public boolean shouldExecute() {
|
||||
return !super.shouldExecute() ? false : (!this.theEntity.worldObj.getGameRules().getGameRuleBooleanValue("mobGriefing") ? false : !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ));
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute a one shot task or start executing a continuous task
|
||||
*/
|
||||
public void startExecuting()
|
||||
{
|
||||
public void startExecuting() {
|
||||
super.startExecuting();
|
||||
this.breakingTime = 0;
|
||||
}
|
||||
@@ -34,17 +31,15 @@ public class EntityAIBustDoor extends EntityAIDoorInteract
|
||||
/**
|
||||
* Returns whether an in-progress EntityAIBase should continue executing
|
||||
*/
|
||||
public boolean continueExecuting()
|
||||
{
|
||||
double var1 = this.theEntity.getDistanceSq((double)this.entityPosX, (double)this.entityPosY, (double)this.entityPosZ);
|
||||
public boolean continueExecuting() {
|
||||
double var1 = this.theEntity.getDistanceSq((double) this.entityPosX, (double) this.entityPosY, (double) this.entityPosZ);
|
||||
return this.breakingTime <= 240 && !this.field_151504_e.func_150015_f(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ) && var1 < 4.0D;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resets the task
|
||||
*/
|
||||
public void resetTask()
|
||||
{
|
||||
public void resetTask() {
|
||||
super.resetTask();
|
||||
this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.getEntityId(), this.entityPosX, this.entityPosY, this.entityPosZ, -1);
|
||||
}
|
||||
@@ -52,27 +47,23 @@ public class EntityAIBustDoor extends EntityAIDoorInteract
|
||||
/**
|
||||
* Updates the task
|
||||
*/
|
||||
public void updateTask()
|
||||
{
|
||||
public void updateTask() {
|
||||
super.updateTask();
|
||||
|
||||
if (this.theEntity.getRNG().nextInt(20) == 0)
|
||||
{
|
||||
if (this.theEntity.getRNG().nextInt(20) == 0) {
|
||||
this.theEntity.worldObj.playAuxSFX(1010, this.entityPosX, this.entityPosY, this.entityPosZ, 0);
|
||||
this.theEntity.swingItem();
|
||||
}
|
||||
|
||||
++this.breakingTime;
|
||||
int var1 = (int)((float)this.breakingTime / 240.0F * 10.0F);
|
||||
int var1 = (int) ((float) this.breakingTime / 240.0F * 10.0F);
|
||||
|
||||
if (var1 != this.field_75358_j)
|
||||
{
|
||||
if (var1 != this.field_75358_j) {
|
||||
this.theEntity.worldObj.destroyBlockInWorldPartially(this.theEntity.getEntityId(), this.entityPosX, this.entityPosY, this.entityPosZ, var1);
|
||||
this.field_75358_j = var1;
|
||||
}
|
||||
|
||||
if (this.breakingTime == 240)
|
||||
{
|
||||
if (this.breakingTime == 240) {
|
||||
this.theEntity.worldObj.setBlock(this.entityPosX, this.entityPosY, this.entityPosZ, Blocks.air);
|
||||
this.theEntity.worldObj.playAuxSFX(1012, this.entityPosX, this.entityPosY, this.entityPosZ, 0);
|
||||
this.theEntity.worldObj.playAuxSFX(2001, this.entityPosX, this.entityPosY, this.entityPosZ, Block.getIdFromBlock(this.field_151504_e));
|
||||
|
||||
Reference in new issue
Block a user