thaumcraft.common.config.ConfigBlocks Java Examples

The following examples show how to use thaumcraft.common.config.ConfigBlocks. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: EventHandlerWorld.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@SubscribeEvent
public void onBreak(BlockEvent.BreakEvent event) {
    if (!event.world.isRemote) {
        if (event.block == RegisteredBlocks.blockNodeManipulator) {
            TileEntity te = event.world.getTileEntity(event.x, event.y, event.z);
            if (te != null && te instanceof TileNodeManipulator) {
                if (((TileNodeManipulator) te).isInMultiblock())
                    ((TileNodeManipulator) te).breakMultiblock();
            }
        }
        if (event.block == RegisteredBlocks.blockStoneMachine && event.blockMetadata == 5) {
            TileAIShutdown.removeTrackedEntities(event.world, event.x, event.y, event.z);
        }
        if (event.world.provider.dimensionId == ModConfig.dimOuterId) {
            if(event.block == ConfigBlocks.blockEldritchNothing) {
                if(event.getPlayer().capabilities.isCreativeMode && MiscUtils.isANotApprovedOrMisunderstoodPersonFromMoreDoor(event.getPlayer())) return;
                event.setCanceled(true);
                event.getPlayer().addChatMessage(new ChatComponentText(EnumChatFormatting.ITALIC + "" + EnumChatFormatting.GRAY + StatCollector.translateToLocal("gadomancy.eldritch.nobreakPortalNothing")));
            }
        }
    }
}
 
Example #2
Source File: ItemNodeRenderer.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void renderNodeItem(IItemRenderer.ItemRenderType type, ItemStack item, AspectList aspects, NodeType nodeType, NodeModifier nodeModifier, Object... data) {
    if (type == IItemRenderer.ItemRenderType.ENTITY) {
        GL11.glTranslatef(-0.5F, -0.25F, -0.5F);
    } else if ((type == IItemRenderer.ItemRenderType.EQUIPPED) && ((data[1] instanceof EntityPlayer))) {
        GL11.glTranslatef(0.0F, 0.0F, -0.5F);
    }
    TileNode tjf = new TileNode();
    tjf.setAspects(aspects);
    tjf.setNodeType(nodeType);
    tjf.blockType = ConfigBlocks.blockAiry;
    tjf.blockMetadata = 0;
    GL11.glPushMatrix();
    GL11.glTranslated(0.5D, 0.5D, 0.5D);
    GL11.glScaled(2.0D, 2.0D, 2.0D);
    renderItemNode(tjf);
    GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
    renderItemNode(tjf);
    GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F);
    renderItemNode(tjf);
    GL11.glPopMatrix();
    GL11.glEnable(32826);
}
 
Example #3
Source File: BlockExtendedNodeJarRenderer.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
    GL11.glPushMatrix();
    GL11.glEnable(3042);
    GL11.glBlendFunc(770, 771);
    Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
    IIcon i1 = ((BlockJar) ConfigBlocks.blockJar).iconJarTop;
    IIcon i2 = ((BlockJar) ConfigBlocks.blockJar).iconJarSide;
    block.setBlockBounds(W3, 0.0F, W3, W13, W12, W13);
    renderer.setRenderBoundsFromBlock(block);
    drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true);
    block.setBlockBounds(W5, W12, W5, W11, W14, W11);
    renderer.setRenderBoundsFromBlock(block);
    drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true);
    GL11.glPopMatrix();
}
 
Example #4
Source File: IntegrationAutomagy.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
protected void doInit() {
    Block infinityJar = Block.getBlockFromName("Automagy:blockCreativeJar");
    if(infinityJar != null) {
        RegisteredBlocks.registerStickyJar(infinityJar, 3, false, true);
        RegisteredItems.registerStickyJar(Item.getItemFromBlock(infinityJar), 3);
    }

    if(ModConfig.enableAdditionalNodeTypes) {
        CommonProxy.unregisterWandHandler("Automagy", ConfigBlocks.blockWarded, -1);
    }

    //Better bookshelves -> MOAR knowledge
    Block betterBookshelf = Block.getBlockFromName("Automagy:blockBookshelfEnchanted");
    if(betterBookshelf != null) {
        TileKnowledgeBook.knowledgeIncreaseMap.put(new TileKnowledgeBook.BlockSnapshot(betterBookshelf, 0), 2);
        TileKnowledgeBook.knowledgeIncreaseMap.put(new TileKnowledgeBook.BlockSnapshot(betterBookshelf, 1), 4);
    }
}
 
Example #5
Source File: ExplosionHelper.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void taintplosion(World world, int x, int y, int z, boolean taintBiome, int chanceToTaint, float str, int size, int blocksAffected) {
    if(chanceToTaint < 1) chanceToTaint = 1;
    world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, str, false);
    for (int a = 0; a < blocksAffected; a++) {
        int xx = x + world.rand.nextInt(size) - world.rand.nextInt(size);
        int yy = y + world.rand.nextInt(size) - world.rand.nextInt(size);
        int zz = z + world.rand.nextInt(size) - world.rand.nextInt(size);
        if (world.isAirBlock(xx, yy, zz)) {
            if (yy < y) {
                world.setBlock(xx, yy, zz, ConfigBlocks.blockFluxGoo, 8, 3);
            } else {
                world.setBlock(xx, yy, zz, ConfigBlocks.blockFluxGas, 8, 3);
            }
        }
        if(!Config.genTaint) continue;

        if(taintBiome && world.rand.nextInt(chanceToTaint) == 0) {
            Utils.setBiomeAt(world, xx, zz, ThaumcraftWorldGenerator.biomeTaint);
        }
    }
}
 
Example #6
Source File: WandHandler.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void handleWandInteract(World world, int x, int y, int z, EntityPlayer entityPlayer, ItemStack i) {
    Block target = world.getBlock(x, y, z);
    if(target == null) return;

    if(ModConfig.enableAdditionalNodeTypes) {
        if (target.equals(Blocks.glass)) {
            if (ResearchManager.isResearchComplete(entityPlayer.getCommandSenderName(), "NODEJAR")) {
                tryTCJarNodeCreation(i, entityPlayer, world, x, y, z);
            }
        } else if (target.equals(ConfigBlocks.blockWarded)) {
            if (RegisteredIntegrations.automagy.isPresent() &&
                    ResearchManager.isResearchComplete(entityPlayer.getCommandSenderName(), "ADVNODEJAR")) {
                tryAutomagyJarNodeCreation(i, entityPlayer, world, x, y, z);
            }
        }
    }

    if(target.equals(ConfigBlocks.blockCrystal)) {
        if (ResearchManager.isResearchComplete(entityPlayer.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".AURA_CORE"))
            tryAuraCoreCreation(i, entityPlayer, world, x, y, z);
    }
}
 
