Search in sources :

Example 1 with Explosives

use of icbm.classic.content.explosive.Explosives in project ICBM-Classic by BuiltBrokenModding.

the class ICBMClassic method loadRecipes.

@Override
public void loadRecipes(ModManager manager) {
    /** LOAD. */
    ArrayList dustCharcoal = OreDictionary.getOres("dustCharcoal");
    ArrayList dustCoal = OreDictionary.getOres("dustCoal");
    // Sulfur
    //GameRegistry.addSmelting(blockSulfurOre, new ItemStack(itemSulfurDust, 4), 0.8f);
    GameRegistry.addSmelting(Items.reeds, new ItemStack(itemSulfurDust, 4, 1), 0f);
    GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 2), "dustSulfur", "dustSaltpeter", Items.coal));
    GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 2), "dustSulfur", "dustSaltpeter", new ItemStack(Items.coal, 1, 1)));
    if (dustCharcoal != null && dustCharcoal.size() > 0) {
        GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 2), "dustSulfur", "dustSaltpeter", "dustCharcoal"));
    }
    if (dustCoal != null && dustCoal.size() > 0) {
        GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 2), "dustSulfur", "dustSaltpeter", "dustCoal"));
    }
    GameRegistry.addRecipe(new ShapedOreRecipe(Blocks.tnt, "@@@", "@R@", "@@@", '@', Items.gunpowder, 'R', Items.redstone));
    // Poison Powder
    GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(itemPoisonPowder, 3), Items.spider_eye, Items.rotten_flesh));
    // Glass Pressure Plate
    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockGlassPlate, 1, 0), "##", '#', Blocks.glass));
    // Glass Button
    GameRegistry.addRecipe(new ItemStack(blockGlassButton, 2), "G", "G", 'G', Blocks.glass);
    // Proximity Detector
    GameRegistry.addRecipe(new ShapedOreRecipe(blockProximityDetector, "SSS", "S?S", "SSS", 'S', Items.iron_ingot, '?', itemTracker));
    // Signal Disrupter
    GameRegistry.addRecipe(new ShapedOreRecipe(itemSignalDisrupter, "WWW", "SCS", "SSS", 'S', Items.iron_ingot, 'C', UniversalRecipe.CIRCUIT_T1.get(), 'W', UniversalRecipe.WIRE.get()));
    // Antidote
    OreDictionary.registerOre("seeds", Items.wheat_seeds);
    OreDictionary.registerOre("seeds", Items.pumpkin_seeds);
    OreDictionary.registerOre("seeds", Items.melon_seeds);
    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemAntidote, 6), "@@@", "@@@", "@@@", '@', "seeds"));
    // Reinforced rails
    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockCombatRail, 16, 0), new Object[] { "C C", "CIC", "C C", 'I', new ItemStack(blockConcrete, 1, 0), 'C', Items.iron_ingot }));
    // Reinforced Glass
    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(blockReinforcedGlass, 8), new Object[] { "IGI", "GIG", "IGI", 'G', Blocks.glass, 'I', Items.iron_ingot }));
    // Rocket Launcher
    GameRegistry.addRecipe(new ShapedOreRecipe(itemRocketLauncher, "SCR", "SB ", 'R', itemRadarGun, 'C', new ItemStack(blockCruiseLauncher), 'B', Blocks.stone_button, 'S', UniversalRecipe.PRIMARY_METAL.get()));
    // Radar Gun
    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemRadarGun), "@#!", " $!", "  !", '@', Blocks.glass, '!', UniversalRecipe.PRIMARY_METAL.get(), '#', UniversalRecipe.CIRCUIT_T1.get(), '$', Blocks.stone_button));
    // Remote
    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemRemoteDetonator), "?@@", "@#$", "@@@", '@', UniversalRecipe.PRIMARY_METAL.get(), '?', Items.redstone, '#', UniversalRecipe.CIRCUIT_T2.get(), '$', Blocks.stone_button));
    // Laser Designator
    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemLaserDesignator), "!  ", " ? ", "  @", '@', itemRemoteDetonator, '?', UniversalRecipe.CIRCUIT_T3.get(), '!', itemRadarGun));
    // Defuser
    GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(itemDefuser), "I  ", " W ", "  C", 'C', UniversalRecipe.CIRCUIT_T2.get(), 'W', UniversalRecipe.WRENCH.get(), 'I', UniversalRecipe.WIRE.get()));
    // Missile module
    GameRegistry.addRecipe(new ShapedOreRecipe(Explosives.MISSILE.getItemStack(), " @ ", "@#@", "@?@", '@', UniversalRecipe.PRIMARY_METAL.get(), '?', Items.flint_and_steel, '#', UniversalRecipe.CIRCUIT_T1.get()));
    // Homing
    GameRegistry.addRecipe(new ShapedOreRecipe(Explosives.MISSILE_HOMING.getItemStack(), " B ", " C ", "BMB", 'M', Explosives.MISSILE.getItemStack(), 'C', UniversalRecipe.CIRCUIT_T1.get(), 'B', UniversalRecipe.SECONDARY_METAL.get()));
    // Anti-ballistic
    GameRegistry.addRecipe(new ShapedOreRecipe(Explosives.MISSILE_ANTI.getItemStack(), "!", "?", "@", '@', Explosives.MISSILE.getItemStack(), '?', new ItemStack(blockExplosive, 1, 0), '!', UniversalRecipe.CIRCUIT_T1.get()));
    // Cluster
    GameRegistry.addRecipe(new ShapedOreRecipe(Explosives.MISSILE_CLUSTER.getItemStack(), " ! ", " ? ", "!@!", '@', Explosives.MISSILE.getItemStack(), '?', Explosives.FRAGMENTATION.getItemStack(), '!', new ItemStack(itemMissile, 1, 0)));
    // Nuclear Cluster
    GameRegistry.addRecipe(new ShapedOreRecipe(Explosives.MISSILE_CLUSTER_NUKE.getItemStack(), " N ", "NCN", 'C', Explosives.MISSILE_CLUSTER.getItemStack(), 'N', Explosives.NUCLEAR.getItemStack()));
    for (Explosives ex : Explosives.values()) {
        Explosive explosive = ex.handler;
        explosive.init();
        if (!(explosive instanceof Missile)) {
            // Missile
            RecipeUtility.addRecipe(new ShapelessOreRecipe(new ItemStack(itemMissile, 1, ex.ordinal()), Explosives.MISSILE.getItemStack(), new ItemStack(blockExplosive, 1, ex.ordinal())), explosive.getUnlocalizedName() + " Missile", getConfig(), true);
            if (explosive.getTier() < 2) {
                // Grenade
                RecipeUtility.addRecipe(new ShapedOreRecipe(new ItemStack(itemGrenade, 1, ex.ordinal()), "?", "@", '@', new ItemStack(blockExplosive, 1, ex.ordinal()), '?', Items.string), explosive.getUnlocalizedName() + " Grenade", getConfig(), true);
            }
            if (explosive.getTier() < 3) {
                // Minecart
                RecipeUtility.addRecipe(new ShapedOreRecipe(new ItemStack(itemBombCart, 1, ex.ordinal()), "?", "@", '?', new ItemStack(blockExplosive, 1, ex.ordinal()), '@', Items.minecart), explosive.getUnlocalizedName() + " Minecart", getConfig(), true);
            }
        }
    }
}
Also used : Missile(icbm.classic.content.explosive.ex.missiles.Missile) Explosive(icbm.classic.content.explosive.Explosive) BlockExplosive(icbm.classic.content.explosive.tile.BlockExplosive) ItemBlockExplosive(icbm.classic.content.explosive.tile.ItemBlockExplosive) ShapedOreRecipe(net.minecraftforge.oredict.ShapedOreRecipe) ArrayList(java.util.ArrayList) ShapelessOreRecipe(net.minecraftforge.oredict.ShapelessOreRecipe) Explosives(icbm.classic.content.explosive.Explosives) ItemStack(net.minecraft.item.ItemStack)

