2016-09-14 21:42:03 +02:00
|
|
|
package de.ellpeck.actuallyadditions.mod.blocks;
|
|
|
|
|
|
|
|
import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase;
|
|
|
|
import de.ellpeck.actuallyadditions.mod.tile.TileEntityBioReactor;
|
2020-09-09 10:58:32 +02:00
|
|
|
import net.minecraft.block.BlockState;
|
2016-09-14 21:42:03 +02:00
|
|
|
import net.minecraft.block.SoundType;
|
|
|
|
import net.minecraft.block.material.Material;
|
2020-09-09 10:58:32 +02:00
|
|
|
import net.minecraft.entity.player.PlayerEntity;
|
|
|
|
import net.minecraft.item.Rarity;
|
2016-09-14 21:42:03 +02:00
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2020-09-09 10:58:32 +02:00
|
|
|
import net.minecraft.util.ActionResultType;
|
|
|
|
import net.minecraft.util.Hand;
|
2016-09-14 21:42:03 +02:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2020-09-09 10:58:32 +02:00
|
|
|
import net.minecraft.util.math.BlockRayTraceResult;
|
|
|
|
import net.minecraft.world.IBlockReader;
|
2016-09-14 21:42:03 +02:00
|
|
|
import net.minecraft.world.World;
|
2020-09-08 00:46:45 +02:00
|
|
|
import net.minecraftforge.common.ToolType;
|
2016-09-14 21:42:03 +02:00
|
|
|
|
2019-05-02 09:10:29 +02:00
|
|
|
public class BlockBioReactor extends BlockContainerBase {
|
2016-09-14 21:42:03 +02:00
|
|
|
|
2020-09-08 00:46:45 +02:00
|
|
|
public BlockBioReactor() {
|
|
|
|
super(Properties.create(Material.ROCK)
|
|
|
|
.hardnessAndResistance(2f, 10.0f)
|
|
|
|
.harvestTool(ToolType.PICKAXE)
|
|
|
|
.sound(SoundType.STONE));
|
2016-09-14 21:42:03 +02:00
|
|
|
}
|
2020-09-09 10:58:32 +02:00
|
|
|
|
2016-09-14 21:42:03 +02:00
|
|
|
@Override
|
2020-09-09 10:58:32 +02:00
|
|
|
public TileEntity createTileEntity(BlockState state, IBlockReader world){
|
2016-09-14 21:42:03 +02:00
|
|
|
return new TileEntityBioReactor();
|
|
|
|
}
|
2020-09-09 10:58:32 +02:00
|
|
|
|
2016-09-14 21:42:03 +02:00
|
|
|
@Override
|
2020-09-09 10:58:32 +02:00
|
|
|
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit){
|
2019-05-02 09:10:29 +02:00
|
|
|
if (!world.isRemote) {
|
|
|
|
if (world.getTileEntity(pos) instanceof TileEntityBioReactor) {
|
2020-09-09 10:58:32 +02:00
|
|
|
// todo open gui: player.openGui(ActuallyAdditions.INSTANCE, GuiHandler.GuiTypes.BIO_REACTOR.ordinal(), world, pos.getX(), pos.getY(), pos.getZ());
|
2016-09-14 21:42:03 +02:00
|
|
|
}
|
|
|
|
}
|
2020-09-09 10:58:32 +02:00
|
|
|
return ActionResultType.SUCCESS;
|
2016-09-14 21:42:03 +02:00
|
|
|
}
|
2020-09-09 10:58:32 +02:00
|
|
|
|
2016-09-14 21:42:03 +02:00
|
|
|
@Override
|
2020-09-09 10:58:32 +02:00
|
|
|
public Rarity getRarity() {
|
|
|
|
return Rarity.EPIC;
|
2016-09-14 21:42:03 +02:00
|
|
|
}
|
|
|
|
}
|