Example #7
Source File: TileExtendedNodeJar.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
public int onWandRightClick(World world, ItemStack wandstack, EntityPlayer player, int x, int y, int z, int side, int md) {
    if (!world.isRemote) {
        this.drop = false;
        world.setBlock(x, y, z, ConfigBlocks.blockAiry, 0, 3);
        TileExtendedNode tn = (TileExtendedNode) world.getTileEntity(x, y, z);
        if (tn != null) {
            tn.setAspects(getAspects());
            tn.setNodeModifier(getNodeModifier());
            tn.setNodeType(getNodeType());
            tn.setExtendedNodeType(getExtendedNodeType());
            new Injector(tn, TileNode.class).setField("id", getId());
            tn.readBehaviorSnapshot(getBehaviorSnapshot());
            world.markBlockForUpdate(x, y, z);
            tn.markDirty();
        }
    }
    world.playAuxSFX(2001, x, y, z, Block.getIdFromBlock(ConfigBlocks.blockJar) + 61440);
    player.worldObj.playSound(x + 0.5D, y + 0.5D, z + 0.5D, "random.glass", 1.0F, 0.9F + player.worldObj.rand.nextFloat() * 0.2F, false);
    player.swingItem();
    return 0;
}
 
Example #8
Source File: BlockStoneMachine.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
    int metadata = world.getBlockMetadata(x, y, z);

    if (metadata == 0 || metadata == 3) {
        if (world.getBlock(x, y - 1, z).equals(RegisteredBlocks.blockNodeManipulator) && world.getBlockMetadata(x, y - 1, z) == 5) {
            return world.getBlock(x, y - 1, z).onBlockActivated(world, x, y - 1, z, player, side, hitX, hitY, hitZ);
        }
    } else if (metadata == 1) {
        if(world.isAirBlock(x, y + 1, z)) {
            return ConfigBlocks.blockStoneDevice.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ);
        }
        return true;
    } else if(metadata == 4) {
        player.openGui(Gadomancy.instance, 2, world, x, y, z);
        return true;
    }

    return super.onBlockActivated(world, x, y, z, player, side, hitX, hitY, hitZ);
}
 
Example #9
Source File: ModSubstitutions.java    From Gadomancy with GNU Lesser General Public License v3.0 6 votes vote down vote up
public static void preInit() {
        if(ModConfig.enableAdditionalNodeTypes) {
            try {
                ItemBlock item = (ItemBlock) Item.getItemFromBlock(ConfigBlocks.blockAiry);

                item.field_150939_a = RegisteredBlocks.blockNode;

                //Hacky way
                FMLControlledNamespacedRegistry<Block> registry = GameData.getBlockRegistry();
                registry.underlyingIntegerMap.field_148749_a.put(RegisteredBlocks.blockNode, Block.getIdFromBlock(ConfigBlocks.blockAiry));
                registry.underlyingIntegerMap.field_148748_b.set(Block.getIdFromBlock(ConfigBlocks.blockAiry), RegisteredBlocks.blockNode);
                ((BiMap)registry.field_148758_b).forcePut(RegisteredBlocks.blockNode, registry.field_148758_b.get(ConfigBlocks.blockAiry));

                registry.underlyingIntegerMap.field_148749_a.remove(ConfigBlocks.blockAiry);

                ConfigBlocks.blockAiry = RegisteredBlocks.blockNode;
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
}
 
Example #10
Source File: ItemBlockKnowledgeBook.java    From Gadomancy with GNU Lesser General Public License v3.0 5 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) {
    ForgeDirection placedAgainstDir = ForgeDirection.getOrientation(side);
    Block placedAgainst = world.getBlock(x, y, z);
    int againstMeta = world.getBlockMetadata(x, y, z);
    if(placedAgainstDir.equals(ForgeDirection.UP) && placedAgainst.equals(ConfigBlocks.blockStoneDevice) && againstMeta == 1) {
        if(world.isAirBlock(x, y + 2, z)) {
            return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ);
        } else {
            return false;
        }
    } else {
        return false;
    }
}
 
Example #11
Source File: RegisteredItems.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static void registerDefaultStickyJars() {
    registerStickyJar(ConfigItems.itemJarFilled, 0);
    registerStickyJar(ConfigItems.itemJarFilled, 3);

    Item itemBlockJar = Item.getItemFromBlock(ConfigBlocks.blockJar);
    registerStickyJar(itemBlockJar, 0, new ItemStack(itemBlockJar, 1, 0), "JARLABEL");
    registerStickyJar(itemBlockJar, 3, new ItemStack(itemBlockJar, 1, 3), "JARVOID");

    Item itemRemoteJar = Item.getItemFromBlock(RegisteredBlocks.blockRemoteJar);
    registerStickyJar(itemRemoteJar, 0, new ItemStack(itemRemoteJar), SimpleResearchItem.getFullName("REMOTEJAR"));
}
 
Example #12
Source File: RegisteredBlocks.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static void registerBlocks() {
    blockStickyJar = registerBlock(new BlockStickyJar());
    blockArcaneDropper = registerBlock(new BlockArcaneDropper());
    blockInfusionClaw = registerBlock(new BlockInfusionClaw());
    blockRemoteJar = registerBlock(new BlockRemoteJar(), ItemBlockRemoteJar.class);
    blockNode = ModConfig.enableAdditionalNodeTypes ? (BlockAiry) new BlockNode().setBlockName("blockAiry") : (BlockAiry) ConfigBlocks.blockAiry;
    blockExtendedNodeJar = registerBlock(new BlockExtendedNodeJar());
    blockNodeManipulator = registerBlock(new BlockNodeManipulator(), ItemNodeManipulator.class);
    blockStoneMachine = registerBlock(new BlockStoneMachine(), ItemBlockStoneMachine.class);
    blockAdditionalEldrichPortal = registerBlock(new BlockAdditionalEldritchPortal(), ItemBlockAdditionalEldritchPortal.class);
    blockAuraPylon = registerBlock(new BlockAuraPylon(), ItemBlockAuraPylon.class);
    blockKnowledgeBook = registerBlock(new BlockKnowledgeBook(), ItemBlockKnowledgeBook.class);
    blockEssentiaCompressor = registerBlock(new BlockEssentiaCompressor(), ItemBlockEssentiaCompressor.class);
}
 