Example 2 with Explosives

use of icbm.classic.content.explosive.Explosives in project ICBM-Classic by BuiltBrokenModding.

the class TileLauncherBaseClient method renderDynamic.

@Override
@SideOnly(Side.CLIENT)
public void renderDynamic(Pos pos, float frame, int pass) {
    GL11.glPushMatrix();
    GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 1.5F, (float) pos.z() + 0.5F);
    GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
    if (getDirection() != ForgeDirection.NORTH && getDirection() != ForgeDirection.SOUTH) {
        GL11.glRotatef(90F, 0F, 180F, 1.0F);
    }
    // The missile launcher screen
    if (getTier() == 0) {
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_0);
        modelBase0.render(0.0625F);
        modelRail0.render(0.0625F);
    } else if (getTier() == 1) {
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_1);
        modelBase1.render(0.0625F);
        modelRail1.render(0.0625F);
        GL11.glRotatef(180F, 0F, 180F, 1.0F);
        modelRail1.render(0.0625F);
    } else if (getTier() == 2) {
        FMLClientHandler.instance().getClient().renderEngine.bindTexture(TEXTURE_FILE_2);
        modelBase2.render(0.0625F);
        modelRail2.render(0.0625F);
        GL11.glRotatef(180F, 0F, 180F, 1.0F);
        modelRail2.render(0.0625F);
    }
    GL11.glPopMatrix();
    if (cachedMissileStack != null) {
        GL11.glPushMatrix();
        GL11.glTranslatef((float) pos.x() + 0.5F, (float) pos.y() + 0.5F, (float) pos.z() + 0.5F);
        //GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
        Explosives e = Explosives.get(cachedMissileStack.getItemDamage());
        Explosion missile = e == null ? (Explosion) Explosives.CONDENSED.handler : (Explosion) e.handler;
        if (missile.missileModelPath.contains("missiles")) {
            GL11.glScalef(0.00625f, 0.00625f, 0.00625f);
        } else {
            GL11.glScalef(0.05f, 0.05f, 0.05f);
        }
        RenderMissile.renderMissile(missile);
        GL11.glPopMatrix();
    }
}
Also used : Explosion(icbm.classic.content.explosive.ex.Explosion) Explosives(icbm.classic.content.explosive.Explosives) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 3 with Explosives

