本文整理汇总了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));
}