TechReborn/src/main/java/techreborn/tiles/TileAlarm.java

23 lines
727 B
Java
Raw Normal View History

2017-12-18 20:58:52 +01:00
package techreborn.tiles;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ITickable;
import net.minecraft.util.SoundCategory;
2018-01-03 04:26:23 +01:00
import techreborn.blocks.BlockAlarm;
2017-12-18 20:58:52 +01:00
import techreborn.init.ModSounds;
2018-01-03 04:26:23 +01:00
public class TileAlarm extends TileEntity implements ITickable {
boolean state = false;
int selectedSound;
@Override
public void update() {
if (!world.isRemote && world.getTotalWorldTime() % 25 == 0 && world.isBlockPowered(getPos())) {
BlockAlarm.setActive(true, world, pos);
state = true;
} else if(!world.isRemote && world.getTotalWorldTime() % 25 == 0 ) {
BlockAlarm.setActive(false, world, pos);
state = false;
}
}
2017-12-18 20:58:52 +01:00
}