Example #13
Source File: RegisteredRecipes.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static List[] createAuraCoreRecipes() {
    List[] recipes = new List[7];
    for(int i = 0; i < 7; i++) {
        AspectList cost = new AspectList();
        switch (i) {
            case 0: cost.add(Aspect.AIR, 84); break;
            case 1: cost.add(Aspect.FIRE, 84); break;
            case 2: cost.add(Aspect.WATER, 84); break;
            case 3: cost.add(Aspect.EARTH, 84); break;
            case 4: cost.add(Aspect.ORDER, 84); break;
            case 5: cost.add(Aspect.ENTROPY, 84); break;
            case 6: cost.add(Aspect.AIR, 14).add(Aspect.FIRE, 14).add(Aspect.WATER, 14)
                    .add(Aspect.EARTH, 14).add(Aspect.ORDER, 14).add(Aspect.ENTROPY, 14);
        }

        ItemWandCasting item = (ItemWandCasting) ConfigItems.itemWandCasting;
        ItemStack wand = new ItemStack(item);
        item.setRod(wand, ConfigItems.WAND_ROD_GREATWOOD);
        item.setCap(wand, ConfigItems.WAND_CAP_GOLD);

        recipes[i] = Arrays.asList(cost, 3, 2, 3,
                Arrays.asList(
                        null, null, null, null, wand, null, null, null, null,
                        null, null, null, null, new ItemStack(ConfigBlocks.blockCrystal, 1, i),
                        new ItemStack(RegisteredItems.itemAuraCore), null, null, null
                ));
    }
    return recipes;
}
 
Example #14
Source File: ItemCreativeNode.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private boolean placeRandomNode(World world, int x, int y, int z) {
    if(world.getBlock(x, y, z) == Blocks.air) {
        ThaumcraftWorldGenerator.createRandomNodeAt(world, x, y, z, world.rand, false, false, false);
        return world.getBlock(x, y, z) == ConfigBlocks.blockAiry;
    }
    return false;
}
 
Example #15
Source File: BlockStoneMachine.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public Item getItemDropped(int metadata, Random random, int fortune) {
    if (metadata == 11 || metadata == 15) {
        return Item.getItemFromBlock(ConfigBlocks.blockCosmeticSolid);
    }

    return super.getItemDropped(metadata, random, fortune);
}
 
Example #16
Source File: BlockKnowledgeBook.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block neighbor) {
    if(world.isRemote) return;
    Block lower = world.getBlock(x, y - 1, z);
    int metaLower = world.getBlockMetadata(x, y - 1, z);
    if(!lower.equals(ConfigBlocks.blockStoneDevice) || metaLower != 1) {
        breakThisBlock(world, x, y, z);
    }
    if(!world.isAirBlock(x, y + 1, z)) {
        breakThisBlock(world, x, y, z);
    }
}
 
Example #17
Source File: BlockLogTainted.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
public BlockLogTainted()
{
    super();
    setCreativeTab(Forbidden.tab);
    setStepSound(ConfigBlocks.blockTaint.stepSound);
    try {
        Field mat = ReflectionHelper.findField(Block.class, "blockMaterial", "field_149764_J");
        mat.set(this, Config.taintMaterial);
    } catch (Exception e){
        e.printStackTrace();
    }
    this.setHarvestLevel("axe", 0);
}
 
Example #18
Source File: BlockLeavesTainted.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
public BlockLeavesTainted()
{
    super();
    setCreativeTab(Forbidden.tab);
    setLightOpacity(0);
    setHardness(0.2F);
    setStepSound(ConfigBlocks.blockTaint.stepSound);
    try {
        Field mat = ReflectionHelper.findField(Block.class, "blockMaterial", "field_149764_J");
        mat.set(this, Config.taintMaterial);
    } catch (Exception e){
        e.printStackTrace();
    }
}
 
Example #19
Source File: FakeWorldTCGeneration.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public boolean setBlock(int x, int y, int z, Block block, int meta, int flags) {
    if(block == ConfigBlocks.blockEldritchPortal) return true;
    if(block == ConfigBlocks.blockEldritch && (meta == 1 || meta == 2 || meta == 3)) return true;

    blockCount++;

    long chKey = ((long) x >> 4) | ((long) z >> 4) << 32;
    ChunkBuffer buf = chunks.get(chKey);
    int keyX = (x & 15) << 7 << 4;
    int keyZ = (z & 15) << 7;
    int key = keyX | keyZ | y;

    if(buf.blockData[key] != null) {
        blockOverwriteCount++;
        ChunkCoordinates cc = new ChunkCoordinates(x, y, z);
        if(gettedTE.containsKey(cc)) {
            gettedTE.remove(cc);
        }
    }

    /*if(block == ConfigBlocks.blockEldritchNothing) {
        if(BlockUtils.isBlockExposed(this, x, y, z)) {
            meta = 1;
        }
    }*/

    buf.blockData[key] = block;
    buf.metaBuffer[key] = (byte) meta;
    if(block.hasTileEntity(meta)) buf.tiles.add(new Integer[] {x, y, z, key});
    return true;
}
 
Example #20
Source File: TCMazeHandler.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void handleBossFinish(TCMazeSession session) {
    CellLoc spawnChunk = session.portalCell;
    WorldServer world = MinecraftServer.getServer().worldServerForDimension(ModConfig.dimOuterId);
    int lX = (spawnChunk.x << 4) + 8;
    int lZ = (spawnChunk.z << 4) + 8;
    world.setBlock(lX, 52, lZ, ConfigBlocks.blockEldritch, 3, 3);
    world.setBlock(lX, 53, lZ, RegisteredBlocks.blockAdditionalEldrichPortal);
    GenCommon.genObelisk(world, lX, 54, lZ);
    session.player.addChatMessage(new ChatComponentText(EnumChatFormatting.ITALIC + "" + EnumChatFormatting.GRAY + StatCollector.translateToLocal("gadomancy.eldritch.portalSpawned")));
}
 
Example #21
Source File: BlockSaplingTainted.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
public BlockSaplingTainted()
{
    super();
    setCreativeTab(Forbidden.tab);
    setStepSound(ConfigBlocks.blockTaint.stepSound);
    try {
        Field mat = ReflectionHelper.findField(Block.class, "blockMaterial", "field_149764_J");
        mat.set(this, Config.taintMaterial);
    } catch (Exception e){
        e.printStackTrace();
    }
}
 
Example #22
Source File: ItemTaintShovel.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 5 votes vote down vote up
@Override
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, float par8, float par9, float par10) {
    int purified = 0;
    for(int ex = x - 5;ex < x + 6;ex++){
        for(int wy = y - 4;wy < y + 5;wy++){
            for(int zee = z - 5;zee < z + 6;zee++){
                Block target = world.getBlock(ex, wy, zee);
                if(target != null && (target == ConfigBlocks.blockFluxGoo || target == ConfigBlocks.blockFluxGas)){
                    purified++;
                    world.setBlockToAir(ex, wy, zee);
                    float d1 = ((float) ex + world.rand.nextFloat());
                    float d2 = ((float) wy + world.rand.nextFloat());
                    float d0 = ((float) zee + world.rand.nextFloat());
                    Thaumcraft.proxy.nodeBolt(world, (float)player.posX, (float)player.posY, (float)player.posZ, d1, d2, d0);
                }
            }
        }
    }
    if(purified > 0){
        itemstack.damageItem(Math.min(purified, 15), player);
        player.swingItem();
        world.playSoundEffect((double)x + 0.5D, (double)y + 0.5D, (double)z + 0.5D, "thaumcraft:wandfail", 0.2F, 0.2F + world.rand.nextFloat() * 0.2F);
        return true;
    }
    else
        return super.onItemUse(itemstack, player, world, x, y, z, side, par8, par9, par10);
}
 
