@Override
 public String getAdjective() {
   String translation =
       LanguageRegistry.instance().getStringLocalization("openperipheral.turtle.sensor.adjective");
   return translation == ""
       ? LanguageRegistry.instance()
           .getStringLocalization("openperipheral.turtle.sensor.adjective", "en_US")
       : translation;
 }
  @EventHandler // used in 1.6.2
  // @Init       // used in 1.5.2
  public void load(FMLInitializationEvent event) {
    //      proxy.registerRenderers();
    MinecraftForge.EVENT_BUS.register(new VampireEventHandler());

    LanguageRegistry.addName(BloodtapEmpty, "Empty Bloodtap");
    LanguageRegistry.addName(Bloodtap, "Filled Bloodtap");
    LanguageRegistry.addName(BottledBlood, "Bottle of Blood");

    // Recipes
    GameRegistry.addRecipe(
        new ItemStack(BloodtapEmpty),
        "xxx",
        "zyx",
        'x',
        new ItemStack(Item.stick),
        'y',
        new ItemStack(Item.glassBottle),
        'z',
        new ItemStack(Item.ingotIron));

    GameRegistry.addRecipe(
        new ItemStack(RunicBrick),
        "rdr",
        "dod",
        "rdr",
        'r',
        new ItemStack(Item.redstone),
        'd',
        new ItemStack(Item.diamond),
        'o',
        new ItemStack(Block.obsidian));

    LanguageRegistry.addName(RuneCraftingTable, "Runecrafting Table");
    MinecraftForge.setBlockHarvestLevel(RuneCraftingTable, "pickaxe", 2);
    GameRegistry.registerBlock(RuneCraftingTable, "RuneCraftingTable");

    LanguageRegistry.addName(RunicBrick, "Runic Brick");
    MinecraftForge.setBlockHarvestLevel(RunicBrick, "pickaxe", 5);
    GameRegistry.registerBlock(RunicBrick, "RunicBrick");

    LanguageRegistry.instance()
        .addStringLocalization("achievement.vampirism", "en_US", "Became a vampire!");
    LanguageRegistry.instance()
        .addStringLocalization("achievement.vampirism.desc", "en_US", "You (sort of) died!");

    LanguageRegistry.instance()
        .addStringLocalization("achievement.immortality", "en_US", "Became an original");
    LanguageRegistry.instance()
        .addStringLocalization(
            "achievement.immortality.desc", "en_US", "Hope you made the right call.");

    AchievementPage.registerAchievementPage(page1);
  }
Пример #3
0
 public static void addNames() {
   LanguageRegistry.instance()
       .addStringLocalization(
           "entity." + Names.entityAssassin_unlocalizedName + ".name", Names.entityAssassin_name);
   LanguageRegistry.instance()
       .addStringLocalization(
           "entity." + Names.entityCitizen_unlocalizedName + ".name", Names.entityCitizen_name);
   LanguageRegistry.instance()
       .addStringLocalization(
           "entity." + Names.entityGoblin_unlocalizedName + ".name", Names.entityGoblin_name);
 }
Пример #4
0
  public void Init() {
    int defMR = AMCore.config.getConfigurableEnchantmentID("magic_resist", 100);

    Enchantment.addToBookList(magicResist);
    Enchantment.addToBookList(soulbound);

    LanguageRegistry.instance()
        .addStringLocalization("enchantment.magicresist", "en_US", "Magic Resistance");
    LanguageRegistry.instance()
        .addStringLocalization("enchantment.soulbound", "en_US", "Soulbound");
  }
