mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
47 lines
721 B
Java
47 lines
721 B
Java
package com.hbm.tileentity.machine;
|
|
|
|
import com.hbm.interfaces.IConsumer;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
public class TileEntityMachineDetector extends TileEntity implements IConsumer {
|
|
|
|
long power;
|
|
|
|
@Override
|
|
public void updateEntity() {
|
|
|
|
if(!worldObj.isRemote) {
|
|
|
|
int meta = this.getBlockMetadata();
|
|
int state = 0;
|
|
|
|
if(power > 0) {
|
|
state = 1;
|
|
power--;
|
|
}
|
|
|
|
if(meta != state) {
|
|
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, state, 3);
|
|
this.markDirty();
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public void setPower(long i) {
|
|
power = i;
|
|
}
|
|
|
|
@Override
|
|
public long getPower() {
|
|
return power;
|
|
}
|
|
|
|
@Override
|
|
public long getMaxPower() {
|
|
return 20;
|
|
}
|
|
|
|
}
|