Package thaumic.tinkerer.common.core.helper

Examples of thaumic.tinkerer.common.core.helper.BlockTuple


    @Override
    public HashMap<BlockTuple, BlockTuple> getBlockTransformation(World w, int x, int y, int z) {

        Block block = w.getBlock(x, y, z);
        int meta = w.getBlockMetadata(x, y, z);
        if (!fireResults.containsKey(new BlockTuple(block, meta))) {
            Block result = null;
            int resultMeta = 0;

            ArrayList<ItemStack> drops = block.getDrops(w, x, y, z, meta, 0);
            if (drops.size() > 0 && (drops.size() == 1 || allEqual(drops))) {

                ItemStack stack = drops.get(0);

                ItemStack blockStack = getBlockCraftingResult(w, stack);
                if (blockStack == null) {
                    ItemStack ingotStack = FurnaceRecipes.smelting().getSmeltingResult(stack);
                    blockStack = getBlockCraftingResult(w, ingotStack);
                }
                if (blockStack != null && Block.getBlockFromItem(blockStack.getItem()) != null) {
                    result = Block.getBlockFromItem(blockStack.getItem());
                    resultMeta = blockStack.getItemDamage();
                }
            }

            fireResults.put(new BlockTuple(block, meta), new BlockTuple(result, resultMeta));
        }
        return fireResults;
    }
View Full Code Here


    }

    @Override
    public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
        HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
        result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireAir.class)), new BlockTuple(Blocks.fire));
        result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireWater.class)), new BlockTuple(Blocks.fire));
        result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireEarth.class)), new BlockTuple(Blocks.fire));
        result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireIgnis.class)), new BlockTuple(Blocks.fire));
        result.put(new BlockTuple(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockFireOrder.class)), new BlockTuple(Blocks.fire));

        return result;
    }
View Full Code Here

    }

    @Override
    public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
        HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
        result.put(new BlockTuple(Blocks.log), new BlockTuple(Blocks.sand));
        result.put(new BlockTuple(Blocks.leaves), new BlockTuple(Blocks.sandstone));
        result.put(new BlockTuple(Blocks.leaves2), new BlockTuple(Blocks.sandstone));
        result.put(new BlockTuple(Blocks.log2), new BlockTuple(Blocks.sand));
        result.put(new BlockTuple(Blocks.ice), new BlockTuple(Blocks.glass));
        if (ConfigHandler.enableCake) {
            result.put(new BlockTuple(Blocks.water), new BlockTuple(Blocks.cake));
        }
        result.put(new BlockTuple(Blocks.dirt), new BlockTuple(Blocks.sand));
        result.put(new BlockTuple(Blocks.grass), new BlockTuple(Blocks.sand));
        return result;
    }
View Full Code Here

    }

    @Override
    public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
        HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
        result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.dirt));
        result.put(new BlockTuple(Blocks.gravel), new BlockTuple(Blocks.clay));
        result.put(new BlockTuple(Blocks.nether_brick), new BlockTuple(Blocks.planks));
        result.put(new BlockTuple(Blocks.nether_brick_fence), new BlockTuple(Blocks.fence));
        result.put(new BlockTuple(Blocks.nether_brick_stairs), new BlockTuple(Blocks.oak_stairs));
        result.put(new BlockTuple(Blocks.cactus), new BlockTuple(Blocks.log));
        result.put(new BlockTuple(Blocks.snow_layer), new BlockTuple(Blocks.tallgrass));
        result.put(new BlockTuple(Blocks.stone), new BlockTuple(Blocks.dirt));
        result.put(new BlockTuple(Blocks.mob_spawner), new BlockTuple(Blocks.iron_block));
        result.put(new BlockTuple(Blocks.log), new BlockTuple(Blocks.dirt));

        result.put(new BlockTuple(Blocks.log2), new BlockTuple(Blocks.dirt));

        result.put(new BlockTuple(Blocks.leaves), new BlockTuple(Blocks.dirt));
        result.put(new BlockTuple(Blocks.leaves2), new BlockTuple(Blocks.dirt));
        result.put(new BlockTuple(Blocks.cobblestone), new BlockTuple(Blocks.dirt));
        result.put(new BlockTuple(Blocks.planks), new BlockTuple(Blocks.dirt));
        result.put(new BlockTuple(Blocks.glass), new BlockTuple(Blocks.dirt));
        return result;
    }