Пример #5
0
  private void initBlazeArmor() {
    /**
     * CLOTH(5, new int[]{1, 3, 2, 1}, 15), CHAIN(15, new int[]{2, 5, 4, 1}, 12), IRON(15, new
     * int[]{2, 6, 5, 2}, 9), GOLD(7, new int[]{2, 5, 3, 1}, 25), DIAMOND(33, new int[]{3, 8, 6, 3},
     * 10);
     */
    BlazeArmorMaterial = EnumHelper.addArmorMaterial("blazeIngot", 33, new int[] {2, 6, 5, 2}, 9);

    BlazeHelmet =
        (new BlazeItemArmor(DefaultProps.BLAZE_HELMET_ID, BlazeArmorMaterial, 1, 0))
            .setIconCoord(7, 0)
            .setItemName("blazeHelmet");
    LanguageRegistry.addName(BlazeHelmet, DefaultNames.EN.BLAZE_HELMET);
    LanguageRegistry.instance()
        .addNameForObject(BlazeHelmet, "ja_JP", DefaultNames.JP.BLAZE_HELMET);
    GameRegistry.addRecipe(
        new ItemStack(BlazeHelmet, 1),
        new Object[] {"XXX", "X X", Character.valueOf('X'), BlazeIngot});

    BlazeChestPlate =
        (new BlazeItemArmor(DefaultProps.BLAZE_CHESTPLATE_ID, BlazeArmorMaterial, 1, 1))
            .setIconCoord(8, 0)
            .setItemName("blazeChestPlate");
    LanguageRegistry.addName(BlazeChestPlate, DefaultNames.EN.BLAZE_CHESTPLATE);
    LanguageRegistry.instance()
        .addNameForObject(BlazeChestPlate, "ja_JP", DefaultNames.JP.BLAZE_CHESTPLATE);
    GameRegistry.addRecipe(
        new ItemStack(BlazeChestPlate, 1),
        new Object[] {"X X", "XXX", "XXX", Character.valueOf('X'), BlazeIngot});

    BlazeLeggings =
        (new BlazeItemArmor(DefaultProps.BLAZE_LEGGINGS_ID, BlazeArmorMaterial, 1, 2))
            .setIconCoord(9, 0)
            .setItemName("blazeLeggings");
    LanguageRegistry.addName(BlazeLeggings, DefaultNames.EN.BLAZE_LEGGINGS);
    LanguageRegistry.instance()
        .addNameForObject(BlazeLeggings, "ja_JP", DefaultNames.JP.BLAZE_LEGGINGS);
    GameRegistry.addRecipe(
        new ItemStack(BlazeLeggings, 1),
        new Object[] {"XXX", "X X", "X X", Character.valueOf('X'), BlazeIngot});

    BlazeBoots =
        (new BlazeItemArmor(DefaultProps.BLAZE_BOOTS_ID, BlazeArmorMaterial, 1, 3))
            .setIconCoord(10, 0)
            .setItemName("blazeBoots");
    LanguageRegistry.addName(BlazeBoots, DefaultNames.EN.BLAZE_BOOTS);
    LanguageRegistry.instance().addNameForObject(BlazeBoots, "ja_JP", DefaultNames.JP.BLAZE_BOOTS);
    GameRegistry.addRecipe(
        new ItemStack(BlazeBoots, 1),
        new Object[] {"X X", "X X", Character.valueOf('X'), BlazeIngot});
  }
Пример #6
0
  @Override
  public void addLocalizations() {
    LanguageRegistry.addName(saltOre, "Salt Ore");
    LanguageRegistry.addName(platinumOre, "Platinum Ore");
    LanguageRegistry.addName(leadOre, "Lead Ore");
    LanguageRegistry.addName(cinnabarOre, "Cinnabar Ore");
    LanguageRegistry.addName(carobbiiteOre, "Carobiite Ore");

    LanguageRegistry.instance()
        .addStringLocalization("itemGroup.ChemCreativeTab", "en_US", "AITS | Chemistry");
    LanguageRegistry.instance()
        .addStringLocalization("itemGroup.ChemCreativeTab", "en_GB", "AITS | Chemistry");
    LanguageRegistry.addName(Chemistry.BlockLabBench, "Lab Bench");
  }
Пример #7
0
 @Override
 public void initLangNames() {
   for (BoatType boat : BoatType.values()) {
     LanguageRegistry.instance()
         .addStringLocalization("item." + boat.unloc + ".chest.name", boat.loc + " with Chest");
   }
 }
