Search in sources :

Example 1 with Explosive

use of icbm.classic.content.explosive.Explosive 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 Explosive

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

the class RenderBombBlock method renderTileEntityAt.

@Override
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
    if (tileEntity instanceof TileEntityExplosive) {
        Explosive explosive = ((TileEntityExplosive) tileEntity).explosive.handler;
        if (explosive != null && explosive.getBlockModel() != null && explosive.getBlockResource() != null) {
            GL11.glPushMatrix();
            GL11.glTranslated(x + 0.5f, y + 1.5f, z + 0.5f);
            GL11.glRotatef(180f, 0f, 0f, 1f);
            FMLClientHandler.instance().getClient().renderEngine.bindTexture(explosive.getBlockResource());
            explosive.getBlockModel().render(0.0625f);
            RenderUtility.setTerrainTexture();
            GL11.glPopMatrix();
        }
    }
}
Also used : Explosive(icbm.classic.content.explosive.Explosive) TileEntityExplosive(icbm.classic.content.explosive.tile.TileEntityExplosive) TileEntityExplosive(icbm.classic.content.explosive.tile.TileEntityExplosive)

Example 3 with Explosive

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

the class ItemGrenade method onItemRightClick.

@Override
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer entityPlayer) {
    if (itemStack != null) {
        Explosive zhaPin = Explosives.get(itemStack.getItemDamage()).handler;
        ExplosivePreDetonationEvent evt = new ExplosivePreDetonationEvent(world, entityPlayer, ExplosiveType.ITEM, zhaPin);
        MinecraftForge.EVENT_BUS.post(evt);
        if (!evt.isCanceled()) {
            entityPlayer.setItemInUse(itemStack, this.getMaxItemUseDuration(itemStack));
        } else {
            entityPlayer.addChatMessage(new ChatComponentText("Grenades are banned in this region."));
        }
    }
    return itemStack;
}
Also used : Explosive(icbm.classic.content.explosive.Explosive) ItemBlockExplosive(icbm.classic.content.explosive.tile.ItemBlockExplosive) ExplosivePreDetonationEvent(resonant.api.explosion.ExplosionEvent.ExplosivePreDetonationEvent) ChatComponentText(net.minecraft.util.ChatComponentText)

Example 4 with Explosive

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

the class RenderMissile method doRender.

@Override
public void doRender(Entity entity, double x, double y, double z, float f, float f1) {
    EntityMissile entityMissile = (EntityMissile) entity;
    Explosive e = entityMissile.getExplosiveType();
    Explosion missile = e == null ? (Explosion) Explosives.CONDENSED.handler : (Explosion) e;
    GL11.glPushMatrix();
    GL11.glTranslated(x, y, z);
    GL11.glRotatef(entityMissile.prevRotationYaw + (entityMissile.rotationYaw - entityMissile.prevRotationYaw) * f1 - 90.0F, 0.0F, 1.0F, 0.0F);
    float pitch = entityMissile.prevRotationPitch + (entityMissile.rotationPitch - entityMissile.prevRotationPitch) * f1 - 90;
    GL11.glRotatef(pitch, 0.0F, 0.0F, 1.0F);
    if (missile.missileModelPath.contains("missiles")) {
        GL11.glScalef(0.00625f, 0.00625f, 0.00625f);
    } else {
        GL11.glScalef(0.07f, 0.07f, 0.07f);
    }
    renderMissile(missile);
    GL11.glPopMatrix();
}
Also used : Explosive(icbm.classic.content.explosive.Explosive) Explosion(icbm.classic.content.explosive.ex.Explosion) EntityMissile(icbm.classic.content.entity.EntityMissile)

Example 5 with Explosive

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

the class TileLauncherBase method launchMissile.

/**
     * Launches the missile
     *
     * @param target - The target in which the missile will land in
     */
public boolean launchMissile(Pos target, int gaoDu) {
    final ItemStack stack = getMissileStack();
    if (stack != null && stack.getItem() == ICBMClassic.itemMissile) {
        Explosive ex = Explosives.get(stack.getItemDamage()).handler;
        if (ex.hasMissileForm()) {
            // Apply inaccuracy
            int inaccuracy = 30;
            //Get value from support frame
            if (this.supportFrame != null) {
                inaccuracy = this.supportFrame.getInaccuracy();
            }
            //Randomize distance
            inaccuracy = world().rand.nextInt(inaccuracy);
            //Randomize radius drop
            angle.setYaw(world().rand.nextFloat() * 360);
            //Update target
            target = target.add(angle.x() * inaccuracy, 0, angle.z() * inaccuracy);
            if (isServer()) {
                EntityMissile missile = new EntityMissile(world());
                missile.explosiveID = Explosives.get(stack.getItemDamage());
                missile.launcherPos = new Pos((TileEntity) this);
                missile.setPosition(xi(), yi() + 3, zi());
                missile.launch(target, gaoDu);
                world().spawnEntityInWorld(missile);
                this.decrStackSize(0, 1);
            }
            return true;
        }
    }
    return false;
}
Also used : TileEntity(net.minecraft.tileentity.TileEntity) Explosive(icbm.classic.content.explosive.Explosive) Pos(com.builtbroken.mc.imp.transform.vector.Pos) ItemStack(net.minecraft.item.ItemStack) EntityMissile(icbm.classic.content.entity.EntityMissile)

Aggregations

Explosive (icbm.classic.content.explosive.Explosive)5 EntityMissile (icbm.classic.content.entity.EntityMissile)2 ItemBlockExplosive (icbm.classic.content.explosive.tile.ItemBlockExplosive)2 ItemStack (net.minecraft.item.ItemStack)2 Pos (com.builtbroken.mc.imp.transform.vector.Pos)1 Explosives (icbm.classic.content.explosive.Explosives)1 Explosion (icbm.classic.content.explosive.ex.Explosion)1 Missile (icbm.classic.content.explosive.ex.missiles.Missile)1 BlockExplosive (icbm.classic.content.explosive.tile.BlockExplosive)1 TileEntityExplosive (icbm.classic.content.explosive.tile.TileEntityExplosive)1 ArrayList (java.util.ArrayList)1 TileEntity (net.minecraft.tileentity.TileEntity)1 ChatComponentText (net.minecraft.util.ChatComponentText)1 ShapedOreRecipe (net.minecraftforge.oredict.ShapedOreRecipe)1 ShapelessOreRecipe (net.minecraftforge.oredict.ShapelessOreRecipe)1 ExplosivePreDetonationEvent (resonant.api.explosion.ExplosionEvent.ExplosivePreDetonationEvent)1