Example #23
Source File: ForbiddenRecipes.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 4 votes vote down vote up
public static void addRecipes() {
    ForbiddenResearch.recipes.put("TaintShovel", ThaumcraftApi.addInfusionCraftingRecipe("TAINTSHOVEL", new ItemStack(ForbiddenItems.taintShovel), 5, (new AspectList()).add(Aspect.HEAL, 8).add(Aspect.CRYSTAL, 24).add(Aspect.MINE, 12), ItemApi.getItem("itemShovelThaumium", 0), new ItemStack[] { ItemApi.getItem("itemShard", 4), ItemApi.getItem("itemShard", 4), new ItemStack(Items.diamond), ItemApi.getBlock("blockMagicalLog", 1) }));
    ForbiddenResearch.recipes.put("TaintPick", ThaumcraftApi.addInfusionCraftingRecipe("TAINTPICK", new ItemStack(ForbiddenItems.taintPickaxe), 1, (new AspectList()).add(Aspect.ENTROPY, 8).add(Aspect.MINE, 8).add(Aspect.TAINT, 12), ItemApi.getItem("itemPickThaumium", 0), new ItemStack[] { ItemApi.getItem("itemShard", 5), ItemApi.getItem("itemShard", 5), new ItemStack(Items.diamond), ItemApi.getBlock("blockMagicalLog", 0) }));
    ForbiddenResearch.recipes.put("WandRodTainted", ThaumcraftApi.addInfusionCraftingRecipe("ROD_tainted", new ItemStack(ForbiddenItems.wandCore, 1, 0), 5, (new AspectList()).add(Aspect.TAINT, 24).add(Aspect.MAGIC, 12).add(Aspect.ENTROPY, 12), ItemApi.getItem("itemResource", 12), new ItemStack[]{ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2), new ItemStack(ForbiddenItems.deadlyShards, 1, 2)}));
    ForbiddenResearch.recipes.put("TaintTree", ThaumcraftApi.addCrucibleRecipe("TAINTTREE", new ItemStack(ForbiddenBlocks.taintSapling, 1, 0), new ItemStack(Blocks.sapling, 1, 0), (new AspectList()).merge(Aspect.TAINT, 10).add(Aspect.POISON, 4)));
    ForbiddenResearch.recipes.put("TaintPlank", CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenBlocks.taintPlanks, 4, 0), new Object[]{"#", Character.valueOf('#'), new ItemStack(ForbiddenBlocks.taintLog, 1, 0)}));
    GameRegistry.addSmelting(ForbiddenBlocks.taintLog, new ItemStack(ForbiddenItems.taintCoal, 1), 0.15F);
    OreDictionary.registerOre("resourceTaint", new ItemStack(ConfigItems.itemResource, 1, 11));
    OreDictionary.registerOre("resourceTaint", new ItemStack(ForbiddenItems.deadlyShards, 1, 2));
    ForbiddenResearch.recipes.put("TaintStone", ThaumcraftApi.addArcaneCraftingRecipe("TAINTSTONE", new ItemStack(ForbiddenBlocks.taintStone, 9, 0), (new AspectList()).add(Aspect.ENTROPY, 2).add(Aspect.ORDER, 1), new Object[]{"SSS", "SXS", "SSS", Character.valueOf('S'), new ItemStack(Blocks.stone, 1), Character.valueOf('X'), "resourceTaint"}));
    ForbiddenResearch.recipes.put("TaintBrick", CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenBlocks.taintStone, 4, 1), new Object[] { "##", "##", Character.valueOf('#'), new ItemStack(ForbiddenBlocks.taintStone, 1, 0) }));

    ForbiddenResearch.recipes.put("SkullAxe", ThaumcraftApi.addInfusionCraftingRecipe("SKULLAXE", new ItemStack(ForbiddenItems.skullAxe), 1, (new AspectList()).add(DarkAspects.WRATH, 8).add(Aspect.WEAPON, 8).add(DarkAspects.NETHER, 8), ItemApi.getItem("itemAxeThaumium", 0), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(Items.diamond), new ItemStack(Items.skull, 1, 1) }));
    if(!Config.noLust)
        ForbiddenResearch.recipes.put("SubCollar", ThaumcraftApi.addInfusionCraftingRecipe("SUBCOLLAR", new ItemStack(ForbiddenItems.subCollar), 1, (new AspectList()).add(DarkAspects.LUST, 8).add(Aspect.TRAP, 8).add(DarkAspects.NETHER, 4).add(Aspect.FLESH, 4), new ItemStack(ConfigItems.itemAmuletVis, 1, 1), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 4), new ItemStack(ForbiddenItems.deadlyShards, 1, 4), new ItemStack(ForbiddenItems.deadlyShards, 1, 4), new ItemStack(Items.lead, 1), new ItemStack(ConfigItems.itemBaubleBlanks, 1, 2) }));
    if(Config.gluttony == 0) {
        ForbiddenResearch.recipes.put("ArcaneCake", ThaumcraftApi.addInfusionCraftingRecipe("ARCANECAKE", new ItemStack(ForbiddenItems.arcaneCakeItem), 3, (new AspectList()).add(DarkAspects.GLUTTONY, 12).add(Aspect.HUNGER, 24).add(Aspect.CRAFT, 24), new ItemStack(Items.cake), new ItemStack[]{ItemApi.getItem("itemResource", 14), new ItemStack(Items.egg), new ItemStack(Items.milk_bucket), new ItemStack(Items.egg), new ItemStack(ForbiddenItems.gluttonyShard), new ItemStack(ForbiddenItems.gluttonyShard)}));
        ForbiddenResearch.recipes.put("RingFood", ThaumcraftApi.addArcaneCraftingRecipe("RINGFOOD", new ItemStack(ForbiddenItems.ringFood), (new AspectList()).add(Aspect.ENTROPY, 10).add(Aspect.WATER, 20).add(Aspect.EARTH, 20), new Object[]{" D ", "SXS", " S ", Character.valueOf('S'), new ItemStack(ForbiddenItems.gluttonyShard, 1), Character.valueOf('X'), new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), Character.valueOf('D'), new ItemStack(Items.diamond)}));
    }
    else if(Config.gluttony == 2){
        ForbiddenResearch.recipes.put("ArcaneCake", ThaumcraftApi.addInfusionCraftingRecipe("ARCANECAKE", new ItemStack(ForbiddenItems.arcaneCakeItem), 3, (new AspectList()).add(DarkAspects.GLUTTONY, 12).add(Aspect.HUNGER, 24).add(Aspect.CRAFT, 24), new ItemStack(Items.cake), new ItemStack[]{ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenBlocks.starBlock), new ItemStack(ForbiddenBlocks.starBlock), new ItemStack(Items.egg), new ItemStack(ForbiddenItems.gluttonyShard), new ItemStack(ForbiddenItems.gluttonyShard)}));
        ForbiddenResearch.recipes.put("RingFood", ThaumcraftApi.addArcaneCraftingRecipe("RINGFOOD", new ItemStack(ForbiddenItems.ringFood), (new AspectList()).add(Aspect.ENTROPY, 10).add(Aspect.WATER, 20).add(Aspect.EARTH, 20), new Object[]{" D ", "SXS", " S ", Character.valueOf('S'), new ItemStack(ForbiddenItems.gluttonyShard, 1), Character.valueOf('X'), new ItemStack(ConfigItems.itemBaubleBlanks, 1, 1), Character.valueOf('D'), new ItemStack(ForbiddenBlocks.starBlock)}));
    }
    ForbiddenResearch.recipes.put("FocusBlink", ThaumcraftApi.addInfusionCraftingRecipe("FOCUSBLINK", new ItemStack(ForbiddenItems.blinkFocus), 3, (new AspectList()).add(Aspect.TRAVEL, 25).add(DarkAspects.NETHER, 10).add(DarkAspects.SLOTH, 10).add(Aspect.ENTROPY, 25), new ItemStack(Items.ender_pearl), new ItemStack[]{new ItemStack(Items.quartz), new ItemStack(ForbiddenItems.deadlyShards, 1, 5), new ItemStack(Items.quartz), new ItemStack(ForbiddenItems.deadlyShards, 1, 5), new ItemStack(Items.quartz), new ItemStack(ForbiddenItems.deadlyShards, 1, 5)}));
    ForbiddenResearch.recipes.put("MorphPick", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphPickaxe), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.TOOL, 16), ItemApi.getItem("itemPickThaumium", 0), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(Items.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1) }));
    ForbiddenResearch.recipes.put("MorphSword", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphSword), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.WEAPON, 16), ItemApi.getItem("itemSwordThaumium", 0), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(Items.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1) }));
    ForbiddenResearch.recipes.put("MorphShovel", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphShovel), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.TOOL, 16), ItemApi.getItem("itemShovelThaumium", 0), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(Items.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1) }));
    ForbiddenResearch.recipes.put("MorphAxe", ThaumcraftApi.addInfusionCraftingRecipe("MORPHTOOLS", new ItemStack(ForbiddenItems.morphAxe), 6, (new AspectList()).add(Aspect.EXCHANGE, 32).add(DarkAspects.ENVY, 16).add(Aspect.TOOL, 16), ItemApi.getItem("itemAxeThaumium", 0), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(Items.diamond), ItemApi.getItem("itemResource", 3), ItemApi.getBlock("blockMagicalLog", 1) }));
    ForbiddenResearch.recipes.put("WandRodInfernal", ThaumcraftApi.addInfusionCraftingRecipe("ROD_infernal", new ItemStack(ForbiddenItems.wandCore, 1, 1), 5, (new AspectList()).add(DarkAspects.NETHER, 32).add(Aspect.MAGIC, 12).add(DarkAspects.PRIDE, 12), new ItemStack(Items.blaze_rod), new ItemStack[] { ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenItems.deadlyShards, 1, 3), new ItemStack(ForbiddenItems.deadlyShards, 1, 3), new ItemStack(Blocks.soul_sand), new ItemStack(Items.skull, 1, 1), new ItemStack(Items.quartz), new ItemStack(Items.blaze_powder) }));
    if (Config.wrathCage) {
        ForbiddenResearch.recipes.put("WrathCage", ThaumcraftApi.addInfusionCraftingRecipe("WRATHCAGE", new ItemStack(ForbiddenBlocks.wrathCage, 1, 0), 10, (new AspectList()).add(DarkAspects.WRATH, 32).add(Aspect.MAGIC, 32).add(Aspect.BEAST, 32).add(Aspect.MECHANISM, 16), ItemApi.getBlock("blockCosmeticSolid", 4), new ItemStack[] { new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(Items.diamond, 1, 0), new ItemStack(Items.diamond, 1, 0), new ItemStack(Items.diamond, 1, 0), new ItemStack(Items.diamond, 1, 0), ItemApi.getBlock("blockJar", 0), ItemApi.getBlock("blockJar", 0), ItemApi.getBlock("blockJar", 0) }));
        ForbiddenResearch.recipes.put("MobCrystal", ThaumcraftApi.addCrucibleRecipe("WRATHCAGE", new ItemStack(ForbiddenItems.mobCrystal, 1, 0), new ItemStack(Items.diamond, 1), (new AspectList()).merge(Aspect.MIND, 10).merge(Aspect.ENERGY, 10)));
    }

    ForbiddenResearch.recipes.put("Fork", ThaumcraftApi.addInfusionCraftingRecipe("FORK", new ItemStack(ForbiddenItems.fork, 1, 0), 1, (new AspectList()).add(DarkAspects.NETHER, 8).add(Aspect.MECHANISM, 8).add(Aspect.ENERGY, 8), ItemApi.getItem("itemSwordThaumium", 0), new ItemStack[] { new ItemStack(Items.quartz), new ItemStack(Items.quartz), new ItemStack(Items.quartz), new ItemStack(Items.redstone) }));

    if (Config.emeraldTrans)
        ForbiddenResearch.recipes.put("TransEmerald", ThaumcraftApi.addCrucibleRecipe("TRANSEMERALD", new ItemStack(ForbiddenItems.resource, 4, 0), "nuggetEmerald", (new AspectList()).merge(Aspect.CRYSTAL, 2).merge(Aspect.GREED, 2)));
    ForbiddenResearch.recipes.put("BlackFlower", ThaumcraftApi.addCrucibleRecipe("BLACKFLOWER", new ItemStack(ForbiddenBlocks.roseBush, 1, 0), new ItemStack(Blocks.double_plant, 1, 4), (new AspectList()).merge(Aspect.DARKNESS, 8).merge(Aspect.LIFE, 5)));
    ForbiddenResearch.recipes.put("BlackInk", CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenItems.resource, 2, 1), new Object[]{"#", Character.valueOf('#'), new ItemStack(ForbiddenBlocks.blackFlower, 1, 0)}));

    if(thaumcraft.common.config.Config.researchDifficulty != -1)
        ForbiddenResearch.recipes.put("Crystalwell", ThaumcraftApi.addShapelessArcaneCraftingRecipe("CRYSTALWELL", new ItemStack(ForbiddenItems.crystalwell, 1, 0), (new AspectList()).add(Aspect.WATER, 1).add(Aspect.ORDER, 1), new Object[] { new ItemStack(ConfigItems.itemInkwell, 1, 32767), "dyeBlack", new ItemStack(ConfigItems.itemShard, 1, 32767), new ItemStack(ConfigItems.itemShard, 1, 32767) }));
    else
        ForbiddenResearch.recipes.put("Crystalwell", ThaumcraftApi.addShapelessArcaneCraftingRecipe("CRYSTALWELL", new ItemStack(ForbiddenItems.crystalwell, 1, 0), (new AspectList()).add(Aspect.WATER, 1).add(Aspect.ORDER, 1), new Object[] { new ItemStack(ConfigItems.itemInkwell, 1, 32767), "dyeBlack", new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemShard, 1, 6) }));

    ForbiddenResearch.recipes.put("Primewell", ThaumcraftApi.addShapelessArcaneCraftingRecipe("PRIMEWELL", new ItemStack(ForbiddenItems.primewell, 1, 0), (new AspectList()).add(Aspect.WATER, 50).add(Aspect.EARTH, 50).add(Aspect.FIRE, 50).add(Aspect.AIR, 50).add(Aspect.ORDER, 50).add(Aspect.ENTROPY, 50), new Object[] { new ItemStack(Items.feather, 1, 0), new ItemStack(ConfigItems.itemEldritchObject, 1, 3), new ItemStack(Items.glass_bottle, 1, 0) }));

    if(Config.enchanting) {
        if (Config.greedyEnch)
            ForbiddenResearch.recipes.put("Greedy", ThaumcraftApi.addInfusionEnchantmentRecipe("GREEDY", DarkEnchantments.greedy, 4, (new AspectList()).add(DarkAspects.NETHER, 16).add(Aspect.WEAPON, 8).add(Aspect.GREED, 16), new ItemStack[]{new ItemStack(Items.golden_sword), new ItemStack(Items.diamond), new ItemStack(ForbiddenItems.deadlyShards, 1, 6), new ItemStack(ForbiddenItems.deadlyShards, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 14)}));
        ForbiddenResearch.recipes.put("Consuming", ThaumcraftApi.addInfusionEnchantmentRecipe("CONSUMING", DarkEnchantments.consuming, 3, (new AspectList()).add(Aspect.VOID, 8).add(Aspect.TOOL, 8).add(Aspect.HUNGER, 8), new ItemStack[]{new ItemStack(Items.iron_pickaxe), new ItemStack(Items.lava_bucket), ItemApi.getItem("itemResource", 14)}));
        ForbiddenResearch.recipes.put("Wrath", ThaumcraftApi.addInfusionEnchantmentRecipe("WRATH", DarkEnchantments.wrath, 8, (new AspectList()).add(DarkAspects.WRATH, 16).add(Aspect.WEAPON, 16).add(DarkAspects.NETHER, 8), new ItemStack[]{ItemApi.getItem("itemResource", 14), new ItemStack(Items.diamond_sword, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0), new ItemStack(ForbiddenItems.deadlyShards, 1, 0)}));
        ForbiddenResearch.recipes.put("Educational", ThaumcraftApi.addInfusionEnchantmentRecipe("EDUCATIONAL", DarkEnchantments.educational, 3, (new AspectList()).add(Aspect.MAGIC, 4).add(Aspect.WEAPON, 4).add(Aspect.MIND, 8), new ItemStack[]{ItemApi.getItem("itemZombieBrain", 0), new ItemStack(Items.book), ItemApi.getItem("itemResource", 14)}));
        ForbiddenResearch.recipes.put("Corrupting", ThaumcraftApi.addInfusionEnchantmentRecipe("CORRUPTING", DarkEnchantments.corrupting, 4, (new AspectList()).add(DarkAspects.NETHER, 16).add(Aspect.EXCHANGE, 16).add(Aspect.CRYSTAL, 8), new ItemStack[]{new ItemStack(Items.nether_wart), new ItemStack(Blocks.soul_sand), ItemApi.getItem("itemResource", 14)}));

        ForbiddenResearch.recipes.put("Cluster", ThaumcraftApi.addInfusionEnchantmentRecipe("CLUSTER", DarkEnchantments.cluster, 3, (new AspectList()).add(Aspect.FIRE, 4).add(Aspect.METAL, 4).add(Aspect.GREED, 4), new ItemStack[]{ItemApi.getItem("itemPickElemental", 0), ItemApi.getItem("itemResource", 14)}));
        ForbiddenResearch.recipes.put("Impact", ThaumcraftApi.addInfusionEnchantmentRecipe("IMPACT", DarkEnchantments.impact, 4, (new AspectList()).add(Aspect.ENTROPY, 16).add(Aspect.MINE, 16), new ItemStack[]{ItemApi.getItem("itemResource", 14), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ConfigItems.itemShovelElemental, 1, 0)}));
        ForbiddenResearch.recipes.put("Voidtouched", ThaumcraftApi.addInfusionEnchantmentRecipe("VOIDTOUCHED", DarkEnchantments.voidtouched, 8, (new AspectList()).add(Aspect.VOID, 16).add(Aspect.DARKNESS, 16).add(DarkAspects.ENVY, 24).add(Aspect.ELDRITCH, 16), new ItemStack[]{ItemApi.getItem("itemResource", 14), ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), ItemApi.getItem("itemResource", 16), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1), new ItemStack(ForbiddenItems.deadlyShards, 1, 1)}));
    }

    CraftingManager.getInstance().addRecipe(new ItemStack(Items.emerald, 1, 0), new Object[] { "###", "###", "###", Character.valueOf('#'), new ItemStack(ForbiddenItems.resource, 1, 0) });
    CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenItems.resource, 9, 0), new Object[] { "#", Character.valueOf('#'), new ItemStack(Items.emerald, 1, 0) });
    CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenBlocks.starBlock, 1, 0), new Object[] { "###", "###", "###", Character.valueOf('#'), new ItemStack(Items.nether_star, 1, 0) });
    CraftingManager.getInstance().addRecipe(new ItemStack(Items.nether_star, 9, 0), new Object[]{"#", Character.valueOf('#'), new ItemStack(ForbiddenBlocks.starBlock, 1, 0)});
    ForbiddenResearch.recipes.put("RidingCrop", CraftingManager.getInstance().addRecipe(new ItemStack(ForbiddenItems.ridingCrop, 1, 0), new Object[]{"X", "#", "#", Character.valueOf('#'), Items.stick, Character.valueOf('X'), Items.leather}));
    ThaumcraftApi.addSmeltingBonus(new ItemStack(Items.emerald), new ItemStack(ForbiddenItems.resource, 0, 0));

    GameRegistry.registerFuelHandler(new IFuelHandler() {
        Random randy = new Random();
        @Override
        public int getBurnTime(ItemStack fuel) {

            if(fuel.getItem() == ForbiddenItems.taintCoal) {
                return 1 + randy.nextInt(2400);
            }
            return 0;
        }
    });

    OreDictionary.registerOre("logWood", new ItemStack(ConfigBlocks.blockMagicalLog, 1, OreDictionary.WILDCARD_VALUE));

}
 
