Java Code Examples for net.minecraft.block.material.Material

The following are top voted examples for showing how to use net.minecraft.block.material.Material. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: Solar   File: ModBlocks.java   Source Code and License 6 votes vote down vote up
public static void register(IForgeRegistry<Block> registry) {
	registry.register(new BlockBase(LibNames.PRIMAL_STONE, Material.ROCK).setHardness(4F).setResistance(2000F));
	registry.register(new BlockMonolithicGlyph());
	registry.register(new BlockQuantumMirror());
	registry.register(new BlockGravityHopper());
	registry.register(new BlockSchrodingerGlyph());
	registry.register(new BlockBlinker());
	registry.register(new BlockPhenomena());
	registry.register(new BlockQSquared());
	registry.register(new BlockTheorema());
	registry.register(new BlockGravityInhibitor());
	registry.register(new BlockHyperConductor());
	registry.register(new BlockElectron());
	registry.register(new BlockAshen());
	registry.register(new BlockMonolithic());
	registry.register(new BlockAngstrom());
	registry.register(new BlockQimranut());
	registry.register(new BlockCelestialResonator());
	registry.register(new BlockLargePot());
	registry.register(new BlockVacuumConveyor());
	registry.register(new BlockMechanicalTranslocator());
	registerTiles();
}
 
Example 2
Project: CustomWorldGen   File: EntityAIHarvestFarmland.java   Source Code and License 6 votes vote down vote up
/**
 * Return true to set given position as destination
 */
protected boolean shouldMoveTo(World worldIn, BlockPos pos)
{
    Block block = worldIn.getBlockState(pos).getBlock();

    if (block == Blocks.FARMLAND)
    {
        pos = pos.up();
        IBlockState iblockstate = worldIn.getBlockState(pos);
        block = iblockstate.getBlock();

        if (block instanceof BlockCrops && ((BlockCrops)block).isMaxAge(iblockstate) && this.wantsToReapStuff && (this.currentTask == 0 || this.currentTask < 0))
        {
            this.currentTask = 0;
            return true;
        }

        if (iblockstate.getMaterial() == Material.AIR && this.hasFarmItem && (this.currentTask == 1 || this.currentTask < 0))
        {
            this.currentTask = 1;
            return true;
        }
    }

    return false;
}
 
Example 3
Project: connor41-etfuturum2   File: OceanMonument.java   Source Code and License 6 votes vote down vote up
private static void generatePillar(World world, int x, int y, int z, Block block, int meta) {
	for (int i = 1; i <= 5; i++)
		generatePillarSection(world, x, y - i, z, block, meta);
	y -= 5;

	for (; y >= 0; y--) {
		generatePillarSection(world, x, y, z, block, meta);
		for (int i = 0; i < 4; i++)
			for (int k = 0; k < 4; k++)
				if (world.getBlock(x + i, y, z).getMaterial() != Material.water && y > 3) {
					generatePillarSection(world, x, y - 1, z, block, meta);
					generatePillarSection(world, x, y - 2, z, block, meta);
					return;
				}
	}
}
 
Example 4
Project: BaseClient   File: CommandSpreadPlayers.java   Source Code and License 6 votes vote down vote up
public boolean func_111098_b(World worldIn)
{
    BlockPos blockpos = new BlockPos(this.field_111101_a, 256.0D, this.field_111100_b);

    while (blockpos.getY() > 0)
    {
        blockpos = blockpos.down();
        Material material = worldIn.getBlockState(blockpos).getBlock().getMaterial();

        if (material != Material.air)
        {
            return !material.isLiquid() && material != Material.fire;
        }
    }

    return false;
}
 
Example 5
Project: CustomWorldGen   File: UniversalBucket.java   Source Code and License 6 votes vote down vote up
@Deprecated
public boolean tryPlaceFluid(Block block, World worldIn, BlockPos pos)
{
    if (block instanceof IFluidBlock)
    {
        IFluidBlock fluidBlock = (IFluidBlock) block;
        return FluidUtil.tryPlaceFluid(null, worldIn, new FluidStack(fluidBlock.getFluid(), Fluid.BUCKET_VOLUME), pos);
    }
    else if (block.getDefaultState().getMaterial() == Material.WATER)
    {
        FluidUtil.tryPlaceFluid(null, worldIn, new FluidStack(FluidRegistry.WATER, Fluid.BUCKET_VOLUME), pos);
    }
    else if (block.getDefaultState().getMaterial() == Material.LAVA)
    {
        FluidUtil.tryPlaceFluid(null, worldIn, new FluidStack(FluidRegistry.LAVA, Fluid.BUCKET_VOLUME), pos);
    }
    return false;
}
 
