Java Code Examples for net.minecraft.init.Blocks

The following are top voted examples for showing how to use net.minecraft.init.Blocks. 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: Proyecto-DASI   File: ClassroomDecoratorImplementation.java   Source Code and License 7 votes vote down vote up
private void setIgloo()
{
    this.floor = Blocks.snow.getDefaultState();
    this.exterior = Blocks.snow.getDefaultState();
    this.wall = Blocks.packed_ice.getDefaultState();
    this.light = Blocks.torch.getDefaultState();
    this.goal = Blocks.redstone_block.getDefaultState();
    this.moat = Blocks.water.getDefaultState();
    this.moatContainer = Blocks.glowstone.getDefaultState();
    this.doorUpper = Blocks.spruce_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
    this.doorLower = Blocks.spruce_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
    this.stairs = Blocks.spruce_stairs.getDefaultState();
    this.stairsPlatform = Blocks.packed_ice.getDefaultState();
    this.ladder = Blocks.ladder.getDefaultState();
    this.puzzleDoorUpper = Blocks.iron_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.UPPER);
    this.puzzleDoorLower = Blocks.iron_door.getDefaultState().withProperty(BlockDoor.HALF, BlockDoor.EnumDoorHalf.LOWER);
    this.trigger = Blocks.lever.getDefaultState();
    this.platform = Blocks.snow.getDefaultState();
    this.hint = Blocks.redstone_ore.getDefaultState();
}
 
Example 2
Project: rezolve   File: CityGenerator.java   Source Code and License 6 votes vote down vote up
private void drawStandardRoads(World world, int chunkX, int groundY, int chunkZ, int chunkSize) {

		// Draw roads

		for (int x = 0, maxX = chunkSize; x < maxX; ++x) {
			for (int z = 0, maxZ = chunkSize; z < maxZ; ++z) {
				int edgeX = (x > chunkSize / 2) ? chunkSize - 1 - x : x;
				int edgeZ = (z > chunkSize / 2) ? chunkSize - 1 - z : z;
						
				if (edgeX < 2 || edgeZ < 2) {
					world.setBlockState(new BlockPos(chunkX * 16 + x, groundY, chunkZ * 16 + z), 
							Blocks.STONE.getStateFromMeta(4), 2);
				}
			}
		}
	}
 
Example 3
Project: DecompiledMinecraft   File: ItemRecord.java   Source Code and License 6 votes vote down vote up
/**
 * Called when a Block is right-clicked with this Item
 */
public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
{
    IBlockState iblockstate = worldIn.getBlockState(pos);

    if (iblockstate.getBlock() == Blocks.jukebox && !((Boolean)iblockstate.getValue(BlockJukebox.HAS_RECORD)).booleanValue())
    {
        if (worldIn.isRemote)
        {
            return true;
        }
        else
        {
            ((BlockJukebox)Blocks.jukebox).insertRecord(worldIn, pos, iblockstate, stack);
            worldIn.playAuxSFXAtEntity((EntityPlayer)null, 1005, pos, Item.getIdFromItem(this));
            --stack.stackSize;
            playerIn.triggerAchievement(StatList.field_181740_X);
            return true;
        }
    }
    else
    {
        return false;
    }
}
 
Example 4
Project: CharcoalPit   File: PotteryKilnRecipe.java   Source Code and License 6 votes vote down vote up
public static void initRecipes(){
	recipes.add(new PotteryKilnRecipe(new ItemStack(Items.CLAY_BALL), new ItemStack(Items.BRICK)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.CLAY), new ItemStack(Blocks.HARDENED_CLAY)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(ItemsRegistry.clay_Pot), new ItemStack(Items.FLOWER_POT)));
	
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 0), new ItemStack(Blocks.WHITE_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 1), new ItemStack(Blocks.ORANGE_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 2), new ItemStack(Blocks.MAGENTA_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 3), new ItemStack(Blocks.LIGHT_BLUE_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 4), new ItemStack(Blocks.YELLOW_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 5), new ItemStack(Blocks.LIME_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 6), new ItemStack(Blocks.PINK_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 7), new ItemStack(Blocks.GRAY_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 8), new ItemStack(Blocks.SILVER_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 9), new ItemStack(Blocks.CYAN_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 10), new ItemStack(Blocks.PURPLE_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 11), new ItemStack(Blocks.BLUE_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 12), new ItemStack(Blocks.BROWN_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 13), new ItemStack(Blocks.GREEN_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 14), new ItemStack(Blocks.RED_GLAZED_TERRACOTTA)));
	recipes.add(new PotteryKilnRecipe(new ItemStack(Blocks.STAINED_HARDENED_CLAY, 1, 15), new ItemStack(Blocks.BLACK_GLAZED_TERRACOTTA)));
}
 
Example 5
Project: Backmemed   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 6
Project: MooncakeCraft   File: MooncakeRegistries.java   Source Code and License 6 votes vote down vote up
@SubscribeEvent
public static void onItemRegister(RegistryEvent.Register<Item> event) {
    IForgeRegistry<Item> registry = event.getRegistry();
    registry.registerAll(
            new Mooncake().setRegistryName("mooncakecraft:mooncake"),
            new MooncakeMold().setRegistryName("mooncakecraft:mooncakemold"),
            new MooncakeFilling().setRegistryName("mooncakecraft:mooncake_filling"),
            new Item().setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setHasSubtypes(false).setUnlocalizedName("mooncakecraft.wheat_flour").setRegistryName("mooncakecraft:wheat_flour"),
            new MoonCakeRaw().setRegistryName("mooncakecraft:mooncakeraw"),
            new MoonCakeUnshaped().setRegistryName("mooncakecraft:mooncakeunshaped"),
            new Item().setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setHasSubtypes(false).setUnlocalizedName("mooncakecraft.lotus_seeds").setRegistryName("mooncakecraft:lotus_seeds"),
            new Item().setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setHasSubtypes(false).setUnlocalizedName("mooncakecraft.jujube").setRegistryName("mooncakecraft:jujube"),
            new ItemSeeds(MooncakeConstants.PEANUT_PLANT, Blocks.FARMLAND).setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setUnlocalizedName("mooncakecraft.peanut_seeds").setRegistryName("mooncakecraft:peanut_seeds"),
            new ItemSeeds(MooncakeConstants.SESAME_PLANT, Blocks.FARMLAND).setCreativeTab(MooncakeConstants.TAB_MOONCAKE_CRAFT).setUnlocalizedName("mooncakecraft.sesame_seeds").setRegistryName("mooncakecraft:sesame_seeds"),
            new Item().setRegistryName("mooncakecraft:icon")
    );
}
 
Example 7
Project: DecompiledMinecraft   File: World.java   Source Code and License 6 votes vote down vote up
/**
 * Attempts to extinguish a fire
 */
public boolean extinguishFire(EntityPlayer player, BlockPos pos, EnumFacing side)
{
    pos = pos.offset(side);

    if (this.getBlockState(pos).getBlock() == Blocks.fire)
    {
        this.playAuxSFXAtEntity(player, 1004, pos, 0);
        this.setBlockToAir(pos);
        return true;
    }
    else
    {
        return false;
    }
}
 
Example 8
Project: ExPetrum   File: PebbleGenerator.java   Source Code and License 6 votes vote down vote up
@Override
public boolean generate(World worldIn, Random rand, BlockPos position)
{
	for (int i = 0; i < 16; ++i)
	{
		BlockPos offset = position.add(rand.nextInt(6) - rand.nextInt(6), 6, rand.nextInt(6) - rand.nextInt(6));
		while (!worldIn.isSideSolid(offset.down(), EnumFacing.UP, false) && offset.getY() > 0)
		{
			offset = offset.down();
		}
		
		if (worldIn.isAirBlock(offset) && !worldIn.getBlockState(offset.down()).getBlock().isAssociatedBlock(Blocks.SAND))
		{
			EnumRockClass erc = GenerationHelper.getStoneTypeAt(worldIn, offset);
			worldIn.setBlockState(offset, ExPBlocks.pebble.getDefaultState().withProperty(ExPBlockProperties.ROCK_CLASS, erc), 2);
		}
	}
	
	return true;
}
 
