本文整理匯總了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);
}
示例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);
}
示例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);
}
示例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));
}
示例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);
}
示例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);
}
示例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" );
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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));
}
示例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);
}
示例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);
}
示例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));
}