Search in sources :

Example 11 with SoundEvent

use of net.minecraft.util.SoundEvent in project VoodooCraft by Mod-DevCafeTeam.

the class VCSoundHandler method register.

public static SoundEvent register(String name) {
    ResourceLocation loc = new ResourceLocation(Reference.MODID, name);
    SoundEvent sEvent = new SoundEvent(loc);
    SoundEvent.REGISTRY.register(ID++, loc, sEvent);
    return sEvent;
}
Also used : SoundEvent(net.minecraft.util.SoundEvent) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 12 with SoundEvent

use of net.minecraft.util.SoundEvent in project ConvenientAdditions by Necr0.

the class ModSounds method register.

public static SoundEvent register(int id, String loc) {
    ResourceLocation l = new ResourceLocation(ModConstants.Mod.MODID + ":" + loc);
    SoundEvent e = new SoundEvent(l);
    SoundEvent.REGISTRY.register(id, l, e);
    return e;
}
Also used : SoundEvent(net.minecraft.util.SoundEvent) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 13 with SoundEvent

use of net.minecraft.util.SoundEvent in project OpenModularTurrets by OpenModularTurretsTeam.

the class ModSounds method init.

public static void init() {
    turretDeploySound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "turret_deploy")).setRegistryName("openmodularturrets", "turret_deploy"));
    turretRetractSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "turret_retract")).setRegistryName("openmodularturrets", "turret_retract"));
    bulletHitSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "bullet_hit")).setRegistryName("openmodularturrets", "bullet_hit"));
    railGunHitSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "rail_gun_hit")).setRegistryName("openmodularturrets", "rail_gun_hit"));
    laserHitSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "laser_hit")).setRegistryName("openmodularturrets", "laser_hit"));
    disposableLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "disposable")).setRegistryName("openmodularturrets", "disposable"));
    grenadeLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "grenade")).setRegistryName("openmodularturrets", "grenade"));
    machinegunLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "machine_gun")).setRegistryName("openmodularturrets", "machine_gun"));
    incendiaryLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "incendiary")).setRegistryName("openmodularturrets", "incendiary"));
    laserLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "laser")).setRegistryName("openmodularturrets", "laser"));
    potatoLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "potato")).setRegistryName("openmodularturrets", "potato"));
    railgunLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "rail_gun")).setRegistryName("openmodularturrets", "rail_gun"));
    relativisticLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "relativistic")).setRegistryName("openmodularturrets", "relativistic"));
    rocketLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "rocket")).setRegistryName("openmodularturrets", "rocket"));
    teleportLaunchSound = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "teleport")).setRegistryName("openmodularturrets", "teleport"));
    amped = registerSound(new SoundEvent(new ResourceLocation("openmodularturrets", "amped")).setRegistryName("openmodularturrets", "amped"));
}
Also used : SoundEvent(net.minecraft.util.SoundEvent) ResourceLocation(net.minecraft.util.ResourceLocation)

Example 14 with SoundEvent

use of net.minecraft.util.SoundEvent in project SecurityCraft by Geforce132.

the class ConfigurationHandler method setupGameRegistry.