Example 6
Project: statclock   File: ModBlocks.java   Source Code and License 6 votes vote down vote up
public static void preInit() {

        // Ores
        sc_strangeOre = new BlockStrangeOre(Material.ROCK,"strange_ore");

        // Metal Blocks
        sc_strangeBlock = new BlockStrangeBlock(Material.IRON, "strange_block");
        sc_scrapBlock = new BlockScrapBlock(Material.IRON, "scrap_block");
        sc_reclaimedBlock = new BlockReclaimedBlock(Material.IRON, "reclaimed_block");
        sc_refinedBlock = new BlockRefinedBlock(Material.IRON, "refined_block");

        registerBlock(sc_strangeOre, "strange_ore");
        registerBlock(sc_strangeBlock, "strange_block");
        registerBlock(sc_scrapBlock, "scrap_block");
        registerBlock(sc_reclaimedBlock, "reclaimed_block");
        registerBlock(sc_refinedBlock, "refined_block");

    }
 
Example 7
Project: BetterBeginningsReborn   File: BlockCampfire.java   Source Code and License 6 votes vote down vote up
public BlockCampfire(boolean lit)
{
    super(Material.WOOD);
    setResistance(3.0F);
    setHardness(0.5F);

    if (!lit)
    {
        setLightLevel(0.0f);
        setCreativeTab(ModMain.tabBetterBeginnings);
    }
    else
    {
        setLightLevel(0.875f);
    }

    isLit = lit;
}
 
Example 8
Project: Bewitchment   File: ExtinguishFiresBrew.java   Source Code and License 6 votes vote down vote up
@Override
public void safeImpact(BlockPos pos, @Nullable EnumFacing side, World world, int amplifier) {
	if (side != null) pos = pos.offset(side);
	if (canExtinguish(world, pos, amplifier)) {
		int box = 1 + (int) ((float) amplifier / 2F);

		world.playSound(null, pos, SoundEvents.BLOCK_FIRE_EXTINGUISH, SoundCategory.BLOCKS, 1F, 1F);

		BlockPos posI = pos.add(box, box, box);
		BlockPos posF = pos.add(-box, -box, -box);

		Iterable<BlockPos> poses = BlockPos.getAllInBox(posI, posF);
		poses.forEach(
				in -> {
					Material material = world.getBlockState(in).getMaterial();
					if (material == Material.FIRE) {
						world.setBlockToAir(in);
					}
				}
		);
	}
}
 
Example 9
Project: Loot-Slash-Conquer   File: BlockBase.java   Source Code and License 5 votes vote down vote up
/**
 * Creates a block according to the following parameters.
 */
public BlockBase(Material material, String name, CreativeTabs tab, SoundType soundType, float hardness, float resistance, float lightValue, String harvestType, int harvestLevel)
{
	super(material);
	this.setRegistryName(Reference.MODID, name);
	this.setUnlocalizedName(name);
	this.setCreativeTab(tab);
	this.setSoundType(soundType);
	this.setHardness(hardness);
	this.setResistance(resistance);
	this.setLightLevel(lightValue);
	this.setHarvestLevel(harvestType, harvestLevel);
}
 
Example 10
Project: harshencastle   File: PedestalSlab.java   Source Code and License 5 votes vote down vote up
public PedestalSlab() {
	super(Material.ROCK);
	setRegistryName("pedestal_slab");
	setUnlocalizedName("pedestal_slab");
	setHardness(5.0F);
	setResistance(5.0F);
}
 
Example 11
Project: minecraft-quiverbow   File: Helper.java   Source Code and License 5 votes vote down vote up
public static boolean hasValidMaterial(World world, int x, int y, int z)
{
	Block block = world.getBlock(x, y, z);
	
	// Is the attached block a valid material?
	if (block.getMaterial() == Material.clay) { return true; }
	else if (block.getMaterial() == Material.cloth) { return true; }
	else if (block.getMaterial() == Material.grass) { return true; }
	else if (block.getMaterial() == Material.ground) { return true; }
	else if (block.getMaterial() == Material.iron) { return true; }
	else if (block.getMaterial() == Material.piston) { return true; }
	else if (block.getMaterial() == Material.rock) { return true; }
	else if (block.getMaterial() == Material.sand) { return true; }
	else if (block.getMaterial() == Material.wood) { return true; }
	else if (block.getMaterial() == Material.craftedSnow) { return true; }
	else if (block.getMaterial() == Material.leaves) { return true; }
	
	// No?
	return false;
}
 
Example 12
Project: BaseClient   File: BlockIce.java   Source Code and License 5 votes vote down vote up
public BlockIce()
{
    super(Material.ice, false);
    this.slipperiness = 0.98F;
    this.setTickRandomly(true);
    this.setCreativeTab(CreativeTabs.tabBlock);
}
 