Example #24
Source File: ItemCreativeNode.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public String getUnlocalizedNameInefficiently(ItemStack stack) {
    return Item.getItemFromBlock(ConfigBlocks.blockAiry).getUnlocalizedName(new ItemStack(ConfigBlocks.blockAiry, 1, 0));
}
 
Example #25
Source File: TileEssentiaCompressor.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void consumeElements() {
    if(coordPedestal != null) {
        if(!checkPedestal(coordPedestal)) {
            consumeTick = 0;
            coordPedestal = null;
            return;
        }
        consumeTick++;
        if(consumeTick <= 400) {
            PacketAnimationAbsorb absorb = new PacketAnimationAbsorb(
                    xCoord, yCoord + 1, zCoord,
                    coordPedestal.getBlockX(), coordPedestal.getBlockY() + 1, coordPedestal.getBlockZ(),
                    5, Block.getIdFromBlock(ConfigBlocks.blockCosmeticSolid), 1);
            makeo.gadomancy.common.network.PacketHandler.INSTANCE.sendToAllAround(absorb, new NetworkRegistry.TargetPoint(
                    getWorldObj().provider.dimensionId,
                    xCoord, yCoord, zCoord, 16));
        } else {
            TilePedestal te = (TilePedestal) worldObj.getTileEntity(
                    coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
            te.setInventorySlotContents(0, null);
            te.markDirty();
            worldObj.markBlockForUpdate(
                    coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ());
            consumeTick = 0;
            coordPedestal = null;
            incSize += 1;
            worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
            markDirty();
        }
    } else {
        for (int xx = -3; xx <= 3; xx++) {
            for (int zz = -3; zz <= 3; zz++) {
                Vector3 offset = new Vector3(xCoord + xx, yCoord, zCoord + zz);
                if(checkPedestal(offset)) {
                    this.coordPedestal = offset;
                    this.consumeTick = 0;
                    return;
                }
            }
        }
        this.coordPedestal = null;
        this.consumeTick = 0;
    }
}
 
Example #26
Source File: SubTileTainthistle.java    From ForbiddenMagic with Do What The F*ck You Want To Public License 4 votes vote down vote up
public boolean isFlux(int x, int y, int z){
    Block target = supertile.getWorldObj().getBlock(x, y, z);
    return target == ConfigBlocks.blockFluxGas || target == ConfigBlocks.blockFluxGoo;
}
 
Example #27
Source File: EventHandlerWorld.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@SubscribeEvent
public void on(TickEvent.WorldTickEvent event) {
    if(event.phase == TickEvent.Phase.START && !event.world.isRemote && event.world.getTotalWorldTime() % 10 == 0) {

        Iterator<Map.Entry<EntityItem, Long>> iterator = trackedItems.entrySet().iterator();
        while(iterator.hasNext()) {
            Map.Entry<EntityItem, Long> entry = iterator.next();
            EntityItem entity = entry.getKey();

            if(event.world == entity.worldObj) {
                if(entity.isDead || !isDisguised(entity.getEntityItem())) {
                    iterator.remove();
                    continue;
                }

                int x = MathHelper.floor_double(entity.posX);
                int y = MathHelper.floor_double(entity.posY);
                int z = MathHelper.floor_double(entity.posZ);

                if(entity.delayBeforeCanPickup <= 0 && entity.worldObj.getTotalWorldTime() - entry.getValue() > 0) {
                    if(ConfigBlocks.blockFluidPure == event.world.getBlock(x, y, z)
                            && event.world.getBlockMetadata(x, y, z) == 0) {
                        NBTTagCompound compound = NBTHelper.getPersistentData(entity.getEntityItem());
                        NBTBase base = compound.getTag("disguise");
                        if(base instanceof NBTTagCompound) {
                            ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) base);
                            EntityItem newEntity = new EntityItem(event.world, entity.posX, entity.posY, entity.posZ, stack);
                            ItemUtils.applyRandomDropOffset(newEntity, event.world.rand);
                            event.world.spawnEntityInWorld(newEntity);
                        }
                        compound.removeTag("disguise");
                        if(compound.hasNoTags()) {
                            NBTHelper.removePersistentData(entity.getEntityItem());
                            if(entity.getEntityItem().getTagCompound().hasNoTags()) {
                                entity.getEntityItem().setTagCompound(null);
                            }
                        }
                        event.world.setBlockToAir(x, y, z);
                    }
                } else {
                    Gadomancy.proxy.spawnBubbles(event.world, (float)entity.posX, (float)entity.posY, (float)entity.posZ, 0.2f);
                }
            }
        }
    }
}
 
