Java Code Examples for net.minecraft.block.material.Material#glass()

The following examples show how to use net.minecraft.block.material.Material#glass() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
public BlockSoulGlass()
{
	super(Material.GLASS, false);
	blockSoundType = SoundType.GLASS;

	setDefaultState(this.blockState.getBaseState().withProperty(POWERED, false));
}
 
Example 2
Source Project: EmergingTechnology   File: AquaponicGlass.java    License: MIT License 5 votes vote down vote up
public AquaponicGlass() {
  super(Material.GLASS, false);
  this.setHardness(1.0f);
  this.setRegistryName(EmergingTechnology.MODID, _name);
  this.setUnlocalizedName(EmergingTechnology.MODID + "." + _name);
  this.setCreativeTab(EmergingTechnology.TECHNOLOGYTAB);
  this.setSoundType(SoundType.STONE);
  this.setLightOpacity(0);
}
 
Example 3
Source Project: EmergingTechnology   File: Torch.java    License: MIT License 5 votes vote down vote up
public Torch() {
  super(Material.GLASS);
  this.setHardness(1.0f);
  this.setRegistryName(EmergingTechnology.MODID, _name);
  this.setUnlocalizedName(EmergingTechnology.MODID + "." + _name);
  this.setCreativeTab(EmergingTechnology.TECHNOLOGYTAB);
  this.setSoundType(SoundType.GLASS);
  this.setLightLevel(1.0f);
  this.setLightOpacity(0);
}
 
Example 4
Source Project: EmergingTechnology   File: ClearPlasticBlock.java    License: MIT License 5 votes vote down vote up
public ClearPlasticBlock() {
  super(Material.GLASS, false);
  this.setHardness(1.0f);
  this.setRegistryName(EmergingTechnology.MODID, _name);
  this.setUnlocalizedName(EmergingTechnology.MODID + "." + _name);
  this.setCreativeTab(EmergingTechnology.TECHNOLOGYTAB);
  this.setSoundType(SoundType.STONE);
  this.setLightOpacity(0);
}
 
Example 5
Source Project: EmergingTechnology   File: Light.java    License: MIT License 5 votes vote down vote up
public Light() {
    super(Material.GLASS, "light");
    this.setSoundType(SoundType.GLASS);
    this.setLightLevel(1.0f);
    this.setLightOpacity(0);

    setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(POWERED, false)
            .withProperty(BULBTYPE, 0));
}
 
Example 6
Source Project: EmergingTechnology   File: SolarGlass.java    License: MIT License 5 votes vote down vote up
public SolarGlass() {
    super(Material.GLASS, "solarglass");
    this.setSoundType(SoundType.METAL);
    this.setLightOpacity(0);

    setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
}
 
Example 7
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    return (tool != null && (tool.equals("pickaxe") || tool.equals("shovel"))) ||
        block.getMaterial() == Material.ROCK ||
        block.getMaterial() == Material.IRON ||
        block.getMaterial() == Material.ANVIL ||
        block.getMaterial() == Material.SAND ||
        block.getMaterial() == Material.GRASS ||
        block.getMaterial() == Material.GROUND ||
        block.getMaterial() == Material.SNOW ||
        block.getMaterial() == Material.CLAY ||
        block.getMaterial() == Material.GLASS;
}
 
Example 8
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    ItemStack itemStack = new ItemStack(block.getBlock(), 1, block.getBlock().getMetaFromState(block));
    return (tool != null && (tool.equals("hammer") || tool.equals("pickaxe"))) ||
        block.getMaterial() == Material.ROCK ||
        block.getMaterial() == Material.GLASS ||
        block.getMaterial() == Material.ICE ||
        block.getMaterial() == Material.PACKED_ICE ||
        RecipeMaps.FORGE_HAMMER_RECIPES.findRecipe(Long.MAX_VALUE, Collections.singletonList(itemStack), Collections.emptyList(), 0) != null;
}
 
Example 9
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    return (tool != null && tool.equals("pickaxe")) ||
        block.getMaterial() == Material.ROCK ||
        block.getMaterial() == Material.IRON ||
        block.getMaterial() == Material.ANVIL ||
        block.getMaterial() == Material.GLASS;
}
 
