EntityMinecartMobSpawner .java

net.minecraft.entity.ai.EntityMinecartMobSpawner (class): members: mobSpawnerLogic, func_98039_d, getDefaultDisplayTile, getMinecartType, writeEntityToNBT.

net.minecraft.entity.aiclass87 linescommonextends EntityMinecart2.3 KB

API Surface (10)

void func_98267_a(int id)
World getSpawnerWorld()
BlockPos getSpawnerPosition()
EntityMinecart.EnumMinecartType getMinecartType()
IBlockState getDefaultDisplayTile()
void readEntityFromNBT(NBTTagCompound tagCompund)
void writeEntityToNBT(NBTTagCompound tagCompound)
void handleStatusUpdate(byte id)
void onUpdate()
MobSpawnerBaseLogic func_98039_d()

Fields & Constants (1)

mobSpawnerLogic

Full Source

EntityMinecartMobSpawner.java87 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.entity.ai;
2
3
import net.minecraft.block.state.IBlockState;
4
import net.minecraft.entity.item.EntityMinecart;
5
import net.minecraft.init.Blocks;
6
import net.minecraft.nbt.NBTTagCompound;
7
import net.minecraft.tileentity.MobSpawnerBaseLogic;
8
import net.minecraft.util.BlockPos;
9
import net.minecraft.world.World;
10
11
public class EntityMinecartMobSpawner extends EntityMinecart
12
{
13
    /** Mob spawner logic for this spawner minecart. */
14
    private final MobSpawnerBaseLogic mobSpawnerLogic = new MobSpawnerBaseLogic()
15
    {
16
        public void func_98267_a(int id)
17
        {
18
            EntityMinecartMobSpawner.this.worldObj.setEntityState(EntityMinecartMobSpawner.this, (byte)id);
19
        }
20
        public World getSpawnerWorld()
21
        {
22
            return EntityMinecartMobSpawner.this.worldObj;
23
        }
24
        public BlockPos getSpawnerPosition()
25
        {
26
            return new BlockPos(EntityMinecartMobSpawner.this);
27
        }
28
    };
29
30
    public EntityMinecartMobSpawner(World worldIn)
31
    {
32
        super(worldIn);
33
    }
34
35
    public EntityMinecartMobSpawner(World worldIn, double p_i1726_2_, double p_i1726_4_, double p_i1726_6_)
36
    {
37
        super(worldIn, p_i1726_2_, p_i1726_4_, p_i1726_6_);
38
    }
39
40
    public EntityMinecart.EnumMinecartType getMinecartType()
41
    {
42
        return EntityMinecart.EnumMinecartType.SPAWNER;
43
    }
44
45
    public IBlockState getDefaultDisplayTile()
46
    {
47
        return Blocks.mob_spawner.getDefaultState();
48
    }
49
50
    /**
51
     * (abstract) Protected helper method to read subclass entity data from NBT.
52
     */
53
    protected void readEntityFromNBT(NBTTagCompound tagCompund)
54
    {
55
        super.readEntityFromNBT(tagCompund);
56
        this.mobSpawnerLogic.readFromNBT(tagCompund);
57
    }
58
59
    /**
60
     * (abstract) Protected helper method to write subclass entity data to NBT.
61
     */
62
    protected void writeEntityToNBT(NBTTagCompound tagCompound)
63
    {
64
        super.writeEntityToNBT(tagCompound);
65
        this.mobSpawnerLogic.writeToNBT(tagCompound);
66
    }
67
68
    public void handleStatusUpdate(byte id)
69
    {
70
        this.mobSpawnerLogic.setDelayToMin(id);
71
    }
72
73
    /**
74
     * Called to update the entity's position/logic.
75
     */
76
    public void onUpdate()
77
    {
78
        super.onUpdate();
79
        this.mobSpawnerLogic.updateSpawner();
80
    }
81
82
    public MobSpawnerBaseLogic func_98039_d()
83
    {
84
        return this.mobSpawnerLogic;
85
    }
86
}
87

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