Пример #8
0
  @PreInit
  public void preInit(FMLPreInitializationEvent evt) {
    PHArmory.initProps();
    toolrack = new DisplayBlock(PHArmory.toolrack, Material.rock);
    GameRegistry.registerBlock(toolrack, tinker.armory.content.ToolrackItem.class, "ToolRack");
    GameRegistry.registerTileEntity(tinker.armory.content.ShieldrackLogic.class, "Display");
    shelf = new Shelf(PHArmory.shieldrack, Material.rock);
    GameRegistry.registerBlock(shelf, tinker.armory.content.ToolrackItem.class, "Shelf");
    GameRegistry.registerTileEntity(tinker.armory.content.ToolrackLogic.class, "aShelf");
    /*armorStand = new ArmorStand(1501, Material.rock);
    GameRegistry.registerBlock(armorStand, mDiyo.inficraft.armory.ArmorStandItem.class);
    GameRegistry.registerTileEntity(mDiyo.inficraft.armory.ArmorStandLogic.class, "InfiArmorStand");*/

    armorStandItem = new ArmorStandItem(PHArmory.armorItem).setItemName("armorstand");
    LanguageRegistry.instance().addName(armorStandItem, "Armor Stand");

    EntityRegistry.registerModEntity(
        tinker.armory.content.ArmorStandEntity.class, "Armor Stand", 0, this, 32, 5, true);
    NetworkRegistry.instance().registerGuiHandler(instance, new ArmoryGuiHandler());

    GameRegistry.addRecipe(
        new ItemStack(Armory.instance.armorStandItem, 1, 0),
        " c ",
        "csc",
        " b ",
        's',
        Item.stick,
        'c',
        Block.cobblestone,
        'b',
        Block.stoneSingleSlab);
  }
  public static void preinit() {
    LanguageRegistry.instance()
        .addStringLocalization("itemGroup.BGMTAB", "en_US", Reference.MOD_NAME);

    PinkGum1 = new BlockPinkGum1(IDs.PINK_GUM1);
    GameRegistry.registerBlock(PinkGum1, Strings.PG1);
    LanguageRegistry.addName(PinkGum1, Strings.PG1);

    PinkGum2 = new BlockPinkGum2(IDs.PINK_GUM2);
    GameRegistry.registerBlock(PinkGum2, Strings.PG2);
    LanguageRegistry.addName(PinkGum2, Strings.PG2);

    PinkGum3 = new BlockPinkGum3(IDs.PINK_GUM3);
    GameRegistry.registerBlock(PinkGum3, Strings.PG3);
    LanguageRegistry.addName(PinkGum3, Strings.PG3);

    PinkGum4 = new BlockPinkGum4(IDs.PINK_GUM4);
    GameRegistry.registerBlock(PinkGum4, Strings.PG4);
    LanguageRegistry.addName(PinkGum4, Strings.PG4);

    RedGum1 = new BlockRedGum1(IDs.RED_GUM1);
    GameRegistry.registerBlock(RedGum1, Strings.RG1);
    LanguageRegistry.addName(RedGum1, Strings.RG1);

    RedGum2 = new BlockRedGum2(IDs.RED_GUM2);
    GameRegistry.registerBlock(RedGum2, Strings.RG2);
    LanguageRegistry.addName(RedGum2, Strings.RG2);

    RedGum3 = new BlockRedGum3(IDs.RED_GUM3);
    GameRegistry.registerBlock(RedGum3, Strings.RG3);
    LanguageRegistry.addName(RedGum3, Strings.RG3);

    RedGum4 = new BlockRedGum4(IDs.RED_GUM4);
    GameRegistry.registerBlock(RedGum4, Strings.RG4);
    LanguageRegistry.addName(RedGum4, Strings.RG4);

    BlueGum1 = new BlockBlueGum1(IDs.BLUE_GUM1);
    GameRegistry.registerBlock(BlueGum1, Strings.BG1);
    LanguageRegistry.addName(BlueGum1, Strings.BG1);

    BlueGum2 = new BlockBlueGum2(IDs.BLUE_GUM2);
    GameRegistry.registerBlock(BlueGum2, Strings.BG2);
    LanguageRegistry.addName(BlueGum2, Strings.BG2);

    BGMPortal = (BlockBGMPortal) new BlockBGMPortal(IDs.BGMPORTAL).setUnlocalizedName(Strings.BGMP);
    GameRegistry.registerBlock(BGMPortal, Strings.BGMP);
    LanguageRegistry.addName(BGMPortal, Strings.BGMP);

    BGMFire = (BlockBGMFire) new BlockBGMFire(IDs.BGMFIRE).setUnlocalizedName(Strings.BGMF);
    GameRegistry.registerBlock(BGMFire, Strings.BGMF);
    LanguageRegistry.addName(BGMFire, Strings.BGMF);

    BlackGum = new BlockBlackGum(IDs.BLACK_GUM1);
    GameRegistry.registerBlock(BlackGum, Strings.BG);
    LanguageRegistry.addName(BlackGum, Strings.BG);

    RawGum = new BlockRawGum(IDs.RAWGUM);
    GameRegistry.registerBlock(RawGum, Strings.RAWG);
    LanguageRegistry.addName(RawGum, Strings.RAWG);
  }
