567891011
import net.glowstone.block.entity.TileEntity; public class BlockMobSpawner extends BlockDropless { @Override public TileEntity createTileEntity(GlowChunk chunk, int cx, int cy, int cz) { return new TEMobSpawner(chunk.getBlock(cx, cy, cz)); }
131415161718192021
private int delay; public GlowCreatureSpawner(GlowBlock block) { super(block); TEMobSpawner spawner = getTileEntity(); spawned = spawner.getSpawning(); delay = spawner.getDelay(); }
262728293031323334353637
@Override public boolean update(boolean force, boolean applyPhysics) { boolean result = super.update(force, applyPhysics); if (result) { TEMobSpawner spawner = getTileEntity(); spawner.setSpawning(spawned); spawner.setDelay(delay); spawner.updateInRange(); } return result; }