Example 9
Project: DecompiledMinecraft   File: BlockRedstoneWire.java   Source Code and License 6 votes vote down vote up
protected static boolean canConnectTo(IBlockState blockState, EnumFacing side)
{
    Block block = blockState.getBlock();

    if (block == Blocks.redstone_wire)
    {
        return true;
    }
    else if (Blocks.unpowered_repeater.isAssociated(block))
    {
        EnumFacing enumfacing = (EnumFacing)blockState.getValue(BlockRedstoneRepeater.FACING);
        return enumfacing == side || enumfacing.getOpposite() == side;
    }
    else
    {
        return block.canProvidePower() && side != null;
    }
}
 
Example 10
Project: Technical   File: TileEntityMachine.java   Source Code and License 6 votes vote down vote up
public static int getItemBurnTimeBurning(ItemStack itemStack) {
	if(itemStack == null)
		return 0;
	else {
		Item item = itemStack.getItem();

		if(item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air) {

			Block block = Block.getBlockFromItem(item);

			if(block == Blocks.coal_block)
				return 3200;
		}

		if(item == Items.coal)
			return 320;

		return 0;
	}
}
 
Example 11
Project: BaseClient   File: EntityDiggingFX.java   Source Code and License 6 votes vote down vote up
public EntityDiggingFX func_174845_l()
{
    this.field_181019_az = new BlockPos(this.posX, this.posY, this.posZ);
    Block block = this.field_174847_a.getBlock();

    if (block == Blocks.grass)
    {
        return this;
    }
    else
    {
        int i = block.getRenderColor(this.field_174847_a);
        this.particleRed *= (float)(i >> 16 & 255) / 255.0F;
        this.particleGreen *= (float)(i >> 8 & 255) / 255.0F;
        this.particleBlue *= (float)(i & 255) / 255.0F;
        return this;
    }
}
 
Example 12
Project: BaseClient   File: World.java   Source Code and License 6 votes vote down vote up
/**
 * Sets a block to air, but also plays the sound and particles and can spawn drops
 */
public boolean destroyBlock(BlockPos pos, boolean dropBlock)
{
    IBlockState iblockstate = this.getBlockState(pos);
    Block block = iblockstate.getBlock();

    if (block.getMaterial() == Material.air)
    {
        return false;
    }
    else
    {
        this.playAuxSFX(2001, pos, Block.getStateId(iblockstate));

        if (dropBlock)
        {
            block.dropBlockAsItem(this, pos, iblockstate, 0);
        }

        return this.setBlockState(pos, Blocks.air.getDefaultState(), 3);
    }
}
 
Example 13
Project: pnc-repressurized   File: TileEntityElectrostaticCompressor.java   Source Code and License 6 votes vote down vote up
@Override
public void update() {
    /*
     * Most of the Electrostatic Compressor's logic can be found in TickHandlerPneumaticCraft#handleElectrostaticGeneration().
     */
    if (getWorld().getTotalWorldTime() % 40 == 0) {
        for (ironBarsBeneath = 0; ironBarsBeneath < 128; ironBarsBeneath++) {
            if (getWorld().getBlockState(getPos().offset(EnumFacing.DOWN, ironBarsBeneath + 1)).getBlock() != Blocks.IRON_BARS) {
                break;
            }
        }
    }
    super.update();
    if (!getWorld().isRemote) {
        if (lastRedstoneState != shouldEmitRedstone()) {
            lastRedstoneState = !lastRedstoneState;
            updateNeighbours();
        }
        struckByLightningCooldown--;
    }

}
 
Example 14
Project: DecompiledMinecraft   File: Chunk.java   Source Code and License 6 votes vote down vote up
/**
 * Returns the block corresponding to the given coordinates inside a chunk.
 */
private Block getBlock0(int x, int y, int z)
{
    Block block = Blocks.air;

    if (y >= 0 && y >> 4 < this.storageArrays.length)
    {
        ExtendedBlockStorage extendedblockstorage = this.storageArrays[y >> 4];

        if (extendedblockstorage != null)
        {
            try
            {
                block = extendedblockstorage.getBlockByExtId(x, y & 15, z);
            }
            catch (Throwable throwable)
            {
                CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Getting block");
                throw new ReportedException(crashreport);
            }
        }
    }

    return block;
}
 
Example 15
Project: BaseClient   File: BlockPortal.java   Source Code and License 6 votes vote down vote up
/**
 * Called when a neighboring block changes.
 */
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
{
    EnumFacing.Axis enumfacing$axis = (EnumFacing.Axis)state.getValue(AXIS);

    if (enumfacing$axis == EnumFacing.Axis.X)
    {
        BlockPortal.Size blockportal$size = new BlockPortal.Size(worldIn, pos, EnumFacing.Axis.X);

        if (!blockportal$size.func_150860_b() || blockportal$size.field_150864_e < blockportal$size.field_150868_h * blockportal$size.field_150862_g)
        {
            worldIn.setBlockState(pos, Blocks.air.getDefaultState());
        }
    }
    else if (enumfacing$axis == EnumFacing.Axis.Z)
    {
        BlockPortal.Size blockportal$size1 = new BlockPortal.Size(worldIn, pos, EnumFacing.Axis.Z);

        if (!blockportal$size1.func_150860_b() || blockportal$size1.field_150864_e < blockportal$size1.field_150868_h * blockportal$size1.field_150862_g)
        {
            worldIn.setBlockState(pos, Blocks.air.getDefaultState());
        }
    }
}
 
Example 16
Project: Backmemed   File: EntitySheep.java   Source Code and License 6 votes vote down vote up
public boolean processInteract(EntityPlayer player, EnumHand hand)
{
    ItemStack itemstack = player.getHeldItem(hand);

    if (itemstack.getItem() == Items.SHEARS && !this.getSheared() && !this.isChild())
    {
        if (!this.world.isRemote)
        {
            this.setSheared(true);
            int i = 1 + this.rand.nextInt(3);

            for (int j = 0; j < i; ++j)
            {
                EntityItem entityitem = this.entityDropItem(new ItemStack(Item.getItemFromBlock(Blocks.WOOL), 1, this.getFleeceColor().getMetadata()), 1.0F);
                entityitem.motionY += (double)(this.rand.nextFloat() * 0.05F);
                entityitem.motionX += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
                entityitem.motionZ += (double)((this.rand.nextFloat() - this.rand.nextFloat()) * 0.1F);
            }
        }

        itemstack.damageItem(1, player);
        this.playSound(SoundEvents.ENTITY_SHEEP_SHEAR, 1.0F, 1.0F);
    }

    return super.processInteract(player, hand);
}
 
Example 17
Project: minecraft-quiverbow   File: NeedleMagazine.java   Source Code and License 6 votes vote down vote up
private void fillEight(ItemStack stack, World world, EntityPlayer player)
{
	boolean doSFX = false;
	
	int counter = 0;
	
	while (counter < 8)
	{
		if (player.inventory.hasItem(Item.getItemFromBlock(Blocks.cactus)))
		{
			int dmg = stack.getItemDamage() - 1;
			stack.setItemDamage(dmg);
			
			player.inventory.consumeInventoryItem(Item.getItemFromBlock(Blocks.cactus));	// We're just grabbing what we need from the inventory
			
			doSFX = true;
		}
		// else, doesn't have what it takes
		
		counter += 1;
	}
	
	if (doSFX) { world.playSoundAtEntity(player, "random.wood_click", 1.0F, 0.2F); }
}
 
Example 18
Project: BaseClient   File: TileEntityPiston.java   Source Code and License 6 votes vote down vote up
/**
 * removes a piston's tile entity (and if the piston is moving, stops it)
 */
public void clearPistonTileEntity()
{
    if (this.lastProgress < 1.0F && this.worldObj != null)
    {
        this.lastProgress = this.progress = 1.0F;
        this.worldObj.removeTileEntity(this.pos);
        this.invalidate();

        if (this.worldObj.getBlockState(this.pos).getBlock() == Blocks.piston_extension)
        {
            this.worldObj.setBlockState(this.pos, this.pistonState, 3);
            this.worldObj.notifyBlockOfStateChange(this.pos, this.pistonState.getBlock());
        }
    }
}
 
