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


Java EntityRegistry类代码示例

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


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

示例1: init

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
@Override
public void init() {
    for (Fluid fluid : Fluids.FLUIDS) {
        ModelLoader.setBucketModelDefinition(Fluids.getBucket(fluid));
    }

    ThirdPartyManager.instance().clientInit();

    RenderingRegistry.registerEntityRenderingHandler(EntityRing.class, RenderEntityRing.FACTORY);
    EntityRegistry.registerModEntity(RL("ring"), EntityRing.class, Names.MOD_ID + ".ring", 100, PneumaticCraftRepressurized.instance, 80, 1, true);

    registerModuleRenderers();

    Blockss.setupColorHandlers();
    BlockColorHandler.registerColorHandlers();
    ItemColorHandler.registerColorHandlers();

    super.init();
}
 
开发者ID:TeamPneumatic,项目名称:pnc-repressurized,代码行数:20,代码来源:ClientProxy.java

示例2: getChangeForSpawn

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
@Override
public int getChangeForSpawn(SpawnEventDetails details) {

    EntityList.EntityEggInfo eggInfo = EntityRegistry.getEntry(details.entity.getClass()).getEgg();
    if(eggInfo==null) {
        if(DifficultyManager.debugLogSpawns){
            LOG.info("Tried to get kills for mob with class "+details.entity.getClass()+", but not spawn egg found.  Cannot count kills for this mob for difficulty.");
        }
        return 0;
    }
    StatBase stat = eggInfo.killEntityStat;
    int killedMobs = PlayerAreaStatAccumulator.getStatForPlayersInArea(type,stat,details.entity,128);

    int contribution = (int)(((double)killedMobs * difficultyPerHundredKills) / 100);

    if(maxAddedDifficulty>=0){
        contribution = Math.min(contribution,maxAddedDifficulty);
    }

    return contribution;
}
 
开发者ID:talandar,项目名称:ProgressiveDifficulty,代码行数:22,代码来源:SpecificMobKilledControl.java

示例3: init

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
public static void init() {
	int id = 0;
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":withering_bolt"), EntityWitheringBolt.class, "withering_bolt", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), EntityPigZombieMage.class, "zombie_pigman_mage", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":zombie_pigman_mage"), 14581128, 11799808);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":pigman_mage"), EntityPigMage.class, "pigman_mage", id++, Infernum.instance, 64, 1, true);
	EntityRegistry.registerEgg(new ResourceLocation(Infernum.MODID + ":pigman_mage"), 14581128, 11665527);
	EntityRegistry.registerModEntity(new ResourceLocation(Infernum.MODID + ":fire_breath"), EntityFireBreath.class, "fire_breath", id++, Infernum.instance, 64, 1, true);
	
	List<Biome> spawnBiomes = new ArrayList<Biome>();
	spawnBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
	spawnBiomes.add(Biomes.HELL);
	for (Biome b : spawnBiomes) {
		System.out.println(b.getBiomeName());
	}
	EntityRegistry.addSpawn(EntityPigZombieMage.class, 150, 1, 2, EnumCreatureType.MONSTER, spawnBiomes.toArray(new Biome[spawnBiomes.size()]));
}
 
开发者ID:the-realest-stu,项目名称:Infernum,代码行数:18,代码来源:InfernumEntities.java

示例4: init

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
public static void init()
{
	// Register mod entities
	int entityId = 1;
	EntityRegistry.registerModEntity(new ResourceLocation("btweagles:stevebeej"), EntitySteveBeej.class, "SteveBeej", entityId++, BetterThanWeagles.instance, 64, 3, true, 0xD1A288, 0x00CCCC);

	// Set up spawn criteria
	Set<Biome> validBiomes = new HashSet<>();

	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.PLAINS));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.FOREST));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.HILLS));
	validBiomes.addAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.SWAMP));

	validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.NETHER));
	validBiomes.removeAll(BiomeDictionary.getBiomes(BiomeDictionary.Type.END));

	EntityRegistry.addSpawn(EntitySteveBeej.class, 10, 1, 1, EnumCreatureType.MONSTER, validBiomes.toArray(new Biome[validBiomes.size()]));

	// Register entity loot tables
	LootTableList.register(EntitySteveBeej.LOOT_TABLE);
}
 
开发者ID:DarkMorford,项目名称:BetterThanWeagles,代码行数:23,代码来源:ModEntities.java