Example 13
Project: BaseClient   File: Chunk.java   Source Code and License 5 votes vote down vote up
public Chunk(World worldIn, ChunkPrimer primer, int x, int z)
{
    this(worldIn, x, z);
    int i = 256;
    boolean flag = !worldIn.provider.getHasNoSky();

    for (int j = 0; j < 16; ++j)
    {
        for (int k = 0; k < 16; ++k)
        {
            for (int l = 0; l < i; ++l)
            {
                int i1 = j * i * 16 | k * i | l;
                IBlockState iblockstate = primer.getBlockState(i1);

                if (iblockstate.getBlock().getMaterial() != Material.air)
                {
                    int j1 = l >> 4;

                    if (this.storageArrays[j1] == null)
                    {
                        this.storageArrays[j1] = new ExtendedBlockStorage(j1 << 4, flag);
                    }

                    this.storageArrays[j1].set(j, l & 15, k, iblockstate);
                }
            }
        }
    }
}
 
Example 14
Project: Technical   File: BlockHematiteBasalt2.java   Source Code and License 5 votes vote down vote up
public BlockHematiteBasalt2() {
	super(Material.rock);
	setCreativeTab(Technical.tabTechnicalBlocks);
	setBlockName("hematiteBasalt2");
	setBlockTextureName(Technical.modName + ":" + getUnlocalizedName().substring(5));
	setStepSound(soundTypeStone);
	setHardness(5.0F);
	setResistance(5.0F);
	setHarvestLevel("pickaxe", 2);
}
 
Example 15
Project: Technical   File: BlockUrainiteGneiss.java   Source Code and License 5 votes vote down vote up
public BlockUrainiteGneiss() {
	super(Material.rock);
	setCreativeTab(Technical.tabTechnicalBlocks);
	setBlockName("urainiteGneiss");
	setBlockTextureName(Technical.modName + ":" + getUnlocalizedName().substring(5));
	setStepSound(soundTypeStone);
	setHardness(6.0F);
	setResistance(6.0F);
	setHarvestLevel("pickaxe", 3);
}
 
Example 16
Project: BaseClient   File: BlockAnvil.java   Source Code and License 5 votes vote down vote up
protected BlockAnvil()
{
    super(Material.anvil);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(DAMAGE, Integer.valueOf(0)));
    this.setLightOpacity(0);
    this.setCreativeTab(CreativeTabs.tabDecorations);
}
 
Example 17
Project: MC-More-Ore-Mod   File: BlockAluminiumOre.java   Source Code and License 5 votes vote down vote up
public BlockAluminiumOre() {
	super(Material.IRON);

	setUnlocalizedName(ReferenceModBlocks.ALUMINIUMORE.getUnlocalizedName());
	setRegistryName(ReferenceModBlocks.ALUMINIUMORE.getRegistryName());
	
	setHardness(2.0F);
	setHarvestLevel("pickaxe", 1);
	setCreativeTab(ModTabs.ctDefault);
	
}
 
Example 18
Project: harshencastle   File: BlockOfHeads.java   Source Code and License 5 votes vote down vote up
public BlockOfHeads()
{
	super(Material.ROCK);
	setRegistryName("block_of_heads");
	setUnlocalizedName("block_of_heads");
	setHardness(5.0F);
	setResistance(5.0F);
	this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH));
}
 
Example 19
Project: Backmemed   File: BlockPressurePlate.java   Source Code and License 5 votes vote down vote up
protected void playClickOnSound(World worldIn, BlockPos color)
{
    if (this.blockMaterial == Material.WOOD)
    {
        worldIn.playSound((EntityPlayer)null, color, SoundEvents.BLOCK_WOOD_PRESSPLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.8F);
    }
    else
    {
        worldIn.playSound((EntityPlayer)null, color, SoundEvents.BLOCK_STONE_PRESSPLATE_CLICK_ON, SoundCategory.BLOCKS, 0.3F, 0.6F);
    }
}
 
Example 20
Project: ExSartagine   File: BlockPot.java   Source Code and License 5 votes vote down vote up
public BlockPot() {
	super(Material.ROCK);

	setLightLevel(0.0f);
	setHardness(8f);
	setSoundType(SoundType.STONE);
	setCreativeTab(ExSartagineItems.pots);
	setHarvestLevel("pickaxe", 1);
	setUnlocalizedName(ExSartagine.MODID+".pot");
	setRegistryName("pot");
	setHardness(3.5f);
	this.setLightOpacity(0);
	this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(FULL, false));

}
 
Example 21
Project: CustomWorldGen   File: BlockSnow.java   Source Code and License 5 votes vote down vote up
protected BlockSnow()
{
    super(Material.SNOW);
    this.setDefaultState(this.blockState.getBaseState().withProperty(LAYERS, Integer.valueOf(1)));
    this.setTickRandomly(true);
    this.setCreativeTab(CreativeTabs.DECORATIONS);
}
 
Example 22
Project: BaseClient   File: BlockRedstoneLight.java   Source Code and License 5 votes vote down vote up
public BlockRedstoneLight(boolean isOn)
{
    super(Material.redstoneLight);
    this.isOn = isOn;

    if (isOn)
    {
        this.setLightLevel(1.0F);
    }
}
 
