当前位置: 首页>>代码示例>>Java>>正文


Java EntityEggInfo类代码示例

本文整理汇总了Java中net.minecraft.entity.EntityList.EntityEggInfo的典型用法代码示例。如果您正苦于以下问题:Java EntityEggInfo类的具体用法?Java EntityEggInfo怎么用?Java EntityEggInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EntityEggInfo类属于net.minecraft.entity.EntityList包,在下文中一共展示了EntityEggInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: registerEntityEgg

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static void registerEntityEgg(Class eClass, String name, BiomeGenBase... biomes)
{
	int id = getUniqueEntityId();
	Random rand = new Random(name.hashCode());
	int mainColor = rand.nextInt() * 16777215;
	int secondColor = rand.nextInt() * 16777215;

	EntityRegistry.registerGlobalEntityID(eClass, name, id);
	//TODO Model error
	//EntityRegistry.registerModEntity(eClass, name, id, ARKCraft.instance(), 64, 4, true);
	EntityRegistry.addSpawn(eClass, CoreBalance.DINO_PROPERTIES.SPAWN_PROBABILITY, 2, 4,
			EnumCreatureType.CREATURE, biomes);
	EntityList.idToClassMapping.put(id, eClass);
	EntityList.entityEggs.put(Integer.valueOf(id), new EntityList.EntityEggInfo(id, mainColor,
			secondColor));
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:17,代码来源:EntityHandler.java

示例2: addVanillaSpawnEggs

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private static void addVanillaSpawnEggs() throws RuntimeException {
	for (EntityEggInfo info : (Collection<EntityEggInfo>) EntityList.entityEggs.values()) {
		int registerID = VANILLA_START + info.spawnedID;
		String mobID = EntityList.getStringFromID(info.spawnedID);

		if (registerID > Short.MAX_VALUE || registerID < Short.MIN_VALUE)
			throw new RuntimeException("RegisterID out of bounds for " + mobID);
		
		try {
			SpawnEggRegistry.registerSpawnEgg(new SpawnEggInfo((short)registerID, mobID, 
					new NBTTagCompound(), info.primaryColor, info.secondaryColor));
		}
		catch(IllegalArgumentException e) {
			throw new RuntimeException(e);
		}
	}
}
 
开发者ID:DavidGoldman,项目名称:BetterSpawnEggs,代码行数:19,代码来源:DefaultFunctionality.java

示例3: getEntityStatistic

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static net.minecraft.stats.StatBase getEntityStatistic(org.bukkit.Statistic stat, EntityType entity) {
    EntityEggInfo entityEggInfo = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(entity.getTypeId()));

    if (entityEggInfo != null) {
        return entityEggInfo.field_151512_d;
    }
    return null;
}
 
开发者ID:UraniumMC,项目名称:Uranium,代码行数:9,代码来源:CraftStatistic.java

示例4: registerEntityEgg

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static EntityEggInfo registerEntityEgg(String id, Class<? extends Entity> entity,
		int primaryColor, int secondaryColor) {
	ResourceLocation res = CrystalMod.resourceL(id);
	EntityEggInfo info = new EntityEggInfo(res, primaryColor, secondaryColor);
	EntityList.ENTITY_EGGS.put(res, info);
	return info;
}
 
开发者ID:Alec-WAM,项目名称:CrystalMod,代码行数:8,代码来源:ModEntites.java

示例5: registerMonster

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static void registerMonster(Class eClass, String name, BiomeGenBase... biomes)
{
	int eggID = EntityRegistry.findGlobalUniqueEntityId();
	Random rand = new Random(name.hashCode());
	int mainColor = rand.nextInt() * 16777215;
	int secondColor = rand.nextInt() * 16777215;

	EntityRegistry.registerGlobalEntityID(eClass, name, eggID);
	EntityRegistry.addSpawn(eClass, 25, 2, 4, EnumCreatureType.CREATURE, biomes);
	EntityRegistry
			.registerModEntity(eClass, name, ++entityID, ARKCraft.instance(), 64, 3, true);
	EntityList.entityEggs.put(Integer.valueOf(eggID), new EntityList.EntityEggInfo(++entityID,
			mainColor, secondColor));
}
 
开发者ID:Archiving,项目名称:ARKCraft-Code,代码行数:15,代码来源:EntityHandler.java

示例6: getOverrideCallbackValue

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@Override
protected StatBase getOverrideCallbackValue(StatBase originalValue) {
	if (requiresParameterBlock()) {
		return StatList.getBlockStats(parameterBlock);
	} else if (requiresParameterItem()) {
		String statId = originalValue.statId;
		if ("stat.pickup".equals(statId)) {
			return StatList.getObjectsPickedUpStats(parameterItem);
		} else if ("stat.drop".equals(statId)) {
			return StatList.getDroppedObjectStats(parameterItem);
		} else if ("stat.useItem".equals(statId)) {
			return StatList.getObjectUseStats(parameterItem);
		} else if ("stat.breakItem".equals(statId)) {
			return StatList.getObjectBreakStats(parameterItem);
		} else if ("stat.craftItem".equals(statId)) {
			return StatList.getCraftStats(parameterItem);
		} else {
			throw new AssertionError();
		}
	} else if (requiresParameterEntity()) {
		EntityEggInfo eggInfo = EntityList.ENTITY_EGGS.get(parameterEntity);
		if ("stat.killEntity".equals(originalValue.statId)) {
			return eggInfo.killEntityStat;
		} else {
			return eggInfo.entityKilledByStat;
		}
	} else {
		return originalValue;
	}
}
 
开发者ID:Earthcomputer,项目名称:Easy-Editors,代码行数:31,代码来源:GuiSelectStat.java

示例7: registerEntity

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
/**
 * @param entityClass a Entity__.class
 * @param entityName name of entity
 * @param the color of egg
 */
@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,代码行数:13,代码来源:LapMain.java

示例8: registerEntity

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的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

示例9: registerEgg

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@Override
public void registerEgg() {
    super.registerEgg();
    int eggID = ProjectZulu_Core.getNextDefaultEggID();
    while (EntityList.IDtoClassMapping.containsKey(eggID)) {
        eggID = ProjectZulu_Core.getNextDefaultEggID();
    }
    EntityList.IDtoClassMapping.put(eggID, mobClass);
    EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2));
}
 
开发者ID:soultek101,项目名称:projectzulu1.7.10-pre-1.3a,代码行数:11,代码来源:EggableDeclaration.java

示例10: registerEntityEgg

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void registerEntityEgg(Class<? extends Entity> entity, int colPrim, int colSec) {
    int id = getUniqueEntityID();
    EntityList.IDtoClassMapping.put(id, entity);
    EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec));
    return;
}
 
开发者ID:TeamAmeriFrance,项目名称:Electro-Magic-Tools,代码行数:8,代码来源:BaseEntityRegistry.java

示例11: onEntityRegister

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@SubscribeEvent
public void onEntityRegister(Register<EntityEntry> e) {
    for (MobInfo mob : MobInfo.values()) {
    	EntityEntry entry = new EntityEntry(mob.getClz(), mob.getName());
    	ResourceLocation name = new ResourceLocation(EnderZoo.MODID, mob.getName());
    	entry.setRegistryName(name);
    	entry.setEgg(new EntityEggInfo(name, mob.getEggBackgroundColor(), mob.getEggForegroundColor()));
    	e.getRegistry().register(entry);
        registerEntity(mob);
      }
}
 
开发者ID:SleepyTrousers,项目名称:EnderZoo,代码行数:12,代码来源:RegistryHandler.java

示例12: createZombie

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static void createZombie(String name,
		Class<? extends EntityLiving> entityClass, int id,
		int secondaryColor) {
	EntityRegistry.registerModEntity(entityClass, name, id, PvZ.instance,
			80, 3, true);
	EntityList.IDtoClassMapping.put(id, entityClass);
	EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id,
			primaryColor, secondaryColor));
	EntityRegistry.addSpawn(entityClass, 20, 2, 6,
			EnumCreatureType.monster, spawnBiomes);

}
 
开发者ID:TheTemportalist,项目名称:CountryGamer_PlantsVsZombies,代码行数:13,代码来源:Zombies.java

示例13: createPlant

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
public static void createPlant(int id, Class<? extends Entity> entityClass,
		String name, int secondaryColor) {
	EntityRegistry.registerModEntity(entityClass, name, id, PvZ.instance,
			80, 3, true);
	EntityList.IDtoClassMapping.put(id, entityClass);
	EntityList.entityEggs.put(id, new EntityEggInfo(id,
			primaryColor, secondaryColor));
}
 
开发者ID:TheTemportalist,项目名称:CountryGamer_PlantsVsZombies,代码行数:9,代码来源:EntDec.java

示例14: registerEntityEgg

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor)
{
	int id = getUniqueEntityId();
	EntityList.IDtoClassMapping.put(id, entity);
	EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
}
 
开发者ID:wuppy29,项目名称:WuppyMods,代码行数:8,代码来源:ModEntities.java

示例15: addMob

import net.minecraft.entity.EntityList.EntityEggInfo; //导入依赖的package包/类
private static void addMob(MappedCategory category, String soundId, ResourceLocation mobId, boolean isHostile) {
	final EntityEggInfo mobInfo = EntityList.ENTITY_EGGS.get(mobId);

	// TODO maybe some default colors for egg-less mobs?
	if (mobInfo != null) addMob(category, soundId, isHostile, mobInfo.primaryColor, mobInfo.secondaryColor);
	else addMob(category, soundId, isHostile, 0xFFFFFFFF, 0x00000000);
}
 
开发者ID:OpenMods,项目名称:OpenBlocks,代码行数:8,代码来源:SoundIconRegistry.java


注:本文中的net.minecraft.entity.EntityList.EntityEggInfo类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。