public void decorate(World worldIn, Random random, Biome biome, BlockPos pos) { if (this.decorating) { throw new RuntimeException("Already decorating"); } else { this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(worldIn.getWorldInfo().getGeneratorOptions()).build(); this.chunkPos = pos; this.dirtGen = new WorldGenMinable(Blocks.DIRT.getDefaultState(), this.chunkProviderSettings.dirtSize); this.gravelGen = new WorldGenMinable(Blocks.GRAVEL.getDefaultState(), this.chunkProviderSettings.gravelSize); this.graniteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize); this.dioriteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize); this.andesiteGen = new WorldGenMinable(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize); this.coalGen = new WorldGenMinable(Blocks.COAL_ORE.getDefaultState(), this.chunkProviderSettings.coalSize); this.ironGen = new WorldGenMinable(Blocks.IRON_ORE.getDefaultState(), this.chunkProviderSettings.ironSize); this.goldGen = new WorldGenMinable(Blocks.GOLD_ORE.getDefaultState(), this.chunkProviderSettings.goldSize); this.redstoneGen = new WorldGenMinable(Blocks.REDSTONE_ORE.getDefaultState(), this.chunkProviderSettings.redstoneSize); this.diamondGen = new WorldGenMinable(Blocks.DIAMOND_ORE.getDefaultState(), this.chunkProviderSettings.diamondSize); this.lapisGen = new WorldGenMinable(Blocks.LAPIS_ORE.getDefaultState(), this.chunkProviderSettings.lapisSize); this.genDecorations(biome, worldIn, random); this.decorating = false; } }
@Override protected void runTest() { final ItemStack oakLog = new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.OAK.getMetadata()); assertRegistered(oakLog, "logWood"); assertNotRegistered(oakLog, "blahblahblah"); final ItemStack jungleLog = new ItemStack(Blocks.LOG, 1, BlockPlanks.EnumType.JUNGLE.getMetadata()); assertRegistered(jungleLog, "logWood"); final ItemStack ironIngot = new ItemStack(Items.IRON_INGOT); assertRegistered(ironIngot, "ingotIron"); final ItemStack stone = new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.STONE.getMetadata()); assertRegistered(stone, "stone"); final ItemStack andesite = new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.ANDESITE.getMetadata()); assertNotRegistered(andesite, "stone"); final ItemStack record13 = new ItemStack(Items.RECORD_13); assertRegistered(record13, "record"); }
@Override public void registerOreTypes(OreTypeRegistry registry) { registry.register( new OreType(w -> w.provider.getDimension() == 0, OreTypeRegistry.OVERWORLD, b -> b.getBlock() == Blocks.STONE && b.getValue(BlockStone.VARIANT) == EnumType.STONE), new OreType(w -> w.provider.getDimension() == 1, OreTypeRegistry.END, b -> b.getBlock() == Blocks.END_STONE), new OreType(w -> w.provider.getDimension() == -1, OreTypeRegistry.NETHER, b -> b.getBlock() == Blocks.NETHERRACK) ); registry.register(new DefaultOreTypeGenerator()); }
public void decorate(World worldIn, Random random, BiomeGenBase p_180292_3_, BlockPos p_180292_4_) { if (this.currentWorld != null) { throw new RuntimeException("Already decorating"); } else { this.currentWorld = worldIn; String s = worldIn.getWorldInfo().getGeneratorOptions(); if (s != null) { this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory(s).func_177864_b(); } else { this.chunkProviderSettings = ChunkProviderSettings.Factory.jsonToFactory("").func_177864_b(); } this.randomGenerator = random; this.field_180294_c = p_180292_4_; this.dirtGen = new WorldGenMinable(Blocks.dirt.getDefaultState(), this.chunkProviderSettings.dirtSize); this.gravelGen = new WorldGenMinable(Blocks.gravel.getDefaultState(), this.chunkProviderSettings.gravelSize); this.graniteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), this.chunkProviderSettings.graniteSize); this.dioriteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), this.chunkProviderSettings.dioriteSize); this.andesiteGen = new WorldGenMinable(Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), this.chunkProviderSettings.andesiteSize); this.coalGen = new WorldGenMinable(Blocks.coal_ore.getDefaultState(), this.chunkProviderSettings.coalSize); this.ironGen = new WorldGenMinable(Blocks.iron_ore.getDefaultState(), this.chunkProviderSettings.ironSize); this.goldGen = new WorldGenMinable(Blocks.gold_ore.getDefaultState(), this.chunkProviderSettings.goldSize); this.redstoneGen = new WorldGenMinable(Blocks.redstone_ore.getDefaultState(), this.chunkProviderSettings.redstoneSize); this.diamondGen = new WorldGenMinable(Blocks.diamond_ore.getDefaultState(), this.chunkProviderSettings.diamondSize); this.lapisGen = new WorldGenMinable(Blocks.lapis_ore.getDefaultState(), this.chunkProviderSettings.lapisSize); this.genDecorations(p_180292_3_); this.currentWorld = null; this.randomGenerator = null; } }
/** * 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}); }
public boolean apply(IBlockState p_apply_1_) { if (p_apply_1_ != null && p_apply_1_.getBlock() == Blocks.STONE) { BlockStone.EnumType blockstone$enumtype = (BlockStone.EnumType)p_apply_1_.getValue(BlockStone.VARIANT); return blockstone$enumtype.func_190912_e(); } else { return false; } }
private void other(Random random, int x, int z, World world) { int dim = world.provider.getDimension(); if (!meteorGenStats.containsKey(dim)) meteorGenStats.put(dim, 0); if (!meteorChunkStats.containsKey(dim)) meteorChunkStats.put(dim, 0); meteorChunkStats.put(dim, meteorChunkStats.get(dim) + 1); meteorGenStats.put(meteorGenStats.get(dim), meteorGenStats.get(dim) + Generator.generateMeteor(duraniteOre.getDefaultState(), blockMeteorite.getDefaultState(), random, x, z, world, DURANITE_VAL, 6, 16, 112)); Generator.generateOreDescending(newArrayList(Blocks.LAVA.getDefaultState(), Blocks.FLOWING_LAVA.getDefaultState()), basaltBlock.getDefaultState(), random, x, z, world, BASALT_VAL, 0, 64); Generator.generateOreDescending(newArrayList(Blocks.BEDROCK.getDefaultState()), eezoOre.getDefaultState(), random, x, z, world, EEZO_VAL, 0, 10); Generator.generateOreStoneVariant(karmesineOre.getDefaultState(), BlockStone.EnumType.ANDESITE, random, x, z, world, KARMESINE_VAL); Generator.generateOreStoneVariant(oviumOre.getDefaultState(), BlockStone.EnumType.DIORITE, random, x, z, world, OVIUM_VAL); Generator.generateOreStoneVariant(jauxumOre.getDefaultState(), BlockStone.EnumType.GRANITE, random, x, z, world, JAUXUM_VAL); Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, VIBRANIUM_VAL, 100, 0, 64, 2, 6, newArrayList(Biomes.DESERT_HILLS, Biomes.EXTREME_HILLS, Biomes.EXTREME_HILLS_EDGE, Biomes.EXTREME_HILLS_WITH_TREES, Biomes.DESERT)); Generator.generateOre(dilithiumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, DILITHIUM_VAL, 100, 0, 64, 2, 8, newArrayList(Biomes.DESERT, Biomes.DESERT_HILLS, Biomes.MUTATED_DESERT, Biomes.OCEAN, Biomes.DEEP_OCEAN, Biomes.FROZEN_OCEAN, Biomes.BEACH)); Generator.generateOre(vibraniumOre.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, 1, 15, 0, 128, 1, 5, null); if (ironGen) { Generator.generateOre(Blocks.IRON_ORE.getDefaultState(), Blocks.STONE.getDefaultState(), random, x, z, world, IRON_VAL, 0, 32, 2, 8); } if (meteorChunkStats.get(dim) > 100 && meteorGenStats.get(dim) == 0) { blackList.add(dim); TAIGA.logger.info(String.format("Detected void dimension, adding to blacklist: %d", dim)); } }
@SubscribeEvent public void onBreak(BlockEvent.BreakEvent e) { IBlockState state = e.getState(); ItemStack tool = e.getPlayer().getHeldItemMainhand(); if (state.getBlock().equals(net.minecraft.init.Blocks.STONE) && TinkerUtil.hasTrait(TagUtil.getTagSafe(tool), identifier)) System.out.println("State.Variant: " + state.getValue(BlockStone.VARIANT)); }
private QBarOreGenerator() { this.STONE_PREDICATE = state -> state != null && state.getBlock() == Blocks.STONE && state.getValue(BlockStone.VARIANT).isNatural(); this.DECORATION_PREDICATE = this.STONE_PREDICATE .or(state -> state != null && (state.getBlock() == Blocks.DIRT || state.getBlock() == Blocks.GRASS || state.getBlock() == Blocks.SAND || state.getBlock() == Blocks.GRAVEL)); QBarVeins.initVeins(); }
/** * Initializes a new instance of the BlockAndesiteStairs class. * @param name The registered name of this block. */ public BlockAndesiteStairs(String name) { super(Blocks.STONE.getStateFromMeta(BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata())); this.setHarvestLevel("pickaxe", 0); ModRegistry.setBlockName(this, name); }
/** * Initializes a new instance of the BlockGraniteStairs class. * @param name The registered name of this block. */ public BlockGraniteStairs(String name) { super(Blocks.STONE.getStateFromMeta(BlockStone.EnumType.GRANITE_SMOOTH.getMetadata())); this.setHarvestLevel("pickaxe", 0); ModRegistry.setBlockName(this, name); }
/** * Initializes a new instance of the BlockDioriteStairs class. * @param name The registered name of this block. */ public BlockDioriteStairs(String name) { super(Blocks.STONE.getStateFromMeta(BlockStone.EnumType.DIORITE_SMOOTH.getMetadata())); this.setHarvestLevel("pickaxe", 0); ModRegistry.setBlockName(this, name); }
public static void init() { GameRegistry.addRecipe(new ShapedOreRecipe(ENItems.hammerWood, new Object[] { " x ", " yx", "y ", 'x', "plankWood", 'y', "stickWood"})); GameRegistry.addRecipe(new ShapedOreRecipe(ENItems.hammerStone, new Object[] { " x ", " yx", "y ", 'x', "cobblestone", 'y', "stickWood"})); GameRegistry.addRecipe(new ShapedOreRecipe(ENItems.hammerIron, new Object[] { " x ", " yx", "y ", 'x', "ingotIron", 'y', "stickWood"})); GameRegistry.addRecipe(new ShapedOreRecipe(ENItems.hammerGold, new Object[] { " x ", " yx", "y ", 'x', "ingotGold", 'y', "stickWood"})); GameRegistry.addRecipe(new ShapedOreRecipe(ENItems.hammerDiamond, new Object[] { " x ", " yx", "y ", 'x', "gemDiamond", 'y', "stickWood"})); GameRegistry.addRecipe(new ShapedOreRecipe(ENItems.crookWood, new Object[] { "xx"," x"," x", 'x', "stickWood"})); GameRegistry.addRecipe(new ShapedOreRecipe(ENItems.crookBone, new Object[] { "xx"," x"," x", 'x', Items.BONE})); if (Config.enableBarrels) { GameRegistry.addRecipe(new ShapedOreRecipe(ENBlocks.barrelWood, new Object[] {"x x","x x", "xyx", 'x', "plankWood", 'y', "slabWood"})); GameRegistry.addRecipe(new ShapedOreRecipe(ENBlocks.barrelStone, new Object[] {"x x","x x", "xyx", 'x', new ItemStack(Blocks.STONE), 'y', new ItemStack(Blocks.STONE_SLAB)})); } if (Config.enableCrucible) { GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ENBlocks.crucible, 1, 0), new Object[] {"x x","x x","xxx", 'x', "clayPorcelain"})); FurnaceRecipes.instance().addSmeltingRecipe(new ItemStack(ENBlocks.crucible, 1, 0), new ItemStack(ENBlocks.crucible, 1, 1), 0.7f); } GameRegistry.addRecipe(new ShapedOreRecipe(Blocks.COBBLESTONE, new Object[] {"xx","xx", 'x', ItemPebble.getPebbleStack("stone")})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.GRANITE.ordinal()), new Object[] {"xx","xx", 'x', ItemPebble.getPebbleStack("granite")})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.DIORITE.ordinal()), new Object[] {"xx","xx", 'x', ItemPebble.getPebbleStack("diorite")})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.ANDESITE.ordinal()), new Object[] {"xx","xx", 'x', ItemPebble.getPebbleStack("andesite")})); GameRegistry.addShapelessRecipe(ItemResource.getResourceStack("porcelain_clay"), new ItemStack(Items.CLAY_BALL), new ItemStack(Items.DYE, 1, 15)); GameRegistry.addRecipe(new ShapedOreRecipe(ENBlocks.sieve, new Object[] {"x x","xyx","z z", 'z', "plankWood", 'y', "slabWood", 'z', "stickWood"})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ENItems.mesh, 1, 1), new Object[] {"xxx","xxx","xxx", 'x', Items.STRING})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ENItems.mesh, 1, 2), new Object[] {"x x","xyx","x x", 'x', Items.FLINT, 'y', new ItemStack(ENItems.mesh, 1, 1)})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ENItems.mesh, 1, 3), new Object[] {"x x","xyx","x x", 'x', Items.IRON_INGOT, 'y', new ItemStack(ENItems.mesh, 1, 2)})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ENItems.mesh, 1, 4), new Object[] {"x x","xyx","x x", 'x', Items.DIAMOND, 'y', new ItemStack(ENItems.mesh, 1, 3)})); FurnaceRecipes.instance().addSmeltingRecipe(ItemResource.getResourceStack("silkworm"), new ItemStack(ENItems.cookedSilkworm), 0.7f); GameRegistry.addRecipe(new ShapedOreRecipe(ItemResource.getResourceStack("doll", 4), new Object[] {"xyx"," x ", "x x", 'x', "clayPorcelain", 'y', "gemDiamond"})); GameRegistry.addRecipe(new ShapedOreRecipe(ItemResource.getResourceStack("doll", 6), new Object[] {"xyx"," x ", "x x", 'x', "clayPorcelain", 'y', "gemEmerald"})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ENItems.dolls, 1, 0), new Object[] {"xyx", "zwz", "xvx", 'x', Items.BLAZE_POWDER, 'v', Items.NETHER_WART, 'w', ItemResource.getResourceStack("doll"), 'y', "dustRedstone", 'z', "dustGlowstone"})); GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ENItems.dolls, 1, 1), new Object[] {"xyx", "zwz", "xvx", 'v', Items.NETHER_WART, 'x', "dyeBlack", 'w', ItemResource.getResourceStack("doll"), 'y', "dustRedstone", 'z', "dustGlowstone"})); }
private void buildVanillaGenerators() { GenerationCategory Ores = new GenerationCategory("VanillaOres", false); GenerationCategory Junk = new GenerationCategory("VanillaJunk", false); ParsableBlockState stone = new ParsableBlockState(Blocks.stone.getDefaultState()); ParsableBlockState netherrack = new ParsableBlockState(Blocks.netherrack.getDefaultState()); ArrayList<Integer> overworld = new ArrayList<Integer>(); overworld.add(0); ArrayList<Integer> nether = new ArrayList<Integer>(); nether.add(-1); ArrayList<Type> mountainBiomes = new ArrayList<Type>(); mountainBiomes.add(BiomeDictionary.Type.MOUNTAIN); GenLoaderAPI.addGeneration(Ores, EnumGenerationPriority.LATER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 20, 0, 128, 17, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.coal_ore.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Ores, EnumGenerationPriority.LATER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 20, 0, 64, 9, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.iron_ore.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Ores, EnumGenerationPriority.LATE, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 2, 0, 32, 9, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.gold_ore.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Ores, EnumGenerationPriority.LATER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 8, 0, 16, 8, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.redstone_ore.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Ores, EnumGenerationPriority.LATE, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 6, 0, 32, 1, overworld, mountainBiomes, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.emerald_ore.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Ores, EnumGenerationPriority.LATE, EnumGenerationType.WEIGHTEDVARIABLECLUSTER, 1.0f, 1, 0, 32, 7, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.lapis_ore.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Ores, EnumGenerationPriority.LATE, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 1, 0, 16, 8, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.diamond_ore.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Ores, EnumGenerationPriority.LATER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 16, 0, 256, 14, nether, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.quartz_ore.getDefaultState())}, netherrack); GenLoaderAPI.addGeneration(Junk, EnumGenerationPriority.EARLIER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 8, 0, 256, 33, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.dirt.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Junk, EnumGenerationPriority.EARLIER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 8, 0, 256, 33, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.gravel.getDefaultState())}, stone); GenLoaderAPI.addGeneration(Junk, EnumGenerationPriority.EARLIER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 10, 0, 80, 33, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE))}, stone); GenLoaderAPI.addGeneration(Junk, EnumGenerationPriority.EARLIER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 10, 0, 80, 33, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE))}, stone); GenLoaderAPI.addGeneration(Junk, EnumGenerationPriority.EARLIER, EnumGenerationType.STANDARDVARIABLECLUSTER, 1.0f, 10, 0, 80, 33, overworld, null, null, new WeightedBlockState[]{new WeightedBlockState(10, Blocks.stone.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE))}, stone); }
protected boolean caveableBlock(IBlockState blockstate, IBlockState aboveblockstate) { if (aboveblockstate.getBlock().getMaterial() == Material.water) return false; return blockstate.getBlock() instanceof BlockStone || blockstate.getBlock() instanceof BlockDirt || blockstate.getBlock() instanceof BlockGrass ; }
private static void registerVanillaVariantProps() { // TODO: omit similar blocks registerVariantProperty(BlockStone.VARIANT); registerVariantProperty(BlockPlanks.VARIANT); registerVariantProperty(BlockSapling.TYPE); registerVariantProperty(BlockDirt.VARIANT); registerVariantProperty(BlockSand.VARIANT); registerVariantProperty(BlockOldLog.VARIANT); registerVariantProperty(BlockNewLog.VARIANT); registerVariantProperty(BlockOldLeaf.VARIANT); registerVariantProperty(BlockNewLeaf.VARIANT); registerVariantProperty(BlockSandStone.TYPE); registerVariantProperty(BlockTallGrass.TYPE); registerVariantProperty(BlockPistonExtension.TYPE); registerVariantProperty(BlockColored.COLOR); registerVariantProperty(BlockPistonMoving.TYPE); registerVariantProperty(Blocks.YELLOW_FLOWER.getTypeProperty()); registerVariantProperty(Blocks.RED_FLOWER.getTypeProperty()); registerVariantProperty(BlockStoneSlab.VARIANT); registerVariantProperty(BlockWoodSlab.VARIANT); registerVariantProperty(BlockAnvil.DAMAGE); registerVariantProperty(BlockQuartz.VARIANT); registerVariantProperty(BlockCarpet.COLOR); registerVariantProperty(BlockDoublePlant.VARIANT); registerVariantProperty(BlockStainedGlass.COLOR); registerVariantProperty(BlockStainedGlassPane.COLOR); registerVariantProperty(BlockPrismarine.VARIANT); registerVariantProperty(BlockRedSandstone.TYPE); registerVariantProperty(BlockStoneSlabNew.VARIANT); }
private void registerVanillaOreGen() { if (configOres.coalChance > 0) { OreGenerator.addOreGen(HelperFunctions.getStateFromMeta(ORE_VANILLA, 0), configOres.coalSize, 48, 70, configOres.coalChance, configOres.coalDimBlacklist); } if (configOres.cinnabarChance > 0) { OreGenerator.addOreGen(HelperFunctions.getStateFromMeta(ORE_VANILLA, 1), configOres.cinnabarSize, 5, 12, configOres.cinnabarChance, configOres.cinnabarDimBlacklist); } if (configOres.goldChance > 0) { OreGenerator.addOreGen(HelperFunctions.getStateFromMeta(ORE_VANILLA, 2), configOres.goldSize, 5, 30, configOres.goldChance, configOres.goldDimBlacklist); } if (configOres.lapisChance > 0) { OreGenerator.addOreGen(HelperFunctions.getStateFromMeta(ORE_VANILLA, 3), configOres.lapisSize, 10, 24, configOres.lapisChance, configOres.lapisDimBlacklist); } if (configOres.quartzChance > 0) { OreGenerator.addOreGen(HelperFunctions.getStateFromMeta(ORE_VANILLA, 4), configOres.quartzSize, 6, 29, configOres.quartzChance, configOres.quartzDimBlacklist); } if (configOres.kimberliteChance > 0) { OreGenerator.addOreGen(HelperFunctions.getStateFromMeta(ORE_VANILLA, 5), configOres.kimberliteSize, 2, 15, configOres.kimberliteChance, configOres.kimberliteDimBlacklist); } if (configOres.berylChance > 0) { OreGenerator.addOreGen(HelperFunctions.getStateFromMeta(ORE_VANILLA, 6), configOres.berylSize, 4, 32, configOres.berylChance, configOres.berylDimBlacklist); } if (Config.getInstance().modStones) { IBlockState diorite = Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE); IBlockState andesite = Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE); IBlockState granite = Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE); StoneGenerator.addStoneGen(andesite, 2, 70, 40); StoneGenerator.addStoneGen(diorite, 2, 70, 40); StoneGenerator.addStoneGen(granite, 2, 70, 40); } }
public void init() { // Register Recipes GameRegistry.addRecipe(new ItemStack(blockTube, 4, 0), new Object[] { "IGI", 'I', Items.IRON_INGOT, 'G', Blocks.GLASS }); GameRegistry.addRecipe(new ItemStack(blockDisplacer, 1, 0), new Object[] { "SHS", "ICI", "SDS", 'D', Blocks.DISPENSER, 'C', Blocks.CHEST, 'S', new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.STONE.getMetadata()), 'H', Blocks.HOPPER, 'I', Items.IRON_INGOT }); GameRegistry.addRecipe(new ItemStack(itemPaintbrush, 1, 0), new Object[] { "W", "S", 'W', new ItemStack(Blocks.WOOL, 1, 0), 'S', Items.STICK }); for (int i = 0; i < 16; i++) GameRegistry.addShapelessRecipe(new ItemStack(itemPaintbrush, 1, i + 1), new Object[] { itemPaintbrush, new ItemStack(Items.DYE, 1, EnumDyeColor.byMetadata(i).getDyeDamage()) }); GameRegistry.addRecipe(new ItemStack(itemUpgrade, 1, 0), new Object[] { "ISI", "RGB", "IDI", 'I', Items.IRON_INGOT, 'S', Items.REDSTONE, 'R', new ItemStack(Items.DYE, 1, EnumDyeColor.RED.getDyeDamage()), 'G', new ItemStack(Items.DYE, 1, EnumDyeColor.GREEN.getDyeDamage()), 'B', new ItemStack(Items.DYE, 1, EnumDyeColor.BLUE.getDyeDamage()), 'D', Items.DIAMOND }); }
/** * Adds the crafting recipes to the CraftingManager. */ public void addRecipes(CraftingManager manager) { manager.addRecipe(new ItemStack(Blocks.CHEST), new Object[] {"###", "# #", "###", '#', Blocks.PLANKS}); manager.addShapelessRecipe(new ItemStack(Blocks.TRAPPED_CHEST), new Object[] {Blocks.CHEST, Blocks.TRIPWIRE_HOOK}); manager.addRecipe(new ItemStack(Blocks.ENDER_CHEST), new Object[] {"###", "#E#", "###", '#', Blocks.OBSIDIAN, 'E', Items.ENDER_EYE}); manager.addRecipe(new ItemStack(Blocks.FURNACE), new Object[] {"###", "# #", "###", '#', Blocks.COBBLESTONE}); manager.addRecipe(new ItemStack(Blocks.CRAFTING_TABLE), new Object[] {"##", "##", '#', Blocks.PLANKS}); manager.addRecipe(new ItemStack(Blocks.SANDSTONE), new Object[] {"##", "##", '#', new ItemStack(Blocks.SAND, 1, BlockSand.EnumType.SAND.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.RED_SANDSTONE), new Object[] {"##", "##", '#', new ItemStack(Blocks.SAND, 1, BlockSand.EnumType.RED_SAND.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.SANDSTONE, 4, BlockSandStone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.SANDSTONE, 1, BlockSandStone.EnumType.DEFAULT.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.RED_SANDSTONE, 4, BlockRedSandstone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.RED_SANDSTONE, 1, BlockRedSandstone.EnumType.DEFAULT.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.SANDSTONE, 1, BlockSandStone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.STONE_SLAB, 1, BlockStoneSlab.EnumType.SAND.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.RED_SANDSTONE, 1, BlockRedSandstone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.STONE_SLAB2, 1, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 1, BlockQuartz.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.STONE_SLAB, 1, BlockStoneSlab.EnumType.QUARTZ.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 2, BlockQuartz.EnumType.LINES_Y.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.QUARTZ_BLOCK, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.STONEBRICK, 4), new Object[] {"##", "##", '#', new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.STONE.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.STONEBRICK, 1, BlockStoneBrick.CHISELED_META), new Object[] {"#", "#", '#', new ItemStack(Blocks.STONE_SLAB, 1, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata())}); manager.addShapelessRecipe(new ItemStack(Blocks.STONEBRICK, 1, BlockStoneBrick.MOSSY_META), new Object[] {Blocks.STONEBRICK, Blocks.VINE}); manager.addShapelessRecipe(new ItemStack(Blocks.MOSSY_COBBLESTONE, 1), new Object[] {Blocks.COBBLESTONE, Blocks.VINE}); manager.addRecipe(new ItemStack(Blocks.IRON_BARS, 16), new Object[] {"###", "###", '#', Items.IRON_INGOT}); manager.addRecipe(new ItemStack(Blocks.GLASS_PANE, 16), new Object[] {"###", "###", '#', Blocks.GLASS}); manager.addRecipe(new ItemStack(Blocks.REDSTONE_LAMP, 1), new Object[] {" R ", "RGR", " R ", 'R', Items.REDSTONE, 'G', Blocks.GLOWSTONE}); manager.addRecipe(new ItemStack(Blocks.BEACON, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Blocks.GLASS, 'S', Items.NETHER_STAR, 'O', Blocks.OBSIDIAN}); manager.addRecipe(new ItemStack(Blocks.NETHER_BRICK, 1), new Object[] {"NN", "NN", 'N', Items.NETHERBRICK}); manager.addRecipe(new ItemStack(Blocks.RED_NETHER_BRICK, 1), new Object[] {"NW", "WN", 'N', Items.NETHERBRICK, 'W', Items.NETHER_WART}); manager.addRecipe(new ItemStack(Blocks.STONE, 2, BlockStone.EnumType.DIORITE.getMetadata()), new Object[] {"CQ", "QC", 'C', Blocks.COBBLESTONE, 'Q', Items.QUARTZ}); manager.addShapelessRecipe(new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.GRANITE.getMetadata()), new Object[] {new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.DIORITE.getMetadata()), Items.QUARTZ}); manager.addShapelessRecipe(new ItemStack(Blocks.STONE, 2, BlockStone.EnumType.ANDESITE.getMetadata()), new Object[] {new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.DIORITE.getMetadata()), Blocks.COBBLESTONE}); manager.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}); manager.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())}); manager.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())}); manager.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())}); manager.addRecipe(new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.ROUGH_META), new Object[] {"SS", "SS", 'S', Items.PRISMARINE_SHARD}); manager.addRecipe(new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.BRICKS_META), new Object[] {"SSS", "SSS", "SSS", 'S', Items.PRISMARINE_SHARD}); manager.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())}); manager.addRecipe(new ItemStack(Blocks.SEA_LANTERN, 1, 0), new Object[] {"SCS", "CCC", "SCS", 'S', Items.PRISMARINE_SHARD, 'C', Items.PRISMARINE_CRYSTALS}); manager.addRecipe(new ItemStack(Blocks.PURPUR_BLOCK, 4, 0), new Object[] {"FF", "FF", 'F', Items.CHORUS_FRUIT_POPPED}); manager.addRecipe(new ItemStack(Blocks.PURPUR_STAIRS, 4, 0), new Object[] {"# ", "## ", "###", '#', Blocks.PURPUR_BLOCK}); manager.addRecipe(new ItemStack(Blocks.PURPUR_PILLAR, 1, 0), new Object[] {"#", "#", '#', Blocks.PURPUR_SLAB}); manager.addRecipe(new ItemStack(Blocks.END_BRICKS, 4, 0), new Object[] {"##", "##", '#', Blocks.END_STONE}); manager.addRecipe(new ItemStack(Blocks.MAGMA, 1, 0), new Object[] {"##", "##", '#', Items.MAGMA_CREAM}); manager.addRecipe(new ItemStack(Blocks.NETHER_WART_BLOCK, 1, 0), new Object[] {"###", "###", "###", '#', Items.NETHER_WART}); }
public static float getHardness(IBlockState state, World world, BlockPos pos) { return state.getBlockHardness(world, pos) * (!state.getMaterial().isToolNotRequired() && !(state.getBlock() instanceof BlockStone) ? 12f : 5.5f); }
public static void load() { STONE = new BlockStone().setHardness(1.5F).setResistance(10.0F).setStepSound(Block.soundTypeStone).setBlockName("stone").setBlockTextureName("magiccrusade:stone_dim"); GameRegistry.registerBlock(STONE, "stone_dim"); DIRT = new BlockDirtDim().setHardness(0.5F).setStepSound(Block.soundTypeGravel).setBlockName("dirt").setBlockTextureName("magiccrusade:dirt_dim"); GameRegistry.registerBlock(DIRT, "dirt_dim"); GRASS = (BlockGrassDim) new BlockGrassDim().setHardness(0.6F).setStepSound(Block.soundTypeGrass).setBlockName("grass").setBlockTextureName("magiccrusade:grass_dim"); GameRegistry.registerBlock(GRASS, "grass_dim"); STONE_FALLING = new BlockStoneFalling(); GameRegistry.registerBlock(STONE_FALLING, "stone_falling"); PORTAL_MY_GROV = new BlockPortalMagic(Main.DIM_ID); GameRegistry.registerBlock(PORTAL_MY_GROV, "portal_dim"); int i; i = 0; PORTAL_DUNGEON = new BlockPortalDungeon[2]; for (Dungeon d : Main.DUNGEONS) { PORTAL_DUNGEON[i] = new BlockPortalDungeon(d.DIM_ID); GameRegistry.registerBlock(PORTAL_DUNGEON[i], "portal_dungeon_" + d.file_name); i++; } LOGS1 = new BlockLogDim(LogCategory.CAT1); GameRegistry.registerBlock(LOGS1, ItemBlockLog.class, "log_1"); PLANKS = new BlockPlankDim(); GameRegistry.registerBlock(PLANKS, ItemBlockPlank.class, "planks_1"); LEAVES = new BlockLeavesDim(LeafCategory.CAT1); GameRegistry.registerBlock(LEAVES, "leaves_dim"); BERRY_RED = new BlockFlowers().setBlockName("berry_red").setBlockTextureName("magiccrusade:berry_red"); GameRegistry.registerBlock(BERRY_RED, "red_berry"); BERRY_YELLOW = new BlockFlowers().setBlockName("berry_yellow").setBlockTextureName("magiccrusade:berry_yellow"); GameRegistry.registerBlock(BERRY_YELLOW, "yellow_berry"); SNOW_TALLGRASS = new BlockFlowers().setBlockName("tallgrass_snowed").setBlockTextureName("magiccrusade:tallgrass_snowed"); GameRegistry.registerBlock(SNOW_TALLGRASS, "tallgrass_snowed"); TALLGRASS = new BlockFlowers().setBlockName("tallgrass").setBlockTextureName("magiccrusade:tallgrass_dim"); GameRegistry.registerBlock(TALLGRASS, "tallgrass_dim"); ORE_ETHERNIUM = new BlockOreEthernium(); GameRegistry.registerBlock(ORE_ETHERNIUM, "ore_ethernium"); ORE_SILVER = (BlockOreMagic) new BlockOreMagic().setBlockName("ore_silver").setBlockTextureName("magiccrusade:ore_silver").setHardness(2.0f); GameRegistry.registerBlock(ORE_SILVER, "ore_silver"); ORE_TITANIUM = (BlockOreMagic) new BlockOreMagic().setBlockName("ore_titanium").setBlockTextureName("magiccrusade:ore_titanium").setHardness(2.0f); GameRegistry.registerBlock(ORE_TITANIUM, "ore_titanium"); ORE_COMBUSTIUM = (BlockOreMagic) new BlockOreMagic().setBlockName("ore_combustium").setBlockTextureName("magiccrusade:ore_combustium").setHardness(2.0f); GameRegistry.registerBlock(ORE_COMBUSTIUM, "ore_combustium"); }
protected void placeTombBlock() { block = null; radiusSq = (x * x) + (z * z); if (isOutside()) { return; } else if (isWall() || isRoof()) { block = Blocks.STONE.getDefaultState(); } else if (isFloor()) { block = Blocks.DIRT.getDefaultState(); } else if (isPlatform()) { if (isPlatformUnderstructure()) { if (isHiddenUnderPlatformChest()) { block = Blocks.CHEST.getDefaultState(); } else { block = Blocks.DIRT.getDefaultState(); } } else if (isPlatformEdge()) { block = Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE_SMOOTH); } else { block = Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE_SMOOTH); } } else if (isWalkway()) { if (isWalkwayEdge()) { block = Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE_SMOOTH); } else { block = Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE_SMOOTH); } } else if (isWalkwayTorch()) { block = Blocks.REDSTONE_TORCH.getDefaultState(); } else if (isWalkwaySubstructure()) { block = Blocks.DIRT.getDefaultState(); } else if (isLootChest()) { block = randomChest(); } else { block = Blocks.AIR.getDefaultState(); } placeBlock(); addLootToChest(); }
public static void generateOreStoneVariant(IBlockState newState, BlockStone.EnumType type, Random random, int chunkX, int chunkZ, World world, int count) { List<BlockStone.EnumType> list = newArrayList(type); for (int i = 0; i < count; i += 2) { int posX = chunkX + random.nextInt(16); int posZ = chunkZ + random.nextInt(16); BlockPos cPos = new BlockPos(posX, random.nextInt(64) + 32, posZ); IBlockState state = world.getBlockState(cPos); if (state.getBlock().equals(Blocks.STONE.getDefaultState().getBlock())) { if (list.contains(state.getValue(BlockStone.VARIANT))) { world.setBlockState(cPos, newState); } } else { while (cPos.getY() >= 0) { cPos = cPos.down(); state = world.getBlockState(cPos); if (state.getBlock().equals(Blocks.STONE.getDefaultState().getBlock())) { if (list.contains(state.getValue(BlockStone.VARIANT))) { world.setBlockState(cPos, newState); break; } } } } cPos = new BlockPos(posX, random.nextInt(32), posZ); state = world.getBlockState(cPos); if (state.getBlock().equals(Blocks.STONE.getDefaultState().getBlock())) { if (list.contains(state.getValue(BlockStone.VARIANT))) { world.setBlockState(cPos, newState); } } else { while (cPos.getY() <= 96) { cPos = cPos.up(); state = world.getBlockState(cPos); if (state.getBlock().equals(Blocks.STONE.getDefaultState().getBlock())) { if (list.contains(state.getValue(BlockStone.VARIANT))) { world.setBlockState(cPos, newState); break; } } } } } }
public static void init() { IBlockState coarseDirt = Blocks.DIRT.getDefaultState().withProperty(BlockDirt.VARIANT, BlockDirt.DirtType.COARSE_DIRT); MapMaterial.addMaterial("concrete", Blocks.STONEBRICK, Blocks.STONE_BRICK_STAIRS, Blocks.COBBLESTONE_WALL); MapMaterial.addMaterial("metal", Blocks.IRON_BLOCK, Blocks.QUARTZ_STAIRS, Blocks.IRON_BARS); MapMaterial.addMaterial("bars", Blocks.IRON_BARS, Blocks.IRON_BARS, Blocks.IRON_BARS); MapMaterial.addMaterial("railing", Blocks.IRON_BARS, Blocks.IRON_BARS, Blocks.IRON_BARS); MapMaterial.addMaterial("chain", Blocks.IRON_BARS, Blocks.IRON_BARS, Blocks.IRON_BARS); MapMaterial.addMaterial("wood", Blocks.PLANKS, Blocks.OAK_STAIRS, Blocks.OAK_FENCE); MapMaterial.addMaterial("asphalt", Blocks.COAL_BLOCK, Blocks.NETHER_BRICK_STAIRS, Blocks.NETHER_BRICK_FENCE); MapMaterial.addMaterial("glass", Blocks.GLASS, Blocks.GLASS, Blocks.GLASS_PANE); MapMaterial.addMaterial("grass", coarseDirt, coarseDirt, Blocks.TALLGRASS.getDefaultState().withProperty(BlockTallGrass.TYPE, BlockTallGrass.EnumType.GRASS)); MapMaterial.addMaterial("cobblestone", Blocks.COBBLESTONE, Blocks.STONE_STAIRS, Blocks.COBBLESTONE_WALL); MapMaterial.addMaterial("pebbles", Blocks.COBBLESTONE, Blocks.STONE_STAIRS, Blocks.COBBLESTONE_WALL); MapMaterial.addMaterial("pebblestone", Blocks.COBBLESTONE, Blocks.STONE_STAIRS, Blocks.COBBLESTONE_WALL); MapMaterial.addMaterial("cobblestone:flattened", Blocks.COBBLESTONE, Blocks.STONE_STAIRS, Blocks.COBBLESTONE_WALL); MapMaterial.addMaterial("paved", Blocks.DOUBLE_STONE_SLAB, Blocks.DOUBLE_STONE_SLAB, Blocks.DOUBLE_STONE_SLAB); MapMaterial.addMaterial("sidewalk", Blocks.DOUBLE_STONE_SLAB, Blocks.DOUBLE_STONE_SLAB, Blocks.DOUBLE_STONE_SLAB); MapMaterial.addMaterial("brick", Blocks.BRICK_BLOCK, Blocks.NETHER_BRICK_STAIRS, Blocks.NETHER_BRICK_FENCE); MapMaterial.addMaterial("bricks", Blocks.BRICK_BLOCK, Blocks.NETHER_BRICK_STAIRS, Blocks.NETHER_BRICK_FENCE); MapMaterial.addMaterial("stone", Blocks.STONE, Blocks.STONE_BRICK_STAIRS, Blocks.COBBLESTONE_WALL); MapMaterial.addMaterial("gravel", Blocks.GRAVEL, Blocks.GRAVEL, Blocks.GRAVEL); MapMaterial.addMaterial("fine_gravel", Blocks.GRAVEL, Blocks.GRAVEL, Blocks.GRAVEL); MapMaterial.addMaterial("sand", Blocks.SAND, Blocks.SANDSTONE_STAIRS, Blocks.BIRCH_FENCE); MapMaterial.addMaterial("granite", Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), Blocks.STONE_STAIRS.getDefaultState(), Blocks.COBBLESTONE_WALL.getDefaultState()); MapMaterial.addMaterial("dirt", coarseDirt, coarseDirt, coarseDirt); MapMaterial.addMaterial("mud", coarseDirt, coarseDirt, coarseDirt); MapMaterial.addMaterial("earth", coarseDirt, coarseDirt, coarseDirt); MapMaterial.addMaterial("ground", coarseDirt, coarseDirt, coarseDirt); Block.REGISTRY.iterator().forEachRemaining(block -> { Material material = block.getDefaultState().getMaterial(); if (material == Material.ROCK || material == Material.IRON) { ResourceLocation identifier = Block.REGISTRY.getNameForObject(block); if (identifier.getResourceDomain().equals("minecraft")) { int colour = block.getDefaultState().getMapColor().colorValue; Set<Block> blocks = BLOCK_COLOURS.computeIfAbsent(colour, (key) -> new HashSet<>()); blocks.add(block); } } }); }
/** * Get the MapColor for this Block and the given BlockState */ @Override public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos) { return ((BlockStone)Blocks.STONE).getMapColor(Blocks.STONE.getStateFromMeta(BlockStone.EnumType.GRANITE_SMOOTH.getMetadata()), worldIn, pos); }
/** * Get the MapColor for this Block and the given BlockState */ @Override public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos) { return ((BlockStone)Blocks.STONE).getMapColor(Blocks.STONE.getStateFromMeta(BlockStone.EnumType.DIORITE_SMOOTH.getMetadata()), worldIn, pos); }
/** * Get the MapColor for this Block and the given BlockState */ @Override public MapColor getMapColor(IBlockState state, IBlockAccess worldIn, BlockPos pos) { return ((BlockStone)Blocks.STONE).getMapColor(Blocks.STONE.getStateFromMeta(BlockStone.EnumType.ANDESITE_SMOOTH.getMetadata()), worldIn, pos); }
public static void loadRecipes() { addCrusherRecipe(new ItemStack(Items.BLAZE_ROD), new ItemStack(Items.BLAZE_POWDER, 5)); addCrusherRecipe(new ItemStack(Blocks.COBBLESTONE), new ItemStack(Blocks.SAND, 1)); addCrusherRecipe(new ItemStack(Blocks.GRAVEL), new ItemStack(Items.FLINT, 1)); addCrusherRecipe(new ItemStack(Blocks.STONE), new ItemStack(Blocks.GRAVEL, 1)); addCrusherRecipe(new ItemStack(Items.REEDS), new ItemStack(Items.SUGAR, 2)); addAlloySmelterRecipe(TMResource.COPPER.getStackNormal(Type.INGOT, 3), TMResource.TIN.getStackNormal(Type.INGOT), TMResource.BRONZE.getStackNormal(Type.INGOT, 4)); addAlloySmelterRecipe(TMResource.GOLD.getStackNormal(Type.INGOT), TMResource.SILVER.getStackNormal(Type.INGOT), TMResource.ELECTRUM.getStackNormal(Type.INGOT, 2)); addCrusherRecipe(new ItemStack(Blocks.NETHERRACK), CraftingMaterial.NETHERRACK_DUST.getStackNormal()); addAlloySmelterRecipe(TMResource.LEAD.getStackNormal(Type.INGOT), TMResource.TIN.getStackNormal(Type.INGOT), CraftingMaterial.SOLDERING_ALLOY.getStackNormal(2)); addPlateBlenderRecipe(CraftingMaterial.SILICON.getStackNormal(), CraftingMaterial.SILICON_PLATE.getStackNormal(), 1); addCrusherRecipe(new ItemStack(Blocks.GLASS), CraftingMaterial.GLASS_DUST.getStackNormal()); addCokeOvenRecipe(new ItemStack(Items.COAL), new ItemStack(FactoryInit.coalCoke), 500, 1800); addCokeOvenRecipe(new ItemStack(Blocks.COAL_BLOCK), new ItemStack(FactoryInit.blockCoalCoke), 5000, 15500); addCokeOvenRecipe(new ItemStack(Blocks.LOG), new ItemStack(Items.COAL, 1, 1), 250, 1600); addBlastFurnaceRecipe(new ItemStack(Items.IRON_INGOT), ItemStack.EMPTY, TMResource.STEEL.getStackNormal(Type.INGOT), 2000, 0); addBlastFurnaceRecipe(TMResource.IRON.getBlockStackNormal(1), ItemStack.EMPTY, TMResource.STEEL.getBlockStackNormal(1), 16000, 0); addCrusherRecipe(TMResource.WOLFRAM.getStackNormal(Type.CRUSHED_ORE), CraftingMaterial.TUNGSTATE_DUST.getStackNormal()); addBlastFurnaceRecipe(CraftingMaterial.TUNGSTATE_DUST.getStackNormal(), ItemStack.EMPTY, CraftingMaterial.HOT_WOLFRAM_INGOT.getStackNormal(), 6400, 0); addAlloySmelterRecipe(new ItemStack(Blocks.REDSTONE_BLOCK), TMResource.ELECTRUM.getStackNormal(Type.INGOT, 4), TMResource.REDSTONE.getStackNormal(Type.INGOT, 4)); addAlloySmelterRecipe(TMResource.COPPER.getStackNormal(Type.INGOT), TMResource.NICKEL.getStackNormal(Type.INGOT), CraftingMaterial.CUPRONICKEL_INGOT.getStackNormal(2)); addWireMillRecipe(CraftingMaterial.CUPRONICKEL_INGOT.getStackNormal(4), CraftingMaterial.CUPRONICKEL_HEATING_COIL.getStackNormal(), 1); addBlastFurnaceRecipe(CraftingMaterial.TUNGSTATE_DUST.getStackNormal(), TMResource.COAL.getStackNormal(Type.DUST_TINY, 3), CraftingMaterial.HOT_WOLFRAM_INGOT.getStackNormal(), 6000, 2200); addBlastFurnaceRecipe(new ItemStack(Items.IRON_INGOT), TMResource.COAL.getStackNormal(Type.DUST, 2), TMResource.STEEL.getStackNormal(Type.INGOT), 2800, 1020); addBlastFurnaceRecipe(TMResource.IRON.getBlockStackNormal(1), TMResource.COAL.getStackNormal(Type.DUST, 18), TMResource.STEEL.getBlockStackNormal(1), 25000, 1020); addBlastFurnaceRecipe(CraftingMaterial.ENDERIUM_BASE.getStackNormal(), new ItemStack(Items.ENDER_PEARL, 4), TMResource.ENDERIUM.getStackNormal(Type.INGOT), 5000, 2000); addBlastFurnaceRecipe(TMResource.WOLFRAM.getStackNormal(Type.DUST), TMResource.STEEL.getStackNormal(Type.INGOT), TMResource.TUNGSTENSTEEL.getStackNormal(Type.INGOT, 2), 15000, 3000); addBlastFurnaceRecipe(TMResource.TITANIUM.getStackNormal(Type.DUST), ItemStack.EMPTY, TMResource.TITANIUM.getStackNormal(Type.INGOT), 4000, 1500); addBlastFurnaceRecipe(TMResource.CHROME.getStackNormal(Type.DUST), ItemStack.EMPTY, TMResource.CHROME.getStackNormal(Type.INGOT), 4000, 1700); addBlastFurnaceRecipe(TMResource.WOLFRAM.getStackNormal(Type.DUST), ItemStack.EMPTY, CraftingMaterial.HOT_WOLFRAM_INGOT.getStackNormal(), 4000, 2000); addBlastFurnaceRecipe(TMResource.TUNGSTENSTEEL.getStackNormal(Type.DUST), ItemStack.EMPTY, CraftingMaterial.HOT_TUNGSTENSTEEL_INGOT.getStackNormal(), 4000, 3000); addBlastFurnaceRecipe(CraftingMaterial.BAUXITE_DUST.getStackNormal(), TMResource.MERCURY.getStackNormal(Type.GEM), TMResource.ALUMINUM.getStackNormal(Type.INGOT), 5000, 1700); addBlastFurnaceRecipe(TMResource.MERCURY.getStackNormal(Type.CRUSHED_ORE), TMResource.COAL.getStackNormal(Type.DUST, 4), TMResource.MERCURY.getStackNormal(Type.GEM), 5000, 1700); addAlloySmelterRecipe(TMResource.OBSIDIAN.getStackNormal(Type.DUST, 2), TMResource.LEAD.getStackNormal(Type.DUST), new ItemStack(CoreInit.hardenedGlass)); addAlloySmelterRecipe(new ItemStack(CoreInit.hardenedGlass, 2), TMResource.ENDERIUM.getStackNormal(Type.DUST), new ItemStack(CoreInit.hardenedGlass, 2, 1)); addWireMillRecipe(TMResource.STEEL.getStackNormal(Type.PLATE, 3), new ItemStack(CoreInit.steelFence, 2), 2); addCrusherRecipe(new ItemStack(DefenseInit.oreMonazit, 1, 0), new ItemStack(DefenseInit.crushedMonazit, 2, 0)); addCrusherRecipe(new ItemStack(DefenseInit.oreMonazit, 1, 1), new ItemStack(DefenseInit.crushedMonazit, 2, 1)); addPlateBlenderRecipe(TMResource.TIN.getStackNormal(Type.PLATE), CraftingMaterial.TIN_CAN.getStackNormal(), 1); addCrusherRecipe(TMResource.ALUMINUM.getStackNormal(Type.CRUSHED_ORE), CraftingMaterial.BAUXITE_DUST.getStackNormal()); addBlastFurnaceRecipe(TMResource.ALUMINUM.getStackNormal(Type.DUST, 2), TMResource.COAL.getStackNormal(Type.DUST), TMResource.ALUMINUM.getStackNormal(Type.INGOT, 2), 5000, 1700); addBlastFurnaceRecipe(TMResource.ALUMINUM.getStackNormal(Type.DUST), ItemStack.EMPTY, TMResource.ALUMINUM.getStackNormal(Type.INGOT), 5000, 0); addPlateBlenderRecipe(CraftingMaterial.ELECTRICAL_STEEL_INGOT.getStackNormal(), CraftingMaterial.ELECTRICAL_STEEL_PLATE.getStackNormal(), 1); addAlloySmelterRecipe(TMResource.STEEL.getStackNormal(Type.INGOT, 4), CraftingMaterial.RAW_ELECTRICAL_STEEL_DUST.getStackNormal(), CraftingMaterial.ELECTRICAL_STEEL_INGOT.getStackNormal(4)); addAlloySmelterRecipe(TMResource.COPPER.getStackNormal(Type.INGOT, 3), TMResource.ZINC.getStackNormal(Type.INGOT), TMResource.BRASS.getStackNormal(Type.INGOT, 4)); addWireMillRecipe(new ItemStack(Blocks.OBSIDIAN), CraftingMaterial.OBSIDIAN_ROD.getStackNormal(2), 5); addCrusherRecipe(CraftingMaterial.IMPURE_FLUIX.getStackNormal(), CraftingMaterial.IMPURE_FLUIX_DUST.getStackNormal()); addLaserEngraverRecipe(1, new ItemStack(Items.REDSTONE), CraftingMaterial.BLUEPRINT_BASIC_CHIPSET.getStackNormal(), CraftingMaterial.BASIC_CHIPSET.getStackNormal(), 600, 0); addLaserEngraverRecipe(3, TMResource.GOLD.getStackNormal(Type.DUST), CraftingMaterial.BLUEPRINT_ADVANCED_CHIPSET.getStackNormal(), CraftingMaterial.ADVANCED_CHIPSET.getStackNormal(), 1200, 1); addLaserEngraverRecipe(5, TMResource.FLUIX.getStackNormal(Type.DUST), CraftingMaterial.BLUEPRINT_FLUIX_CHIPSET.getStackNormal(), CraftingMaterial.FLUIX_CHIPSET.getStackNormal(), 1700, 1); addLaserEngraverRecipe(8, TMResource.PLATINUM.getStackNormal(Type.DUST), CraftingMaterial.BLUEPRINT_QUANTUM_CHIPSET.getStackNormal(), CraftingMaterial.QUANTUM_CHIPSET.getStackNormal(), 2500, 2); addLaserEngraverRecipe(1, new ItemStack(Items.GOLD_NUGGET, 2), CraftingMaterial.BLUEPRINT_LOGIC_PROCESSOR.getStackNormal(), CraftingMaterial.LOGIC_PROCESSOR.getStackNormal(4), 800, 1); addCrusherRecipe(CraftingMaterial.CRUSHED_OBSIDIAN.getStackNormal(), TMResource.OBSIDIAN.getStackNormal(Type.DUST)); addCrusherRecipe(new ItemStack(Blocks.OBSIDIAN), CraftingMaterial.CRUSHED_OBSIDIAN.getStackNormal()); addHammerRecipe(Blocks.OBSIDIAN.getDefaultState(), 2, CraftingMaterial.CRUSHED_OBSIDIAN.getStackNormal()); addHammerRecipe(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.STONE), 2, new ItemStack(Blocks.GRAVEL)); addHammerRecipe(Blocks.GRAVEL.getDefaultState(), 1, new ItemStackWRng(new ItemStack(Blocks.SAND)), new ItemStackWRng(new ItemStack(Items.FLINT), 15)); addHammerRecipe(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.ANDESITE), 2, new ItemStack(Blocks.GRAVEL)); addHammerRecipe(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.GRANITE), 2, new ItemStack(Blocks.GRAVEL)); addHammerRecipe(Blocks.STONE.getDefaultState().withProperty(BlockStone.VARIANT, BlockStone.EnumType.DIORITE), 2, new ItemStack(Blocks.GRAVEL)); addHammerRecipe(Blocks.COBBLESTONE.getDefaultState(), 2, new ItemStack(Blocks.GRAVEL)); addElectrolyzerRecipe(new FluidStack(FluidRegistry.WATER, 300), 200, new FluidStack(CoreInit.Hydrogen.get(), 200), new FluidStack(CoreInit.Oxygen.get(), 100)); addCentrifugeRecipe(new FluidStack(CoreInit.Hydrogen.get(), 5), 5, new FluidStack(CoreInit.Deuterium.get(), 5)); addCentrifugeRecipe(new FluidStack(CoreInit.Deuterium.get(), 5), 10, new FluidStack(CoreInit.Tritium.get(), 5)); }
private void changeBlockType(int x, int y, int z, Block block) { if (block == ModBlocks.machineexplosivepackeddrilledstone) { // do the explosion! if it's blasted stone so we can propagate the // explosion on to the next block ! block.onBlockExploded(this.worldObj, new BlockPos(x, y, z), this); } else { if (!this.worldObj.isRemote) { // Determine block to turn this block into BlockPos bp = new BlockPos(x, y, z); if (this.worldObj.getBlockState(bp).getBlock() == Blocks.STONE) { // its stone so get variant if (this.worldObj.getBlockState(bp).getValue(BlockStone.VARIANT) == BlockStone.EnumType.STONE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastedstone.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getValue(BlockStone.VARIANT) == BlockStone.EnumType.GRANITE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastedgranite.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getValue(BlockStone.VARIANT) == BlockStone.EnumType.DIORITE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblasteddiorite.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getValue(BlockStone.VARIANT) == BlockStone.EnumType.ANDESITE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastedandesite.getDefaultState()); } } // not stone else if (this.worldObj.getBlockState(bp).getBlock() == Blocks.GOLD_ORE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastedgold.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getBlock() == Blocks.IRON_ORE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastediron.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getBlock() == Blocks.COAL_ORE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastedcoal.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getBlock() == Blocks.LAPIS_ORE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastedlapis.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getBlock() == Blocks.DIAMOND_ORE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblasteddiamond.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getBlock() == Blocks.REDSTONE_ORE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastedredstone.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getBlock() == Blocks.EMERALD_ORE) { this.worldObj.setBlockState(new BlockPos(x, y, z), ModBlocks.machineblastedemerald.getDefaultState()); } else if (this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastedstone || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastedgranite || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblasteddiorite || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastedandesite || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastedgold || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastediron || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastedcoal || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastedlapis || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblasteddiamond || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastedredstone || this.worldObj.getBlockState(bp).getBlock() == ModBlocks.machineblastedemerald) { } else { // check for mod blocks here using ore dictionary & set it // to ModBlocks.machinemodblastedstone2 ...... block.dropBlockAsItem(this.worldObj, bp, this.worldObj.getBlockState(bp), 0); block.onBlockExploded(this.worldObj, bp, this); // this.worldObj.setBlockState(new BlockPos(x, y, z), // ModBlocks.machinemodblastedstone.getDefaultState()); } } } }
@Override public void onUpdate() { if (!world.isRemote) { if (this.Attribute1 > 89) { // drill is extended disable all movement controls this.isPlayerTurningLeft = false; this.isPlayerTurningRight = false; this.isPlayerAccelerating = false; this.isPlayerBreaking = false; } } super.onUpdate(); if (!world.isRemote) { if (this.Attribute1 > 90) { // drilling arm fully extended so now for every 10 units drill another block currentDepth = (int) ((this.Attribute1 - 90) / 5); if (currentDepth > 15) { // fail safe limit currentDepth = 15; } BlockPos bp = new BlockPos(posX + calcTwoOffsetX(7, 0, 0), posY - currentDepth - 1, posZ + calcTwoOffsetZ(7, 0, 0)); if (world.getBlockState(bp).getBlock() == Blocks.STONE && world.getBlockState(bp).getBlock().getMetaFromState(world.getBlockState(bp)) == BlockStone.EnumType.STONE.getMetadata()) { // world.getBlockState(bp).getBlock().dropBlockAsItem(worldObj, bp, world.getBlockState(bp), 0); // world.setBlockToAir(bp); world.setBlockState(bp, ModBlocks.machinedrilledstone.getDefaultState()); } else if (world.getBlockState(bp).getBlock() == Blocks.STONE && world.getBlockState(bp).getBlock().getMetaFromState(world.getBlockState(bp)) == BlockStone.EnumType.ANDESITE.getMetadata()) { // world.getBlockState(bp).getBlock().dropBlockAsItem(worldObj, bp, world.getBlockState(bp), 0); // world.setBlockToAir(bp); world.setBlockState(bp, ModBlocks.machinedrilledandesite.getDefaultState()); } else if (world.getBlockState(bp).getBlock() == Blocks.STONE && world.getBlockState(bp).getBlock().getMetaFromState(world.getBlockState(bp)) == BlockStone.EnumType.DIORITE.getMetadata()) { // world.getBlockState(bp).getBlock().dropBlockAsItem(worldObj, bp, world.getBlockState(bp), 0); // world.setBlockToAir(bp); world.setBlockState(bp, ModBlocks.machinedrilleddiorite.getDefaultState()); } else if (world.getBlockState(bp).getBlock() == Blocks.STONE && world.getBlockState(bp).getBlock().getMetaFromState(world.getBlockState(bp)) == BlockStone.EnumType.GRANITE.getMetadata()) { // world.getBlockState(bp).getBlock().dropBlockAsItem(worldObj, bp, world.getBlockState(bp), 0); // world.setBlockToAir(bp); world.setBlockState(bp, ModBlocks.machinedrilledgranite.getDefaultState()); } } } }
private void repeaterSimple() { RecipeRegistry.addShapedRecipe(new ItemStack(Items.REPEATER), "r r", "srs", "ttt", 't', new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.STONE.ordinal()), 's', new ItemStack(Items.STICK), 'r', new ItemStack(Items.REDSTONE)); }
/** * Adds the crafting recipes to the CraftingManager. */ public void addRecipes(CraftingManager manager) { manager.addRecipe(new ItemStack(Blocks.CHEST), new Object[] {"###", "# #", "###", '#', Blocks.PLANKS}); manager.addShapelessRecipe(new ItemStack(Blocks.TRAPPED_CHEST), new Object[] {Blocks.CHEST, Blocks.TRIPWIRE_HOOK}); manager.addRecipe(new ItemStack(Blocks.ENDER_CHEST), new Object[] {"###", "#E#", "###", '#', Blocks.OBSIDIAN, 'E', Items.ENDER_EYE}); manager.addRecipe(new ItemStack(Blocks.FURNACE), new Object[] {"###", "# #", "###", '#', Blocks.COBBLESTONE}); manager.addRecipe(new ItemStack(Blocks.CRAFTING_TABLE), new Object[] {"##", "##", '#', Blocks.PLANKS}); manager.addRecipe(new ItemStack(Blocks.SANDSTONE), new Object[] {"##", "##", '#', new ItemStack(Blocks.SAND, 1, BlockSand.EnumType.SAND.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.RED_SANDSTONE), new Object[] {"##", "##", '#', new ItemStack(Blocks.SAND, 1, BlockSand.EnumType.RED_SAND.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.SANDSTONE, 4, BlockSandStone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.SANDSTONE, 1, BlockSandStone.EnumType.DEFAULT.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.RED_SANDSTONE, 4, BlockRedSandstone.EnumType.SMOOTH.getMetadata()), new Object[] {"##", "##", '#', new ItemStack(Blocks.RED_SANDSTONE, 1, BlockRedSandstone.EnumType.DEFAULT.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.SANDSTONE, 1, BlockSandStone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.STONE_SLAB, 1, BlockStoneSlab.EnumType.SAND.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.RED_SANDSTONE, 1, BlockRedSandstone.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.STONE_SLAB2, 1, BlockStoneSlabNew.EnumType.RED_SANDSTONE.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 1, BlockQuartz.EnumType.CHISELED.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.STONE_SLAB, 1, BlockStoneSlab.EnumType.QUARTZ.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.QUARTZ_BLOCK, 2, BlockQuartz.EnumType.LINES_Y.getMetadata()), new Object[] {"#", "#", '#', new ItemStack(Blocks.QUARTZ_BLOCK, 1, BlockQuartz.EnumType.DEFAULT.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.STONEBRICK, 4), new Object[] {"##", "##", '#', new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.STONE.getMetadata())}); manager.addRecipe(new ItemStack(Blocks.STONEBRICK, 1, BlockStoneBrick.CHISELED_META), new Object[] {"#", "#", '#', new ItemStack(Blocks.STONE_SLAB, 1, BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata())}); manager.addShapelessRecipe(new ItemStack(Blocks.STONEBRICK, 1, BlockStoneBrick.MOSSY_META), new Object[] {Blocks.STONEBRICK, Blocks.VINE}); manager.addShapelessRecipe(new ItemStack(Blocks.MOSSY_COBBLESTONE, 1), new Object[] {Blocks.COBBLESTONE, Blocks.VINE}); manager.addRecipe(new ItemStack(Blocks.IRON_BARS, 16), new Object[] {"###", "###", '#', Items.IRON_INGOT}); manager.addRecipe(new ItemStack(Blocks.GLASS_PANE, 16), new Object[] {"###", "###", '#', Blocks.GLASS}); manager.addRecipe(new ItemStack(Blocks.REDSTONE_LAMP, 1), new Object[] {" R ", "RGR", " R ", 'R', Items.REDSTONE, 'G', Blocks.GLOWSTONE}); manager.addRecipe(new ItemStack(Blocks.BEACON, 1), new Object[] {"GGG", "GSG", "OOO", 'G', Blocks.GLASS, 'S', Items.NETHER_STAR, 'O', Blocks.OBSIDIAN}); manager.addRecipe(new ItemStack(Blocks.NETHER_BRICK, 1), new Object[] {"NN", "NN", 'N', Items.NETHERBRICK}); manager.addRecipe(new ItemStack(Blocks.field_189879_dh, 1), new Object[] {"NW", "WN", 'N', Items.NETHERBRICK, 'W', Items.NETHER_WART}); manager.addRecipe(new ItemStack(Blocks.STONE, 2, BlockStone.EnumType.DIORITE.getMetadata()), new Object[] {"CQ", "QC", 'C', Blocks.COBBLESTONE, 'Q', Items.QUARTZ}); manager.addShapelessRecipe(new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.GRANITE.getMetadata()), new Object[] {new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.DIORITE.getMetadata()), Items.QUARTZ}); manager.addShapelessRecipe(new ItemStack(Blocks.STONE, 2, BlockStone.EnumType.ANDESITE.getMetadata()), new Object[] {new ItemStack(Blocks.STONE, 1, BlockStone.EnumType.DIORITE.getMetadata()), Blocks.COBBLESTONE}); manager.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}); manager.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())}); manager.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())}); manager.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())}); manager.addRecipe(new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.ROUGH_META), new Object[] {"SS", "SS", 'S', Items.PRISMARINE_SHARD}); manager.addRecipe(new ItemStack(Blocks.PRISMARINE, 1, BlockPrismarine.BRICKS_META), new Object[] {"SSS", "SSS", "SSS", 'S', Items.PRISMARINE_SHARD}); manager.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())}); manager.addRecipe(new ItemStack(Blocks.SEA_LANTERN, 1, 0), new Object[] {"SCS", "CCC", "SCS", 'S', Items.PRISMARINE_SHARD, 'C', Items.PRISMARINE_CRYSTALS}); manager.addRecipe(new ItemStack(Blocks.PURPUR_BLOCK, 4, 0), new Object[] {"FF", "FF", 'F', Items.CHORUS_FRUIT_POPPED}); manager.addRecipe(new ItemStack(Blocks.PURPUR_STAIRS, 4, 0), new Object[] {"# ", "## ", "###", '#', Blocks.PURPUR_BLOCK}); manager.addRecipe(new ItemStack(Blocks.PURPUR_PILLAR, 1, 0), new Object[] {"#", "#", '#', Blocks.PURPUR_SLAB}); manager.addRecipe(new ItemStack(Blocks.END_BRICKS, 4, 0), new Object[] {"##", "##", '#', Blocks.END_STONE}); manager.addRecipe(new ItemStack(Blocks.field_189877_df, 1, 0), new Object[] {"##", "##", '#', Items.MAGMA_CREAM}); manager.addRecipe(new ItemStack(Blocks.field_189878_dg, 1, 0), new Object[] {"###", "###", "###", '#', Items.NETHER_WART}); }