Example 23
Project: Firma   File: LeafBlock2.java   Source Code and License 5 votes vote down vote up
public LeafBlock2(Material materialIn) {
	super(materialIn, "leaf2");
	this.setHardness(10);
	this.setResistance(10);
	this.setCreativeTab(FirmaMod.blockTab);
	this.setDefaultState(this.getStateFromMeta(0));
	this.needsRandomTick=true;
}
 
Example 24
Project: Backmemed   File: BlockFarmland.java   Source Code and License 5 votes vote down vote up
protected BlockFarmland()
{
    super(Material.GROUND);
    this.setDefaultState(this.blockState.getBaseState().withProperty(MOISTURE, Integer.valueOf(0)));
    this.setTickRandomly(true);
    this.setLightOpacity(255);
}
 
Example 25
Project: CustomWorldGen   File: ItemFireball.java   Source Code and License 5 votes vote down vote up
/**
 * Called when a Block is right-clicked with this Item
 */
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
{
    if (worldIn.isRemote)
    {
        return EnumActionResult.SUCCESS;
    }
    else
    {
        pos = pos.offset(facing);

        if (!playerIn.canPlayerEdit(pos, facing, stack))
        {
            return EnumActionResult.FAIL;
        }
        else
        {
            if (worldIn.getBlockState(pos).getMaterial() == Material.AIR)
            {
                worldIn.playSound((EntityPlayer)null, pos, SoundEvents.ITEM_FIRECHARGE_USE, SoundCategory.BLOCKS, 1.0F, (itemRand.nextFloat() - itemRand.nextFloat()) * 0.2F + 1.0F);
                worldIn.setBlockState(pos, Blocks.FIRE.getDefaultState());
            }

            if (!playerIn.capabilities.isCreativeMode)
            {
                --stack.stackSize;
            }

            return EnumActionResult.SUCCESS;
        }
    }
}
 
Example 26
Project: CustomWorldGen   File: StructureComponent.java   Source Code and License 5 votes vote down vote up
protected void randomlyRareFillWithBlocks(World worldIn, StructureBoundingBox boundingboxIn, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, IBlockState blockstateIn, boolean excludeAir)
{
    float f = (float)(maxX - minX + 1);
    float f1 = (float)(maxY - minY + 1);
    float f2 = (float)(maxZ - minZ + 1);
    float f3 = (float)minX + f / 2.0F;
    float f4 = (float)minZ + f2 / 2.0F;

    for (int i = minY; i <= maxY; ++i)
    {
        float f5 = (float)(i - minY) / f1;

        for (int j = minX; j <= maxX; ++j)
        {
            float f6 = ((float)j - f3) / (f * 0.5F);

            for (int k = minZ; k <= maxZ; ++k)
            {
                float f7 = ((float)k - f4) / (f2 * 0.5F);

                if (!excludeAir || this.getBlockStateFromPos(worldIn, j, i, k, boundingboxIn).getMaterial() != Material.AIR)
                {
                    float f8 = f6 * f6 + f5 * f5 + f7 * f7;

                    if (f8 <= 1.05F)
                    {
                        this.setBlockState(worldIn, blockstateIn, j, i, k, boundingboxIn);
                    }
                }
            }
        }
    }
}
 
Example 27
Project: minecraft-quiverbow   File: FenLight.java   Source Code and License 5 votes vote down vote up
public FenLight(Material material) 
{
	super(material);
	this.setLightLevel(0.95F);	// Light, yo
	this.setHardness(0.2F);
	this.setResistance(10.0F);
	this.setStepSound(soundTypeGlass);
	this.setCreativeTab(CreativeTabs.tabDecorations);
	this.setBlockTextureName("glowstone");
	this.setBlockName("Fen Light");
	//this.setBlockBounds(sizeMin, sizeMin, sizeMin, sizeMax, sizeMax, sizeMax);
}
 
Example 28
Project: ExSartagine   File: BlockRange.java   Source Code and License 5 votes vote down vote up
public BlockRange() {
	super(Material.IRON);

	setLightLevel(0.0f);
	setSoundType(SoundType.METAL);
	setCreativeTab(ExSartagineItems.pots);
	setHarvestLevel("pickaxe", 1);
	setUnlocalizedName(ExSartagine.MODID+".range");
	setRegistryName("range");
	setHardness(3.5f);
	this.setLightOpacity(0);
}
 
Example 29
Project: customstuff4   File: BlockSlab.java   Source Code and License 5 votes vote down vote up
public BlockSlab(Material material, ContentBlockSlab content)
{
    super(material, MapColor.AIR); // that map color is being overridden

    this.content = content;
    mapper = StateMetaMapper.create(Collections.singleton(HALF));

    useNeighborBrightness = true;
}
 