Example 19
Project: connor41-etfuturum2   File: EndCrystal.java   Source Code and License 6 votes vote down vote up
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ) {
	if (side != 1)
		return false;

	Block block = world.getBlock(x, y, z);
	if (block == Blocks.obsidian || block == Blocks.bedrock)
		if (world.isAirBlock(x, y + 1, z)) {
			if (!world.isRemote) {
				EntityPlacedEndCrystal endCrystal = new EntityPlacedEndCrystal(world);
				endCrystal.setPosition(x + 0.5, y, z + 0.5);
				endCrystal.setBlockPos(x, y, z);

				world.spawnEntityInWorld(endCrystal);
				if (!player.capabilities.isCreativeMode)
					stack.stackSize--;
			}
			return true;
		}

	return false;
}
 
Example 20
Project: minecraft-quiverbow   File: OSR.java   Source Code and License 6 votes vote down vote up
@Override
public void addRecipes()
{
	if (this.Enabled)
	{
		// One obsidigun (empty)
		GameRegistry.addRecipe(new ItemStack(this, 1 , this.getMaxDamage()), "x x", "zbz", "xyx",
				'x', Blocks.obsidian,
				'y', Blocks.lever,
				'z', Items.iron_ingot,
				'a', Items.repeater,
				'b', Blocks.piston
				);
	}
	else if (Main.noCreative) { this.setCreativeTab(null); }	// Not enabled and not allowed to be in the creative menu

	// Reloading with obsidian magazine, setting its ammo metadata as ours (Need to be empty for that)
	Helper.registerAmmoRecipe(ObsidianMagazine.class, this);
}
 
Example 21
Project: DecompiledMinecraft   File: BlockSilverfish.java   Source Code and License 6 votes vote down vote up
protected ItemStack createStackedBlock(IBlockState state)
{
    switch ((BlockSilverfish.EnumType)state.getValue(VARIANT))
    {
        case COBBLESTONE:
            return new ItemStack(Blocks.cobblestone);

        case STONEBRICK:
            return new ItemStack(Blocks.stonebrick);

        case MOSSY_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.MOSSY.getMetadata());

        case CRACKED_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CRACKED.getMetadata());

        case CHISELED_STONEBRICK:
            return new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.EnumType.CHISELED.getMetadata());

        default:
            return new ItemStack(Blocks.stone);
    }
}
 
Example 22
Project: DecompiledMinecraft   File: WorldGenBigTree.java   Source Code and License 5 votes vote down vote up
/**
 * Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height
 * limit, is valid.
 */
private boolean validTreeLocation()
{
    Block block = this.world.getBlockState(this.basePos.down()).getBlock();

    if (block != Blocks.dirt && block != Blocks.grass && block != Blocks.farmland)
    {
        return false;
    }
    else
    {
        int i = this.checkBlockLine(this.basePos, this.basePos.up(this.heightLimit - 1));

        if (i == -1)
        {
            return true;
        }
        else if (i < 6)
        {
            return false;
        }
        else
        {
            this.heightLimit = i;
            return true;
        }
    }
}
 
Example 23
Project: BaseClient   File: WorldGenBigTree.java   Source Code and License 5 votes vote down vote up
/**
 * Generates the leaves surrounding an individual entry in the leafNodes list.
 */
void generateLeafNode(BlockPos pos)
{
    for (int i = 0; i < this.leafDistanceLimit; ++i)
    {
        this.func_181631_a(pos.up(i), this.leafSize(i), Blocks.leaves.getDefaultState().withProperty(BlockLeaves.CHECK_DECAY, Boolean.valueOf(false)));
    }
}
 
Example 24
Project: CustomWorldGen   File: World.java   Source Code and License 5 votes vote down vote up
public boolean isFlammableWithin(AxisAlignedBB bb)
{
    int i = MathHelper.floor_double(bb.minX);
    int j = MathHelper.ceiling_double_int(bb.maxX);
    int k = MathHelper.floor_double(bb.minY);
    int l = MathHelper.ceiling_double_int(bb.maxY);
    int i1 = MathHelper.floor_double(bb.minZ);
    int j1 = MathHelper.ceiling_double_int(bb.maxZ);

    if (this.isAreaLoaded(i, k, i1, j, l, j1, true))
    {
        BlockPos.PooledMutableBlockPos blockpos$pooledmutableblockpos = BlockPos.PooledMutableBlockPos.retain();

        for (int k1 = i; k1 < j; ++k1)
        {
            for (int l1 = k; l1 < l; ++l1)
            {
                for (int i2 = i1; i2 < j1; ++i2)
                {
                    Block block = this.getBlockState(blockpos$pooledmutableblockpos.setPos(k1, l1, i2)).getBlock();

                    if (block == Blocks.FIRE || block == Blocks.FLOWING_LAVA || block == Blocks.LAVA)
                    {
                        blockpos$pooledmutableblockpos.release();
                        return true;
                    }
                    else if (block.isBurning(this, new BlockPos(k1, l1, i2)))
                    {
                        return true;
                    }
                }
            }
        }

        blockpos$pooledmutableblockpos.release();
    }

    return false;
}
 
Example 25
Project: BaseClient   File: ItemBlock.java   Source Code and License 5 votes vote down vote up
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack stack)
{
    Block block = worldIn.getBlockState(pos).getBlock();

    if (block == Blocks.snow_layer)
    {
        side = EnumFacing.UP;
    }
    else if (!block.isReplaceable(worldIn, pos))
    {
        pos = pos.offset(side);
    }

    return worldIn.canBlockBePlaced(this.block, pos, false, side, (Entity)null, stack);
}
 
Example 26
Project: BaseClient   File: BlockRedstoneLight.java   Source Code and License 5 votes vote down vote up
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state)
{
    if (!worldIn.isRemote)
    {
        if (this.isOn && !worldIn.isBlockPowered(pos))
        {
            worldIn.setBlockState(pos, Blocks.redstone_lamp.getDefaultState(), 2);
        }
        else if (!this.isOn && worldIn.isBlockPowered(pos))
        {
            worldIn.setBlockState(pos, Blocks.lit_redstone_lamp.getDefaultState(), 2);
        }
    }
}
 
Example 27
Project: ExSartagine   File: BlockSmelter.java   Source Code and License 5 votes vote down vote up
@Override
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos fromPos)
{

	if(world.getTileEntity(pos) instanceof TileEntitySmelter){
		if(fromPos.up().equals(pos)){ //if the block is beneath us
			Block down = world.getBlockState(fromPos).getBlock();
			if(down == Blocks.AIR)
			{
				dropBlockAsItem(world, pos, getDefaultState(), 0);
				world.setBlockToAir(pos);
			}

			else if(down == Blocks.LIT_FURNACE)
			{
				((TileEntitySmelter)world.getTileEntity(pos)).setCooking();
				world.notifyBlockUpdate(pos, state, getDefaultState(), 3);
			}

			else if(down == Blocks.FURNACE)
			{
				((TileEntitySmelter)world.getTileEntity(pos)).stopCooking();
				world.notifyBlockUpdate(pos, state, getDefaultState(), 3);
			}
			else if (down == ExSartagineBlock.range_extension_lit)
			{
				((TileEntitySmelter)world.getTileEntity(pos)).setCooking();
				world.notifyBlockUpdate(pos, state, getDefaultState(), 3);
			}
			else if (down == ExSartagineBlock.range_extension)
			{
				((TileEntitySmelter)world.getTileEntity(pos)).stopCooking();
				world.notifyBlockUpdate(pos, state, getDefaultState(), 3);
			}
		}
	}
}
 
