EntityAIOpenDoor .java

net.minecraft.entity.ai.EntityAIOpenDoor (class): members: closeDoorTemporisation, closeDoor, updateTask, resetTask, continueExecuting, startExecuting.

net.minecraft.entity.aiclass59 linescommonextends EntityAIDoorInteract1.4 KB

API Surface (4)

boolean continueExecuting()
void startExecuting()
void resetTask()
void updateTask()

Fields & Constants (2)

closeDoor
closeDoorTemporisation

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

EntityAIOpenDoor.java59 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.entity.ai;
2
3
import net.minecraft.entity.EntityLiving;
4
5
public class EntityAIOpenDoor extends EntityAIDoorInteract
6
{
7
    /** If the entity close the door */
8
    boolean closeDoor;
9
10
    /**
11
     * The temporisation before the entity close the door (in ticks, always 20 = 1 second)
12
     */
13
    int closeDoorTemporisation;
14
15
    public EntityAIOpenDoor(EntityLiving entitylivingIn, boolean shouldClose)
16
    {
17
        super(entitylivingIn);
18
        this.theEntity = entitylivingIn;
19
        this.closeDoor = shouldClose;
20
    }
21
22
    /**
23
     * Returns whether an in-progress EntityAIBase should continue executing
24
     */
25
    public boolean continueExecuting()
26
    {
27
        return this.closeDoor && this.closeDoorTemporisation > 0 && super.continueExecuting();
28
    }
29
30
    /**
31
     * Execute a one shot task or start executing a continuous task
32
     */
33
    public void startExecuting()
34
    {
35
        this.closeDoorTemporisation = 20;
36
        this.doorBlock.toggleDoor(this.theEntity.worldObj, this.doorPosition, true);
37
    }
38
39
    /**
40
     * Resets the task
41
     */
42
    public void resetTask()
43
    {
44
        if (this.closeDoor)
45
        {
46
            this.doorBlock.toggleDoor(this.theEntity.worldObj, this.doorPosition, false);
47
        }
48
    }
49
50
    /**
51
     * Updates the task
52
     */
53
    public void updateTask()
54
    {
55
        --this.closeDoorTemporisation;
56
        super.updateTask();
57
    }
58
}
59

Deobfuscated MCP 1.8.9 source of EntityAIOpenDoor from Marcelektro/MavenMCP-1.8.9 (net/minecraft/entity/ai/EntityAIOpenDoor.java), stored verbatim.