Пример #10
0
  /** Registers Entities */
  public void registerEntities() {
    EntityRegistry.registerModEntity(
        EntityParadoxHunter.class, "ParadoxHunter", 1, this, 80, 1, true);
    EntityRegistry.registerModEntity(EntityPlayerPast.class, "PastPlayer", 2, this, 80, 1, true);
    EntityRegistry.addSpawn(
        EntityParadoxHunter.class,
        10,
        2,
        4,
        EnumCreatureType.creature,
        BiomeGenBase.beach,
        BiomeGenBase.extremeHills,
        BiomeGenBase.extremeHillsEdge,
        BiomeGenBase.forest,
        BiomeGenBase.forestHills,
        BiomeGenBase.jungle,
        BiomeGenBase.jungleHills,
        BiomeGenBase.mushroomIsland,
        BiomeGenBase.mushroomIslandShore,
        BiomeGenBase.ocean,
        BiomeGenBase.plains,
        BiomeGenBase.river,
        BiomeGenBase.swampland);
    LanguageRegistry.instance()
        .addStringLocalization("entity.Charsmud_TimeTraveler.ParadoxHunter.name", "Paradox Hunter");

    registerEntityEgg(EntityParadoxHunter.class, 0xffffff, 0x000000);
  }
Пример #11
0
 @EventHandler
 public void load(FMLInitializationEvent event) {
   // Register events
   NetworkRegistry.instance().registerGuiHandler(instance, proxy);
   LanguageRegistry.instance().addStringLocalization("itemGroup.Particular", "Particular");
   GameRegistry.registerWorldGenerator(eventmanager);
 }
Пример #12
0
  /** * Loads in all the localization files from the Localizations library class */
  public static void loadConfig() {
    config = new TagFile();
    InputStream var0 =
        Harmonion.class.getResourceAsStream("/net/Harmonion/client/lang/default.cfg");
    config.readStream(var0);
    File var1;

    if (configDir == null) {
      var1 = Loader.instance().getConfigDir();
      var1 = new File(var1, "/Harmonion/");
      var1.mkdir();
      configDir = var1;
      configFile = new File(var1, "Harmonion.cfg");
    }

    if (configFile.exists()) {
      config.readFile(configFile);
    }

    config.commentFile("Harmonion Configuration");
    String var2;
    Iterator var4;

    for (var4 = config.query("blocks.%.%.id").iterator();
        var4.hasNext();
        reservedIds[config.getInt(var2)] = true) {
      var2 = (String) var4.next();
    }

    for (var4 = config.query("items.%.%.id").iterator();
        var4.hasNext();
        reservedIds[config.getInt(var2) + 256] = true) {
      var2 = (String) var4.next();
    }

    if (hmcTranslateTable == null) {
      hmcTranslateTable = new Properties();
    }

    try {
      hmcTranslateTable.load(
          Harmonion.class.getResourceAsStream("/net/Harmonion/client/lang/Harmonion.lang"));
      var1 = new File(configDir, "Harmonion.lang");

      if (var1.exists()) {
        FileInputStream var5 = new FileInputStream(var1);
        hmcTranslateTable.load(var5);
      }
    } catch (IOException var3) {
      var3.printStackTrace();
    }
    var4 = hmcTranslateTable.entrySet().iterator();

    while (var4.hasNext()) {
      Entry var6 = (Entry) var4.next();
      LanguageRegistry.instance()
          .addStringLocalization((String) var6.getKey(), (String) var6.getValue());
    }
  }
