示例#1
0
  private void registerEntities() {
    //		EntityRegistry.registerGlobalEntityID(EntityCausticBoat.class, "causticBoat",
    // EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(
        EntityCausticBoat.class,
        "causticBoat",
        EntityRegistry.findGlobalUniqueEntityId(),
        this,
        64,
        40,
        true);

    //		EntityRegistry.registerGlobalEntityID(EntityAcidTNTPrimed.class, "acidTntPrimed",
    // EntityRegistry.findGlobalUniqueEntityId());
    EntityRegistry.registerModEntity(
        EntityAcidTNTPrimed.class,
        "acidTntPrimed",
        EntityRegistry.findGlobalUniqueEntityId(),
        this,
        64,
        100,
        false);

    //		int acidGrenadeEntityID = EntityRegistry.findGlobalUniqueEntityId();
    //		EntityRegistry.registerModEntity(EntityAcidGrenade.class, "acidGrenade",
    // acidGrenadeEntityID, this, 32, 100, true);
  }
 /**
  * Register the mod entity type with FML
  *
  * @param entityClass The entity class
  * @param entityName A unique name for the entity
  * @param trackingRange The range at which MC will send tracking updates
  * @param updateFrequency The frequency of tracking updates
  * @param sendsVelocityUpdates Whether to send velocity information packets as well
  */
 public static void addMapping(
     Class<? extends Entity> entityClass,
     String entityName,
     int trackingRange,
     int updateFrequency,
     boolean sendsVelocityUpdates,
     boolean spawnerOrEgg) {
   if (spawnerOrEgg) {
     EntityRegistry.registerModEntity(
         entityClass,
         entityName,
         EntityRegistry.findGlobalUniqueEntityId(),
         mod,
         trackingRange,
         updateFrequency,
         sendsVelocityUpdates);
   } else {
     entityId++;
     EntityRegistry.registerModEntity(
         entityClass,
         entityName,
         entityId,
         mod,
         trackingRange,
         updateFrequency,
         sendsVelocityUpdates);
     //	EntityRegistry.registerGlobalEntityID(entityClass, entityName, entityId);
   }
 }
示例#3
0
文件: Loader.java 项目: Kash-117/main
 public static void addMob(
     Class<? extends Entity> entity, String name, BasicRenderer renderer, int b, int f) {
   EntityRegistry.registerGlobalEntityID(
       entity, name, EntityRegistry.findGlobalUniqueEntityId(), b, f);
   entityList.add(entity);
   renderList.add(renderer);
 }
示例#4
0
  @EventHandler
  public void initialize(FMLInitializationEvent evt) {
    // MinecraftForge.registerConnectionHandler(new ConnectionHandler());
    ActionManager.registerTriggerProvider(new DefaultTriggerProvider());
    ActionManager.registerActionProvider(new DefaultActionProvider());

    if (BuildCraftCore.modifyWorld) {
      MinecraftForge.EVENT_BUS.register(new SpringPopulate());
    }

    if (BuildCraftCore.loadDefaultRecipes) {
      loadRecipes();
    }
    EntityRegistry.registerModEntity(
        EntityRobot.class, "bcRobot", EntityIds.ROBOT, instance, 50, 1, true);
    EntityRegistry.registerModEntity(
        EntityPowerLaser.class, "bcLaser", EntityIds.LASER, instance, 50, 1, true);
    EntityRegistry.registerModEntity(
        EntityEnergyLaser.class, "bcEnergyLaser", EntityIds.ENERGY_LASER, instance, 50, 1, true);
    EntityList.classToStringMapping.remove(EntityRobot.class);
    EntityList.classToStringMapping.remove(EntityPowerLaser.class);
    EntityList.classToStringMapping.remove(EntityEnergyLaser.class);
    EntityList.stringToClassMapping.remove("BuildCraft|Core.bcRobot");
    EntityList.stringToClassMapping.remove("BuildCraft|Core.bcLaser");
    EntityList.stringToClassMapping.remove("BuildCraft|Core.bcEnergyLaser");

    CoreProxy.proxy.initializeRendering();
    CoreProxy.proxy.initializeEntityRendering();

    Localization.addLocalization("/lang/buildcraft/", DefaultProps.DEFAULT_LANGUAGE);
  }
  public void registerEntity(
      Class<? extends Entity> entityClass, String entityName, int bkEggColour, int fgEggColour) {
    int id = EntityRegistry.findGlobalUniqueEntityId();

    EntityRegistry.registerGlobalEntityID(entityClass, entityName, id);
    EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColour, fgEggColour));
  }
