Basic sigils implementation
This commit is contained in:
parent
ae85224003
commit
5dff08380d
61 changed files with 1394 additions and 106 deletions
|
@ -0,0 +1,39 @@
|
|||
package WayofTime.bloodmagic.tile;
|
||||
|
||||
import WayofTime.bloodmagic.api.Constants;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ITickable;
|
||||
|
||||
public class TilePhantomBlock extends TileEntity implements ITickable {
|
||||
|
||||
private int ticksRemaining;
|
||||
|
||||
public TilePhantomBlock() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound tagCompound) {
|
||||
super.readFromNBT(tagCompound);
|
||||
ticksRemaining = tagCompound.getInteger(Constants.NBT.TICKS_REMAINING);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound tagCompound) {
|
||||
super.writeToNBT(tagCompound);
|
||||
tagCompound.setInteger(Constants.NBT.TICKS_REMAINING, ticksRemaining);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
ticksRemaining--;
|
||||
|
||||
if (ticksRemaining <= 0) {
|
||||
worldObj.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public void setDuration(int duration) {
|
||||
ticksRemaining = duration;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue