EntityAIRestrictSun .java

net.minecraft.entity.ai.EntityAIRestrictSun (class, 39 lines): members: theEntity, resetTask, startExecuting, shouldExecute. imports: PathNavigateGround.

net.minecraft.entity.aiclass39 linescommonextends EntityAIBase881 B

API Surface (3)

boolean shouldExecute()
void startExecuting()
void resetTask()

Fields & Constants (1)

theEntity

Code Graph: Dependencies (3)

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

Full Source

EntityAIRestrictSun.java39 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.entity.ai;
2
3
import net.minecraft.entity.EntityCreature;
4
import net.minecraft.pathfinding.PathNavigateGround;
5
6
public class EntityAIRestrictSun extends EntityAIBase
7
{
8
    private EntityCreature theEntity;
9
10
    public EntityAIRestrictSun(EntityCreature creature)
11
    {
12
        this.theEntity = creature;
13
    }
14
15
    /**
16
     * Returns whether the EntityAIBase should begin execution.
17
     */
18
    public boolean shouldExecute()
19
    {
20
        return this.theEntity.worldObj.isDaytime();
21
    }
22
23
    /**
24
     * Execute a one shot task or start executing a continuous task
25
     */
26
    public void startExecuting()
27
    {
28
        ((PathNavigateGround)this.theEntity.getNavigator()).setAvoidSun(true);
29
    }
30
31
    /**
32
     * Resets the task
33
     */
34
    public void resetTask()
35
    {
36
        ((PathNavigateGround)this.theEntity.getNavigator()).setAvoidSun(false);
37
    }
38
}
39

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