示例#6
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);
  }
 @EventHandler()
 public void Init(FMLInitializationEvent Init) {
   loadProps(CBCMod.config);
   XenBlocks.init(CBCMod.config);
   proxy.init();
   DimensionManager.registerProviderType(
       xenContinentDimensionID, WorldProviderXenContinent.class, true);
   DimensionManager.registerDimension(xenContinentDimensionID, xenContinentDimensionID);
   EntityRegistry.addSpawn(
       EntityHoundeye.class,
       25,
       15,
       15,
       EnumCreatureType.monster,
       MainBiomes.xenHill,
       MainBiomes.xenPlain);
   EntityRegistry.addSpawn(
       EntityHeadcrab.class,
       25,
       15,
       15,
       EnumCreatureType.monster,
       MainBiomes.xenHill,
       MainBiomes.xenPlain);
   EntityRegistry.addSpawn(
       EntityAlienSlave.class, 10, 15, 15, EnumCreatureType.monster, MainBiomes.xenHill);
   EntityRegistry.addSpawn(
       EntityBarnacle.class,
       6,
       15,
       15,
       EnumCreatureType.monster,
       MainBiomes.xenHill,
       MainBiomes.xenPlain);
 }
示例#8
0
  public static void RegistrarEntityALoRandomSinSpawn(Class entityClass, String nombre) {
    int entityID = EntityRegistry.findGlobalUniqueEntityId();
    long seed = nombre.hashCode();
    Random rand = new Random(seed);

    EntityRegistry.registerGlobalEntityID(entityClass, nombre, entityID);
    EntityRegistry.registerModEntity(
        entityClass, nombre, entityID, RevolutionMain.instance, 64, 1, true);
  }
 public static void createEntity(
     Class<? extends EntityLiving> entityClass, String name, int solidColor, int spotColor) {
   int randomID = EntityRegistry.findGlobalUniqueEntityId();
   EntityRegistry.registerGlobalEntityID(entityClass, name, randomID);
   EntityRegistry.registerModEntity(
       entityClass, name, randomID, MatterOverdrive.instance, 64, 1, true);
   spawnListEntry = new BiomeGenBase.SpawnListEntry(entityClass, 3, 1, 2);
   addInBiome(BiomeGenBase.getBiomeGenArray());
   createEgg(randomID, solidColor, spotColor);
 }
  public static void createEntity(
      Class entityClass, String entityName, int solidColor, int spotColor) {
    int randomId = EntityRegistry.findGlobalUniqueEntityId();
    EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomId);
    EntityRegistry.registerModEntity(
        entityClass, entityName, randomId, ProjectVelocityCore.instance, 64, 1, true);
    EntityRegistry.addSpawn(entityClass, 2, 0, 1, EnumCreatureType.creature, BiomeGenBase.forest);

    createEgg(randomId, solidColor, spotColor);
  }
 @Override
 public void initRenderers() {
   EntityRegistry.registerGlobalEntityID(
       EntityDarkDruid.class,
       "darkDruid",
       EntityRegistry.findGlobalUniqueEntityId(),
       0x40FF00,
       0x0B610B); // the last two parameters are the colour of the spawnegg you can use HTML color
   // codes just replace the '#' with '0x'
   RenderingRegistry.registerEntityRenderingHandler(
       EntityDarkDruid.class,
       new RenderDarkDruid(new ModelDarkDruid(), 0.7F)); // the 0.5F is the shadowsize
 }