Example 28
Project: DecompiledMinecraft   File: BiomeGenMushroomIsland.java   Source Code and License 5 votes vote down vote up
public BiomeGenMushroomIsland(int p_i1984_1_)
{
    super(p_i1984_1_);
    this.theBiomeDecorator.treesPerChunk = -100;
    this.theBiomeDecorator.flowersPerChunk = -100;
    this.theBiomeDecorator.grassPerChunk = -100;
    this.theBiomeDecorator.mushroomsPerChunk = 1;
    this.theBiomeDecorator.bigMushroomsPerChunk = 1;
    this.topBlock = Blocks.mycelium.getDefaultState();
    this.spawnableMonsterList.clear();
    this.spawnableCreatureList.clear();
    this.spawnableWaterCreatureList.clear();
    this.spawnableCreatureList.add(new BiomeGenBase.SpawnListEntry(EntityMooshroom.class, 8, 4, 8));
}
 
Example 29
Project: rezolve   File: BundleBuilderBlock.java   Source Code and License 5 votes vote down vote up
@Override
public void registerRecipes() {
	if (Item.REGISTRY.getObject(new ResourceLocation("enderio:itemAlloy")) != null) {
		RezolveMod.addRecipe(new ItemStack(this.itemBlock), 
			"RCR",
			"FMF",
			"RcR", 

			'R', "item|enderio:itemAlloy|3",
			'C', Items.COMPARATOR,
			'F', "item|enderio:itemBasicFilterUpgrade",
			'M', "item|enderio:itemMachinePart|0",
			'c', "item|enderio:itemBasicCapacitor|2"
		);
	} else {
		RezolveMod.addRecipe(new ItemStack(this.itemBlock), 
			"QEQ",
			"CRC",
			"QNQ", 
			
			'Q', Blocks.QUARTZ_BLOCK,
			'E', Blocks.ENCHANTING_TABLE,
			'C', Blocks.CRAFTING_TABLE,
			'R', Items.COMPARATOR,
			'N', Items.NETHER_STAR
		);
	}
}
 
Example 30
Project: DecompiledMinecraft   File: EntityArmorStand.java   Source Code and License 5 votes vote down vote up
private void playParticles()
{
    if (this.worldObj instanceof WorldServer)
    {
        ((WorldServer)this.worldObj).spawnParticle(EnumParticleTypes.BLOCK_DUST, this.posX, this.posY + (double)this.height / 1.5D, this.posZ, 10, (double)(this.width / 4.0F), (double)(this.height / 4.0F), (double)(this.width / 4.0F), 0.05D, new int[] {Block.getStateId(Blocks.planks.getDefaultState())});
    }
}
 
Example 31
Project: DecompiledMinecraft   File: EntityMinecartTNT.java   Source Code and License 5 votes vote down vote up
public void killMinecart(DamageSource p_94095_1_)
{
    super.killMinecart(p_94095_1_);
    double d0 = this.motionX * this.motionX + this.motionZ * this.motionZ;

    if (!p_94095_1_.isExplosion() && this.worldObj.getGameRules().getBoolean("doEntityDrops"))
    {
        this.entityDropItem(new ItemStack(Blocks.tnt, 1), 0.0F);
    }

    if (p_94095_1_.isFireDamage() || p_94095_1_.isExplosion() || d0 >= 0.009999999776482582D)
    {
        this.explodeCart(d0);
    }
}
 
Example 32
Project: Adventurers-Toolbox   File: ItemATDagger.java   Source Code and License 5 votes vote down vote up
@Override
public float getDestroySpeed(ItemStack stack, IBlockState state) {
	Block block = state.getBlock();

	if (block == Blocks.WEB) {
		return 15.0F;
	} else {
		Material material = state.getMaterial();
		return material != Material.PLANTS && material != Material.VINE && material != Material.CORAL
				&& material != Material.LEAVES && material != Material.GOURD ? 1.0F : 1.5F;
	}
}
 
Example 33
Project: DecompiledMinecraft   File: StructureNetherBridgePieces.java   Source Code and License 5 votes vote down vote up
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    Random random = new Random((long)this.fillSeed);

    for (int i = 0; i <= 4; ++i)
    {
        for (int j = 3; j <= 4; ++j)
        {
            int k = random.nextInt(8);
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, j, 0, i, j, k, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
        }
    }

    int l = random.nextInt(8);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 0, 5, l, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    l = random.nextInt(8);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 0, 4, 5, l, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);

    for (l = 0; l <= 4; ++l)
    {
        int i1 = random.nextInt(5);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, l, 2, 0, l, 2, i1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    }

    for (l = 0; l <= 4; ++l)
    {
        for (int j1 = 0; j1 <= 1; ++j1)
        {
            int k1 = random.nextInt(3);
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, l, j1, 0, l, j1, k1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
        }
    }

    return true;
}
 
Example 34
Project: BetterBeginningsReborn   File: RegisterRecipes.java   Source Code and License 5 votes vote down vote up
private static void addBrickOvenRecipes()
   {
BrickOvenConfig.addShapedRecipe(new ItemStack(Items.GOLDEN_APPLE), "GGG", "GAG", "GGG", 'G',
	Items.GOLD_INGOT, 'A', Items.APPLE);
BrickOvenConfig.addShapedRecipe(new ItemStack(Items.GOLDEN_APPLE, 1, 1), "###", "#A#", "###", '#',
	Blocks.GOLD_BLOCK, 'A', Items.APPLE);
BrickOvenConfig.addShapedRecipe(new ItemStack(Items.CAKE), "MMM", "SES", "WWW", 'M', Items.MILK_BUCKET,
	'S', Items.SUGAR, 'E', Items.EGG, 'W', "cropWheat");
BrickOvenConfig.addShapedRecipe(new ItemStack(Items.BREAD, 2), "WWW", 'W', "cropWheat");
BrickOvenConfig.addShapedRecipe(new ItemStack(Items.COOKIE, 8), "WCW", 'W', "cropWheat", 'C',
	new ItemStack(Items.DYE, 1, 3)); // Cocoa bean
BrickOvenConfig.addShapedRecipe(new ItemStack(Items.RABBIT_STEW), " R ", "CPM", " B ",
	'R', Items.COOKED_RABBIT, 'C', "cropCarrot", 'P', "cropPotato",
	'M', Blocks.BROWN_MUSHROOM, 'B', Items.BOWL);
BrickOvenConfig.addShapedRecipe(new ItemStack(Items.RABBIT_STEW), " R ", "CPM", " B ",
	'R', Items.COOKED_RABBIT, 'C', "cropCarrot", 'P', "cropPotato",
	'M', Blocks.RED_MUSHROOM, 'B', Items.BOWL);
BrickOvenConfig.addShapedRecipe(new ItemStack(RegisterItems.marshmallow, 3), " S ", "SSS", " S ",
	'S', Items.SUGAR);

BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.MUSHROOM_STEW), Blocks.BROWN_MUSHROOM,
	Blocks.RED_MUSHROOM, Items.BOWL);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.COOKED_BEEF), Items.BEEF);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.COOKED_PORKCHOP), Items.PORKCHOP);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.COOKED_CHICKEN), Items.CHICKEN);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.COOKED_FISH), Items.FISH);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.COOKED_FISH, 1, 1),
	new ItemStack(Items.FISH, 1, 1));
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.COOKED_RABBIT), Items.RABBIT);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.COOKED_MUTTON), Items.MUTTON);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.BAKED_POTATO), "cropPotato");
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.PUMPKIN_PIE), Items.EGG, Items.SUGAR,
	Blocks.PUMPKIN);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.FERMENTED_SPIDER_EYE), Items.SPIDER_EYE,
	Items.SUGAR, Blocks.BROWN_MUSHROOM);
BrickOvenConfig.addShapelessRecipe(new ItemStack(Items.MAGMA_CREAM),
	Items.SLIME_BALL, Items.BLAZE_POWDER);
   }
 
Example 35
Project: BaseClient   File: BlockDeadBush.java   Source Code and License 5 votes vote down vote up
public void harvestBlock(World worldIn, EntityPlayer player, BlockPos pos, IBlockState state, TileEntity te)
{
    if (!worldIn.isRemote && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() == Items.shears)
    {
        player.triggerAchievement(StatList.mineBlockStatArray[Block.getIdFromBlock(this)]);
        spawnAsEntity(worldIn, pos, new ItemStack(Blocks.deadbush, 1, 0));
    }
    else
    {
        super.harvestBlock(worldIn, player, pos, state, te);
    }
}
 
