2019-03-12 19:34:59 +01:00
|
|
|
package de.ellpeck.naturesaura.blocks.tiles;
|
|
|
|
|
2019-10-20 22:30:49 +02:00
|
|
|
import net.minecraft.nbt.CompoundNBT;
|
|
|
|
import net.minecraft.util.Direction;
|
2019-03-12 19:34:59 +01:00
|
|
|
|
|
|
|
public class TileEntityProjectileGenerator extends TileEntityImpl {
|
|
|
|
|
2019-10-20 22:30:49 +02:00
|
|
|
public Direction nextSide = Direction.NORTH;
|
2019-03-12 19:34:59 +01:00
|
|
|
|
2020-01-22 01:32:26 +01:00
|
|
|
public TileEntityProjectileGenerator() {
|
|
|
|
super(ModTileEntities.PROJECTILE_GENERATOR);
|
2020-01-21 21:04:44 +01:00
|
|
|
}
|
|
|
|
|
2019-03-12 19:34:59 +01:00
|
|
|
@Override
|
2019-10-20 22:30:49 +02:00
|
|
|
public void writeNBT(CompoundNBT compound, SaveType type) {
|
2019-03-12 19:34:59 +01:00
|
|
|
super.writeNBT(compound, type);
|
|
|
|
if (type != SaveType.BLOCK) {
|
2020-01-21 21:04:44 +01:00
|
|
|
compound.putInt("next_side", this.nextSide.getHorizontalIndex());
|
2019-03-12 19:34:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-10-20 22:30:49 +02:00
|
|
|
public void readNBT(CompoundNBT compound, SaveType type) {
|
2019-03-12 19:34:59 +01:00
|
|
|
super.readNBT(compound, type);
|
|
|
|
if (type != SaveType.BLOCK) {
|
2020-01-21 21:04:44 +01:00
|
|
|
this.nextSide = Direction.byHorizontalIndex(compound.getInt("next_side"));
|
2019-03-12 19:34:59 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|