當前位置: 首頁>>代碼示例>>Java>>正文


Java EntityRegistry.findGlobalUniqueEntityId方法代碼示例

本文整理匯總了Java中cpw.mods.fml.common.registry.EntityRegistry.findGlobalUniqueEntityId方法的典型用法代碼示例。如果您正苦於以下問題:Java EntityRegistry.findGlobalUniqueEntityId方法的具體用法?Java EntityRegistry.findGlobalUniqueEntityId怎麽用?Java EntityRegistry.findGlobalUniqueEntityId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cpw.mods.fml.common.registry.EntityRegistry的用法示例。


在下文中一共展示了EntityRegistry.findGlobalUniqueEntityId方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerEntity(Class entityClass, String name)
{
	int entityID = EntityRegistry.findGlobalUniqueEntityId();
	long seed = name.hashCode();
	Random rand = new Random(seed);
	int primaryColor = rand.nextInt() * 0x000000;
	int secondaryColor = rand.nextInt() * 0xff00000;
	int spawnRateconfig = ConfigurationHandler.xenbeastSpawnRate;
	int minSpawnconfig = ConfigurationHandler.xenbeastMinSpawn;
	int maxSpawnconfig = ConfigurationHandler.xenbeastMaxSpawn;

	EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
	EntityRegistry.registerModEntity(entityClass, name, entityID, Xenorite.instance, 64, 1, true);
	EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor)); // probablity of space/minimal to spawn/max to spawn
	EntityRegistry.addSpawn(XenBeastEntity.class, spawnRateconfig, minSpawnconfig, maxSpawnconfig, EnumCreatureType.monster, new BiomeGenBase[]
	{ BiomeGenBase.ocean, BiomeGenBase.plains, BiomeGenBase.desert, BiomeGenBase.extremeHills, BiomeGenBase.forest, BiomeGenBase.taiga, BiomeGenBase.swampland, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.icePlains, BiomeGenBase.iceMountains, BiomeGenBase.mushroomIsland, BiomeGenBase.mushroomIslandShore, BiomeGenBase.beach, BiomeGenBase.desertHills, BiomeGenBase.forestHills, BiomeGenBase.taigaHills, BiomeGenBase.extremeHillsEdge, BiomeGenBase.jungle, BiomeGenBase.jungleHills, BiomeGenBase.jungleEdge, BiomeGenBase.deepOcean, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.roofedForest, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.extremeHillsPlus, BiomeGenBase.savanna, BiomeGenBase.savannaPlateau, BiomeGenBase.mesa, BiomeGenBase.mesaPlateau_F, BiomeGenBase.mesaPlateau });
	DungeonHooks.addDungeonMob("XenBeastEntity", 180);
}
 
開發者ID:TechieCrow,項目名稱:Xenorite,代碼行數:19,代碼來源:XenBeastRegistry.java

示例2: createEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
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, ms.modInstance, 64, 1, true);
	EntityRegistry.addSpawn(entityClass, 5, 2, 9, EnumCreatureType.creature, BiomeGenBase.icePlains);
	EntityRegistry.addSpawn(entityClass, 5, 1, 3, EnumCreatureType.creature, BiomeGenBase.iceMountains);
	//EntityRegistry.addSpawn(entityClass, 1, 1, 5, EnumCreatureType.creature, BiomeGenBase.Biome);
	
	createEgg(randomId, solidColor, SpotColor);
	
}
 
開發者ID:MAPReiff,項目名稱:MineMania-Rebirth-1.7.10,代碼行數:12,代碼來源:EntityPG.java

示例3: createEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
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, ms.modInstance, 64, 1, true);
	EntityRegistry.addSpawn(entityClass, 0, 0, 1, EnumCreatureType.creature, BiomeGenBase.forest);
	
	createEgg(randomId, solidColor, SpotColor);
	
}
 
開發者ID:MAPReiff,項目名稱:MineMania-Rebirth-1.7.10,代碼行數:10,代碼來源:EntityLG.java