Пример #13
0
 public void addInformation(ItemStack ist, EntityPlayer player, List list, boolean par4) {
   List<ISpellCard> lp = new InventoryPickaxe(ist, true).matchAll();
   if (lp.size() > 0) {
     for (ISpellCard sp : lp) {
       list.add(LanguageRegistry.instance().getStringLocalization(sp.getStateName()));
     }
   } else {
   }
 }
Пример #14
0
  @EventHandler
  public void load(FMLInitializationEvent event) {
    LanguageRegistry.instance().addStringLocalization("itemGroup.Pistronics2", "Pistronics 2");
    PacketData.init();
    proxy.registerTileEntities();
    NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler());

    MinecraftForge.EVENT_BUS.register(arrowEventHandler);
  }
 public static void loadLanguages() {
   for (String LocationFile : Localizations.localeFiles) {
     LanguageRegistry.instance()
         .loadLocalization(
             LocationFile,
             LocalizationHelper.getLocaleFromFileName(LocationFile),
             LocalizationHelper.isXMLLanguageFile(LocationFile));
   }
 }
Пример #16
0
 public ItemWarpGem(int par1) {
   super(par1);
   setNoRepair();
   setMaxStackSize(1);
   if (FMLCommonHandler.instance().getSide().isClient()) {
     setCreativeTab(ThermalExpansion.tabTools);
   }
   setUnlocalizedName("itemWarpGem");
   LanguageRegistry.instance().addStringLocalization("item.itemWarpGem.name", "Warp Gem");
 }
Пример #17
0
 private void init() {
   LanguageRegistry.addName(this, ModObject.itemMachinePart.name);
   GameRegistry.registerItem(this, ModObject.itemMachinePart.unlocalisedName);
   for (int i = 0; i < MachinePart.values().length; i++) {
     LanguageRegistry.instance()
         .addStringLocalization(
             getUnlocalizedName() + "." + MachinePart.values()[i].unlocalisedName + ".name",
             MachinePart.values()[i].uiName);
   }
 }
  @Init
  public void init(FMLInitializationEvent event) {
    KeyBindingRegistry.registerKeyBinding(new CCKeyHandler(statsKey));

    LanguageRegistry.instance().addStringLocalization("itemGroup.tabCC", Reference.TABNAME);

    // testItem
    testItem = new ItemBase(testItemId).setUnlocalizedName("testItem");
    LanguageRegistry.addName(testItem, Reference.TEST_ITEM);
  }
 public void nameObject(Object item, String key) {
   if (item == null) {
     CoreLoadingPlugin.log.warning(
         String.format("[LanguageEngine] Failed to name object %s, item was null.", key));
     return;
   }
   for (String lan : lang.keySet()) {
     if (lang.get(lan).containsKey(key)) {
       LanguageRegistry.instance().addNameForObject(item, lan, lang.get(lan).get(key));
     } else {
       if (!lang.get(lan).isEmpty())
         CoreLoadingPlugin.log.warning(
             String.format(
                 "[LanguageEngine] Failed to register %s with key %s in language %s",
                 item.toString(), key, lan));
       LanguageRegistry.instance().addNameForObject(item, lan, key);
     }
   }
 }
Пример #20
0
  private void initBlazeIngot() {
    BlazeIngot =
        (new BlazeItem(DefaultProps.BLAZE_INGOT_ID)).setIconCoord(0, 0).setItemName("blazeIngot");

    LanguageRegistry.addName(BlazeIngot, DefaultNames.EN.BLAZE_INGOT);
    LanguageRegistry.instance().addNameForObject(BlazeIngot, "ja_JP", DefaultNames.JP.BLAZE_INGOT);

    GameRegistry.addRecipe(
        new ItemStack(BlazeIngot, 1),
        new Object[] {"XX", "XX", Character.valueOf('X'), Item.blazeRod});
  }
  /** * Loads in all the localization files from the Localizations library class */
  public static void loadLanguages() {

    // For every file specified in the Localization library class, load them into the Language
    // Registry
    for (String localizationFile : Localizations.localeFiles) {
      LanguageRegistry.instance()
          .loadLocalization(
              localizationFile,
              LocalizationHelper.getLocaleFromFileName(localizationFile),
              LocalizationHelper.isXMLLanguageFile(localizationFile));
    }
  }