示例#12
0
 private static void registerEntity(
     Class<? extends Entity> entityClass,
     String entityName,
     Object mod,
     int primaryColor,
     int secondaryColor) {
   int entityID = EntityRegistry.findGlobalUniqueEntityId();
   EntityRegistry.registerGlobalEntityID(entityClass, entityName, entityID);
   EntityRegistry.registerModEntity(entityClass, entityName, entityID, mod, 64, 1, true);
   EntityList.entityEggs.put(
       Integer.valueOf(entityID),
       new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
 }
示例#13
0
  public static void RegistrarEntityALoRandom(Class entityClass, String nombre) {
    int entityID = EntityRegistry.findGlobalUniqueEntityId();
    long seed = nombre.hashCode();
    Random rand = new Random(seed);
    int primaryColor = rand.nextInt() * 16777215;
    int secondaryColor = rand.nextInt() * 16777215;

    EntityRegistry.registerGlobalEntityID(entityClass, nombre, entityID);
    EntityRegistry.registerModEntity(
        entityClass, nombre, entityID, RevolutionMain.instance, 64, 1, true);
    EntityList.entityEggs.put(
        Integer.valueOf(entityID),
        new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
  }
  public static void registerEntity(Class entityClass, String name, Boolean doEgg) {
    int entityId = EntityRegistry.findGlobalUniqueEntityId();
    long x = name.hashCode();
    Random random = new Random(x);
    int mainColor = random.nextInt() * 16777215;
    int subColor = random.nextInt() * 16777215;

    EntityRegistry.registerGlobalEntityID(entityClass, name, entityId);
    EntityRegistry.registerModEntity(entityClass, name, entityId, WTFtweaks.instance, 64, 1, true);
    if (doEgg) {
      EntityList.entityEggs.put(
          Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, mainColor, subColor));
    }
  }
示例#15
0
 public static void createEntity(
     Class<? extends Entity> entityClass, String entityName, int solidColor, int spotColor) {
   if (nextID < 1) {
     nextID = HTTYMDMod.getConfig().getStartEntityID();
     if (nextID == -1) nextID = EntityRegistry.findGlobalUniqueEntityId();
   } else nextID += 1;
   EntityRegistry.registerModEntity(
       entityClass, entityName, nextID, HTTYMDMod.INSTANCE, 50, 2, true);
   HTTYMDMod.registerDragonName(entityName);
   ItemSpawnEgg egg =
       (ItemSpawnEgg)
           new ItemSpawnEgg(entityName, solidColor, spotColor).setCreativeTab(currentTab);
   egg.registerItem();
   ItemRegistry.spawnEggIDMapping.put(nextID, egg);
 }
示例#16
0
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent pEvent) {
    // コンフィグの解析・設定
    configFile = pEvent.getSuggestedConfigurationFile();
    Configuration lconf = new Configuration(configFile);
    lconf.load();
    isDebugMessage =
        lconf.get("RefinedMilitaryShovelReplica", "isDebugMessage", true).getBoolean(true);
    lconf.save();

    // アイテムの登録
    fn_SS190 = new ItemSS190().setUnlocalizedName("ss19").setTextureName("mmm:SS190");
    fn_fiveseven =
        new ItemFiveseveN().setUnlocalizedName("fiveseven").setTextureName("mmm:FiveSeven");
    fn_p90 = new ItemP90().setUnlocalizedName("p90").setTextureName("mmm:P90");

    GameRegistry.registerItem(fn_SS190, "SS190");
    GameRegistry.registerItem(fn_fiveseven, "FiveseveN");
    GameRegistry.registerItem(fn_p90, "P90");

    //		((ItemGunsBase)fn_fiveseven).init();
    //		((ItemGunsBase)fn_p90).init();

    EntityRegistry.registerModEntity(EntityBulletBase.class, "BulletBase", 0, this, 120, 1, false);
  }
示例#17
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 addMapping(
     Class<? extends Entity> entityClass,
     String entityName,
     int trackingRange,
     int updateFrequency) {
   entityId++;
   EntityRegistry.registerModEntity(
       entityClass, entityName, entityId, mod, trackingRange, updateFrequency, false);
   //		EntityRegistry.registerGlobalEntityID(entityClass, entityName, entityId);
 }
 public void addSpawn(
     Class<? extends EntityLiving> entityClass,
     int spawnProb,
     int min,
     int max,
     BiomeGenBase[] biomes) {
   if (spawnProb > 0) {
     EntityRegistry.addSpawn(entityClass, spawnProb, min, max, EnumCreatureType.monster, biomes);
   }
 }
  public static void init() {
    LOGGER.debug("Initializing Entities....");

    if (GoldenBomb.ITEM_ENABLED) {
      EntityRegistry.registerModEntity(
          EntityGoldenBomb.class, GOLDEN_BOMB_ENTITY, 0, GoldenTreasures.instance, 128, 5, true);
    }

    LOGGER.log(Level.INFO, "Mod Entities Initialized");
  }
示例#21
0
 public static BiMap<Class<? extends Entity>, EntityRegistry.EntityRegistration>
     getEntityClassRegistrations() {
   try {
     return (BiMap<Class<? extends Entity>, EntityRegistry.EntityRegistration>)
         ENTITYREGISTRY_CLASSREGISTRATIONS.get(EntityRegistry.instance());
   } catch (IllegalArgumentException ex) {
     return null;
   } catch (IllegalAccessException ex) {
     return null;
   }
 }
示例#22
0
  /** Initiates mod, registers block and item for use. Generates the necessary folders. */
  @EventHandler
  public void load(FMLInitializationEvent event) {
    initialize();
    registerBlocks();
    addNames();
    addSmelt();
    mkDirs();
    registerEntities();
    addRecipes();

    guihandler = new GuiHandler();
    GameRegistry.registerTileEntity(TileEntityCollision.class, "collide");
    GameRegistry.registerTileEntity(TileEntityExtractor.class, "extractor");
    GameRegistry.registerTileEntity(TileEntityParadoxCondenser.class, "condenser");
    GameRegistry.registerTileEntity(TileEntityTimeTravel.class, "timetravel");
    GameRegistry.registerTileEntity(TileEntityMarker.class, "marker");
    GameRegistry.registerTileEntity(TileEntityTimeDistorter.class, "timeDistorter");

    // TickRegistry.registerTickHandler(new TickerClient(), Side.CLIENT);
    GameRegistry.registerWorldGenerator(new StructureGenerator(), 0);
    NetworkRegistry.INSTANCE.registerGuiHandler(this, guihandler);
    EntityRegistry.registerGlobalEntityID(
        EntityPlayerPast.class,
        "PlayerPast",
        EntityRegistry.findGlobalUniqueEntityId(),
        0x191919,
        0x000000); // registers the mobs name and id
    EntityRegistry.registerGlobalEntityID(EntityChair.class, "Chiar", 1001);
    EntityRegistry.registerGlobalEntityID(EntityXPOrbTT.class, "XP Orb", 1002);

    DimensionManager.registerProviderType(
        TimeTraveler.dimensionId, WorldProviderFuture.class, false);
    DimensionManager.registerDimension(TimeTraveler.dimensionId, TimeTraveler.dimensionId);

    FluidContainerRegistry.registerFluidContainer(
        timeFluid, new ItemStack(bucket), new ItemStack(Items.bucket));

    proxy.initCapes();

    proxy.registerRenderThings();
  }
示例#23
0
 public void registerEntity(
     Class<? extends Entity> cls,
     String name,
     int id,
     int updateFrequency,
     boolean sendVelocityUpdates) {
   System.out.printf(
       "%s: BaseMod.registerEntity: %s, \"%s\", %s\n",
       getClass().getSimpleName(), cls.getSimpleName(), name, id);
   EntityRegistry.registerModEntity(
       cls, name, id, /*base*/ this, 256, updateFrequency, sendVelocityUpdates);
 }
示例#24
0
  @EventHandler
  public void init(FMLInitializationEvent event) {
    EntityRegistry.registerGlobalEntityID(
        EntitySpear.class,
        "entitySpear",
        EntityRegistry.findGlobalUniqueEntityId(),
        new Color(0, 255, 0).getRGB(),
        new Color(255, 0, 0).getRGB());
    EntityRegistry.registerModEntity(
        EntitySpear.class, "entitySpear", 420, this.instance, 40, 1, true);

    EntityRegistry.registerGlobalEntityID(
        EntityGiantSpider.class,
        "giantSpider",
        EntityRegistry.findGlobalUniqueEntityId(),
        0x7AE8FF,
        0x47FFE2);

    MinecraftForge.EVENT_BUS.register(new EntityEventHandler());
    proxy.registerRender();
  }
  @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");
  }
示例#26
0
  @Init
  public void init(FMLInitializationEvent evt) {
    WCLanguage.init(evt);

    GameRegistry.registerTileEntity(TileEntityWarpInfuser.class, "Infuser");

    // Ore Generation
    GameRegistry.registerWorldGenerator(new WorldGeneratorWarpCraft());

    // Register Rendering Information
    proxy.registerRenderInformation();
    proxy.registerEntityInformation();
    // Register Dimension

    EntityRegistry.addSpawn(
        EntityRat.class, 5, 2, 3, EnumCreatureType.monster, WCBiomeGenBase.warp);
    EntityRegistry.addSpawn(
        EntitySquig.class, 2, 1, 2, EnumCreatureType.monster, WCBiomeGenBase.warp);
    // stuff

    TickRegistry.registerTickHandler(new ClientTickHandler(), Side.CLIENT);
  }
