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;
|
|
|
|
|
2015-12-27 19:38:12 -05:00
|
|
|
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;
|
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.api.Constants;
|
|
|
|
import WayofTime.bloodmagic.client.IVariantProvider;
|
|
|
|
import WayofTime.bloodmagic.tile.TilePhantomBlock;
|
2016-03-17 13:00:44 -07:00
|
|
|
|
2016-03-16 15:37:55 -07:00
|
|
|
public class BlockPhantom extends BlockContainer implements IVariantProvider
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
|
|
|
public BlockPhantom()
|
|
|
|
{
|
2015-12-27 19:38:12 -05:00
|
|
|
super(Material.cloth);
|
|
|
|
|
|
|
|
setUnlocalizedName(Constants.Mod.MODID + ".phantom");
|
2016-01-11 13:36:07 -08:00
|
|
|
setCreativeTab(BloodMagic.tabBloodMagic);
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
@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
|
2016-03-18 13:16:38 -04:00
|
|
|
public boolean isVisuallyOpaque()
|
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-03-18 13:16:38 -04:00
|
|
|
public boolean shouldSideBeRendered(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side)
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
2016-03-18 13:16:38 -04:00
|
|
|
Block block = state.getBlock();
|
2015-12-27 19:38:12 -05:00
|
|
|
|
2016-03-18 13:16:38 -04:00
|
|
|
if (world.getBlockState(pos.offset(side.getOpposite())) != state)
|
2015-12-30 15:34:40 -05:00
|
|
|
{
|
2015-12-27 19:38:12 -05:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-03-18 13:16:38 -04:00
|
|
|
return block != 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
|
2015-12-30 15:34:40 -05:00
|
|
|
public TileEntity createNewTileEntity(World world, int meta)
|
|
|
|
{
|
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
|
|
|
}
|