Пример #22
0
  @Override
  public boolean interactFirst(EntityPlayer var1) {
    if (this.worldObj.isRemote) {
      if (this.riddenByEntity == null) {
        var1.sendChatToPlayer(
            ChatMessageComponent.createFromText(
                Keyboard.getKeyName(GCKeyHandler.leftKey.keyCode)
                    + " / "
                    + Keyboard.getKeyName(GCKeyHandler.rightKey.keyCode)
                    + "  - "
                    + LanguageRegistry.instance().getStringLocalization("gui.buggy.turn.name")));
        var1.sendChatToPlayer(
            ChatMessageComponent.createFromText(
                Keyboard.getKeyName(GCKeyHandler.accelerateKey.keyCode)
                    + "       - "
                    + LanguageRegistry.instance().getStringLocalization("gui.buggy.accel.name")));
        var1.sendChatToPlayer(
            ChatMessageComponent.createFromText(
                Keyboard.getKeyName(GCKeyHandler.decelerateKey.keyCode)
                    + "       - "
                    + LanguageRegistry.instance().getStringLocalization("gui.buggy.decel.name")));
        var1.sendChatToPlayer(
            ChatMessageComponent.createFromText(
                Keyboard.getKeyName(GCKeyHandler.openSpaceshipInv.keyCode)
                    + "       - "
                    + LanguageRegistry.instance().getStringLocalization("gui.buggy.inv.name")));
      }

      return true;
    } else {
      if (this.riddenByEntity != null) {
        var1.mountEntity(null);
        return true;
      } else {
        var1.mountEntity(this);
        return true;
      }
    }
  }
Пример #23
0
  private void initFoods() {
    FrenchFries =
        (new BlazeItemFoods(DefaultProps.FRENCH_FRIES_ID, 5, 2.0F, false))
            .setPotionEffect(Potion.fireResistance.id, 60, 1, 1.0F)
            .setIconCoord(0, 1)
            .setItemName("frenchFries");

    LanguageRegistry.addName(FrenchFries, DefaultNames.EN.FRENCH_FRIES);
    LanguageRegistry.instance()
        .addNameForObject(FrenchFries, "ja_JP", DefaultNames.JP.FRENCH_FRIES);

    GameRegistry.addRecipe(
        new ItemStack(FrenchFries, 2), new Object[] {"XXX", Character.valueOf('X'), Item.blazeRod});
  }
  @EventHandler
  public void load(FMLInitializationEvent event) {

    // [ ----- BLOCKS ----- ]
    presentBlock = new PresentBlock(500).setUnlocalizedName("presentBlock");
    GameRegistry.registerBlock(presentBlock, "presentBlock");
    LanguageRegistry.addName(presentBlock, "Present");

    // [ ----- ITEMS ----- ]
    ChristmasItems.loadItems();

    LanguageRegistry.instance().addStringLocalization("itemGroup.ChristmasCraft", "ChristmasCraft");
    ChristmasRecipes.loadRecipies();
  }