示例5: registerAll

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
public static void registerAll() {
	
	SongRegistry.addSong(SoundType.AMBIENT, horse = new SongHorse("horse"));
	SongRegistry.addSong(SoundType.AMBIENT, hunt = new SongHunt("hunt"));
	SongRegistry.addSong(SoundType.AMBIENT, calm = new SongCalm("calm"));
	SongRegistry.addSong(SoundType.AMBIENT, invisible = new SongInvisible("invisible"));

	items.add(lyre = new ItemBase("lyre", true));
	items.add(flute = new ItemBase("flute", true));
	items.add(drum = new ItemBase("drum", true));
	items.add(bell = new ItemTempSpellCaster("bell", true));
	items.add(composition_paper = new ItemCompositionPaper("composition_paper", true));
	
	SongRegistry.addSong(SoundType.NEUTRAL, horse = new SongHorse("horse"));
	EntityRegistry.registerModEntity(new ResourceLocation(Melodium.MODID + ":ghost_horse"), 
			EntityGhostHorse.class, "ghost_horse", 0, Melodium.instance, 80, 3, true);
}
 
开发者ID:TeamMelodium,项目名称:Melodium,代码行数:18,代码来源:RegistryManager.java

示例6: addEntitySpawns

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
/**
 * Add spawning rules for the living mobs we want to be able to spawn naturally.
 */
public static void addEntitySpawns()
{
	// get the list of biomes that creepers can spawn in, we'll use the same biomes for all of our mobs
	Biome[] biomes = getBiomeList(EntityCreeper.class, EnumCreatureType.MONSTER);

	// add the spawn rules to the entity registry
	EntityRegistry.addSpawn(EntityJumpkin.class, 100, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityZombieHands.class, 100, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityHallowitch.class, 75, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityCreeperween.class, 75, 4, 4, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityHaunter.class, 5, 1, 1, EnumCreatureType.MONSTER, biomes);
	EntityRegistry.addSpawn(EntityTreater.class, 50, 4, 4, EnumCreatureType.MONSTER, biomes);
}
 
开发者ID:crazysnailboy,项目名称:Halloween,代码行数:17,代码来源:ModEntities.java

示例7: preLoad

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
public void preLoad(FMLPreInitializationEvent event)
{
    /* Network messages */
    Dispatcher.register();

    /* Attaching model manager and morph factories to the morph manager */
    MorphManager.INSTANCE.models = this.models;
    MorphManager.INSTANCE.factories.add(new MobMorphFactory());
    MorphManager.INSTANCE.factories.add(new PlayerMorphFactory());

    /* Configuration */
    File config = new File(event.getModConfigurationDirectory(), "metamorph/config.cfg");
    File morphs = new File(event.getModConfigurationDirectory(), "metamorph/morphs.json");
    File blacklist = new File(event.getModConfigurationDirectory(), "metamorph/blacklist.json");

    this.forge = new Configuration(config);
    this.config = new MetamorphConfig(this.forge);
    this.morphs = morphs;
    this.blacklist = blacklist;

    /* Entities */
    EntityRegistry.registerModEntity(EntityMorph.class, "Morph", 0, Metamorph.instance, 64, 3, false);
}
 
开发者ID:mchorse,项目名称:metamorph,代码行数:24,代码来源:CommonProxy.java

示例8: preInit

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    logger = event.getModLog();
    PacketDispatcher.registerPackets();
    ModItems.init();
    ModItems.register();
    ModTools.init();
    ModTools.register();
    ModArmour.init();
    ModArmour.register();
    AOTATradeRegistry.init();

    NetworkRegistry.INSTANCE.registerGuiHandler(this, new AOTAGuiHandler());

    int eid = -1;
    EntityRegistry.registerModEntity(new ResourceLocation(Reference.MODID + ":fairy"), EntityFairy.class, "fairy", ++eid, instance, 32, 2, false, 12564905, 9413987);

    proxy.registerRenders();
}
 
开发者ID:CountGrimhart,项目名称:Count-Armours,代码行数:20,代码来源:AOTA.java