public void setupGameRegistry() {
    registerBlock(mod_SecurityCraft.laserBlock);
    GameRegistry.registerBlock(mod_SecurityCraft.laser, mod_SecurityCraft.laser.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.keypad);
    registerBlock(mod_SecurityCraft.mine);
    GameRegistry.registerBlock(mod_SecurityCraft.mineCut, mod_SecurityCraft.mineCut.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.dirtMine);
    GameRegistry.registerBlock(mod_SecurityCraft.stoneMine, mod_SecurityCraft.stoneMine.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.cobblestoneMine, mod_SecurityCraft.cobblestoneMine.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.diamondOreMine, mod_SecurityCraft.diamondOreMine.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.sandMine, mod_SecurityCraft.sandMine.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.furnaceMine);
    registerBlock(mod_SecurityCraft.retinalScanner);
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedDoor, mod_SecurityCraft.reinforcedDoor.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.bogusLava, mod_SecurityCraft.bogusLava.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.bogusLavaFlowing, mod_SecurityCraft.bogusLavaFlowing.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.bogusWater, mod_SecurityCraft.bogusWater.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.bogusWaterFlowing, mod_SecurityCraft.bogusWaterFlowing.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.keycardReader);
    registerBlock(mod_SecurityCraft.ironTrapdoor);
    registerBlock(mod_SecurityCraft.bouncingBetty);
    registerBlock(mod_SecurityCraft.inventoryScanner);
    GameRegistry.registerBlock(mod_SecurityCraft.inventoryScannerField, mod_SecurityCraft.inventoryScannerField.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.trackMine);
    registerBlock(mod_SecurityCraft.cageTrap);
    registerBlock(mod_SecurityCraft.portableRadar);
    registerBlock(mod_SecurityCraft.unbreakableIronBars);
    registerBlockWithCustomRecipe(mod_SecurityCraft.keypadChest, new ItemStack[] { null, ItemUtils.toItemStack(mod_SecurityCraft.keyPanel), null, null, ItemUtils.toItemStack(Items.REDSTONE), null, null, ItemUtils.toItemStack(Item.getItemFromBlock(Blocks.CHEST)), null });
    registerBlock(mod_SecurityCraft.usernameLogger);
    registerBlock(mod_SecurityCraft.reinforcedGlassPane);
    registerBlock(mod_SecurityCraft.alarm);
    GameRegistry.registerBlock(mod_SecurityCraft.alarmLit, mod_SecurityCraft.alarmLit.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.reinforcedStone);
    registerBlock(mod_SecurityCraft.reinforcedSandstone, ItemBlockReinforcedSandstone.class);
    registerBlock(mod_SecurityCraft.reinforcedDirt);
    registerBlock(mod_SecurityCraft.reinforcedCobblestone);
    registerBlock(mod_SecurityCraft.reinforcedFencegate);
    registerBlock(mod_SecurityCraft.reinforcedWoodPlanks, ItemBlockReinforcedPlanks.class);
    registerBlock(mod_SecurityCraft.panicButton);
    registerBlock(mod_SecurityCraft.frame);
    registerBlock(mod_SecurityCraft.claymore);
    registerBlock(mod_SecurityCraft.keypadFurnace);
    registerBlock(mod_SecurityCraft.securityCamera);
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedStairsOak, mod_SecurityCraft.reinforcedStairsOak.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedStairsSpruce, mod_SecurityCraft.reinforcedStairsSpruce.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedStairsCobblestone, mod_SecurityCraft.reinforcedStairsCobblestone.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedStairsSandstone, mod_SecurityCraft.reinforcedStairsSandstone.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedStairsBirch, mod_SecurityCraft.reinforcedStairsBirch.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedStairsJungle, mod_SecurityCraft.reinforcedStairsJungle.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedStairsAcacia, mod_SecurityCraft.reinforcedStairsAcacia.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedStairsDarkoak, mod_SecurityCraft.reinforcedStairsDarkoak.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.reinforcedStairsStone);
    registerBlock(mod_SecurityCraft.ironFence);
    registerBlock(mod_SecurityCraft.ims);
    registerBlock(mod_SecurityCraft.reinforcedGlass);
    registerBlock(mod_SecurityCraft.reinforcedStainedGlass, ItemBlockReinforcedStainedGlass.class);
    registerBlock(mod_SecurityCraft.reinforcedStainedGlassPanes, ItemBlockReinforcedStainedGlassPanes.class);
    registerBlock(mod_SecurityCraft.reinforcedWoodSlabs, ItemBlockReinforcedWoodSlabs.class);
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedDoubleWoodSlabs, mod_SecurityCraft.reinforcedDoubleWoodSlabs.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.reinforcedStoneSlabs, ItemBlockReinforcedSlabs.class);
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedDoubleStoneSlabs, mod_SecurityCraft.reinforcedDoubleStoneSlabs.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedDirtSlab, ItemBlockReinforcedSlabs.class, mod_SecurityCraft.reinforcedDirtSlab.getUnlocalizedName().substring(5));
    GameRegistry.registerBlock(mod_SecurityCraft.reinforcedDoubleDirtSlab, mod_SecurityCraft.reinforcedDoubleDirtSlab.getUnlocalizedName().substring(5));
    registerBlock(mod_SecurityCraft.protecto);
    GameRegistry.registerBlock(mod_SecurityCraft.scannerDoor, mod_SecurityCraft.scannerDoor.getUnlocalizedName().substring(5));
    registerItem(mod_SecurityCraft.codebreaker);
    registerItem(mod_SecurityCraft.reinforcedDoorItem, mod_SecurityCraft.reinforcedDoorItem.getUnlocalizedName().substring(5));
    registerItem(mod_SecurityCraft.scannerDoorItem, mod_SecurityCraft.scannerDoorItem.getUnlocalizedName().substring(5));
    registerItem(mod_SecurityCraft.universalBlockRemover);
    registerItem(mod_SecurityCraft.keycardLV1);
    registerItem(mod_SecurityCraft.keycardLV2);
    registerItem(mod_SecurityCraft.keycardLV3);
    registerItem(mod_SecurityCraft.keycardLV4);
    registerItem(mod_SecurityCraft.keycardLV5);
    registerItem(mod_SecurityCraft.limitedUseKeycard);
    registerItem(mod_SecurityCraft.remoteAccessMine);
    registerItem(mod_SecurityCraft.fWaterBucket);
    registerItem(mod_SecurityCraft.fLavaBucket);
    registerItem(mod_SecurityCraft.universalBlockModifier);
    registerItem(mod_SecurityCraft.redstoneModule);
    registerItem(mod_SecurityCraft.whitelistModule);
    registerItem(mod_SecurityCraft.blacklistModule);
    registerItem(mod_SecurityCraft.harmingModule);
    registerItem(mod_SecurityCraft.smartModule);
    registerItem(mod_SecurityCraft.storageModule);
    registerItem(mod_SecurityCraft.disguiseModule);
    registerItem(mod_SecurityCraft.wireCutters);
    registerItem(mod_SecurityCraft.adminTool);
    registerItem(mod_SecurityCraft.keyPanel);
    registerItem(mod_SecurityCraft.cameraMonitor);
    registerItem(mod_SecurityCraft.taser);
    registerItem(mod_SecurityCraft.scManual);
    registerItem(mod_SecurityCraft.universalOwnerChanger);
    registerItem(mod_SecurityCraft.universalBlockReinforcerLvL1);
    registerItem(mod_SecurityCraft.universalBlockReinforcerLvL2);
    registerItem(mod_SecurityCraft.universalBlockReinforcerLvL3);
    registerItem(mod_SecurityCraft.briefcase);
    registerItem(mod_SecurityCraft.universalKeyChanger);
    GameRegistry.registerTileEntity(TileEntityOwnable.class, "abstractOwnable");
    GameRegistry.registerTileEntity(TileEntitySCTE.class, "abstractSC");
    GameRegistry.registerTileEntity(TileEntityKeypad.class, "keypad");
    GameRegistry.registerTileEntity(TileEntityLaserBlock.class, "laserBlock");
    GameRegistry.registerTileEntity(TileEntityKeycardReader.class, "keycardReader");
    GameRegistry.registerTileEntity(TileEntityInventoryScanner.class, "inventoryScanner");
    GameRegistry.registerTileEntity(TileEntityPortableRadar.class, "portableRadar");
    GameRegistry.registerTileEntity(TileEntitySecurityCamera.class, "securityCamera");
    GameRegistry.registerTileEntity(TileEntityLogger.class, "usernameLogger");
    GameRegistry.registerTileEntity(TileEntityRetinalScanner.class, "retinalScanner");
    GameRegistry.registerTileEntity(TileEntityKeypadChest.class, "keypadChest");
    GameRegistry.registerTileEntity(TileEntityAlarm.class, "alarm");
    GameRegistry.registerTileEntity(TileEntityClaymore.class, "claymore");
    GameRegistry.registerTileEntity(TileEntityKeypadFurnace.class, "keypadFurnace");
    GameRegistry.registerTileEntity(TileEntityIMS.class, "ims");
    GameRegistry.registerTileEntity(TileEntityProtecto.class, "protecto");
    GameRegistry.registerTileEntity(CustomizableSCTE.class, "customizableSCTE");
    GameRegistry.registerTileEntity(TileEntityScannerDoor.class, "scannerDoor");
    //TODO not sure if this is the correct way to do it
    GameRegistry.register(new SoundEvent(SCSounds.ALARM.path), SCSounds.ALARM.path);
    GameRegistry.register(new SoundEvent(SCSounds.CAMERAZOOMIN.path), SCSounds.CAMERAZOOMIN.path);
    GameRegistry.register(new SoundEvent(SCSounds.CAMERASNAP.path), SCSounds.CAMERASNAP.path);
    GameRegistry.register(new SoundEvent(SCSounds.TASERFIRED.path), SCSounds.TASERFIRED.path);
    GameRegistry.register(new SoundEvent(SCSounds.ELECTRIFIED.path), SCSounds.ELECTRIFIED.path);
    if (useOldKeypadRecipe) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keypad, 1), new Object[] { "III", "III", "III", 'I', Blocks.STONE_BUTTON });
    } else {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keyPanel, 1), new Object[] { "III", "IBI", "III", 'I', Blocks.STONE_BUTTON, 'B', Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE });
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.frame, 1), new Object[] { "III", "IBI", "I I", 'I', Items.IRON_INGOT, 'B', Items.REDSTONE });
    }
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.laserBlock, 1), new Object[] { "III", "IBI", "IPI", 'I', Blocks.STONE, 'B', Blocks.REDSTONE_BLOCK, 'P', Blocks.GLASS_PANE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.mine, 3), new Object[] { " I ", "IBI", 'I', Items.IRON_INGOT, 'B', Items.GUNPOWDER });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedDoorItem, 1), new Object[] { "III", "IDI", "III", 'I', Items.IRON_INGOT, 'D', Items.IRON_DOOR });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.universalBlockRemover, 1), new Object[] { "SII", 'I', Items.IRON_INGOT, 'S', Items.SHEARS });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.ironTrapdoor, 1), new Object[] { "###", "#P#", "###", '#', Items.IRON_INGOT, 'P', Blocks.TRAPDOOR });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keycardReader, 1), new Object[] { "SSS", "SHS", "SSS", 'S', Blocks.STONE, 'H', Blocks.HOPPER });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.bouncingBetty, 1), new Object[] { " P ", "IBI", 'I', Items.IRON_INGOT, 'B', Items.GUNPOWDER, 'P', Blocks.HEAVY_WEIGHTED_PRESSURE_PLATE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.codebreaker, 1), new Object[] { "DTD", "GSG", "RER", 'D', Items.DIAMOND, 'T', Blocks.REDSTONE_TORCH, 'G', Items.GOLD_INGOT, 'S', Items.NETHER_STAR, 'R', Items.REDSTONE, 'E', Items.EMERALD });
    if (ableToCraftKeycard1) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keycardLV1, 1), new Object[] { "III", "YYY", 'I', Items.IRON_INGOT, 'Y', Items.GOLD_INGOT });
    }
    if (ableToCraftKeycard2) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keycardLV2, 1), new Object[] { "III", "YYY", 'I', Items.IRON_INGOT, 'Y', Items.BRICK });
    }
    if (ableToCraftKeycard3) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keycardLV3, 1), new Object[] { "III", "YYY", 'I', Items.IRON_INGOT, 'Y', Items.NETHERBRICK });
    }
    if (ableToCraftKeycard4) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keycardLV4, 1), new Object[] { "III", "DDD", 'I', Items.IRON_INGOT, 'D', new ItemStack(Items.DYE, 1, 13) });
    }
    if (ableToCraftKeycard5) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keycardLV5, 1), new Object[] { "III", "DDD", 'I', Items.IRON_INGOT, 'D', new ItemStack(Items.DYE, 1, 5) });
    }
    if (ableToCraftLUKeycard) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.limitedUseKeycard, 1), new Object[] { "III", "LLL", 'I', Items.IRON_INGOT, 'L', new ItemStack(Items.DYE, 1, 4) });
    }
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.trackMine, 4), new Object[] { "X X", "X#X", "XGX", 'X', Items.IRON_INGOT, '#', Items.STICK, 'G', Items.GUNPOWDER });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.portableRadar, 1), new Object[] { "III", "ITI", "IRI", 'I', Items.IRON_INGOT, 'T', Blocks.REDSTONE_TORCH, 'R', Items.REDSTONE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keypadChest, 1), new Object[] { "K", "R", "C", 'K', mod_SecurityCraft.keyPanel, 'R', Items.REDSTONE, 'C', Blocks.CHEST });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.remoteAccessMine, 1), new Object[] { " R ", " DG", "S  ", 'R', Blocks.REDSTONE_TORCH, 'D', Items.DIAMOND, 'G', Items.GOLD_INGOT, 'S', Items.STICK });
    for (int i = 0; i < 4; i++) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.fWaterBucket, 1), new Object[] { "P", "B", 'P', new ItemStack(Items.POTIONITEM, 1, harmingPotions[i]), 'B', Items.WATER_BUCKET });
    }
    for (int i = 0; i < 4; i++) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.fLavaBucket, 1), new Object[] { "P", "B", 'P', new ItemStack(Items.POTIONITEM, 1, healingPotions[i]), 'B', Items.LAVA_BUCKET });
    }
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.retinalScanner, 1), new Object[] { "SSS", "SES", "SSS", 'S', Blocks.STONE, 'E', Items.ENDER_EYE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.inventoryScanner, 1), new Object[] { "SSS", "SLS", "SCS", 'S', Blocks.STONE, 'L', mod_SecurityCraft.laserBlock, 'C', Blocks.ENDER_CHEST });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.cageTrap, 1), new Object[] { "BBB", "GRG", "III", 'B', mod_SecurityCraft.unbreakableIronBars, 'G', Items.GOLD_INGOT, 'R', Items.REDSTONE, 'I', Blocks.IRON_BLOCK });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.alarm, 1), new Object[] { "GGG", "GNG", "GRG", 'G', Blocks.GLASS, 'R', Items.REDSTONE, 'N', Blocks.NOTEBLOCK });
    //		GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedFencegate, 1), new Object[]{
    //			" I ", "IFI", " I ", 'I', Items.IRON_INGOT, 'F', Blocks.fence_gate
    //		});
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.wireCutters, 1), new Object[] { "SI ", "I I", " I ", 'I', Items.IRON_INGOT, 'S', Items.SHEARS });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.panicButton, 1), new Object[] { " I ", "IBI", " R ", 'I', Items.IRON_INGOT, 'B', Blocks.STONE_BUTTON, 'R', Items.REDSTONE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.whitelistModule, 1), new Object[] { "III", "IPI", "IPI", 'I', Items.IRON_INGOT, 'P', Items.PAPER });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.blacklistModule, 1), new Object[] { "III", "IPI", "IDI", 'I', Items.IRON_INGOT, 'P', Items.PAPER, 'D', new ItemStack(Items.DYE, 1, 0) });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.redstoneModule, 1), new Object[] { "III", "IPI", "IRI", 'I', Items.IRON_INGOT, 'P', Items.PAPER, 'R', Items.REDSTONE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.harmingModule, 1), new Object[] { "III", "IPI", "IAI", 'I', Items.IRON_INGOT, 'P', Items.PAPER, 'A', Items.ARROW });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.smartModule, 1), new Object[] { "III", "IPI", "IEI", 'I', Items.IRON_INGOT, 'P', Items.PAPER, 'E', Items.ENDER_PEARL });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.storageModule, 1), new Object[] { "III", "IPI", "ICI", 'I', Items.IRON_INGOT, 'P', Items.PAPER, 'C', mod_SecurityCraft.keypadChest });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.disguiseModule, 1), new Object[] { "III", "IPI", "IAI", 'I', Items.IRON_INGOT, 'P', Items.PAPER, 'A', Items.PAINTING });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.universalBlockModifier, 1), new Object[] { "ER ", "RI ", "  I", 'E', Items.EMERALD, 'R', Items.REDSTONE, 'I', Items.IRON_INGOT });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.universalBlockModifier, 1), new Object[] { " RE", " IR", "I  ", 'E', Items.EMERALD, 'R', Items.REDSTONE, 'I', Items.IRON_INGOT });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.usernameLogger, 1), new Object[] { "SPS", "SRS", "SSS", 'S', Blocks.STONE, 'P', mod_SecurityCraft.portableRadar, 'R', Items.REDSTONE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.keypadFurnace, 1), new Object[] { "K", "F", "P", 'K', mod_SecurityCraft.frame, 'F', Blocks.FURNACE, 'P', mod_SecurityCraft.keyPanel });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.claymore, 1), new Object[] { "HSH", "SBS", "RGR", 'H', Blocks.TRIPWIRE_HOOK, 'S', Items.STRING, 'B', mod_SecurityCraft.bouncingBetty, 'R', Items.REDSTONE, 'G', Items.GUNPOWDER });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.ironFence, 1), new Object[] { " I ", "IFI", " I ", 'I', Items.IRON_INGOT, 'F', Blocks.OAK_FENCE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsStone, 4), new Object[] { "S  ", "SS ", "SSS", 'S', mod_SecurityCraft.reinforcedStone });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsCobblestone, 4), new Object[] { "S  ", "SS ", "SSS", 'S', mod_SecurityCraft.reinforcedCobblestone });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsSandstone, 4), new Object[] { "S  ", "SS ", "SSS", 'S', mod_SecurityCraft.reinforcedSandstone });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsOak, 4), new Object[] { "W  ", "WW ", "WWW", 'W', new ItemStack(mod_SecurityCraft.reinforcedWoodPlanks, 1, 0) });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsSpruce, 4), new Object[] { "W  ", "WW ", "WWW", 'W', new ItemStack(mod_SecurityCraft.reinforcedWoodPlanks, 1, 1) });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsBirch, 4), new Object[] { "W  ", "WW ", "WWW", 'W', new ItemStack(mod_SecurityCraft.reinforcedWoodPlanks, 1, 2) });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsJungle, 4), new Object[] { "W  ", "WW ", "WWW", 'W', new ItemStack(mod_SecurityCraft.reinforcedWoodPlanks, 1, 3) });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsAcacia, 4), new Object[] { "W  ", "WW ", "WWW", 'W', new ItemStack(mod_SecurityCraft.reinforcedWoodPlanks, 1, 4) });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStairsDarkoak, 4), new Object[] { "W  ", "WW ", "WWW", 'W', new ItemStack(mod_SecurityCraft.reinforcedWoodPlanks, 1, 5) });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.ims, 1), new Object[] { "BPB", " I ", "B B", 'B', mod_SecurityCraft.bouncingBetty, 'P', mod_SecurityCraft.portableRadar, 'I', Blocks.IRON_BLOCK });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.cameraMonitor, 1), new Object[] { "III", "IGI", "III", 'I', Items.IRON_INGOT, 'G', Blocks.GLASS_PANE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.taser, 1), new Object[] { "BGI", "RSG", "  S", 'B', Items.BOW, 'G', Items.GOLD_INGOT, 'I', Items.IRON_INGOT, 'R', Items.REDSTONE, 'S', Items.STICK });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.securityCamera, 1), new Object[] { "III", "GRI", "IIS", 'I', Items.IRON_INGOT, 'G', mod_SecurityCraft.reinforcedGlassPane, 'R', Blocks.REDSTONE_BLOCK, 'S', Items.STICK });
    for (int i = 0; i < 16; i++) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStainedGlass, 8, 15 - i), new Object[] { "###", "#X#", "###", '#', new ItemStack(mod_SecurityCraft.reinforcedGlass), 'X', new ItemStack(Items.DYE, 1, i) });
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStainedGlassPanes, 16, i - 1), new Object[] { "###", "###", '#', new ItemStack(mod_SecurityCraft.reinforcedStainedGlass, 1, i) });
    }
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.universalBlockReinforcerLvL1, 1), new Object[] { " DG", "RLD", "SR ", 'G', Blocks.GLASS, 'D', Items.DIAMOND, 'L', mod_SecurityCraft.laserBlock, 'R', Items.REDSTONE, 'S', Items.STICK });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.universalBlockReinforcerLvL2, 1), new Object[] { " DG", "RLD", "SR ", 'G', new ItemStack(mod_SecurityCraft.reinforcedStainedGlass, 1, 15), 'D', Blocks.DIAMOND_BLOCK, 'L', mod_SecurityCraft.laserBlock, 'R', Items.REDSTONE, 'S', Items.STICK });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.universalBlockReinforcerLvL3, 1), new Object[] { " EG", "RNE", "SR ", 'G', new ItemStack(mod_SecurityCraft.reinforcedStainedGlass, 1, 6), 'E', Blocks.EMERALD_BLOCK, 'N', Items.NETHER_STAR, 'R', Blocks.REDSTONE_BLOCK, 'S', Items.STICK });
    for (int i = 0; i < 6; i++) {
        GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedWoodSlabs, 6, i), new Object[] { "MMM", 'M', new ItemStack(mod_SecurityCraft.reinforcedWoodPlanks, 1, i) });
    }
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStoneSlabs, 6, 0), new Object[] { "MMM", 'M', mod_SecurityCraft.reinforcedStone });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStoneSlabs, 6, 1), new Object[] { "MMM", 'M', mod_SecurityCraft.reinforcedCobblestone });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedStoneSlabs, 6, 2), new Object[] { "MMM", 'M', mod_SecurityCraft.reinforcedSandstone });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.reinforcedDirtSlab, 6, 3), new Object[] { "MMM", 'M', mod_SecurityCraft.reinforcedDirt });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.protecto, 1), new Object[] { "ODO", "OEO", "OOO", 'O', Blocks.OBSIDIAN, 'D', Blocks.DAYLIGHT_DETECTOR, 'E', Items.ENDER_EYE });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.briefcase, 1), new Object[] { "SSS", "ICI", "III", 'S', Items.STICK, 'I', Items.IRON_INGOT, 'C', Blocks.CHEST });
    GameRegistry.addRecipe(new ItemStack(mod_SecurityCraft.universalKeyChanger, 1), new Object[] { " RL", " IR", "I  ", 'R', Items.REDSTONE, 'L', mod_SecurityCraft.laserBlock, 'I', Items.IRON_INGOT });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.dirtMine, 1), new Object[] { Blocks.DIRT, mod_SecurityCraft.mine });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.stoneMine, 1), new Object[] { Blocks.STONE, mod_SecurityCraft.mine });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.cobblestoneMine, 1), new Object[] { Blocks.COBBLESTONE, mod_SecurityCraft.mine });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.diamondOreMine, 1), new Object[] { Blocks.DIAMOND_ORE, mod_SecurityCraft.mine });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.sandMine, 1), new Object[] { Blocks.SAND, mod_SecurityCraft.mine });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.furnaceMine, 1), new Object[] { Blocks.FURNACE, mod_SecurityCraft.mine });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.universalOwnerChanger, 1), new Object[] { mod_SecurityCraft.universalBlockModifier, Items.NAME_TAG });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.scannerDoorItem), new Object[] { mod_SecurityCraft.reinforcedDoorItem, mod_SecurityCraft.retinalScanner });
    GameRegistry.addShapelessRecipe(new ItemStack(mod_SecurityCraft.universalKeyChanger), new Object[] { mod_SecurityCraft.universalKeyChanger, mod_SecurityCraft.briefcase });
}
Also used : SoundEvent(net.minecraft.util.SoundEvent) ItemStack(net.minecraft.item.ItemStack)