Пример #25
0
  private void addFruitTreesSequence(int i, int leavesTexture, int seedTexture, int subCount) {
    LeavesInfo leaves = leavesList.get(i);
    leaves.leavesBlock = new BlockFruitLeaves(leavesTexture, subCount);
    leaves.leavesBlock.serialNumber = i;
    leaves
        .leavesBlock
        .setBlockName("fruitLeaves" + i)
        .setCreativeTab(creativeTab)
        .setHardness(0.2F)
        .setLightOpacity(1)
        .setStepSound(Block.soundTypeGrass);
    RegistryUtils.registerBlock(leaves.leavesBlock);

    leaves.saplingBlock = new BlockFruitSapling(15, subCount);
    leaves.saplingBlock.serialNumber = i;
    String saplingBlockName = "fruitSapling" + i;
    leaves.saplingBlock.setBlockName(saplingBlockName).setCreativeTab(creativeTab);
    RegistryUtils.registerMultiBlock(
        leaves.saplingBlock,
        ItemBlockFruitSapling.class,
        constructSubNames(treeTypeNames, i, subCount));
    OreDictionary.registerOre("treeSapling", new ItemStack(leaves.saplingBlock, 1, ANY_DMG));
    if (otherMods.isMineFactoryReloadedDetected()) {
      FactoryRegistry.sendMessage("registerFertilizable", leaves.saplingBlock);
      FactoryRegistry.sendMessage("registerPlantable", leaves.saplingBlock);
    }

    leaves.seedsItem = new ItemFruitSeeds(leaves.saplingBlock, seedTexture, subCount);
    RegistryUtils.registerItem(leaves.seedsItem, "treeSeeds" + i);
    leaves.seedsItem.serialNumber = i;
    for (int j = 0; j < subCount; j++) {
      String combinedName = leaves.seedsItem.getUnlocalizedName() + "." + j + ".name";
      LanguageRegistry.instance().addStringLocalization(combinedName, seedsTitles[j + i * 4]);
    }
    if (otherMods.isMineFactoryReloadedDetected()) {
      FactoryRegistry.sendMessage("registerPlantable", leaves.seedsItem);
    }

    // bonemeal event
    MinecraftForge.EVENT_BUS.register(leaves.saplingBlock);
    if (i == 0) {
      leaves.seedsItem.setFirstInSequence();
    }

    if (ModuleManager.isModuleEnabled(technic)) {
      CompostRegister.addStack(leaves.leavesBlock, DEFAULT_BLOCK_COMPOSTING_VALUE);
      CompostRegister.addStack(leaves.saplingBlock, DEFAULT_FRUIT_COMPOSTING_VALUE);
    }
  }
Пример #26
0
  /** Draw the foreground layer for the GuiContainer (everything in front of the items) */
  @Override
  protected void drawGuiContainerForegroundLayer(int par1, int par2) {
    String name = null;

    if (itemContainer != null) name = itemContainer.getDisplayName();

    if (name == null || name == "")
      name = LanguageRegistry.instance().getStringLocalization(container.getInvName() + ".name");

    if (name == null || name == "") name = StatCollector.translateToLocal(container.getInvName());

    this.fontRenderer.drawString(name == null || name == "" ? "Container" : name, 8, 6, 4210752);
    this.fontRenderer.drawString(
        StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
  }
Пример #27
0
  @Init
  public void load(FMLInitializationEvent event) {
    // This is the place where the mod starts loading

    // Set the directory
    try {
      Field minecraftDir = Loader.class.getDeclaredField("minecraftDir");
      minecraftDir.setAccessible(true);
      terrainControlDirectory =
          new File((File) minecraftDir.get(null), "mods" + File.separator + "TerrainControl");
    } catch (Throwable e) {
      terrainControlDirectory = new File("mods" + File.separator + "TerrainControl");
      System.out.println(
          "Could not reflect the Minecraft directory, save location may be unpredicatble.");
      e.printStackTrace();
    }

    // Start TerrainControl engine
    TerrainControl.supportedBlockIds = 4095;
    TerrainControl.startEngine(this);

    // Register localization
    LanguageRegistry.instance().addStringLocalization("generator.TerrainControl", "TerrainControl");

    // Register world type
    worldType = new TCWorldType(this, "TerrainControl");

    // Register listening channel for listening to received configs.
    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
      NetworkRegistry.instance()
          .registerChannel(new PacketHandler(this), TCDefaultValues.ChannelName.stringValue());
    }

    // Register player tracker, for sending configs.
    GameRegistry.registerPlayerTracker(new PlayerTracker(this));

    // Register sapling tracker, for custom tree growth.
    SaplingListener saplingListener = new SaplingListener();
    MinecraftForge.TERRAIN_GEN_BUS.register(saplingListener);
    MinecraftForge.EVENT_BUS.register(saplingListener);

    // Register to our own events, so that they can be fired again as Forge
    // events.
    // TODO: make this optional for people who haven't installed other
    // terrain mods, and don't want to lose performance.
    TerrainControl.registerEventHandler(new EventManager(), EventPriority.CANCELABLE);
  }