View Full Code Here

    }

    @Override
    public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
        HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
        result.put(new BlockTuple(Blocks.grass), new BlockTuple(Blocks.netherrack));
        result.put(new BlockTuple(Blocks.dirt), new BlockTuple(Blocks.netherrack));
        result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.soul_sand));
        result.put(new BlockTuple(Blocks.gravel), new BlockTuple(Blocks.soul_sand));
        result.put(new BlockTuple(Blocks.clay), new BlockTuple(Blocks.glowstone));
        result.put(new BlockTuple(Blocks.coal_ore), new BlockTuple(Blocks.quartz_ore));
        result.put(new BlockTuple(Blocks.iron_ore), new BlockTuple(Blocks.quartz_ore));
        result.put(new BlockTuple(Blocks.diamond_ore), new BlockTuple(Blocks.quartz_ore));
        result.put(new BlockTuple(Blocks.emerald_ore), new BlockTuple(Blocks.quartz_ore));
        result.put(new BlockTuple(Blocks.gold_block), new BlockTuple(Blocks.quartz_ore));
        result.put(new BlockTuple(Blocks.lapis_ore), new BlockTuple(Blocks.quartz_ore));
        result.put(new BlockTuple(Blocks.redstone_ore), new BlockTuple(Blocks.quartz_ore));
        result.put(new BlockTuple(Blocks.lit_redstone_ore), new BlockTuple(Blocks.quartz_ore));
        result.put(new BlockTuple(Blocks.water), new BlockTuple(Blocks.lava));
        result.put(new BlockTuple(Blocks.wheat), new BlockTuple(Blocks.nether_wart));
        result.put(new BlockTuple(Blocks.potatoes), new BlockTuple(Blocks.nether_wart));
        result.put(new BlockTuple(Blocks.carrots), new BlockTuple(Blocks.nether_wart));
        result.put(new BlockTuple(Blocks.red_flower), new BlockTuple(Blocks.brown_mushroom));
        result.put(new BlockTuple(Blocks.yellow_flower), new BlockTuple(Blocks.yellow_flower));
        return result;
    }
View Full Code Here

    public abstract HashMap<BlockTuple, BlockTuple> getBlockTransformation();

    public boolean isTransmutationTarget(Block block, World w, int x, int y, int z) {

        return isTransmutationTarget(new BlockTuple(block), w, x, y, z);
    }
View Full Code Here

        return isTransmutationTarget(new BlockTuple(block), w, x, y, z);
    }

    public boolean isTransmutationResult(Block block, World w, int x, int y, int z) {
        return isTransmutationResult(new BlockTuple(block), w, x, y, z);
    }
View Full Code Here

    }

    public void setBlockWithTransmutationTarget(World world, int x, int y, int z, int meta, Block block) {
        Random random = new Random();
        if (isTransmutationTarget(world.getBlock(x, z, y), world, x, y, z) && random.nextInt(getDecayChance(world, x, y, z)) == 0) {
            world.setBlock(x, z, y, getBlockTransformation(world, x, y, z).get(new BlockTuple(world.getBlock(x, z, y))).block, getBlockTransformation(world, x, y, z).get(new BlockTuple(world.getBlock(x, z, y))).meta, 3);
        } else {
            world.setBlock(x, z, y, block, meta, 3);
        }
    }
View Full Code Here

                    if (isNeighborTarget(world, x, y, z)) {
                        for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
                            if (isTransmutationTarget(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ), world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) {
                                Random random = new Random();
                                if (random.nextInt(getDecayChance(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) == 0) {
                                    world.setBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, getBlockTransformation(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).get(new BlockTuple(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))).block, getBlockTransformation(world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ).get(new BlockTuple(world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ))).meta, 3);
                                } else {
                                    world.setBlockToAir(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
                                }
                            }
                        }
View Full Code Here

    }

    @Override
    public HashMap<BlockTuple, BlockTuple> getBlockTransformation() {
        HashMap<BlockTuple, BlockTuple> result = new HashMap<BlockTuple, BlockTuple>();
        result.put(new BlockTuple(Blocks.sand), new BlockTuple(Blocks.ice));
        result.put(new BlockTuple(Blocks.netherrack), new BlockTuple(Blocks.snow));
        result.put(new BlockTuple(Blocks.soul_sand), new BlockTuple(Blocks.ice));
        result.put(new BlockTuple(Blocks.glowstone), new BlockTuple(Blocks.ice));
        result.put(new BlockTuple(Blocks.lava), new BlockTuple(Blocks.obsidian));
        result.put(new BlockTuple(Blocks.flowing_lava), new BlockTuple(Blocks.obsidian));
        return result;
    }
View Full Code Here

TOP

Related Classes of thaumic.tinkerer.common.core.helper.BlockTuple

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.