Example 36
Project: Backmemed   File: BlockGrass.java   Source Code and License 5 votes vote down vote up
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (!worldIn.isRemote)
    {
        if (worldIn.getLightFromNeighbors(pos.up()) < 4 && worldIn.getBlockState(pos.up()).getLightOpacity() > 2)
        {
            worldIn.setBlockState(pos, Blocks.DIRT.getDefaultState());
        }
        else
        {
            if (worldIn.getLightFromNeighbors(pos.up()) >= 9)
            {
                for (int i = 0; i < 4; ++i)
                {
                    BlockPos blockpos = pos.add(rand.nextInt(3) - 1, rand.nextInt(5) - 3, rand.nextInt(3) - 1);

                    if (blockpos.getY() >= 0 && blockpos.getY() < 256 && !worldIn.isBlockLoaded(blockpos))
                    {
                        return;
                    }

                    IBlockState iblockstate = worldIn.getBlockState(blockpos.up());
                    IBlockState iblockstate1 = worldIn.getBlockState(blockpos);

                    if (iblockstate1.getBlock() == Blocks.DIRT && iblockstate1.getValue(BlockDirt.VARIANT) == BlockDirt.DirtType.DIRT && worldIn.getLightFromNeighbors(blockpos.up()) >= 4 && iblockstate.getLightOpacity() <= 2)
                    {
                        worldIn.setBlockState(blockpos, Blocks.GRASS.getDefaultState());
                    }
                }
            }
        }
    }
}
 
Example 37
Project: DecompiledMinecraft   File: ItemHoe.java   Source Code and License 5 votes vote down vote up
@SuppressWarnings("incomplete-switch")

    /**
     * Called when a Block is right-clicked with this Item
     */
    public boolean onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ)
    {
        if (!playerIn.canPlayerEdit(pos.offset(side), side, stack))
        {
            return false;
        }
        else
        {
            IBlockState iblockstate = worldIn.getBlockState(pos);
            Block block = iblockstate.getBlock();

            if (side != EnumFacing.DOWN && worldIn.getBlockState(pos.up()).getBlock().getMaterial() == Material.air)
            {
                if (block == Blocks.grass)
                {
                    return this.useHoe(stack, playerIn, worldIn, pos, Blocks.farmland.getDefaultState());
                }

                if (block == Blocks.dirt)
                {
                    switch ((BlockDirt.DirtType)iblockstate.getValue(BlockDirt.VARIANT))
                    {
                        case DIRT:
                            return this.useHoe(stack, playerIn, worldIn, pos, Blocks.farmland.getDefaultState());

                        case COARSE_DIRT:
                            return this.useHoe(stack, playerIn, worldIn, pos, Blocks.dirt.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.DIRT));
                    }
                }
            }

            return false;
        }
    }
 
Example 38
Project: BaseClient   File: TileEntityFurnace.java   Source Code and License 5 votes vote down vote up
/**
 * Turn one item from the furnace source stack into the appropriate smelted item in the furnace result stack
 */
public void smeltItem()
{
    if (this.canSmelt())
    {
        ItemStack itemstack = FurnaceRecipes.instance().getSmeltingResult(this.furnaceItemStacks[0]);

        if (this.furnaceItemStacks[2] == null)
        {
            this.furnaceItemStacks[2] = itemstack.copy();
        }
        else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem())
        {
            ++this.furnaceItemStacks[2].stackSize;
        }

        if (this.furnaceItemStacks[0].getItem() == Item.getItemFromBlock(Blocks.sponge) && this.furnaceItemStacks[0].getMetadata() == 1 && this.furnaceItemStacks[1] != null && this.furnaceItemStacks[1].getItem() == Items.bucket)
        {
            this.furnaceItemStacks[1] = new ItemStack(Items.water_bucket);
        }

        --this.furnaceItemStacks[0].stackSize;

        if (this.furnaceItemStacks[0].stackSize <= 0)
        {
            this.furnaceItemStacks[0] = null;
        }
    }
}
 
Example 39
Project: DecompiledMinecraft   File: Teleporter.java   Source Code and License 5 votes vote down vote up
public void placeInPortal(Entity entityIn, float rotationYaw)
{
    if (this.worldServerInstance.provider.getDimensionId() != 1)
    {
        if (!this.placeInExistingPortal(entityIn, rotationYaw))
        {
            this.makePortal(entityIn);
            this.placeInExistingPortal(entityIn, rotationYaw);
        }
    }
    else
    {
        int i = MathHelper.floor_double(entityIn.posX);
        int j = MathHelper.floor_double(entityIn.posY) - 1;
        int k = MathHelper.floor_double(entityIn.posZ);
        int l = 1;
        int i1 = 0;

        for (int j1 = -2; j1 <= 2; ++j1)
        {
            for (int k1 = -2; k1 <= 2; ++k1)
            {
                for (int l1 = -1; l1 < 3; ++l1)
                {
                    int i2 = i + k1 * l + j1 * i1;
                    int j2 = j + l1;
                    int k2 = k + k1 * i1 - j1 * l;
                    boolean flag = l1 < 0;
                    this.worldServerInstance.setBlockState(new BlockPos(i2, j2, k2), flag ? Blocks.obsidian.getDefaultState() : Blocks.air.getDefaultState());
                }
            }
        }

        entityIn.setLocationAndAngles((double)i, (double)j, (double)k, entityIn.rotationYaw, 0.0F);
        entityIn.motionX = entityIn.motionY = entityIn.motionZ = 0.0D;
    }
}
 
Example 40
Project: DecompiledMinecraft   File: WorldGenSwamp.java   Source Code and License 5 votes vote down vote up
private void func_181647_a(World p_181647_1_, BlockPos p_181647_2_, PropertyBool p_181647_3_)
{
    IBlockState iblockstate = Blocks.vine.getDefaultState().withProperty(p_181647_3_, Boolean.valueOf(true));
    this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate);
    int i = 4;

    for (p_181647_2_ = p_181647_2_.down(); p_181647_1_.getBlockState(p_181647_2_).getBlock().getMaterial() == Material.air && i > 0; --i)
    {
        this.setBlockAndNotifyAdequately(p_181647_1_, p_181647_2_, iblockstate);
        p_181647_2_ = p_181647_2_.down();
    }
}
 
Example 41
Project: Backmemed   File: BlockCactus.java   Source Code and License 5 votes vote down vote up
public boolean canBlockStay(World worldIn, BlockPos pos)
{
    for (EnumFacing enumfacing : EnumFacing.Plane.HORIZONTAL)
    {
        Material material = worldIn.getBlockState(pos.offset(enumfacing)).getMaterial();

        if (material.isSolid() || material == Material.LAVA)
        {
            return false;
        }
    }

    Block block = worldIn.getBlockState(pos.down()).getBlock();
    return block == Blocks.CACTUS || block == Blocks.SAND && !worldIn.getBlockState(pos.up()).getMaterial().isLiquid();
}
 
Example 42
Project: CustomWorldGen   File: BlockReed.java   Source Code and License 5 votes vote down vote up
public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand)
{
    if (worldIn.getBlockState(pos.down()).getBlock() == Blocks.REEDS || this.checkForDrop(worldIn, pos, state))
    {
        if (worldIn.isAirBlock(pos.up()))
        {
            int i;

            for (i = 1; worldIn.getBlockState(pos.down(i)).getBlock() == this; ++i)
            {
                ;
            }

            if (i < 3)
            {
                int j = ((Integer)state.getValue(AGE)).intValue();

                if(net.minecraftforge.common.ForgeHooks.onCropsGrowPre(worldIn, pos, state, true))
                {
                if (j == 15)
                {
                    worldIn.setBlockState(pos.up(), this.getDefaultState());
                    worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(0)), 4);
                }
                else
                {
                    worldIn.setBlockState(pos, state.withProperty(AGE, Integer.valueOf(j + 1)), 4);
                }
                net.minecraftforge.common.ForgeHooks.onCropsGrowPost(worldIn, pos, state, worldIn.getBlockState(pos));
                }
            }
        }
    }
}
 