Пример #28
0
  public static void setupLanguages() {

    ArrayList arrayList = new ArrayList();

    try {
      InputStream input =
          CommonProxy.class.getResourceAsStream(
              String.format("%s/languages.txt", OpenCCSensors.LANGUAGE_PATH));

      if (input == null) {
        OCSLog.warn("Cannot load languages.txt. Names may not be displayed correctly.");
        return;
      }

      BufferedReader var2 = new BufferedReader(new InputStreamReader(input, "UTF-8"));

      for (String var3 = var2.readLine(); var3 != null; var3 = var2.readLine()) {
        arrayList.add(var3);
      }
    } catch (IOException var5) {
      OCSLog.warn(
          "Cannot load languages.txt. Names may not be displayed correctly. Stack trace follows.");
      var5.printStackTrace();
      return;
    }

    Iterator iterator = arrayList.iterator();

    while (iterator.hasNext()) {
      String langString = (String) iterator.next();
      URL url =
          CommonProxy.class.getResource(
              String.format("%s/%s.lang", OpenCCSensors.LANGUAGE_PATH, langString));
      if (url == null) {
        OCSLog.warn("Skipping loading of language %s - language file not found.", langString);
        continue;
      }
      LanguageRegistry.instance().loadLocalization(url, langString, false);
    }
  }
  @EventHandler
  public void Load(FMLPreInitializationEvent Event) {

    // Settings For Our Creative Tab
    hazzachooks_star_wars_addon_tab =
        new CreativeTabs("hazzachooks_star_wars_addon_tab") {
          public ItemStack getIconItemStack() {
            return new ItemStack(darkBlade, 1, 0);
          }
        };
    LanguageRegistry.instance()
        .addStringLocalization(
            "itemGroup.hazzachooks_star_wars_addon_tab",
            "en_US",
            "Hazzachooks Star Wars Addon Tab");

    // Settings For Our Items
    darkBlade =
        new DarkBlade(2000, dark_blade_enum)
            .setUnlocalizedName("dark blade")
            .setCreativeTab(this.hazzachooks_star_wars_addon_tab);

    // Settings For Our Mobs
    EntityRegistry.registerGlobalEntityID(Entity_deathwatch.class, "Deathwatch", 1);
    EntityRegistry.addSpawn(Entity_deathwatch.class, 20, 5, 20, EnumCreatureType.monster);
    EntityRegistry.findGlobalUniqueEntityId();
    registerEntityEgg(Entity_deathwatch.class, 0xF1EDED, 0x0020C2);
    RenderingRegistry.registerEntityRenderingHandler(
        Entity_deathwatch.class, new Renderdeathwatch(new Model_deathwatch(), 0.3F));
    EntityRegistry.registerGlobalEntityID(Entity_pre_vizsla.class, "Pre-Vizsla", 1);
    EntityRegistry.addSpawn(Entity_pre_vizsla.class, 20, 5, 20, EnumCreatureType.monster);
    registerEntityEgg(Entity_pre_vizsla.class, 0xF1EDED, 0x0020C2);
    RenderingRegistry.registerEntityRenderingHandler(
        Entity_pre_vizsla.class, new Renderprevizsla(new Model_pre_vizsla(), 0.3F));

    // Register Our Items
    GameRegistry.registerItem(darkBlade, "darkBlade");
    LanguageRegistry.addName(darkBlade, "Dark Saber");
  }
Пример #30
0
  public void addNames() {
    LanguageRegistry.addName(BioFuel, "Bio Fuel");
    LanguageRegistry.addName(ElectrolyticCore, "Electrolytic Core");
    LanguageRegistry.addName(SolarPanel, "Solar Panel");

    // Localization for Generator
    LanguageRegistry.instance()
        .addStringLocalization("tile.Generator.HeatGenerator.name", "Heat Generator");
    LanguageRegistry.instance()
        .addStringLocalization("tile.Generator.SolarGenerator.name", "Solar Generator");
    LanguageRegistry.instance()
        .addStringLocalization(
            "tile.Generator.ElectrolyticSeparator.name", "Electrolytic Separator");
    LanguageRegistry.instance()
        .addStringLocalization("tile.Generator.HydrogenGenerator.name", "Hydrogen Generator");
    LanguageRegistry.instance()
        .addStringLocalization("tile.Generator.BioGenerator.name", "Bio-Generator");
    LanguageRegistry.instance()
        .addStringLocalization(
            "tile.Generator.AdvancedSolarGenerator.name", "Advanced Solar Generator");
  }