Example 10
@Override
public boolean canMineBlock(IBlockState block, ItemStack stack) {
    String tool = block.getBlock().getHarvestTool(block);
    return (tool != null && (tool.equals("hammer") || tool.equals("pickaxe"))) ||
        block.getMaterial() == Material.ROCK ||
        block.getMaterial() == Material.GLASS ||
        block.getMaterial() == Material.ICE ||
        block.getMaterial() == Material.PACKED_ICE;
}
 
Example 11
Source Project: YouTubeModdingTutorial   File: BlockTank.java    License: MIT License 5 votes vote down vote up
public BlockTank() {
    super(Material.GLASS);
    setHardness(1.0f);
    setSoundType(SoundType.GLASS);
    setRegistryName(TANK);
    setTranslationKey(MyMod.MODID + ".tank");
    setHarvestLevel("pickaxe", 0);
}
 
Example 12
public BlockJar() {
	super("jar_block", Material.GLASS);
	setSoundType(SoundType.GLASS);
	setHardness(0.3f);
	setResistance(1.5f);
	setLightOpacity(0);
}
 
Example 13
Source Project: AdvancedRocketry   File: BlockCrystal.java    License: MIT License 5 votes vote down vote up
public BlockCrystal()
{
    super(Material.GLASS);
    this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
    this.setSoundType(SoundType.GLASS);
    this.setDefaultState(this.getDefaultState().withProperty(CRYSTALPROPERTY, EnumCrystal.AMETHYST));
}
 
Example 14
public BlockCreativeManaBattery() {
	super("creative_mana_battery", Material.GLASS);
	setSoundType(SoundType.GLASS);
	getItemForm().setMaxStackSize(1);
}
 
Example 15
public BlockManaBattery() {
	super("mana_battery", Material.GLASS);
	setSoundType(SoundType.GLASS);
	getItemForm().setMaxStackSize(1);
}
 
Example 16
Source Project: AdvancedRocketry   File: BlockLightSource.java    License: MIT License 4 votes vote down vote up
public BlockLightSource() {
	super(Material.GLASS);
	setUnlocalizedName("lightSource");
	setLightLevel(1F);
}
 
Example 17
Source Project: AdvancedRocketry   File: BlockLens.java    License: MIT License 4 votes vote down vote up
public BlockLens() {
	super(Material.GLASS, true);
	setSoundType(SoundType.GLASS);
}
 
Example 18
@Override
public boolean canHarvestBlock(IBlockState state, ItemStack stack)
{
    if (this.isToolBroken(stack))
    {
        return false;
    }

    ToolType tool = ToolType.fromStack(stack);

    if (tool.equals(ToolType.PICKAXE)) // Ender Pickaxe
    {
        if (state.getMaterial() == Material.ROCK
            || state.getMaterial() == Material.GLASS
            || state.getMaterial() == Material.ICE
            || state.getMaterial() == Material.PACKED_ICE
            || state.getMaterial() == Material.REDSTONE_LIGHT
            || state.getMaterial() == Material.PISTON
            || state.getMaterial() == Material.IRON
            || state.getMaterial() == Material.ANVIL)
        {
            //System.out.println("canHarvestBlock(): true; Pickaxe");
            return true;
        }
    }
    else if (tool.equals(ToolType.AXE)) // Ender Axe
    {
        if (state.getMaterial() == Material.WOOD
            || state.getMaterial() == Material.LEAVES
            || state.getMaterial() == Material.GOURD
            || state.getMaterial() == Material.CARPET
            || state.getMaterial() == Material.CLOTH
            || state.getMaterial() == Material.PLANTS
            || state.getMaterial() == Material.VINE)
        {
            //System.out.println("canHarvestBlock(): true; Axe");
            return true;
        }
    }
    else if (tool.equals(ToolType.SHOVEL)) // Ender Shovel
    {
        if (state.getMaterial() == Material.GROUND
            || state.getMaterial() == Material.GRASS
            || state.getMaterial() == Material.SAND
            || state.getMaterial() == Material.SNOW
            || state.getMaterial() == Material.CRAFTED_SNOW
            || state.getMaterial() == Material.CLAY)
        {
            //System.out.println("canHarvestBlock(): true; Shovel");
            return true;
        }
    }

    //System.out.println("canHarvestBlock(): false");
    return false;
}