mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-05 12:59:08 +01:00
02de4bce7f
Closes #77
40 lines
1 KiB
Java
40 lines
1 KiB
Java
package de.ellpeck.naturesaura.blocks.tiles;
|
|
|
|
import de.ellpeck.naturesaura.api.misc.IWorldData;
|
|
import de.ellpeck.naturesaura.misc.WorldData;
|
|
|
|
public class TileEntitySpawnLamp extends TileEntityImpl {
|
|
|
|
public TileEntitySpawnLamp() {
|
|
super(ModTileEntities.SPAWN_LAMP);
|
|
}
|
|
|
|
public int getRadius() {
|
|
return this.redstonePower * 3;
|
|
}
|
|
|
|
@Override
|
|
public void validate() {
|
|
super.validate();
|
|
if (!this.world.isRemote) {
|
|
WorldData data = (WorldData) IWorldData.getWorldData(this.world);
|
|
data.spawnLamps.add(this);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void remove() {
|
|
super.remove();
|
|
if (!this.world.isRemote) {
|
|
WorldData data = (WorldData) IWorldData.getWorldData(this.world);
|
|
data.spawnLamps.remove(this);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void onRedstonePowerChange(int newPower) {
|
|
super.onRedstonePowerChange(newPower);
|
|
if (!this.world.isRemote)
|
|
this.sendToClients();
|
|
}
|
|
}
|