Example 15 with SoundEvent

use of net.minecraft.util.SoundEvent in project Railcraft by Railcraft.

the class RCSoundHandler method onPlaySound.

//TODO: test, catch PlaySoundAtEntityEvent?
@SubscribeEvent
public void onPlaySound(PlaySoundEvent event) {
    ISound soundEvent = event.getSound();
    ResourceLocation soundResource = soundEvent.getSoundLocation();
    if (SoundHelper.matchesSoundResource(soundResource, "null")) {
        event.setResultSound(null);
    } else if (SoundHelper.matchesSoundResource(soundResource, "override")) {
        World world = Railcraft.getProxy().getClientWorld();
        if (world != null) {
            float x = soundEvent.getXPosF();
            float y = soundEvent.getYPosF();
            float z = soundEvent.getZPosF();
            BlockPos pos = new BlockPos(x, y, z);
            String soundPath = soundEvent.getSoundLocation().getResourcePath();
            SoundType blockSound = SoundRegistry.getBlockSound(world, pos);
            if (blockSound == null) {
                if (soundPath.contains("place")) {
                    //Play sound later to adjust for the block not being there yet.
                    event.getManager().playDelayedSound(event.getSound(), 3);
                } else if (soundPath.contains("step")) {
                    blockSound = SoundRegistry.getBlockSound(world, pos.down());
                }
            }
            if (blockSound != null) {
                SoundEvent newSound = SoundHelper.matchSoundEvent(soundResource, blockSound);
                ObfuscationReflectionHelper.setPrivateValue(PositionedSound.class, (PositionedSound) soundEvent, newSound.getSoundName(), 3);
            } else {
                event.setResultSound(null);
            }
        }
    }
}
Also used : SoundType(net.minecraft.block.SoundType) ISound(net.minecraft.client.audio.ISound) PlaySoundEvent(net.minecraftforge.client.event.sound.PlaySoundEvent) SoundEvent(net.minecraft.util.SoundEvent) PositionedSound(net.minecraft.client.audio.PositionedSound) ResourceLocation(net.minecraft.util.ResourceLocation) BlockPos(net.minecraft.util.math.BlockPos) World(net.minecraft.world.World) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