示例9: onPreInit

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
@EventHandler
public void onPreInit(FMLPreInitializationEvent e) {
	LOG = LogManager.getLogger(Engination.MODID);
	File config = e.getSuggestedConfigurationFile();
	CONFIG = new Configuration(config);
	
	BlockDisappearing.DELAY_REAPPEAR = CONFIG.getInt(
			"delay-reappear", "block.disappearing",
			BlockDisappearing.DELAY_REAPPEAR, 1, 900,
			"The time it takes for a disappearing block to reappear");
	
	BlockDisappearing.DISAPPEAR_CHAIN_MAX = CONFIG.getInt(
			"chain-max", "block.disappearing",
			BlockDisappearing.DISAPPEAR_CHAIN_MAX, 1, 900,
			"The maximum number of blocks that will disappear together in a group");
	
	ENABLE_RECIPES_COSMETIC = CONFIG.getBoolean("enable-cosmetic", "recipe", ENABLE_RECIPES_COSMETIC, "If enabled, this registers recipes for cosmetic blocks");
	
	CONFIG.save();
	
	EntityRegistry.registerModEntity(new ResourceLocation("engination", "tomato"), EntityTomato.class, "tomato", 0, this, 80, 3, true);
	
	MinecraftForge.EVENT_BUS.register(this);
	proxy.preInit();
}
 
开发者ID:elytra,项目名称:Engination,代码行数:26,代码来源:Engination.java

示例10: preinit

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
@EventHandler
public void preinit(FMLPreInitializationEvent e){
	corruption = new CorruptionBlock();
	creativetp = new ItemCreativeTP();
	monumentteleporter = new MonumentTeleporterBlock(false);
	monumentteleporterbroken = new MonumentTeleporterBlock(true);
	corruptionslime = new ItemCorruptionSlime();
	GameRegistry.registerBlock(corruption, "corruptionblock");
	GameRegistry.registerBlock(monumentteleporter, "monumentteleporter");
	GameRegistry.registerBlock(monumentteleporterbroken, "monumentteleporterbroken");
	GameRegistry.registerItem(creativetp, "creativetp");
	GameRegistry.registerItem(corruptionslime, "corruptionslime");
	GameRegistry.registerTileEntity(TileEntityMonumentTeleporter.class, "TileEntityMonumentTeleporter");
	EntityRegistry.registerModEntity(EntityCorruptedSlime.class, "dd_throwable_slime", 0, "dungeondimension", 128, 1, true);
	proxy.preInit();
}
 
开发者ID:tiffit,项目名称:DungeonDimension,代码行数:17,代码来源:DungeonDimension.java

示例11: preInit

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
public void preInit() {
    System.out.println("FOE Initiating");
    System.out.println("WAR...");
    System.out.println("WAR NEVER CHANGES...");
    StartUpCommon.preInitCommon();
    // INIT Handler
    MinecraftForge.EVENT_BUS.register(new EventHandlerPre());
    MinecraftForge.EVENT_BUS.register(new UpdateEvents());
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/bullet"), EntityBullet.class, "Bullet", 0, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/laser"), EntityLaser.class, "laser", 1, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Flame"), EntityFlame.class, "Flame", 2, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Pellet"), Pellet.class, "Pellet", 3, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Pellet_one"), Pellet_one.class, "Pellet_one", 4, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Pellet_two"), Pellet_two.class, "Pellet_two", 5, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Pellet_tree"), Pellet_tree.class, "Pellet_tree", 6, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Pellet_four"), Pellet_four.class, "Pellet_four", 7, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Pellet_five"), Pellet_five.class, "Pellet_five", 8, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Pellet_six"), Pellet_six.class, "Pellet_six", 9, main.instance, 64, 10, true);
    EntityRegistry.registerModEntity(new ResourceLocation(GlobalNames.Domain + ":entity/Flare"), EntityFlare.class, "Flare", 10, main.instance, 64, 10, true);
}
 
开发者ID:Hoijima,项目名称:Fallout_Equestria,代码行数:21,代码来源:CommonProxy.java

示例12: init

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
    int entityId = 1;
    EntityRegistry.registerModEntity(location("thrown_rock"), EntityRock.class, "ThrownRock", entityId++, this, 80, 3, true);
    logger.debug("Last used id: %i", entityId);


    NetworkRegistry.INSTANCE.registerGuiHandler(this, guiHandler);

    addSmeltingNugget(rock_ore.getStack(OreMaterial.IRON), "nuggetIron");
    addSmeltingNugget(rock_ore.getStack(OreMaterial.GOLD), "nuggetGold");
    addSmeltingNugget(rock_ore.getStack(OreMaterial.COPPER), "nuggetCopper");
    addSmeltingNugget(rock_ore.getStack(OreMaterial.TIN), "nuggetTin");
    addSmeltingNugget(rock_ore.getStack(OreMaterial.LEAD), "nuggetLead");
    addSmeltingNugget(rock_ore.getStack(OreMaterial.SILVER), "nuggetSilver");

    GameRegistry.addSmelting(dough, new ItemStack(round_bread), 0);
}
 
开发者ID:gigaherz,项目名称:Survivalist,代码行数:20,代码来源:Survivalist.java

示例13: process

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
@Override
public void process(ITypesetter out, String arg) throws TruthError {
    if (arg.equalsIgnoreCase("entity")) {
        BiMap<Class<? extends Entity>, EntityRegistry.EntityRegistration> registrationMap;
        registrationMap = ReflectionHelper.getPrivateValue(EntityRegistry.class, EntityRegistry.instance(), "entityClassRegistrations");
        for (EntityRegistry.EntityRegistration reg : registrationMap.values()) {
            out.write("\\u{" + reg.getEntityName() + "}");
            out.write("\\nlRegistered by: " + reg.getContainer().getDisplayVersion());
            out.write("\\nTracking range: " + reg.getTrackingRange());
            out.write("\\nlLocation sync frequency: " + reg.getUpdateFrequency());
            out.write("\\nlSends velocity updates: " + reg.sendsVelocityUpdates());
            out.write("\\nl");
        }
    } else if (arg.equalsIgnoreCase("tileentity")) {
        //See: GameRegistry.registerTileEntity();
        out.write("TODO: too lazy to add an AT just for this...");
    } else {
        for (String s : new String[] {
                "entity",
                "tileentity"
        }) {
            out.write("\\{cgi/registry/" + s + "}{" + s +"}\n\n");
        }
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:26,代码来源:RegistrationViewer.java

示例14: registerEntities

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
private static void registerEntities() {
	// living
	modEntityID = 0;
	EntityRegistry.registerModEntity(EntityLCZombie.class, "helperZombie", ++modEntityID, LightningCraft.modInstance, 80, 3, true);
	EntityRegistry.registerModEntity(EntityDemonSoldier.class, "demonSoldier", ++modEntityID, LightningCraft.modInstance, 80, 3, true);
	EntityRegistry.registerModEntity(EntityUnderworldSlime.class, "underworldSlime", ++modEntityID, LightningCraft.modInstance, 80, 3, true);
	EntityRegistry.registerModEntity(EntityUnderworldSkeleton.class, "underworldSkeleton", ++modEntityID, LightningCraft.modInstance, 80, 3, true);
	EntityRegistry.registerModEntity(EntityUnderworldSilverfish.class, "underworldSilverfish", ++modEntityID, LightningCraft.modInstance, 80, 3, true);
	EntityRegistry.registerModEntity(EntityUnderworldGhast.class, "underworldGhast", ++modEntityID, LightningCraft.modInstance, 80, 3, true);
	EntityRegistry.registerModEntity(EntityUnderworldCreeper.class, "underworldCreeper", ++modEntityID, LightningCraft.modInstance, 80, 3, true);
	
	// non-living
	modEntityID = 100;
	EntityRegistry.registerModEntity(EntityLCTNTPrimed.class, "lcTNTPrimed", ++modEntityID, LightningCraft.modInstance, 160, 3, true);
	EntityRegistry.registerModEntity(EntityLCElectricAttack.class, "lcElectricAttack", ++modEntityID, LightningCraft.modInstance, 160, 3, true);
}
 
开发者ID:sblectric,项目名称:LightningCraft,代码行数:17,代码来源:LCEntities.java

示例15: init

import net.minecraftforge.fml.common.registry.EntityRegistry; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event)
{
	proxy.registerRenders();
	
	EntityRegistry.registerModEntity(EntitySkateboard.class, "csmSkateboard", 0, this, 64, 1, false);
	
	GameRegistry.registerTileEntity(TileEntitySlope.class, Reference.MOD_ID + "TileEntitySlope");
	GameRegistry.registerTileEntity(TileEntityCornerSlope.class, Reference.MOD_ID + "TileEntityCornerSlope");
	GameRegistry.registerTileEntity(TileEntityStair.class, Reference.MOD_ID + "TileEntityStair");

	if (event.getSide() == Side.CLIENT)
	{
		FMLCommonHandler.instance().bus().register(new SkateboardInput());
		FMLCommonHandler.instance().bus().register(new ComboOverlay());
	}
}
 
开发者ID:MrCrayfish,项目名称:MrCrayfishSkateboardingMod,代码行数:18,代码来源:MrCrayfishSkateboardingMod.java


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