Example 30
Project: Firma   File: ClayBlock.java   Source Code and License 5 votes vote down vote up
public ClayBlock(Material materialIn) {
	super(materialIn, "clayBlock");
	this.setHardness(10);
	this.setResistance(10);
	this.setCreativeTab(FirmaMod.blockTab);
	this.setDefaultState(this.getStateFromMeta(0));
}
 
Example 31
Project: Backmemed   File: WorldGenReed.java   Source Code and License 5 votes vote down vote up
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    for (int i = 0; i < 20; ++i)
    {
        BlockPos blockpos = position.add(rand.nextInt(4) - rand.nextInt(4), 0, rand.nextInt(4) - rand.nextInt(4));

        if (worldIn.isAirBlock(blockpos))
        {
            BlockPos blockpos1 = blockpos.down();

            if (worldIn.getBlockState(blockpos1.west()).getMaterial() == Material.WATER || worldIn.getBlockState(blockpos1.east()).getMaterial() == Material.WATER || worldIn.getBlockState(blockpos1.north()).getMaterial() == Material.WATER || worldIn.getBlockState(blockpos1.south()).getMaterial() == Material.WATER)
            {
                int j = 2 + rand.nextInt(rand.nextInt(3) + 1);

                for (int k = 0; k < j; ++k)
                {
                    if (Blocks.REEDS.canBlockStay(worldIn, blockpos))
                    {
                        worldIn.setBlockState(blockpos.up(k), Blocks.REEDS.getDefaultState(), 2);
                    }
                }
            }
        }
    }

    return true;
}
 
Example 32
Project: Backmemed   File: TileEntityFurnace.java   Source Code and License 5 votes vote down vote up
/**
 * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't
 * fuel
 */
public static int getItemBurnTime(ItemStack stack)
{
    if (stack.func_190926_b())
    {
        return 0;
    }
    else
    {
        Item item = stack.getItem();
        return item == Item.getItemFromBlock(Blocks.WOODEN_SLAB) ? 150 : (item == Item.getItemFromBlock(Blocks.WOOL) ? 100 : (item == Item.getItemFromBlock(Blocks.CARPET) ? 67 : (item == Item.getItemFromBlock(Blocks.LADDER) ? 300 : (item == Item.getItemFromBlock(Blocks.WOODEN_BUTTON) ? 100 : (Block.getBlockFromItem(item).getDefaultState().getMaterial() == Material.WOOD ? 300 : (item == Item.getItemFromBlock(Blocks.COAL_BLOCK) ? 16000 : (item instanceof ItemTool && "WOOD".equals(((ItemTool)item).getToolMaterialName()) ? 200 : (item instanceof ItemSword && "WOOD".equals(((ItemSword)item).getToolMaterialName()) ? 200 : (item instanceof ItemHoe && "WOOD".equals(((ItemHoe)item).getMaterialName()) ? 200 : (item == Items.STICK ? 100 : (item != Items.BOW && item != Items.FISHING_ROD ? (item == Items.SIGN ? 200 : (item == Items.COAL ? 1600 : (item == Items.LAVA_BUCKET ? 20000 : (item != Item.getItemFromBlock(Blocks.SAPLING) && item != Items.BOWL ? (item == Items.BLAZE_ROD ? 2400 : (item instanceof ItemDoor && item != Items.IRON_DOOR ? 200 : (item instanceof ItemBoat ? 400 : 0))) : 100)))) : 300)))))))))));
    }
}
 
Example 33
Project: Firma   File: PlankBlock2.java   Source Code and License 5 votes vote down vote up
public PlankBlock2(Material materialIn) {
	super(materialIn, "plank2");
	this.setHardness(10);
	this.setResistance(10);
	this.setCreativeTab(FirmaMod.blockTab);
	this.setDefaultState(this.getStateFromMeta(0));
}
 
Example 34
Project: CustomWorldGen   File: BlockRedstoneLight.java   Source Code and License 5 votes vote down vote up
public BlockRedstoneLight(boolean isOn)
{
    super(Material.REDSTONE_LIGHT);
    this.isOn = isOn;

    if (isOn)
    {
        this.setLightLevel(1.0F);
    }
}
 
