本文整理匯總了Java中cpw.mods.fml.common.registry.EntityRegistry類的典型用法代碼示例。如果您正苦於以下問題:Java EntityRegistry類的具體用法?Java EntityRegistry怎麽用?Java EntityRegistry使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
EntityRegistry類屬於cpw.mods.fml.common.registry包,在下文中一共展示了EntityRegistry類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
proxy.init(event);
ItemLoader.LoadItems();
BlockLoader.loadBlocks();
Recipes.registerRecpies();
EntityLoader.LoadEntitys();
OreDict.addores();
Achievements.loadAchievements();
Stats.RegisterStats();
EntityRegistry.registerModEntity(EntityGiantSnowBall.class, "GiantSnowBall", EntityRegistry.findGlobalUniqueEntityId(), MODID, 80, 3, true);
proxy.registerRenderThings();
GameRegistry.registerTileEntity(TileEntityBulb.class, "Bulb");
TileEntity.addMapping(TileEntityBulb.class, "Bulb_Mapping");
BulbModelID = 72;
}
示例2: addEntities
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
/**
* Adds and registers all entities and tile entities.
*/
public void addEntities()
{
//Registrations
EntityRegistry.registerModEntity(EntityObsidianTNT.class, "ObsidianTNT", 0, this, 64, 5, true);
EntityRegistry.registerModEntity(EntityRobit.class, "Robit", 1, this, 64, 2, true);
EntityRegistry.registerModEntity(EntityBalloon.class, "Balloon", 2, this, 64, 1, true);
EntityRegistry.registerModEntity(EntityBabySkeleton.class, "BabySkeleton", 3, this, 64, 5, true);
EntityRegistry.registerModEntity(EntityFlame.class, "Flame", 4, this, 64, 5, true);
//Tile entities
GameRegistry.registerTileEntity(TileEntityBoundingBlock.class, "BoundingBlock");
GameRegistry.registerTileEntity(TileEntityAdvancedBoundingBlock.class, "AdvancedBoundingBlock");
GameRegistry.registerTileEntity(TileEntityCardboardBox.class, "CardboardBox");
GameRegistry.registerTileEntity(TileEntitySolarEvaporationValve.class, "SalinationValve");
GameRegistry.registerTileEntity(TileEntitySolarEvaporationBlock.class, "SalinationTank");
GameRegistry.registerTileEntity(TileEntityEntangledBlock.class, "EntangledBlock");
GameRegistry.registerTileEntity(TileEntityBoiler.class, "SteamBoiler");
GameRegistry.registerTileEntity(TileEntityBoilerValve.class, "BoilerValve");
//Load tile entities that have special renderers.
proxy.registerSpecialTileEntities();
}
示例3: spawnEntity
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
public Entity spawnEntity(Location loc, EntityType entityType) {
// Cauldron start - handle custom entity spawns from plugins
if (EntityRegistry.entityClassMap.get(entityType.getName()) != null)
{
net.minecraft.entity.Entity entity = null;
entity = getEntity(EntityRegistry.entityClassMap.get(entityType.getName()), world);
if (entity != null)
{
entity.setLocationAndAngles(loc.getX(), loc.getY(), loc.getZ(), 0, 0);
world.addEntity(entity, SpawnReason.CUSTOM);
return entity.getBukkitEntity();
}
}
// Cauldron end
return spawn(loc, entityType.getEntityClass());
}
示例4: registerEntity
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
private static void registerEntity(Class<? extends Entity> entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates, int eggColour1, int eggColour2, boolean hasEgg) {
EntityRegistry.registerModEntity(entityClass, entityName, id, mod, trackingRange, updateFrequency, sendsVelocityUpdates);
if (id >= array.length) {
EntityData[] newArray = new EntityData[id + 5];
for (int i = 0; i < array.length; i++)
newArray[i] = array[i];
array = newArray;
}
if (array[id] != null)
throw new IllegalArgumentException("ID " + id + " is already being used! Please report this error!");
else {
array[id] = new EntityData(entityName, id, eggColour1, eggColour2, hasEgg);
map.put(id, entityClass);
}
}
示例5: registerTileEntities
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
public void registerTileEntities(boolean flag)
{
// non TESR registers
registerCommonTileEntities();
if (TFCPrimitiveTech.instance.isSlingshotEnabled)
{
EntityRegistry.registerModEntity(EntityProjectileSharpStone.class, "itemSharpStone", 1, TFCPrimitiveTech.instance, 64, 5, true);
EntityRegistry.registerModEntity(EntityProjectileHardStone.class, "itemHardStone", 1, TFCPrimitiveTech.instance, 64, 5, true);
EntityRegistry.registerModEntity(EntityProjectileSoftStone.class, "itemSoftStone", 1, TFCPrimitiveTech.instance, 64, 5, true);
EntityRegistry.registerGlobalEntityID(EntityProjectileStone.class, "SlingshotStone", EntityRegistry.findGlobalUniqueEntityId());
}
if (flag)
{
// GameRegistry.registerTileEntity(TileEntityBurlapSack.class, "Sack");
// TESR registers
}
}
示例6: LoadEntitys
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
public static void LoadEntitys() {
//Pat Registry
EntityRegistry.registerGlobalEntityID(EntitySpookyPat.class, "EntitySpookyPat",EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.addSpawn(EntitySpookyPat.class, 8, 4, 6, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.forest, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.mesa, BiomeGenBase.savanna, BiomeGenBase.desert, BiomeGenBase.desertHills);
//Jen Registry
EntityRegistry.registerGlobalEntityID(EntitySpookyJen.class, "EntitySpookyJen",EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.addSpawn(EntitySpookyJen.class, 8, 4, 6, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.forest, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.mesa, BiomeGenBase.savanna, BiomeGenBase.desert, BiomeGenBase.desertHills);
//Jen Registry
EntityRegistry.registerGlobalEntityID(EntitySpookyCaptianCookie.class, "EntitySpookyCaptianCookie",EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.addSpawn(EntitySpookyCaptianCookie.class, 8, 4, 6, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.forest, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.mesa, BiomeGenBase.savanna, BiomeGenBase.desert, BiomeGenBase.desertHills);
//ScareCrow Registry
EntityRegistry.registerGlobalEntityID(EntityScareCrow.class, "EntityScareCrow",EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.addSpawn(EntityScareCrow.class, 8, 4, 6, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.forest, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.mesa, BiomeGenBase.savanna, BiomeGenBase.desert, BiomeGenBase.desertHills);
//Ghost Registry
EntityRegistry.registerGlobalEntityID(EntityGhost.class, "EntityGhost",EntityRegistry.findGlobalUniqueEntityId());
EntityRegistry.addSpawn(EntityGhost.class, 8, 4, 6, EnumCreatureType.creature, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.forest, BiomeGenBase.plains, BiomeGenBase.beach, BiomeGenBase.mesa, BiomeGenBase.savanna, BiomeGenBase.desert, BiomeGenBase.desertHills);
}
示例7: registerInit
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
static void registerInit(@SuppressWarnings("UnusedParameters") FMLInitializationEvent event) {
//TileEntityの登録 =============================================================================================
GameRegistry.registerTileEntity(TileEntityClayCrucible.class, "tileClayCrucible");
GameRegistry.registerTileEntity(TileEntityClayCrucibleHeater.class, "tileClayCrucibleHeater");
//WorldGeneratorの登録 =========================================================================================
GameRegistry.registerWorldGenerator(new OreGenerator(), 2);
//チャンク生成イベントのフック
MinecraftForge.EVENT_BUS.register(new AMMStructureEventHandler());
MapGenStructureIO.registerStructure(StructureTestStart.class, "Test");
MapGenStructureIO.func_143031_a(StructureTestStart.ComponentTest1.class, "Test1");
MapGenStructureIO.func_143031_a(StructureTestStart.ComponentTest2.class, "Test2");
MapGenStructureIO.func_143031_a(StructureTestStart.ComponentTest3.class, "Test3");
MapGenStructureIO.func_143031_a(StructureTestStart.ComponentTest4.class, "Test4");
MapGenStructureIO.registerStructure(StructureTiamatStart.class, "TiamatComet");
MapGenStructureIO.func_143031_a(ComponentTiamatCenter.class, "TiamaitCometCenter");
MapGenStructureIO.func_143031_a(ComponentTiamatCenterLine.class, "TiamatCometCenterLine");
EntityRegistry.registerModEntity(EntityHoeHoeMan.class, "HoeHoeMan", 0, AntiMatterModCore.MOD_ID, 250, 1, false);//中ボスの追加
if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
RenderingRegistry.registerEntityRenderingHandler(EntityHoeHoeMan.class, new RenderHoeHoeMan());
}
//村のチェストの中身============================================================================================
//ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, new WeightedRandomChestContent(ingot_01,1,1,5,5));
//ChestGenHooks.addItem(ChestGenHooks.VILLAGE_BLACKSMITH, new WeightedRandomChestContent(ingot_01,2,1,5,5));
ChestGenHooks village =ChestGenHooks.getInfo(ChestGenHooks.VILLAGE_BLACKSMITH);
village.setMax(village.getMax()+10);
village.setMin(village.getMin()+10);
}
示例8: registerEntity
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public static void registerEntity (Entity entity){
if (!(entity instanceof SSheepEntity)) { SteelSheep.logger.error("The entity specified (" + entity + ") did not include any of the required fields"); return; }
int newId = getUniqueId();
EntityRegistry.registerModEntity(entity.getClass(),((SSheepEntity)entity).getEntityName(),newId,SteelSheep.instance,80,3,false);
EntityList.IDtoClassMapping.put(newId,entity.getClass());
EntityList.entityEggs.put(newId,new EntityList.EntityEggInfo(newId,((SSheepEntity) entity).getEggColors()[0],((SSheepEntity) entity).getEggColors()[1]));
if (entity instanceof EntityLiving) {
EntityRegistry.addSpawn(((EntityLiving)entity).getClass(), 30, 2, 4, EnumCreatureType.ambient, ((SSheepEntity) entity).getBiomeList());
}
SteelSheep.logger.info("Registered the entity " + entity + " successfully! (Name: " + EntityList.stringToClassMapping.get(entity.getClass()) + ")");
}
示例9: init
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
@EventHandler
public void init(FMLInitializationEvent event) {
// 諸Entity
EntityRegistry.registerModEntity(EntityLawyer.class, "Lawyer", 200,
this, 80, 1, true);
EntityRegistry.registerModEntity(Entity6Char.class, "6char", 201, this,
128, 5, true);
// 諸Recipe
GameRegistry.addShapelessRecipe(new ItemStack(item6Char),
Items.cooked_chicken,// 唐揚げ
Items.fish,// 沢蟹
Items.baked_potato,// コロッケ
Items.cooked_porkchop// 酢豚
);
proxy.init(event);
}
示例10: init
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
public static void init() {
registerSCP(EntitySCP0015.class, "scp:0015",
EntityRegistry.findGlobalUniqueEntityId(),
0x000000, 0x000000, 1);
registerSCP(EntitySCP0015Projectile.class, "scp:0015-p",
EntityRegistry.findGlobalUniqueEntityId(),
-1, -1, -1);
registerSCP(EntitySCP0023.class, "scp:0023",
EntityRegistry.findGlobalUniqueEntityId(),
0x000000, 0x000000, 1);
registerSCP(EntitySCP0131.class, "scp:0131",
EntityRegistry.findGlobalUniqueEntityId(),
0xFF0000, 0xFFFF00, 0);
registerSCP(EntitySCP0173.class, "scp:0173",
EntityRegistry.findGlobalUniqueEntityId(),
0xFEF2BF, 0x2BC600, 1);
registerSCP(EntityClassDMale.class, "scp:classd_male",
EntityRegistry.findGlobalUniqueEntityId(),
0xFF6600, 0x000000, -1);
}
示例11: addSpawn
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature)
{
for (BiomeGenBase biome : BiomeGenBase.biomeList)
{
if(biome != null)
{
if(BiomeDictionary.isBiomeRegistered(biome))
{
if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.END))
{
return;
}
if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER))
{
return;
}
if(BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.MUSHROOM))
{
return;
}
}
EntityRegistry.addSpawn(entityClass, weightedProb, min, max, typeOfCreature, biome);
}
}
}
示例12: init
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
public static void init()
{
LogHelper.debug(ConfigurationHandler.enableCarnivalClowns);
if(ConfigurationHandler.enableCarnivalClowns == true) {
EntityRegistry.registerModEntity(EntityCarnivalClown.class, "carnival_clown", 1, Reference.MOD_ID, 80, 3, true);
RenderingRegistry.registerEntityRenderingHandler(EntityCarnivalClown.class, new RenderClown(new ModelCarnivalClown(), 0.5F));
EntityRegistry.addSpawn(EntityCarnivalClown.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.plains);
ModelCarnivalClown.registerEntityEgg(EntityCarnivalClown.class, 0xffffff, 0xff0000);
LanguageRegistry.instance().addStringLocalization("entity.Carnival.carnival_clown.name", "en_US", "Carnival Clown");
}
//Temporarily removed while i think of a way to fix it
/*EntityRegistry.registerModEntity(EntityDethknight.class, "dethknight", 2, Reference.MOD_ID, 80, 3, true);
RenderingRegistry.registerEntityRenderingHandler(EntityDethknight.class, new RenderDethknight(new ModelDethknight(), 0.5F));
EntityRegistry.addSpawn(EntityDethknight.class, 10, 1, 2, EnumCreatureType.creature, BiomeGenBase.plains);
ModelCarnivalClown.registerEntityEgg(EntityDethknight.class, 0x000000, 0xff0000);
LanguageRegistry.instance().addStringLocalization("entity.Carnival.dethknight.name", "en_US", "Dethknight");*/
}
示例13: init
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
public static void init() {
EntityRegistry.registerModEntity(EntityMagician.class, "entityMagician", mageID, MagiciansArtifice.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntitySoulFragment.class, "entitySoul", soulID, MagiciansArtifice.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityBossOverworld.class, "bossOverworld", overworldBossID, MagiciansArtifice.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityBossNether.class, "bossNether", netherBossID, MagiciansArtifice.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityBossEnder.class, "bossEnder", enderBossID, MagiciansArtifice.instance, 80, 3, true);
//EntityRegistry.registerModEntity(EntityPetPheonix.class, "petPheonix", pheonixID, MagiciansArtifice.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityPetAppling.class, "petAppling", applingID, MagiciansArtifice.instance, 80, 3, true);
EntityRegistry.registerModEntity(EntityPetDragon.class, "petDragon", dragonID, MagiciansArtifice.instance, 80, 3, true);
//EntityRegistry.registerModEntity(EntityPetRat.class, "petRat", ratID, MagiciansArtifice.instance, 80, 3, true);
BlockDispenser.dispenseBehaviorRegistry.putObject(ItemRegistry.horcrux, new DispenserSoulBehavior());
registerEntityEgg(EntityMagician.class, 0x000349, 0xFFE343);
registerEntityEgg(EntityBossOverworld.class, 0xBBF2FF, 0xFFFFFF);
registerEntityEgg(EntityBossNether.class, 0xDA0000, 0x3B0000);
registerEntityEgg(EntityBossEnder.class, 0x3C0059, 0x2B0C36);
registerEntityEgg(EntityPetAppling.class, 0xDE0101, 0xFFC8C8);
registerEntityEgg(EntityPetDragon.class, 0xDE0101, 0xFFC8C8);
registerVillagers();
}
示例14: registerBase
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
@Override
public void registerBase() {
super.registerBase();
this.initializeSpellMaterials();
EntityRegistry.registerModEntity(EntitySpellProjectile.class,
"SpellProjectile", cpw.mods.fml.common.registry.EntityRegistry
.findGlobalUniqueEntityId(), RubedoCore.instance, 64,
1, true);
for (MaterialMultiItem material : this.getMaterials()) {
if (material.baseMaterial != null) {
String name = "base_" + material.name;
Item item = ItemSpellBase.getBaseMap().get(name);
GameRegistry.registerItem(item, name);
}
}
}
示例15: preInit
import cpw.mods.fml.common.registry.EntityRegistry; //導入依賴的package包/類
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
try {
if (Class.forName("com.pixelmonmod.pixelmon.Pixelmon") != null)
pixelmonPresent = true;
} catch (ClassNotFoundException e) {
FMLLog.warning("Pixelmon mod not found, pixelmon functions disabled.");
}
AddMeta(event);
config = PixelUtilitysConfig.getInstance();
config.setEvent(event);
PixelUtilitysAchievements.setupAchievements();
EntityRegistry.registerModEntity(SeatEntity.class, "Seat", 0, this, 3, 1, false);
}