本文整理汇总了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();
}
示例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;
}
示例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()]));
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
示例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();
}
示例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);
}
示例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);
}
示例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");
}
}
}
示例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);
}
示例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());
}
}