Example 35
Project: Backmemed   File: WalkNodeProcessor.java   Source Code and License 5 votes vote down vote up
private PathNodeType getPathNodeTypeRaw(IBlockAccess p_189553_1_, int p_189553_2_, int p_189553_3_, int p_189553_4_)
{
    BlockPos blockpos = new BlockPos(p_189553_2_, p_189553_3_, p_189553_4_);
    IBlockState iblockstate = p_189553_1_.getBlockState(blockpos);
    Block block = iblockstate.getBlock();
    Material material = iblockstate.getMaterial();
    return material == Material.AIR ? PathNodeType.OPEN : (block != Blocks.TRAPDOOR && block != Blocks.IRON_TRAPDOOR && block != Blocks.WATERLILY ? (block == Blocks.FIRE ? PathNodeType.DAMAGE_FIRE : (block == Blocks.CACTUS ? PathNodeType.DAMAGE_CACTUS : (block instanceof BlockDoor && material == Material.WOOD && !((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_WOOD_CLOSED : (block instanceof BlockDoor && material == Material.IRON && !((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_IRON_CLOSED : (block instanceof BlockDoor && ((Boolean)iblockstate.getValue(BlockDoor.OPEN)).booleanValue() ? PathNodeType.DOOR_OPEN : (block instanceof BlockRailBase ? PathNodeType.RAIL : (!(block instanceof BlockFence) && !(block instanceof BlockWall) && (!(block instanceof BlockFenceGate) || ((Boolean)iblockstate.getValue(BlockFenceGate.OPEN)).booleanValue()) ? (material == Material.WATER ? PathNodeType.WATER : (material == Material.LAVA ? PathNodeType.LAVA : (block.isPassable(p_189553_1_, blockpos) ? PathNodeType.OPEN : PathNodeType.BLOCKED))) : PathNodeType.FENCE))))))) : PathNodeType.TRAPDOOR);
}
 
Example 36
Project: Technical   File: BlockMagnesiteSlate.java   Source Code and License 5 votes vote down vote up
public BlockMagnesiteSlate() {
	super(Material.rock);
	setCreativeTab(Technical.tabTechnicalBlocks);
	setBlockName("magnesiteSlate");
	setBlockTextureName(Technical.modName + ":" + getUnlocalizedName().substring(5));
	setStepSound(soundTypeGlass);
	setHardness(3.0F);
	setResistance(3.0F);
	setHarvestLevel("pickaxe", 1);
}
 
Example 37
Project: BaseClient   File: BlockRotatedPillar.java   Source Code and License 4 votes vote down vote up
protected BlockRotatedPillar(Material p_i46385_1_, MapColor p_i46385_2_)
{
    super(p_i46385_1_, p_i46385_2_);
}
 
Example 38
Project: OpenFlexiTrack   File: BlockSurveyFlag.java   Source Code and License 4 votes vote down vote up
public BlockSurveyFlag() {
	super(Material.WOOD);
	this.setHardness(0.0F);
}
 
Example 39
Project: Backmemed   File: BlockEndPortalFrame.java   Source Code and License 4 votes vote down vote up
public BlockEndPortalFrame()
{
    super(Material.ROCK, MapColor.GREEN);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(EYE, Boolean.valueOf(false)));
}
 
Example 40
Project: rezolve   File: CableBlock.java   Source Code and License 4 votes vote down vote up
public CableBlock(String registryName, Material material, float hardness, float resistance) {
	super(registryName, material, hardness, resistance);
}
 
Example 41
Project: Backmemed   File: BlockTNT.java   Source Code and License 4 votes vote down vote up
public BlockTNT()
{
    super(Material.TNT);
    this.setDefaultState(this.blockState.getBaseState().withProperty(EXPLODE, Boolean.valueOf(false)));
    this.setCreativeTab(CreativeTabs.REDSTONE);
}
 
Example 42
Project: BaseClient   File: BlockFlowerPot.java   Source Code and License 4 votes vote down vote up
public BlockFlowerPot()
{
    super(Material.circuits);
    this.setDefaultState(this.blockState.getBaseState().withProperty(CONTENTS, BlockFlowerPot.EnumFlowerType.EMPTY).withProperty(LEGACY_DATA, Integer.valueOf(0)));
    this.setBlockBoundsForItemRender();
}
 
Example 43
Project: CustomWorldGen   File: BlockPortal.java   Source Code and License 4 votes vote down vote up
public BlockPortal()
{
    super(Material.PORTAL, false);
    this.setDefaultState(this.blockState.getBaseState().withProperty(AXIS, EnumFacing.Axis.X));
    this.setTickRandomly(true);
}
 
Example 44
Project: Backmemed   File: BlockFenceGate.java   Source Code and License 4 votes vote down vote up
public BlockFenceGate(BlockPlanks.EnumType p_i46394_1_)
{
    super(Material.WOOD, p_i46394_1_.getMapColor());
    this.setDefaultState(this.blockState.getBaseState().withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false)));
    this.setCreativeTab(CreativeTabs.REDSTONE);
}
 
Example 45
Project: Backmemed   File: BlockEmptyDrops.java   Source Code and License 4 votes vote down vote up
public BlockEmptyDrops(Material materialIn)
{
    super(materialIn);
}
 
Example 46
Project: VanillaExtras   File: BlockSandbrick.java   Source Code and License 4 votes vote down vote up
public BlockSandbrick() {
	super(Material.ROCK, "blockSandbrick", Refs.MOD_ID);
	setHardness(0.8F);
	setHarvestLevel("pickaxe", 0);
}
 
Example 47
Project: BaseClient   File: BlockAir.java   Source Code and License 4 votes vote down vote up
protected BlockAir()
{
    super(Material.air);
}
 
Example 48
Project: CustomWorldGen   File: BlockJukebox.java   Source Code and License 4 votes vote down vote up
protected BlockJukebox()
{
    super(Material.WOOD, MapColor.DIRT);
    this.setDefaultState(this.blockState.getBaseState().withProperty(HAS_RECORD, Boolean.valueOf(false)));
    this.setCreativeTab(CreativeTabs.DECORATIONS);
}
 
Example 49
Project: Backmemed   File: World.java   Source Code and License 4 votes vote down vote up
public boolean func_190527_a(Block p_190527_1_, BlockPos p_190527_2_, boolean p_190527_3_, EnumFacing p_190527_4_, @Nullable Entity p_190527_5_)
{
    IBlockState iblockstate = this.getBlockState(p_190527_2_);
    AxisAlignedBB axisalignedbb = p_190527_3_ ? null : p_190527_1_.getDefaultState().getCollisionBoundingBox(this, p_190527_2_);
    return axisalignedbb != Block.NULL_AABB && !this.checkNoEntityCollision(axisalignedbb.offset(p_190527_2_), p_190527_5_) ? false : (iblockstate.getMaterial() == Material.CIRCUITS && p_190527_1_ == Blocks.ANVIL ? true : iblockstate.getMaterial().isReplaceable() && p_190527_1_.canPlaceBlockOnSide(this, p_190527_2_, p_190527_4_));
}
 
Example 50
Project: ArcaneMagic   File: BlockAnimaConjurer.java   Source Code and License 4 votes vote down vote up
public BlockAnimaConjurer()
{
	super("anima_conjurer", Material.ROCK, 2.5f, SoundType.STONE);
}
 
Example 51
Project: BaseClient   File: WorldGenGlowStone1.java   Source Code and License 4 votes vote down vote up
public boolean generate(World worldIn, Random rand, BlockPos position)
{
    if (!worldIn.isAirBlock(position))
    {
        return false;
    }
    else if (worldIn.getBlockState(position.up()).getBlock() != Blocks.netherrack)
    {
        return false;
    }
    else
    {
        worldIn.setBlockState(position, Blocks.glowstone.getDefaultState(), 2);

        for (int i = 0; i < 1500; ++i)
        {
            BlockPos blockpos = position.add(rand.nextInt(8) - rand.nextInt(8), -rand.nextInt(12), rand.nextInt(8) - rand.nextInt(8));

            if (worldIn.getBlockState(blockpos).getBlock().getMaterial() == Material.air)
            {
                int j = 0;

                for (EnumFacing enumfacing : EnumFacing.values())
                {
                    if (worldIn.getBlockState(blockpos.offset(enumfacing)).getBlock() == Blocks.glowstone)
                    {
                        ++j;
                    }

                    if (j > 1)
                    {
                        break;
                    }
                }

                if (j == 1)
                {
                    worldIn.setBlockState(blockpos, Blocks.glowstone.getDefaultState(), 2);
                }
            }
        }

        return true;
    }
}
 
Example 52
Project: minecraft-quiverbow   File: ProxyThorn.java   Source Code and License 4 votes vote down vote up
@Override
public void onImpact(MovingObjectPosition movPos)	// Server-side
{
	if (movPos.entityHit != null) 		// We hit a living thing!
   	{	
		movPos.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.shootingEntity), (float) this.damage);	// Damage gets applied here
		movPos.entityHit.hurtResistantTime = 0;	// No immunity frames
           
		this.goBoom();
           this.setDead();		// We've hit something, so begone with the projectile
       }
	
	else // Hit the terrain
	{			
		if (Helper.tryBlockBreak(this.worldObj, this, movPos, 1)) 	// Going straight through a thing
		{ 
			//this.goBoom();
		} 
		else	// Didn't manage to break that block, so we're stuck now for a short while
		{
			this.stuckBlockX = movPos.blockX;
			this.stuckBlockY = movPos.blockY;
			this.stuckBlockZ = movPos.blockZ;
			
			this.stuckBlock = this.worldObj.getBlock(this.stuckBlockX, this.stuckBlockY, this.stuckBlockZ);
			this.inData = this.worldObj.getBlockMetadata(this.stuckBlockX, this.stuckBlockY, this.stuckBlockZ);
			
			this.motionX = movPos.hitVec.xCoord - this.posX;
			this.motionY = movPos.hitVec.yCoord - this.posY;
			this.motionZ = movPos.hitVec.zCoord - this.posZ;
			
			this.hitSide = movPos.sideHit;	// Keeping track of the side we hit, for when we go boom
			
			float distance = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionY * this.motionY + this.motionZ * this.motionZ);
			
			this.posX -= this.motionX / (double) distance * 0.05000000074505806D;
			this.posY -= this.motionY / (double) distance * 0.05000000074505806D;
			this.posZ -= this.motionZ / (double) distance * 0.05000000074505806D;
			
			this.inGround = true;
			
			this.arrowShake = 7;
			
			if (this.stuckBlock.getMaterial() != Material.air)
			{
				this.stuckBlock.onEntityCollidedWithBlock(this.worldObj, this.stuckBlockX, this.stuckBlockY, this.stuckBlockZ, this);
			}
		}
		
		this.boundingBox.setBounds(-0.2d, 0.0d, -0.2d, 0.2d, 0.2d, 0.2d);	// Attackable
	}
   	
	// SFX
   	this.worldObj.playSoundAtEntity(this, "random.wood_click", 1.0F, 0.3F);
       NetHelper.sendParticleMessageToAllPlayers(this.worldObj, this.getEntityId(), (byte) 3, (byte) 4);
       
       //this.setDead();		// We've hit something, so begone with the projectile
}
 