use of icbm.classic.content.explosive.Explosives in project ICBM-Classic by BuiltBrokenModding.

the class BlockExplosive method registerBlockIcons.

@SideOnly(Side.CLIENT)
@Override
public void registerBlockIcons(IIconRegister iconRegister) {
    /** Register every single texture for all explosives. */
    for (Explosives ex : Explosives.values()) {
        if (ex.handler.hasBlockForm() && ex != Explosives.SMINE) {
            ICONS.put(ex.ordinal() + "_top", this.getIcon(iconRegister, ex.handler, "_top"));
            ICONS.put(ex.ordinal() + "_side", this.getIcon(iconRegister, ex.handler, "_side"));
            ICONS.put(ex.ordinal() + "_bottom", this.getIcon(iconRegister, ex.handler, "_bottom"));
        }
    }
}
Also used : Explosives(icbm.classic.content.explosive.Explosives) SideOnly(cpw.mods.fml.relauncher.SideOnly)

Example 4 with Explosives

use of icbm.classic.content.explosive.Explosives in project ICBM-Classic by BuiltBrokenModding.

the class BlockExplosive method onBlockActivated.

/**
     * Called upon block activation (left or right click on the block.). The three integers
     * represent x,y,z of the block.
     */
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int par6, float par7, float par8, float par9) {
    TileEntity tileEntity = world.getTileEntity(x, y, z);
    if (entityPlayer.getHeldItem() != null) {
        if (entityPlayer.getHeldItem().getItem() == Items.flint_and_steel) {
            Explosives explosiveID = ((TileEntityExplosive) tileEntity).explosive;
            BlockExplosive.triggerExplosive(world, x, y, z, explosiveID, 0);
            return true;
        } else if (WrenchUtility.isUsableWrench(entityPlayer, entityPlayer.getCurrentEquippedItem(), x, y, z)) {
            byte change = 3;
            // Reorient the block
            switch(world.getBlockMetadata(x, y, z)) {
                case 0:
                    change = 2;
                    break;
                case 2:
                    change = 5;
                    break;
                case 5:
                    change = 3;
                    break;
                case 3:
                    change = 4;
                    break;
                case 4:
                    change = 1;
                    break;
                case 1:
                    change = 0;
                    break;
            }
            world.setBlockMetadataWithNotify(x, y, z, ForgeDirection.getOrientation(change).ordinal(), 3);
            world.notifyBlockChange(x, y, z, this);
            return true;
        }
    }
    if (tileEntity instanceof TileEntityExplosive) {
        return ((TileEntityExplosive) tileEntity).explosive.handler.onBlockActivated(world, x, y, z, entityPlayer, par6, par7, par8, par9);
    }
    return false;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) Explosives(icbm.classic.content.explosive.Explosives)