SoundEvent (net.minecraft.util.SoundEvent)17 ResourceLocation (net.minecraft.util.ResourceLocation)7 Nonnull (javax.annotation.Nonnull)3 ItemStack (net.minecraft.item.ItemStack)3 SoundType (net.minecraft.block.SoundType)2 IBlockState (net.minecraft.block.state.IBlockState)2 IFluidHandlerItem (net.minecraftforge.fluids.capability.IFluidHandlerItem)2 Block (net.minecraft.block.Block)1 BlockLiquid (net.minecraft.block.BlockLiquid)1 Material (net.minecraft.block.material.Material)1 ISound (net.minecraft.client.audio.ISound)1 PositionedSound (net.minecraft.client.audio.PositionedSound)1 BlockPos (net.minecraft.util.math.BlockPos)1 World (net.minecraft.world.World)1 PlaySoundEvent (net.minecraftforge.client.event.sound.PlaySoundEvent)1 IFluidHandler (net.minecraftforge.fluids.capability.IFluidHandler)1 VoidFluidHandler (net.minecraftforge.fluids.capability.templates.VoidFluidHandler)1 BlockLiquidWrapper (net.minecraftforge.fluids.capability.wrappers.BlockLiquidWrapper)1 BlockWrapper (net.minecraftforge.fluids.capability.wrappers.BlockWrapper)1 FluidBlockWrapper (net.minecraftforge.fluids.capability.wrappers.FluidBlockWrapper)1