Example 53
Project: Solar   File: BlockAngstrom.java   Source Code and License 4 votes vote down vote up
public BlockAngstrom() {
	super(LibNames.ANGSTROM, Material.IRON);
	setHarvestLevel(Tool.PICK, ToolLevel.STONE);
	setHardness(2F);
}
 
Example 54
Project: BaseClient   File: BlockPistonMoving.java   Source Code and License 4 votes vote down vote up
public BlockPistonMoving()
{
    super(Material.piston);
    this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(TYPE, BlockPistonExtension.EnumPistonType.DEFAULT));
    this.setHardness(-1.0F);
}
 
Example 55
Project: BaseClient   File: Minecraft.java   Source Code and License 4 votes vote down vote up
private void clickMouse()
{
    if (this.leftClickCounter <= 0)
    {
        this.thePlayer.swingItem();

        if (this.objectMouseOver == null)
        {
            logger.error("Null returned as \'hitResult\', this shouldn\'t happen!");

            if (this.playerController.isNotCreative())
            {
                this.leftClickCounter = 10;
            }
        }
        else
        {
            switch (this.objectMouseOver.typeOfHit)
            {
                case ENTITY:
                    this.playerController.attackEntity(this.thePlayer, this.objectMouseOver.entityHit);
                    break;

                case BLOCK:
                    BlockPos blockpos = this.objectMouseOver.getBlockPos();

                    if (this.theWorld.getBlockState(blockpos).getBlock().getMaterial() != Material.air)
                    {
                        this.playerController.clickBlock(blockpos, this.objectMouseOver.sideHit);
                        break;
                    }

                case MISS:
                default:
                    if (this.playerController.isNotCreative())
                    {
                        this.leftClickCounter = 10;
                    }
            }
        }
    }
}
 
