mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-06-28 13:19:09 +02:00
35 lines
1 KiB
Java
35 lines
1 KiB
Java
package de.ellpeck.naturesaura.blocks.tiles;
|
|
|
|
import net.minecraft.core.BlockPos;
|
|
import net.minecraft.core.Direction;
|
|
import net.minecraft.nbt.CompoundTag;
|
|
import net.minecraft.world.level.block.state.BlockState;
|
|
|
|
public class BlockEntityProjectileGenerator extends BlockEntityImpl {
|
|
|
|
public Direction nextSide = Direction.NORTH;
|
|
|
|
public BlockEntityProjectileGenerator(BlockPos pos, BlockState state) {
|
|
super(ModBlockEntities.PROJECTILE_GENERATOR, pos, state);
|
|
}
|
|
|
|
@Override
|
|
public void writeNBT(CompoundTag compound, SaveType type) {
|
|
super.writeNBT(compound, type);
|
|
if (type != SaveType.BLOCK)
|
|
compound.putInt("next_side", this.nextSide.ordinal());
|
|
}
|
|
|
|
@Override
|
|
public void readNBT(CompoundTag compound, SaveType type) {
|
|
super.readNBT(compound, type);
|
|
if (type != SaveType.BLOCK)
|
|
this.nextSide = Direction.values()[compound.getInt("next_side")];
|
|
}
|
|
|
|
@Override
|
|
public boolean wantsLimitRemover() {
|
|
return true;
|
|
}
|
|
}
|