2015-12-28 00:38:12 +00:00
|
|
|
package WayofTime.bloodmagic.block;
|
|
|
|
|
2016-01-11 21:36:07 +00:00
|
|
|
import WayofTime.bloodmagic.BloodMagic;
|
2015-12-28 00:38:12 +00:00
|
|
|
import WayofTime.bloodmagic.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.tile.TilePhantomBlock;
|
|
|
|
import net.minecraft.block.Block;
|
|
|
|
import net.minecraft.block.BlockContainer;
|
|
|
|
import net.minecraft.block.material.Material;
|
|
|
|
import net.minecraft.block.state.IBlockState;
|
|
|
|
import net.minecraft.tileentity.TileEntity;
|
|
|
|
import net.minecraft.util.BlockPos;
|
|
|
|
import net.minecraft.util.EnumFacing;
|
|
|
|
import net.minecraft.util.EnumWorldBlockLayer;
|
|
|
|
import net.minecraft.world.IBlockAccess;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
public class BlockPhantom extends BlockContainer
|
|
|
|
{
|
|
|
|
public BlockPhantom()
|
|
|
|
{
|
2015-12-28 00:38:12 +00:00
|
|
|
super(Material.cloth);
|
|
|
|
|
|
|
|
setUnlocalizedName(Constants.Mod.MODID + ".phantom");
|
2016-01-11 21:36:07 +00:00
|
|
|
setCreativeTab(BloodMagic.tabBloodMagic);
|
2015-12-28 00:38:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-12-30 20:34:40 +00:00
|
|
|
public boolean isOpaqueCube()
|
|
|
|
{
|
2015-12-28 00:38:12 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-12-30 20:34:40 +00:00
|
|
|
public boolean isFullCube()
|
|
|
|
{
|
2015-12-28 00:38:12 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-29 00:09:51 +00:00
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
|
|
|
public boolean isTranslucent()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-01-11 21:36:07 +00:00
|
|
|
@Override
|
|
|
|
public int getRenderType()
|
|
|
|
{
|
|
|
|
return 3;
|
|
|
|
}
|
|
|
|
|
2015-12-28 00:38:12 +00:00
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2015-12-30 20:34:40 +00:00
|
|
|
public EnumWorldBlockLayer getBlockLayer()
|
|
|
|
{
|
2015-12-29 00:09:51 +00:00
|
|
|
return EnumWorldBlockLayer.TRANSLUCENT;
|
2015-12-28 00:38:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2015-12-30 20:34:40 +00:00
|
|
|
public boolean shouldSideBeRendered(IBlockAccess worldIn, BlockPos pos, EnumFacing side)
|
|
|
|
{
|
2015-12-28 00:38:12 +00:00
|
|
|
IBlockState iblockstate = worldIn.getBlockState(pos);
|
|
|
|
Block block = iblockstate.getBlock();
|
|
|
|
|
2015-12-30 20:34:40 +00:00
|
|
|
if (worldIn.getBlockState(pos.offset(side.getOpposite())) != iblockstate)
|
|
|
|
{
|
2015-12-28 00:38:12 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
return block != this && super.shouldSideBeRendered(worldIn, pos, side);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-12-30 20:34:40 +00:00
|
|
|
public int quantityDropped(Random par1Random)
|
|
|
|
{
|
2015-12-28 00:38:12 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2015-12-30 20:34:40 +00:00
|
|
|
public TileEntity createNewTileEntity(World world, int meta)
|
|
|
|
{
|
2016-01-11 21:36:07 +00:00
|
|
|
return new TilePhantomBlock(100);
|
2015-12-28 00:38:12 +00:00
|
|
|
}
|
|
|
|
}
|