Example #28
Source File: RegisteredBlocks.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
private static void registerDefaultClawBehaviors() {
    registerClawClickBehavior(new ClickBehavior() {
        @Override
        public boolean isValidForBlock() {
            return (block == Blocks.bookshelf && metadata == 0)
                    || (block == Blocks.cauldron && metadata == 0);
        }
    });

    registerClawClickBehavior(new ClickBehavior(true) {
        private TileInfusionMatrix matrix;

        @Override
        public boolean isValidForBlock() {
            if(block == ConfigBlocks.blockStoneDevice && metadata == 2) {
                matrix = (TileInfusionMatrix) world.getTileEntity(x, y, z);
                return true;
            }
            return false;
        }

        @Override
        public void addInstability(int instability) {
            matrix.instability += instability;
        }

        @Override
        public int getComparatorOutput() {
            return matrix.crafting ? 15 : 0;
        }
    });

    /*registerClawClickBehavior(new ClickBehavior(true) {
        @Override
        public boolean isValidForBlock() {
            return block.equals(ConfigBlocks.blockCrystal) && metadata <= 6;
        }

        @Override
        public AspectList getVisCost() {
            return RegisteredRecipes.costsAuraCoreStart;
        }
    });*/
}
 
Example #29
Source File: RegisteredBlocks.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
private static void registerDefaultStickyJars() {
    registerStickyJar(ConfigBlocks.blockJar, 0, true, true);
    registerStickyJar(ConfigBlocks.blockJar, 3, true, true);

    registerStickyJar(RegisteredBlocks.blockRemoteJar, 0, false, false);
}
 