Example 5 with Explosives

use of icbm.classic.content.explosive.Explosives in project ICBM-Classic by BuiltBrokenModding.

the class RenderMissile method renderItem.

@Override
public void renderItem(IItemRenderer.ItemRenderType type, ItemStack item, Object... data) {
    Explosives ex = Explosives.get(item.getItemDamage());
    if (ex.handler instanceof Explosion) {
        Explosion missile = (Explosion) ex.handler;
        float yaw = 0;
        float pitch = -90;
        float scale = missile.missileModelPath.contains("missiles") ? 0.00625f : 0.7f;
        switch(type) {
            case INVENTORY:
                scale = missile.missileModelPath.contains("missiles") ? 0.0035f : 0.5f;
                if (missile.getTier() == 2 || !missile.hasBlockForm()) {
                    scale = scale / 1.5f;
                    GL11.glTranslatef(-0.7f, 0f, 0f);
                } else if (missile.getTier() == 3) {
                    scale = scale / 1.7f;
                    GL11.glTranslatef(-0.65f, 0f, 0f);
                } else if (missile.getTier() == 4) {
                    scale = scale / 1.4f;
                    GL11.glTranslatef(-0.5f, 0f, 0f);
                } else {
                    GL11.glTranslatef(-0.5f, 0f, 0f);
                }
                break;
            case EQUIPPED:
                GL11.glTranslatef(1f, 0.3f, 0.5f);
                break;
            case EQUIPPED_FIRST_PERSON:
                GL11.glTranslatef(1.15f, -1f, 0.5f);
                break;
            case ENTITY:
                GL11.glTranslatef(-0.6f, 0f, 0f);
                break;
            default:
                break;
        }
        GL11.glRotatef(yaw, 0, 1f, 0f);
        GL11.glRotatef(pitch, 0, 0f, 1f);
        GL11.glScalef(scale, scale, scale);
        renderMissile(missile);
    }
}
Also used : Explosion(icbm.classic.content.explosive.ex.Explosion) Explosives(icbm.classic.content.explosive.Explosives)

Aggregations

Explosives (icbm.classic.content.explosive.Explosives)9 Explosion (icbm.classic.content.explosive.ex.Explosion)4 SideOnly (cpw.mods.fml.relauncher.SideOnly)3 ExplosivePreDetonationEvent (resonant.api.explosion.ExplosionEvent.ExplosivePreDetonationEvent)3 ItemStack (net.minecraft.item.ItemStack)2 TileEntity (net.minecraft.tileentity.TileEntity)2 ChatComponentText (net.minecraft.util.ChatComponentText)2 Pos (com.builtbroken.mc.imp.transform.vector.Pos)1 RenderBombBlock (icbm.classic.client.render.tile.RenderBombBlock)1 EntityGrenade (icbm.classic.content.entity.EntityGrenade)1 EntityMissile (icbm.classic.content.entity.EntityMissile)1 Explosive (icbm.classic.content.explosive.Explosive)1 Missile (icbm.classic.content.explosive.ex.missiles.Missile)1 BlockExplosive (icbm.classic.content.explosive.tile.BlockExplosive)1 ItemBlockExplosive (icbm.classic.content.explosive.tile.ItemBlockExplosive)1 ArrayList (java.util.ArrayList)1 Block (net.minecraft.block.Block)1 ShapedOreRecipe (net.minecraftforge.oredict.ShapedOreRecipe)1 ShapelessOreRecipe (net.minecraftforge.oredict.ShapelessOreRecipe)1