001 package net.minecraft.entity.ai; 002 003 import net.minecraft.entity.EntityLiving; 004 005 public class EntityAIOpenDoor extends EntityAIDoorInteract 006 { 007 boolean field_75361_i; 008 int field_75360_j; 009 010 public EntityAIOpenDoor(EntityLiving par1EntityLiving, boolean par2) 011 { 012 super(par1EntityLiving); 013 this.theEntity = par1EntityLiving; 014 this.field_75361_i = par2; 015 } 016 017 /** 018 * Returns whether an in-progress EntityAIBase should continue executing 019 */ 020 public boolean continueExecuting() 021 { 022 return this.field_75361_i && this.field_75360_j > 0 && super.continueExecuting(); 023 } 024 025 /** 026 * Execute a one shot task or start executing a continuous task 027 */ 028 public void startExecuting() 029 { 030 this.field_75360_j = 20; 031 this.targetDoor.onPoweredBlockChange(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, true); 032 } 033 034 /** 035 * Resets the task 036 */ 037 public void resetTask() 038 { 039 if (this.field_75361_i) 040 { 041 this.targetDoor.onPoweredBlockChange(this.theEntity.worldObj, this.entityPosX, this.entityPosY, this.entityPosZ, false); 042 } 043 } 044 045 /** 046 * Updates the task 047 */ 048 public void updateTask() 049 { 050 --this.field_75360_j; 051 super.updateTask(); 052 } 053 }