示例4: registerEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerEntity(Class entityClass, String name) {

        int entityId = EntityRegistry.findGlobalUniqueEntityId();
        long seed = name.hashCode();
        Random rand = new Random(seed);

        int primaryColor = rand.nextInt() * 16777215;
        int secondaryColor = rand.nextInt() * 16777215;

        EntityRegistry.registerGlobalEntityID(entityClass, name, entityId);
        EntityRegistry.registerModEntity(entityClass, name, entityId, instance, 64, 1, true);
        EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, primaryColor, secondaryColor));
    }
 
開發者ID:TeamBW,項目名稱:NetherEnhancements,代碼行數:14,代碼來源:NetherEnhancements.java

示例5: preInit

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
@Override
public void preInit(FMLPreInitializationEvent evt) {
	GameRegistry.registerTileEntity(FWTile.class, "novaTile");
	int globalUniqueEntityId = EntityRegistry.findGlobalUniqueEntityId();
	EntityRegistry.registerGlobalEntityID(FWEntity.class, "novaEntity", globalUniqueEntityId);
	EntityRegistry.registerModEntity(FWEntity.class, "novaEntity", globalUniqueEntityId, NovaMinecraft.instance, 64, 20, true);
}
 
開發者ID:NOVA-Team,項目名稱:NOVA-Core,代碼行數:8,代碼來源:CommonProxy.java

示例6: createEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void createEntity(Class entityClass, String entityName, EnumCreatureType type, int probability, int minSpawn, int maxSpawn, BiomeGenBase[] biomes, int solidColor, int spotColor)
{
	int randomId = EntityRegistry.findGlobalUniqueEntityId();
	
	EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomId);
	EntityRegistry.registerModEntity(entityClass, entityName, randomId, RegistryMain.modInstance, 64, 1, true);
	EntityRegistry.addSpawn(entityName, probability, minSpawn, maxSpawn, type, biomes);
	createEgg(randomId, solidColor, spotColor);
}
 
開發者ID:ehea617,項目名稱:mo-zombies,代碼行數:10,代碼來源:EntityMain.java

示例7: registerEntities

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
private void registerEntities()
{
	arrowEntityId = EntityRegistry.findGlobalUniqueEntityId();
	EntityRegistry.registerGlobalEntityID( ArrowEntity.class, "decoArrow", arrowEntityId );
	EntityRegistry.registerModEntity( ArrowEntity.class, "decoArrow", arrowEntityId, this, 64, 20, false );
	//EntityRegistry.instance().lookupModSpawn( ArrowEntity.class, false ).setCustomSpawning( null,  true );
	LanguageRegistry.instance().addStringLocalization( "entity.deco_arrow.name", "Arrow" );
}
 
開發者ID:spacechase0,項目名稱:ComponentEquipment,代碼行數:9,代碼來源:ComponentEquipment.java

示例8: registerSpawnable

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerSpawnable(Class entityClass, String name, int MAINCOLORS, int SUBCOLORS){
	int entityId = EntityRegistry.findGlobalUniqueEntityId();
	long x = name.hashCode();
	Random random = new Random(x);
	int mainColor = MAINCOLORS;
	int subColor = SUBCOLORS;

	EntityRegistry.registerGlobalEntityID(entityClass, name, entityId);
	EntityRegistry.registerModEntity(entityClass, name, entityId,ItsAboutTime.instance, 64, 1, true);
	EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, mainColor, subColor));
}
 
開發者ID:Alex-the-666,項目名稱:It-s-About-Time-Minecraft-Mod,代碼行數:12,代碼來源:EntityHandler.java

示例9: registerEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerEntity(Class entityClass, String name) {
    int entityID = EntityRegistry.findGlobalUniqueEntityId();
    long seed = name.hashCode();
    Random rand = new Random(seed);
    int primaryColor = rand.nextInt() * 16777215;
    int secondaryColor = rand.nextInt() * 16777215;

    EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
    EntityRegistry.registerModEntity(entityClass, name, entityID, instance, 64, 1, true);
    EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
}
 
開發者ID:njdart,項目名稱:OrbitCraft,代碼行數:12,代碼來源:OrbitCraft.java