Example 43
Project: ExPetrum   File: BlockVegetation.java   Source Code and License 5 votes vote down vote up
@Override
public void initBlock()
{
	this.setHardness(0);
	this.setRegistryName(ExPRegistryNames.asLocation(ExPRegistryNames.blockVegetation));
	this.setResistance(0);
	this.setSoundType(SoundType.PLANT);
	this.setUnlocalizedName(this.getRegistryName().toString().replace(':', '.'));
	this.setDefaultState(this.blockState.getBaseState().withProperty(RANDOM_MODEL, 0).withProperty(ExPBlockProperties.VEGETATION_GROWTH, 0));
	this.setCreativeTab(ExPCreativeTabs.tabPlantlife);
	this.setTickRandomly(true);
	Blocks.FIRE.setFireInfo(this, 60, 100);
}
 
Example 44
Project: BaseClient   File: BlockTorch.java   Source Code and License 5 votes vote down vote up
private boolean canPlaceOn(World worldIn, BlockPos pos) {
	if (World.doesBlockHaveSolidTopSurface(worldIn, pos)) {
		return true;
	} else {
		Block block = worldIn.getBlockState(pos).getBlock();
		return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall
				|| block == Blocks.stained_glass;
	}
}
 
Example 45
Project: DecompiledMinecraft   File: RecipesCrafting.java   Source Code and License 5 votes vote down vote up
/**
 * Adds the crafting recipes to the CraftingManager.
 */
public void addRecipes(CraftingManager p_77589_1_)
{
    p_77589_1_.addRecipe(new ItemStack(Blocks.chest), new Object[] {"###", "# #", "###", '#', Blocks.planks});
    p_77589_1_.addRecipe(new ItemStack(Blocks.trapped_chest), new Object[] {"#-", '#', Blocks.chest, '-', Blocks.tripwire_hook});
    p_77589_1_.addRecipe(new ItemStack(Blocks.ender_chest), new Object[] {"###", "#E#", "###", '#', Blocks.obsidian, 'E', Items.ender_eye});
    p_77589_1_.addRecipe(new ItemStack(Blocks.furnace), new Object[] {"###", "# #", "###", '#', Blocks.cobblestone});
    p_77589_1_.addRecipe(new ItemStack(Blocks.crafting_table), new Object[] {"##", "##", '#', Blocks.planks});
    p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.SAND.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.RED_SAND.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 4, BlockSandStone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.DEFAULT.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 4, BlockRedSandstone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.DEFAULT.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SAND.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab2, 1, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.QUARTZ.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 2, BlockQuartz.EnumType.LINES_Y.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 4), new Object[] {"##", "##", '#', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CHISELED_META), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata())});
    p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.MOSSY_META), new Object[] {Blocks.stonebrick, Blocks.vine});
    p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.mossy_cobblestone, 1), new Object[] {Blocks.cobblestone, Blocks.vine});
    p_77589_1_.addRecipe(new ItemStack(Blocks.iron_bars, 16), new Object[] {"###", "###", '#', Items.iron_ingot});
    p_77589_1_.addRecipe(new ItemStack(Blocks.glass_pane, 16), new Object[] {"###", "###", '#', Blocks.glass});
    p_77589_1_.addRecipe(new ItemStack(Blocks.redstone_lamp, 1), new Object[] {" R ", "RGR", " R ", 'R', Items.redstone, 'G', Blocks.glowstone});
    p_77589_1_.addRecipe(new ItemStack(Blocks.beacon, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Blocks.glass, 'S', Items.nether_star, 'O', Blocks.obsidian});
    p_77589_1_.addRecipe(new ItemStack(Blocks.nether_brick, 1), new Object[] {"NN", "NN", 'N', Items.netherbrick});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.DIORITE.getMetadata()), new Object[] {"CQ", "QC", 'C', Blocks.cobblestone, 'Q', Items.quartz});
    p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Items.quartz});
    p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.ANDESITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Blocks.cobblestone});
    p_77589_1_.addRecipe(new ItemStack(Blocks.dirt, 4, BlockDirt.DirtType.COARSE_DIRT.getMetadata()), new Object[] {"DG", "GD", 'D', new ItemStack(Blocks.dirt, 1, BlockDirt.DirtType.DIRT.getMetadata()), 'G', Blocks.gravel});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.DIORITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.GRANITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.ANDESITE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.ROUGH_META), new Object[] {"SS", "SS", 'S', Items.prismarine_shard});
    p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.BRICKS_META), new Object[] {"SSS", "SSS", "SSS", 'S', Items.prismarine_shard});
    p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.DARK_META), new Object[] {"SSS", "SIS", "SSS", 'S', Items.prismarine_shard, 'I', new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.sea_lantern, 1, 0), new Object[] {"SCS", "CCC", "SCS", 'S', Items.prismarine_shard, 'C', Items.prismarine_crystals});
}
 
Example 46
Project: BaseClient   File: StructureNetherBridgePieces.java   Source Code and License 5 votes vote down vote up
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    Random random = new Random((long)this.fillSeed);

    for (int i = 0; i <= 4; ++i)
    {
        for (int j = 3; j <= 4; ++j)
        {
            int k = random.nextInt(8);
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, i, j, 0, i, j, k, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
        }
    }

    int l = random.nextInt(8);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 0, 5, l, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    l = random.nextInt(8);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 0, 4, 5, l, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);

    for (l = 0; l <= 4; ++l)
    {
        int i1 = random.nextInt(5);
        this.fillWithBlocks(worldIn, structureBoundingBoxIn, l, 2, 0, l, 2, i1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
    }

    for (l = 0; l <= 4; ++l)
    {
        for (int j1 = 0; j1 <= 1; ++j1)
        {
            int k1 = random.nextInt(3);
            this.fillWithBlocks(worldIn, structureBoundingBoxIn, l, j1, 0, l, j1, k1, Blocks.nether_brick.getDefaultState(), Blocks.nether_brick.getDefaultState(), false);
        }
    }

    return true;
}
 
Example 47
Project: DecompiledMinecraft   File: World.java   Source Code and License 5 votes vote down vote up
public boolean isFlammableWithin(AxisAlignedBB bb)
{
    int i = MathHelper.floor_double(bb.minX);
    int j = MathHelper.floor_double(bb.maxX + 1.0D);
    int k = MathHelper.floor_double(bb.minY);
    int l = MathHelper.floor_double(bb.maxY + 1.0D);
    int i1 = MathHelper.floor_double(bb.minZ);
    int j1 = MathHelper.floor_double(bb.maxZ + 1.0D);

    if (this.isAreaLoaded(i, k, i1, j, l, j1, true))
    {
        BlockPos.MutableBlockPos blockpos$mutableblockpos = new BlockPos.MutableBlockPos();

        for (int k1 = i; k1 < j; ++k1)
        {
            for (int l1 = k; l1 < l; ++l1)
            {
                for (int i2 = i1; i2 < j1; ++i2)
                {
                    Block block = this.getBlockState(blockpos$mutableblockpos.func_181079_c(k1, l1, i2)).getBlock();

                    if (block == Blocks.fire || block == Blocks.flowing_lava || block == Blocks.lava)
                    {
                        return true;
                    }
                }
            }
        }
    }

    return false;
}
 