Example 56
Project: BaseClient   File: ItemPickaxe.java   Source Code and License 4 votes vote down vote up
/**
 * Check whether this Item can harvest the given Block
 */
public boolean canHarvestBlock(Block blockIn)
{
    return blockIn == Blocks.obsidian ? this.toolMaterial.getHarvestLevel() == 3 : (blockIn != Blocks.diamond_block && blockIn != Blocks.diamond_ore ? (blockIn != Blocks.emerald_ore && blockIn != Blocks.emerald_block ? (blockIn != Blocks.gold_block && blockIn != Blocks.gold_ore ? (blockIn != Blocks.iron_block && blockIn != Blocks.iron_ore ? (blockIn != Blocks.lapis_block && blockIn != Blocks.lapis_ore ? (blockIn != Blocks.redstone_ore && blockIn != Blocks.lit_redstone_ore ? (blockIn.getMaterial() == Material.rock ? true : (blockIn.getMaterial() == Material.iron ? true : blockIn.getMaterial() == Material.anvil)) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 1) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2) : this.toolMaterial.getHarvestLevel() >= 2);
}
 
Example 57
Project: CustomWorldGen   File: BlockContainer.java   Source Code and License 4 votes vote down vote up
protected BlockContainer(Material materialIn)
{
    this(materialIn, materialIn.getMaterialMapColor());
}
 
Example 58
Project: CustomWorldGen   File: BlockNote.java   Source Code and License 4 votes vote down vote up
public BlockNote()
{
    super(Material.WOOD);
    this.setCreativeTab(CreativeTabs.REDSTONE);
}
 
Example 59
Project: BaseClient   File: BlockContainer.java   Source Code and License 4 votes vote down vote up
protected BlockContainer(Material p_i46402_1_, MapColor p_i46402_2_)
{
    super(p_i46402_1_, p_i46402_2_);
    this.isBlockContainer = true;
}
 
Example 60
Project: Backmemed   File: BlockStone.java   Source Code and License 4 votes vote down vote up
public BlockStone()
{
    super(Material.ROCK);
    this.setDefaultState(this.blockState.getBaseState().withProperty(VARIANT, BlockStone.EnumType.STONE));
    this.setCreativeTab(CreativeTabs.BUILDING_BLOCKS);
}