2015-12-28 00:38:12 +00:00
|
|
|
package WayofTime.bloodmagic.block;
|
|
|
|
|
2017-08-15 03:53:42 +00:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
2016-05-12 03:30:23 +00:00
|
|
|
import WayofTime.bloodmagic.ConfigHandler;
|
2017-08-16 04:30:48 +00:00
|
|
|
import WayofTime.bloodmagic.tile.TileSpectralBlock;
|
2017-01-02 05:43:34 +00:00
|
|
|
import net.minecraft.block.Block;
|
2015-12-28 00:38:12 +00:00
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2016-05-12 00:40:41 +00:00
|
|
|
import net.minecraft.util.BlockRenderLayer;
|
2016-03-18 17:16:38 +00:00
|
|
|
import net.minecraft.util.EnumBlockRenderType;
|
2016-05-12 00:40:41 +00:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2016-03-18 17:16:38 +00:00
|
|
|
import net.minecraft.util.math.AxisAlignedBB;
|
|
|
|
import net.minecraft.util.math.BlockPos;
|
2015-12-28 00:38:12 +00:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
import net.minecraft.world.World;
|
2016-05-12 00:40:41 +00:00
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
2015-12-28 00:38:12 +00:00
|
|
|
|
2017-01-02 05:43:34 +00:00
|
|
|
import javax.annotation.Nullable;
|
2017-08-16 04:30:48 +00:00
|
|
|
import java.util.List;
|
|
|
|
import java.util.Random;
|
2017-01-02 05:43:34 +00:00
|
|
|
|
2018-03-08 03:43:00 +00:00
|
|
|
public class BlockSpectral extends Block {
|
2016-03-18 17:16:38 +00:00
|
|
|
protected static final AxisAlignedBB AABB = new AxisAlignedBB(0, 0, 0, 0, 0, 0);
|
|
|
|
|
2017-08-16 04:30:48 +00:00
|
|
|
public BlockSpectral() {
|
2016-04-24 17:06:28 +00:00
|
|
|
super(Material.CLOTH);
|
2015-12-28 00:38:12 +00:00
|
|
|
|
2019-02-01 03:10:37 +00:00
|
|
|
setTranslationKey(BloodMagic.MODID + ".spectral");
|
2015-12-28 00:38:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
2016-03-18 17:16:38 +00:00
|
|
|
return AABB;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
|
2016-03-18 17:16:38 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-05-12 00:40:41 +00:00
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean isOpaqueCube(IBlockState state) {
|
2016-05-12 00:40:41 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-03-18 17:16:38 +00:00
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean isFullCube(IBlockState state) {
|
2015-12-28 00:38:12 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean causesSuffocation(IBlockState state) {
|
2015-12-28 00:38:12 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-05-12 00:40:41 +00:00
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
@Override
|
2019-02-01 03:10:37 +00:00
|
|
|
public BlockRenderLayer getRenderLayer() {
|
2016-05-12 00:40:41 +00:00
|
|
|
return BlockRenderLayer.TRANSLUCENT;
|
|
|
|
}
|
|
|
|
|
2015-12-28 00:38:12 +00:00
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public EnumBlockRenderType getRenderType(IBlockState state) {
|
2017-08-20 01:56:50 +00:00
|
|
|
return ConfigHandler.client.invisibleSpectralBlocks ? EnumBlockRenderType.INVISIBLE : EnumBlockRenderType.MODEL;
|
2015-12-28 00:38:12 +00:00
|
|
|
}
|
|
|
|
|
2016-05-12 00:40:41 +00:00
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
2016-05-12 00:40:41 +00:00
|
|
|
return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
|
|
|
|
}
|
|
|
|
|
2015-12-28 00:38:12 +00:00
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public void addCollisionBoxToList(IBlockState state, World worldIn, BlockPos pos, AxisAlignedBB mask, List<AxisAlignedBB> list, Entity collidingEntity, boolean bool) {
|
2015-12-28 00:38:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public int quantityDropped(Random par1Random) {
|
2015-12-28 00:38:12 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos) {
|
2015-12-28 00:38:12 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-08-16 04:30:48 +00:00
|
|
|
public boolean isAir(IBlockState state, IBlockAccess world, BlockPos blockPos) {
|
2015-12-28 00:38:12 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-01-02 05:43:34 +00:00
|
|
|
public boolean hasTileEntity(IBlockState state) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public TileEntity createTileEntity(World world, IBlockState state) {
|
2015-12-28 00:38:12 +00:00
|
|
|
return new TileSpectralBlock();
|
|
|
|
}
|
|
|
|
}
|