Example #30
Source File: ClientProxy.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public void initalize() {
    super.initalize();

    injectGolemTextures();

    //Tiles
    ClientRegistry.bindTileEntitySpecialRenderer(TileStickyJar.class, new RenderTileStickyJar());

    RenderTileRemoteJar renderTileRemoteJar = new RenderTileRemoteJar();
    ClientRegistry.bindTileEntitySpecialRenderer(TileRemoteJar.class, renderTileRemoteJar);

    RenderTileArcaneDropper renderTileArcaneDropper = new RenderTileArcaneDropper();
    ClientRegistry.bindTileEntitySpecialRenderer(TileArcaneDropper.class, renderTileArcaneDropper);

    RenderTileInfusionClaw renderTileInfusionClaw = new RenderTileInfusionClaw();
    ClientRegistry.bindTileEntitySpecialRenderer(TileInfusionClaw.class, renderTileInfusionClaw);

    RenderTileExtendedNode nodeRenderer = new RenderTileExtendedNode();
    ClientRegistry.bindTileEntitySpecialRenderer(TileExtendedNode.class, nodeRenderer);

    RenderTileExtendedNodeJar nodeJarRenderer = new RenderTileExtendedNodeJar();
    ClientRegistry.bindTileEntitySpecialRenderer(TileExtendedNodeJar.class, nodeJarRenderer);

    ClientRegistry.bindTileEntitySpecialRenderer(TileNodeManipulator.class, new RenderTileNodeManipulator());

    ClientRegistry.bindTileEntitySpecialRenderer(TileManipulatorPillar.class, new RenderTileManipulatorPillar());
    RenderTileManipulationFocus renderTileManipulationFocus = new RenderTileManipulationFocus();
    ClientRegistry.bindTileEntitySpecialRenderer(TileManipulationFocus.class, renderTileManipulationFocus);

    ClientRegistry.bindTileEntitySpecialRenderer(TileAdditionalEldritchPortal.class, new TileEldritchPortalRenderer());

    ClientRegistry.bindTileEntitySpecialRenderer(TileEldritchObelisk.class, new RenderTileObelisk());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEldritchAltar.class, new RenderTileCapEldritch("textures/models/obelisk_cap_altar.png"));
    ClientRegistry.bindTileEntitySpecialRenderer(TileEldritchCap.class, new RenderTileCapEldritch("textures/models/obelisk_cap.png"));
    RenderTileEssentiaCompressor renderTileEssentiaCompressor = new RenderTileEssentiaCompressor();
    ClientRegistry.bindTileEntitySpecialRenderer(TileEssentiaCompressor.class, renderTileEssentiaCompressor);

    //ClientRegistry.bindTileEntitySpecialRenderer(TileAIShutdown.class, new RenderTileAIShutdown());

    RenderTileAuraPylon renderTileAuraPylon = new RenderTileAuraPylon();
    ClientRegistry.bindTileEntitySpecialRenderer(TileAuraPylon.class, renderTileAuraPylon);
    ClientRegistry.bindTileEntitySpecialRenderer(TileAuraPylonTop.class, renderTileAuraPylon);

    RenderTileBlockProtector renderTileBlockProtector = new RenderTileBlockProtector();
    ClientRegistry.bindTileEntitySpecialRenderer(TileBlockProtector.class, renderTileBlockProtector);

    RenderTileArcanePackager renderTileArcanePackager = new RenderTileArcanePackager();
    ClientRegistry.bindTileEntitySpecialRenderer(TileArcanePackager.class, renderTileArcanePackager);

    RenderTileKnowledgeBook bookRender = new RenderTileKnowledgeBook();
    ClientRegistry.bindTileEntitySpecialRenderer(TileKnowledgeBook.class, bookRender);

    //Items
    TileArcaneDropper fakeTile = new TileArcaneDropper();
    fakeTile.blockMetadata = 8 | ForgeDirection.SOUTH.ordinal();
    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockArcaneDropper), new ItemRenderTileEntity<TileArcaneDropper>(renderTileArcaneDropper, fakeTile));

    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockInfusionClaw), new ItemRenderTileEntity<TileInfusionClaw>(renderTileInfusionClaw, new TileInfusionClaw()));

    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockEssentiaCompressor), new ItemRenderTileEntity<TileEssentiaCompressor>(renderTileEssentiaCompressor, new TileEssentiaCompressor()));

    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ConfigBlocks.blockAiry), new ItemExNodeRenderer());

    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockKnowledgeBook), new ItemRenderTEKnowledgeBook(bookRender));

    ItemRenderTileEntityMulti multi = new ItemRenderTileEntityMulti(new ItemRenderTileEntityMulti.RenderSet(renderTileAuraPylon, new TileAuraPylon(), 0),
           new ItemRenderTileEntityMulti.RenderSet(renderTileAuraPylon, new TileAuraPylonTop(), 1));
    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockAuraPylon), multi);

    MinecraftForgeClient.registerItemRenderer(RegisteredItems.itemExtendedNodeJar, new ItemJarExtendedNodeRenderer());
    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockRemoteJar), new ItemRenderRemoteJar(renderTileRemoteJar));

    ItemRenderStoneMachine itemRenderStoneMachine = new ItemRenderStoneMachine();
    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine), itemRenderStoneMachine);
    itemRenderStoneMachine.registerRenderer(0, new TileManipulationFocus(), renderTileManipulationFocus);
    TileManipulationFocus tileManipulationFocus = new TileManipulationFocus();
    tileManipulationFocus.blockMetadata = 3;
    itemRenderStoneMachine.registerRenderer(3, tileManipulationFocus, renderTileManipulationFocus);
    TileBlockProtector tileBlockProtector = new TileBlockProtector();
    tileBlockProtector.facing = 3;
    itemRenderStoneMachine.registerRenderer(2, tileBlockProtector, renderTileBlockProtector);
    itemRenderStoneMachine.registerRenderer(4, new TileArcanePackager(), renderTileArcanePackager);

    MinecraftForgeClient.registerItemRenderer(RegisteredItems.itemEtherealFamiliar, new ItemRenderFamiliar());
    MinecraftForgeClient.registerItemRenderer(RegisteredItems.itemCreativeNode, new ItemCreativeNodeRenderer());

    //Entities
    RenderingRegistry.registerEntityRenderingHandler(EntityPermNoClipItem.class, new RenderSpecialItem());
    RenderingRegistry.registerEntityRenderingHandler(EntityAuraCore.class, new RenderEntityAuraCore());

    //Blocks
    RegisteredBlocks.rendererTransparentBlock = registerBlockRenderer(new RenderBlockTransparent());
    RegisteredBlocks.rendererExtendedNodeJarBlock = registerBlockRenderer(new BlockExtendedNodeJarRenderer());
    RegisteredBlocks.rendererBlockStoneMachine = registerBlockRenderer(new RenderBlockStoneMachine());
}