示例10: registerEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerEntity(Class entityClass, String name)
{
    int entityID = EntityRegistry.findGlobalUniqueEntityId();
    long seed = name.hashCode();
    Random rand = new Random(seed);
    int primaryColor = rand.nextInt() * 16777215;
    int secondaryColor = rand.nextInt() * 16777215;
    EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
    EntityRegistry.registerModEntity(entityClass, name, entityID, Relearning_to_mod.instance, 64, 1, true);
    EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
}
 
開發者ID:static7s,項目名稱:RTM,代碼行數:12,代碼來源:ModEntities.java

示例11: registerEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerEntity(Class entityClass, String name)
{
int entityID = EntityRegistry.findGlobalUniqueEntityId();
long seed = name.hashCode();
Random rand = new Random(seed);
int primaryColor = rand.nextInt() * 16777215;
int secondaryColor = rand.nextInt() * 16777215;

EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
EntityRegistry.registerModEntity(entityClass, name, entityID, instance, 64, 1, true);
EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
}
 
開發者ID:ZippyIO,項目名稱:IgnitionUtilities,代碼行數:13,代碼來源:IgnitionLib.java

示例12: registerEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void registerEntity(Class entityClass, String name)
{
int entityID = EntityRegistry.findGlobalUniqueEntityId();
long seed = name.hashCode();
Random rand = new Random(seed);
int primaryColor = rand.nextInt() * 16777215;
int secondaryColor = rand.nextInt() * 16777215;

EntityRegistry.registerGlobalEntityID(entityClass, name, entityID);
EntityRegistry.registerModEntity(entityClass, name, entityID, Mankini.instance, 64, 1, true);
EntityList.entityEggs.put(Integer.valueOf(entityID), new EntityList.EntityEggInfo(entityID, primaryColor, secondaryColor));
}
 
開發者ID:MasterAbdoTGM50,項目名稱:Mankini,代碼行數:13,代碼來源:ModEntities.java

示例13: preInit

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	networkLog.info("Starting Network");//Log out to the logger saying that the mod is starting to init

	initConfig.loadConfig(event.getSuggestedConfigurationFile());//load the config

	ModRegistry.registerMod(this);//register the mod with source core

	//some of the entity registry
	int entityID;
	entityID = EntityRegistry.findGlobalUniqueEntityId();
	EntityRegistry.registerGlobalEntityID(ServerCart.class, "DiamondCart", entityID);
	EntityRegistry.registerModEntity(ServerCart.class, "DiamondCart", 2, instance, 64, 5, true);

	//register the gui handler
	NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());

	//register the drop item event for the tablets
	MinecraftForge.EVENT_BUS.register(new DropItemEvent());

	MinecraftForge.EVENT_BUS.register(new BlockBreakEvent());
	FMLCommonHandler.instance().bus().register(new RFPowerNet());
	FMLCommonHandler.instance().bus().register(new WorldTick());
	//call the item system
	ItemSystem.preInit(event);
	playerSystem.preInit(event);
}
 
開發者ID:modmuss50,項目名稱:Network,代碼行數:28,代碼來源:NetworkCore.java

示例14: createEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
public static void createEntity(Class entityClass, String entityName, int solidColour, int spotColour){
	int randomId = EntityRegistry.findGlobalUniqueEntityId();

	EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomId);
	EntityRegistry.registerModEntity(entityClass, entityName, randomId, mainclass.modInstance, 64, 1, true);
	createEgg(randomId, solidColour, spotColour);
}
 
開發者ID:IronManMod,項目名稱:IronMan,代碼行數:8,代碼來源:imEntity.java

示例15: registerEntity

import cpw.mods.fml.common.registry.EntityRegistry; //導入方法依賴的package包/類
@Override
public void registerEntity(Class<? extends Entity> entityClass, String entityName, int bkEggColor, int fgEggColor) {
	int id = EntityRegistry.findGlobalUniqueEntityId();

	EntityRegistry.registerGlobalEntityID(entityClass, entityName, id);
	EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColor, fgEggColor));
}
 
開發者ID:mookie1097,項目名稱:NausicaaMod,代碼行數:8,代碼來源:Main.java


注:本文中的cpw.mods.fml.common.registry.EntityRegistry.findGlobalUniqueEntityId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。