當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。