Example 48
Project: uniquecrops   File: UCBaubles.java   Source Code and License 5 votes vote down vote up
public static void initRecipes() {
	
	if (!UniqueCrops.baublesLoaded) return;
	
	GameRegistry.addRecipe(new ItemStack(emblemMelee), " d ", "gDi", " w " , 'd', Items.DIAMOND_SWORD, 'g', Items.GOLDEN_SWORD, 'i', Items.IRON_SWORD, 'w', Items.WOODEN_SWORD, 'D', UCBlocks.darkBlock);
	GameRegistry.addRecipe(new ItemStack(emblemScarab), "gGg", "GDG", "gGg", 'g', Items.GOLD_INGOT, 'G', Blocks.GOLD_BLOCK, 'D', UCBlocks.darkBlock);
	GameRegistry.addRecipe(new ItemStack(emblemTransformation), " P ", "fDf", " f ", 'P', UCItems.generic.createStack(EnumItems.POTIONSPLASH), 'f', Items.FEATHER, 'D', UCBlocks.darkBlock);
	GameRegistry.addRecipe(new ItemStack(emblemPowerfist), " p ", "BDB", " b ", 'p', Items.DIAMOND_PICKAXE, 'B', Items.BLAZE_ROD, 'b', Items.BLAZE_POWDER, 'D', UCBlocks.darkBlock);
	GameRegistry.addRecipe(new ItemStack(emblemRainbow), "RGB", "YDb", "PNW", 'R', new ItemStack(Blocks.WOOL, 1, EnumDyeColor.RED.getMetadata()), 'G', new ItemStack(Blocks.WOOL, 1, EnumDyeColor.GREEN.getMetadata()), 'B', new ItemStack(Blocks.WOOL, 1, EnumDyeColor.BLUE.getMetadata()), 'Y', new ItemStack(Blocks.WOOL, 1, EnumDyeColor.YELLOW.getMetadata()), 'b', new ItemStack(Blocks.WOOL, 1, EnumDyeColor.BLACK.getMetadata()), 'P', new ItemStack(Blocks.WOOL, 1, EnumDyeColor.PURPLE.getMetadata()), 'N', new ItemStack(Blocks.WOOL, 1, EnumDyeColor.BROWN.getMetadata()), 'W', new ItemStack(Blocks.WOOL, 1, EnumDyeColor.WHITE.getMetadata()), 'D', UCBlocks.darkBlock);
	GameRegistry.addRecipe(new ItemStack(emblemFood), "PPP", "PDP", "PPP", 'P', Items.POTATO, 'D', UCBlocks.darkBlock);
	GameRegistry.addRecipe(new ItemStack(emblemIronstomach), "SgP", "iDe", "RdC", 'S', Items.COOKED_BEEF, 'g', Items.GOLD_INGOT, 'P', Items.COOKED_PORKCHOP, 'i', Items.IRON_INGOT, 'D', UCBlocks.darkBlock, 'e', Items.EMERALD, 'R', Items.COOKED_RABBIT, 'd', Items.DIAMOND, 'C', Items.COOKED_CHICKEN);
	GameRegistry.addRecipe(new ItemStack(emblemDefense), "ABA", "SDS", "ABA", 'A', Items.ARROW, 'B', Items.BOW, 'D', UCBlocks.darkBlock, 'S', Items.SHIELD);
	GameRegistry.addRecipe(new ItemStack(emblemLeaf), "lLl", "LDL", "lLl", 'l', Blocks.LEAVES, 'L', Blocks.LOG, 'D', UCBlocks.darkBlock);
	GameRegistry.addShapelessRecipe(new ItemStack(emblemPacifism), emblemMelee, emblemScarab, emblemTransformation, emblemPowerfist, emblemRainbow, emblemFood, emblemIronstomach, emblemDefense, emblemLeaf);
}
 
Example 49
Project: DecompiledMinecraft   File: EntityFallingBlock.java   Source Code and License 5 votes vote down vote up
public void fall(float distance, float damageMultiplier)
{
    Block block = this.fallTile.getBlock();

    if (this.hurtEntities)
    {
        int i = MathHelper.ceiling_float_int(distance - 1.0F);

        if (i > 0)
        {
            List<Entity> list = Lists.newArrayList(this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()));
            boolean flag = block == Blocks.anvil;
            DamageSource damagesource = flag ? DamageSource.anvil : DamageSource.fallingBlock;

            for (Entity entity : list)
            {
                entity.attackEntityFrom(damagesource, (float)Math.min(MathHelper.floor_float((float)i * this.fallHurtAmount), this.fallHurtMax));
            }

            if (flag && (double)this.rand.nextFloat() < 0.05000000074505806D + (double)i * 0.05D)
            {
                int j = ((Integer)this.fallTile.getValue(BlockAnvil.DAMAGE)).intValue();
                ++j;

                if (j > 2)
                {
                    this.canSetAsBlock = true;
                }
                else
                {
                    this.fallTile = this.fallTile.withProperty(BlockAnvil.DAMAGE, Integer.valueOf(j));
                }
            }
        }
    }
}
 
Example 50
Project: Backmemed   File: StructureStrongholdPieces.java   Source Code and License 5 votes vote down vote up
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn))
    {
        return false;
    }
    else
    {
        this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 10, 4, true, randomIn, StructureStrongholdPieces.STRONGHOLD_STONES);
        this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.entryDoor, 1, 7, 0);
        this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 4);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 2, 6, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 1, 5, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 6, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 1, 5, 2, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 1, 4, 3, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 5, 3, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 2, 4, 3, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 3, 3, 3, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 3, 4, 3, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 3, 3, 2, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 3, 2, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 3, 3, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 2, 2, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 1, 1, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 2, 1, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONEBRICK.getDefaultState(), 1, 1, 2, structureBoundingBoxIn);
        this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.STONE.getMetadata()), 1, 1, 3, structureBoundingBoxIn);
        return true;
    }
}
 
Example 51
Project: DecompiledMinecraft   File: BlockRedstoneOre.java   Source Code and License 5 votes vote down vote up
private void activate(World worldIn, BlockPos pos)
{
    this.spawnParticles(worldIn, pos);

    if (this == Blocks.redstone_ore)
    {
        worldIn.setBlockState(pos, Blocks.lit_redstone_ore.getDefaultState());
    }
}
 
Example 52
Project: Geolosys   File: ConfigParser.java   Source Code and License 5 votes vote down vote up
public void parseStones()
{
    for (String s : Config.getInstance().userStoneEntriesRaw)
    {
        String[] parts = s.trim().replaceAll(" ", "").split("[\\W]");
        if (parts.length != 6)
        {
            printFormattingError(s);
            continue;
        }
        try
        {
            Block block = ForgeRegistries.BLOCKS.getValue(new ResourceLocation(parts[0], parts[1]));
            if (block == null || block == Blocks.AIR)
            {
                printFormattingError(s);
                continue;
            }
            IBlockState tempState = block.getStateForPlacement(null, null, null, 0.0F, 0.0F, 0.0F, toInt(parts[2]), null, null);
            userStoneEntriesClean.add(new Entry(tempState, 0, toInt(parts[3]), toInt(parts[4]), toInt(parts[5])));

        }
        catch (NumberFormatException e)
        {
            printFormattingError(s);
            continue;
        }
    }
}
 
Example 53
Project: CustomWorldGen   File: StructureNetherBridgePieces.java   Source Code and License 5 votes vote down vote up
/**
 * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes
 * Mineshafts at the end, it adds Fences...
 */
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
{
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 0, 4, 4, 18, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 5, 0, 3, 7, 18, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 5, 0, 0, 5, 18, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 0, 4, 5, 18, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 2, 5, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 13, 4, 2, 18, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 3, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 15, 4, 1, 18, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false);

    for (int i = 0; i <= 4; ++i)
    {
        for (int j = 0; j <= 2; ++j)
        {
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i, -1, j, structureBoundingBoxIn);
            this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i, -1, 18 - j, structureBoundingBoxIn);
        }
    }

    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 1, 0, 4, 1, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 4, 0, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 14, 0, 4, 14, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 1, 17, 0, 4, 17, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 1, 4, 4, 1, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 4, 4, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 14, 4, 4, 14, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
    this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 1, 17, 4, 4, 17, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false);
    return true;
}
 
Example 54
Project: Backmemed   File: StructureMineshaftPieces.java   Source Code and License 5 votes vote down vote up
private void func_189922_a(World p_189922_1_, StructureBoundingBox p_189922_2_, Random p_189922_3_, float p_189922_4_, int p_189922_5_, int p_189922_6_, int p_189922_7_)
{
    if (this.func_189916_b(p_189922_1_, p_189922_5_, p_189922_6_, p_189922_7_, p_189922_2_) < 8)
    {
        this.randomlyPlaceBlock(p_189922_1_, p_189922_2_, p_189922_3_, p_189922_4_, p_189922_5_, p_189922_6_, p_189922_7_, Blocks.WEB.getDefaultState());
    }
}
 
