Skip to content

Instantly share code, notes, and snippets.

@ThexXTURBOXx
Created June 1, 2017 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThexXTURBOXx/88a383403d983686e5987958a4d76197 to your computer and use it in GitHub Desktop.
Save ThexXTURBOXx/88a383403d983686e5987958a4d76197 to your computer and use it in GitHub Desktop.
package de.Femtopedia.XYCraftRL;
import java.util.ArrayList;
import java.util.Arrays;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockBlackOreCrystal extends BlockContainer {
protected BlockBlackOreCrystal() {
super(Material.ROCK);
setCreativeTab(Main.tabXYCraftRL);
setSoundType(SoundType.STONE);
setUnlocalizedName("ore_xy_black");
setHardness(3.0F);
setHarvestLevel("pickaxe", 2);
}
@Override
public ArrayList<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
ArrayList<ItemStack> drops = new ArrayList<ItemStack>();
drops.add(new ItemStack(Main.itemBlackCrystal, RANDOM.nextInt(3) + 1));
return drops;
}
@Override
public TileEntity createTileEntity(World world, IBlockState state) {
return createNewTileEntity(world, 0);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityGlow("black_ore",
Arrays.asList(new ResourceLocation(Main.MODID, "textures/blocks/block_sprite.png"), new ResourceLocation(Main.MODID, "textures/blocks/block_sprite.png")),
Arrays.asList(true, false),
Arrays.asList(3/8f, 3/8f),
Arrays.asList(1/8f, 0f),
Arrays.asList(1/8f, 1/8f),
Arrays.asList(1/8f, 1/8f));
}
@Override
public boolean isBlockNormalCube(IBlockState state) {
return isOpaqueCube(state);
}
@Override
public boolean isNormalCube(IBlockState state) {
return isOpaqueCube(state);
}
@Override
public boolean isNormalCube(IBlockState state, IBlockAccess world, BlockPos pos) {
return isOpaqueCube(state);
}
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment