2015-12-27 19:38:12 -05:00
|
|
|
package WayofTime.bloodmagic.block;
|
|
|
|
|
2016-03-18 13:16:38 -04:00
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Random;
|
|
|
|
|
2017-01-01 21:43:34 -08:00
|
|
|
import net.minecraft.block.Block;
|
2015-12-27 19:38:12 -05:00
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
2016-03-18 13:16:38 -04:00
|
|
|
import net.minecraft.util.BlockRenderLayer;
|
|
|
|
import net.minecraft.util.EnumBlockRenderType;
|
2015-12-27 19:38:12 -05:00
|
|
|
import net.minecraft.util.EnumFacing;
|
2016-03-18 13:16:38 -04:00
|
|
|
import net.minecraft.util.math.BlockPos;
|
2015-12-27 19:38:12 -05:00
|
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
2016-03-18 13:16:38 -04:00
|
|
|
|
2016-03-16 15:37:55 -07:00
|
|
|
import org.apache.commons.lang3.tuple.ImmutablePair;
|
|
|
|
import org.apache.commons.lang3.tuple.Pair;
|
2015-12-27 19:38:12 -05:00
|
|
|
|
2016-03-18 13:16:38 -04:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
|
|
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
|
|
|
import WayofTime.bloodmagic.tile.TilePhantomBlock;
|
2016-03-17 13:00:44 -07:00
|
|
|
|
2017-01-01 21:43:34 -08:00
|
|
|
import javax.annotation.Nullable;
|
|
|
|
|
|
|
|
public class BlockPhantom extends Block implements IVariantProvider
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
|
|
|
public BlockPhantom()
|
|
|
|
{
|
2016-04-24 10:06:28 -07:00
|
|
|
super(Material.CLOTH);
|
2015-12-27 19:38:12 -05:00
|
|
|
|
2017-08-14 20:53:42 -07:00
|
|
|
setUnlocalizedName(BloodMagic.MODID + ".phantom");
|
|
|
|
setCreativeTab(BloodMagic.TAB_BM);
|
2015-12-27 19:38:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2016-03-18 13:16:38 -04:00
|
|
|
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos)
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
2015-12-27 19:38:12 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-05-11 17:26:38 -07:00
|
|
|
@Override
|
|
|
|
public boolean isOpaqueCube(IBlockState state)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-27 19:38:12 -05:00
|
|
|
@Override
|
2016-03-18 13:16:38 -04:00
|
|
|
public boolean isFullCube(IBlockState state)
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
2015-12-27 19:38:12 -05:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-28 19:09:51 -05:00
|
|
|
@Override
|
2017-01-01 21:43:34 -08:00
|
|
|
public boolean causesSuffocation(IBlockState state)
|
2015-12-28 19:09:51 -05:00
|
|
|
{
|
2016-03-18 13:16:38 -04:00
|
|
|
return false;
|
2015-12-28 19:09:51 -05:00
|
|
|
}
|
|
|
|
|
2016-01-11 13:36:07 -08:00
|
|
|
@Override
|
2016-03-18 13:16:38 -04:00
|
|
|
public EnumBlockRenderType getRenderType(IBlockState state)
|
2016-01-11 13:36:07 -08:00
|
|
|
{
|
2016-03-18 13:16:38 -04:00
|
|
|
return EnumBlockRenderType.MODEL;
|
2016-01-11 13:36:07 -08:00
|
|
|
}
|
|
|
|
|
2015-12-27 19:38:12 -05:00
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2016-03-18 13:16:38 -04:00
|
|
|
public BlockRenderLayer getBlockLayer()
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
2016-03-18 13:16:38 -04:00
|
|
|
return BlockRenderLayer.TRANSLUCENT;
|
2015-12-27 19:38:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2016-06-23 21:43:27 -04:00
|
|
|
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
|
|
|
{
|
2016-05-11 17:26:38 -07:00
|
|
|
return world.getBlockState(pos.offset(side)) != state || state.getBlock() != this && super.shouldSideBeRendered(state, world, pos, side);
|
2015-12-27 19:38:12 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-12-30 15:34:40 -05:00
|
|
|
public int quantityDropped(Random par1Random)
|
|
|
|
{
|
2015-12-27 19:38:12 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2017-01-01 21:43:34 -08:00
|
|
|
public boolean hasTileEntity(IBlockState state) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Nullable
|
|
|
|
@Override
|
|
|
|
public TileEntity createTileEntity(World world, IBlockState state) {
|
2016-01-11 13:36:07 -08:00
|
|
|
return new TilePhantomBlock(100);
|
2015-12-27 19:38:12 -05:00
|
|
|
}
|
2016-03-16 15:37:55 -07:00
|
|
|
|
|
|
|
@Override
|
2016-03-16 18:41:06 -04:00
|
|
|
public List<Pair<Integer, String>> getVariants()
|
|
|
|
{
|
2016-03-16 15:37:55 -07:00
|
|
|
List<Pair<Integer, String>> ret = new ArrayList<Pair<Integer, String>>();
|
|
|
|
ret.add(new ImmutablePair<Integer, String>(0, "normal"));
|
|
|
|
return ret;
|
|
|
|
}
|
2015-12-27 19:38:12 -05:00
|
|
|
}
|