Example 55
Project: Industrial-Foregoing   File: LaserDrillBlock.java   Source Code and License 5 votes vote down vote up
public void createRecipe() {
    RecipeUtils.addShapedRecipe(new ItemStack(this), "plp", "gwg", "omo",
            'p', ItemRegistry.plastic,
            'l', ItemRegistry.laserLensItem,
            'g', "blockGlassColorless",
            'w', Blocks.GLOWSTONE,
            'o', "gearDiamond",
            'm', MachineCaseItem.INSTANCE);
}
 
Example 56
Project: Backmemed   File: RecipesBanners.java   Source Code and License 5 votes vote down vote up
/**
 * Adds the banner recipes to the CraftingManager.
 */
void addRecipes(CraftingManager manager)
{
    for (EnumDyeColor enumdyecolor : EnumDyeColor.values())
    {
        manager.addRecipe(ItemBanner.func_190910_a(enumdyecolor, (NBTTagList)null), new Object[] {"###", "###", " | ", '#', new ItemStack(Blocks.WOOL, 1, enumdyecolor.getMetadata()), '|', Items.STICK});
    }

    manager.addRecipe(new RecipesBanners.RecipeDuplicatePattern());
    manager.addRecipe(new RecipesBanners.RecipeAddPattern());
}
 
Example 57
Project: needtobreath   File: PurifierTileEntity.java   Source Code and License 5 votes vote down vote up
@Override
public boolean isItemValidForSlot(int index, ItemStack stack) {
    if (index == PurifierContainer.SLOT_COALINPUT) {
        return stack.getItem() == Items.COAL || stack.getItem() == Item.getItemFromBlock(Blocks.COAL_BLOCK);
    }
    return true;
}
 
Example 58
Project: BaseClient   File: RecipesCrafting.java   Source Code and License 5 votes vote down vote up
/**
 * Adds the crafting recipes to the CraftingManager.
 */
public void addRecipes(CraftingManager p_77589_1_)
{
    p_77589_1_.addRecipe(new ItemStack(Blocks.chest), new Object[] {"###", "# #", "###", '#', Blocks.planks});
    p_77589_1_.addRecipe(new ItemStack(Blocks.trapped_chest), new Object[] {"#-", '#', Blocks.chest, '-', Blocks.tripwire_hook});
    p_77589_1_.addRecipe(new ItemStack(Blocks.ender_chest), new Object[] {"###", "#E#", "###", '#', Blocks.obsidian, 'E', Items.ender_eye});
    p_77589_1_.addRecipe(new ItemStack(Blocks.furnace), new Object[] {"###", "# #", "###", '#', Blocks.cobblestone});
    p_77589_1_.addRecipe(new ItemStack(Blocks.crafting_table), new Object[] {"##", "##", '#', Blocks.planks});
    p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.SAND.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone), new Object[] {"##", "##", '#', new ItemStack(Blocks.sand, 1, BlockSand.EnumType.RED_SAND.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 4, BlockSandStone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.DEFAULT.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 4, BlockRedSandstone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.DEFAULT.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.sandstone, 1, BlockSandStone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SAND.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.red_sandstone, 1, BlockRedSandstone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab2, 1, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.QUARTZ.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.quartz_block, 2, BlockQuartz.EnumType.LINES_Y.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.quartz_block, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 4), new Object[] {"##", "##", '#', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.STONE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.CHISELED_META), new Object[] {"#", "#", '#', new ItemStack(Blocks.stone_slab, 1, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata())});
    p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stonebrick, 1, BlockStoneBrick.MOSSY_META), new Object[] {Blocks.stonebrick, Blocks.vine});
    p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.mossy_cobblestone, 1), new Object[] {Blocks.cobblestone, Blocks.vine});
    p_77589_1_.addRecipe(new ItemStack(Blocks.iron_bars, 16), new Object[] {"###", "###", '#', Items.iron_ingot});
    p_77589_1_.addRecipe(new ItemStack(Blocks.glass_pane, 16), new Object[] {"###", "###", '#', Blocks.glass});
    p_77589_1_.addRecipe(new ItemStack(Blocks.redstone_lamp, 1), new Object[] {" R ", "RGR", " R ", 'R', Items.redstone, 'G', Blocks.glowstone});
    p_77589_1_.addRecipe(new ItemStack(Blocks.beacon, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Blocks.glass, 'S', Items.nether_star, 'O', Blocks.obsidian});
    p_77589_1_.addRecipe(new ItemStack(Blocks.nether_brick, 1), new Object[] {"NN", "NN", 'N', Items.netherbrick});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.DIORITE.getMetadata()), new Object[] {"CQ", "QC", 'C', Blocks.cobblestone, 'Q', Items.quartz});
    p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Items.quartz});
    p_77589_1_.addShapelessRecipe(new ItemStack(Blocks.stone, 2, BlockStone.EnumType.ANDESITE.getMetadata()), new Object[] {new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata()), Blocks.cobblestone});
    p_77589_1_.addRecipe(new ItemStack(Blocks.dirt, 4, BlockDirt.DirtType.COARSE_DIRT.getMetadata()), new Object[] {"DG", "GD", 'D', new ItemStack(Blocks.dirt, 1, BlockDirt.DirtType.DIRT.getMetadata()), 'G', Blocks.gravel});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.DIORITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.DIORITE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.GRANITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.GRANITE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.stone, 4, BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata()), new Object[] {"SS", "SS", 'S', new ItemStack(Blocks.stone, 1, BlockStone.EnumType.ANDESITE.getMetadata())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.ROUGH_META), new Object[] {"SS", "SS", 'S', Items.prismarine_shard});
    p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.BRICKS_META), new Object[] {"SSS", "SSS", "SSS", 'S', Items.prismarine_shard});
    p_77589_1_.addRecipe(new ItemStack(Blocks.prismarine, 1, BlockPrismarine.DARK_META), new Object[] {"SSS", "SIS", "SSS", 'S', Items.prismarine_shard, 'I', new ItemStack(Items.dye, 1, EnumDyeColor.BLACK.getDyeDamage())});
    p_77589_1_.addRecipe(new ItemStack(Blocks.sea_lantern, 1, 0), new Object[] {"SCS", "CCC", "SCS", 'S', Items.prismarine_shard, 'C', Items.prismarine_crystals});
}
 
Example 59
Project: SimpleTractor   File: ItemTractor.java   Source Code and License 4 votes vote down vote up
public void registerRecipe() {
    GameRegistry.addRecipe(new ItemStack(this), " I ", "III", " I ", 'I', Blocks.IRON_BLOCK);
}
 
Example 60
Project: Backmemed   File: BlockShulkerBox.java   Source Code and License 4 votes vote down vote up
public static Block func_190952_a(EnumDyeColor p_190952_0_)
{
    switch (p_190952_0_)
    {
        case WHITE:
            return Blocks.field_190977_dl;

        case ORANGE:
            return Blocks.field_190978_dm;

        case MAGENTA:
            return Blocks.field_190979_dn;

        case LIGHT_BLUE:
            return Blocks.field_190980_do;

        case YELLOW:
            return Blocks.field_190981_dp;

        case LIME:
            return Blocks.field_190982_dq;

        case PINK:
            return Blocks.field_190983_dr;

        case GRAY:
            return Blocks.field_190984_ds;

        case SILVER:
            return Blocks.field_190985_dt;

        case CYAN:
            return Blocks.field_190986_du;

        case PURPLE:
        default:
            return Blocks.field_190987_dv;

        case BLUE:
            return Blocks.field_190988_dw;

        case BROWN:
            return Blocks.field_190989_dx;

        case GREEN:
            return Blocks.field_190990_dy;

        case RED:
            return Blocks.field_190991_dz;

        case BLACK:
            return Blocks.field_190975_dA;
    }
}