NaturesAura/src/main/java/de/ellpeck/naturesaura/blocks/tiles/TileEntityProjectileGenerator.java
2021-12-04 15:40:09 +01:00

35 lines
942 B
Java

package de.ellpeck.naturesaura.blocks.tiles;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.Direction;
public class BlockEntityProjectileGenerator extends BlockEntityImpl {
public Direction nextSide = Direction.NORTH;
public BlockEntityProjectileGenerator() {
super(ModTileEntities.PROJECTILE_GENERATOR);
}
@Override
public void writeNBT(CompoundTag compound, SaveType type) {
super.writeNBT(compound, type);
if (type != SaveType.BLOCK) {
compound.putInt("next_side", this.nextSide.getHorizontalIndex());
}
}
@Override
public void readNBT(CompoundTag compound, SaveType type) {
super.readNBT(compound, type);
if (type != SaveType.BLOCK) {
this.nextSide = Direction.byHorizontalIndex(compound.getInt("next_side"));
}
}
@Override
public boolean wantsLimitRemover() {
return true;
}
}