示例#27
0
  @Mod.EventHandler
  public void preInit(FMLPreInitializationEvent evt) {
    BuildCraftCore.mainConfigManager.register(
        "power.chipsetCostMultiplier",
        1.0D,
        "The cost multiplier for Chipsets",
        ConfigManager.RestartRequirement.GAME);
    BuildCraftCore.mainConfiguration.save();
    chipsetCostMultiplier =
        (float) BuildCraftCore.mainConfigManager.get("power.chipsetCostMultiplier").getDouble();

    if (BuildCraftCore.mainConfiguration.hasChanged()) {
      BuildCraftCore.mainConfiguration.save();
    }

    laserBlock = (BlockLaser) CompatHooks.INSTANCE.getBlock(BlockLaser.class);
    laserBlock.setBlockName("laserBlock");
    CoreProxy.proxy.registerBlock(laserBlock);

    assemblyTableBlock = (BlockLaserTable) CompatHooks.INSTANCE.getBlock(BlockLaserTable.class);
    assemblyTableBlock.setBlockName("laserTableBlock");
    CoreProxy.proxy.registerBlock(assemblyTableBlock, ItemLaserTable.class);

    packagerBlock = (BlockPackager) CompatHooks.INSTANCE.getBlock(BlockPackager.class);
    packagerBlock.setBlockName("packagerBlock");
    CoreProxy.proxy.registerBlock(packagerBlock);

    redstoneChipset = new ItemRedstoneChipset();
    redstoneChipset.setUnlocalizedName("redstoneChipset");
    CoreProxy.proxy.registerItem(redstoneChipset);
    redstoneChipset.registerItemStacks();

    packageItem = new ItemPackage();
    packageItem.setUnlocalizedName("package");
    CoreProxy.proxy.registerItem(packageItem);

    redstoneCrystal = (new ItemBuildCraft()).setUnlocalizedName("redstoneCrystal");
    CoreProxy.proxy.registerItem(redstoneCrystal);

    OreDictionary.registerOre("redstoneCrystal", new ItemStack(redstoneCrystal)); // Deprecated
    OreDictionary.registerOre("crystalRedstone", new ItemStack(redstoneCrystal));

    EntityRegistry.registerModEntity(
        EntityPackage.class,
        "bcPackageThrowable",
        EntityIds.PACKAGE_THROWABLE,
        instance,
        48,
        10,
        true);
  }
示例#28
0
  @EventHandler
  public void preInit(FMLPreInitializationEvent event) {

    FMLCommonHandler.instance().bus().register(new KeyHandler());
    ConfigurationHandler.init(
        new File(
            event.getModConfigurationDirectory().getAbsolutePath()
                + File.separator
                + this.author
                + "'s mods"
                + File.separator
                + this.modid
                + ".cfg"));
    proxy.registerKeyBindings();
    NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);

    EntityRegistry.registerModEntity(EntityMudBall.class, "Mud Ball", ++mudID, this, 64, 10, true);
    EntityRegistry.registerModEntity(
        EntityClayBall.class, "Clay Ball", ++clayID, this, 64, 10, true);
    LoadMod.load();

    GameRegistry.registerWorldGenerator(new ClayWorldgen(), 0);
  }
  public static void Init() {
    GameRegistry.registerTileEntity(TileEntitySell.class, "TeSell");
    GameRegistry.registerTileEntity(TileEntityKingdom.class, "TeKingdom");

    EntityRegistry.registerGlobalEntityID(EntityGuildMaster.class, "GuildMaster", 215, 255, 255);
    EntityRegistry.registerModEntity(
        EntityGuildMaster.class, "GuildMaster", 215, TaleOfKingdoms.instance, 250, 5, false);

    EntityRegistry.registerGlobalEntityID(EntityBuilder.class, "Builder", 216, 145, 122);
    EntityRegistry.registerModEntity(
        EntityBuilder.class, "Builder", 216, TaleOfKingdoms.instance, 250, 5, false);

    EntityRegistry.registerGlobalEntityID(EntityFarmerKeeper.class, "Farmer", 217, 145, 122);
    EntityRegistry.registerModEntity(
        EntityFarmerKeeper.class, "Farmer", 217, TaleOfKingdoms.instance, 250, 5, false);

    EntityRegistry.registerGlobalEntityID(EntityGuildMember.class, "GuildMember", 218, 145, 122);
    EntityRegistry.registerModEntity(
        EntityGuildMember.class, "GuildMember", 218, TaleOfKingdoms.instance, 250, 5, false);

    EntityRegistry.registerGlobalEntityID(EntityWeaponKeeper.class, "WeaponKeeper", 219, 145, 122);
    EntityRegistry.registerModEntity(
        EntityWeaponKeeper.class, "WeaponKeeper", 219, TaleOfKingdoms.instance, 250, 5, false);
  }
示例#30
0
 public static void buildEntityTracker(
     BaseModProxy mod,
     Class<? extends Entity> entityClass,
     int entityTypeId,
     int updateRange,
     int updateInterval,
     boolean sendVelocityInfo) {
   EntityRegistration er =
       EntityRegistry.registerModLoaderEntity(
           mod, entityClass, entityTypeId, updateRange, updateInterval, sendVelocityInfo);
   er.setCustomSpawning(
       new ModLoaderEntitySpawnCallback(mod, er),
       EntityDragon.class.isAssignableFrom(entityClass)
           || IAnimals.class.isAssignableFrom(entityClass));
 }