Search in sources :

Example 1 with MobSpawnerBaseLogic

use of net.minecraft.tileentity.MobSpawnerBaseLogic in project PneumaticCraft by MineMaarten.

the class HackableMobSpawner method afterHackTick.

@Override
public boolean afterHackTick(World world, int x, int y, int z) {
    MobSpawnerBaseLogic spawner = ((TileEntityMobSpawner) world.getTileEntity(x, y, z)).func_145881_a();
    //oldRotation = rotation, to stop render glitching
    spawner.field_98284_d = spawner.field_98287_c;
    spawner.spawnDelay = 10;
    return false;
}
Also used : MobSpawnerBaseLogic(net.minecraft.tileentity.MobSpawnerBaseLogic) TileEntityMobSpawner(net.minecraft.tileentity.TileEntityMobSpawner)

Example 2 with MobSpawnerBaseLogic

use of net.minecraft.tileentity.MobSpawnerBaseLogic in project PneumaticCraft by MineMaarten.

the class BlockTrackEntryMobSpawner method addInformation.

@Override
public void addInformation(World world, int x, int y, int z, TileEntity te, List<String> infoList) {
    if (te instanceof TileEntityMobSpawner) {
        MobSpawnerBaseLogic spawner = ((TileEntityMobSpawner) te).func_145881_a();
        infoList.add("Spawner Type: " + StatCollector.translateToLocal("entity." + spawner.getEntityNameToSpawn() + ".name"));
        if (spawner.isActivated()) {
            infoList.add("Time until next spawn: " + PneumaticCraftUtils.convertTicksToMinutesAndSeconds(spawner.spawnDelay, false));
        } else if (HackableMobSpawner.isHacked(world, x, y, z)) {
            infoList.add("Spawner is hacked");
        } else {
            infoList.add("Spawner is standing by");
        }
    }
}
Also used : MobSpawnerBaseLogic(net.minecraft.tileentity.MobSpawnerBaseLogic) TileEntityMobSpawner(net.minecraft.tileentity.TileEntityMobSpawner)

Aggregations

MobSpawnerBaseLogic (net.minecraft.tileentity.MobSpawnerBaseLogic)2 TileEntityMobSpawner (net.minecraft.tileentity.TileEntityMobSpawner)2