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


Java EntityEntry类代码示例

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


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

示例1: registerTeleportBlacklist

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
public static void registerTeleportBlacklist(String[] blacklist)
{
    TELEPORT_BLACKLIST_CLASSES.clear();

    for (String name : blacklist)
    {
        EntityEntry entry = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(name));

        if (entry != null && entry.getEntityClass() != null)
        {
            TELEPORT_BLACKLIST_CLASSES.add(entry.getEntityClass());
        }
        else
        {
            EnderUtilities.logger.warn("Unknown Entity type '{}' on the teleport blacklist", name);
        }
    }
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:19,代码来源:BlackLists.java

示例2: generateDefaultSpawnCosts

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
private static String[] generateDefaultSpawnCosts(){
    List<String> lines = Lists.newArrayList();
    for(EntityEntry entry : ForgeRegistries.ENTITIES.getValues()){
        if(EntityLiving.class.isAssignableFrom(entry.getEntityClass())) {
            lines.add(entry.getName()+":0");
        }
    }
    return lines.toArray(new String[lines.size()]);
}
 
开发者ID:talandar,项目名称:ProgressiveDifficulty,代码行数:10,代码来源:Region.java

示例3: getMobList

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
private String[] getMobList(){
    List<String> lines = Lists.newArrayList();
    for(EntityEntry entry : ForgeRegistries.ENTITIES.getValues()){
        if(EntityLiving.class.isAssignableFrom(entry.getEntityClass())) {
            lines.add(entry.getName());
        }
    }
    return lines.toArray(new String[lines.size()]);
}
 
开发者ID:talandar,项目名称:ProgressiveDifficulty,代码行数:10,代码来源:ServerCommand.java

示例4: createEntity

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
private static EntityEntry createEntity(Class<? extends Entity> entityClass, String name, int eggPrimary, int eggSecondary) {
    ResourceLocation location = new ResourceLocation(Reference.MOD_ID, name);
    EntityEntry entry = new EntityEntry(entityClass, location.toString());
    entry.setRegistryName(location);
    entry.setEgg(new EntityList.EntityEggInfo(location, eggPrimary, eggSecondary));
    entities.add(entry);
    return entry;
}
 
开发者ID:GirafiStudios,项目名称:Waddles,代码行数:9,代码来源:PenguinRegistry.java

示例5: registerPenguins

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
@SubscribeEvent
public static void registerPenguins(RegistryEvent.Register<EntityEntry> event) {
    int id = 0;
    for (EntityEntry entry : entities) {
        event.getRegistry().register(entry);
        id++;
        EntityRegistry.registerModEntity(entry.getRegistryName(), entry.getEntityClass(), entry.getName(), id, Waddles.instance, 64, 1, true, entry.getEgg().primaryColor, entry.getEgg().secondaryColor);
    }
}
 
开发者ID:GirafiStudios,项目名称:Waddles,代码行数:10,代码来源:PenguinRegistry.java

示例6: addPenguinSpawn

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
public static void addPenguinSpawn(Class<? extends EntityAgeable> penguinClass, EntityEntry penguinEntry, int defaultWeight, int defaultMin, int defaultMax, Biome... biomes) {
    String subCategoryNames = ConfigurationHandler.CATEGORY_PENGUIN_SPAWNS + Configuration.CATEGORY_SPLITTER + penguinEntry.getRegistryName().getResourcePath();
    int weight = ConfigurationHandler.config.get(subCategoryNames, "Weight", defaultWeight).getInt();
    int min = ConfigurationHandler.config.get(subCategoryNames, "Min", defaultMin).getInt();
    int max = ConfigurationHandler.config.get(subCategoryNames, "Max", defaultMax).getInt();

    ConfigurationHandler.config.save();

    if (weight != 0) {
        EntityRegistry.addSpawn(penguinClass, weight, min, max, EnumCreatureType.CREATURE, biomes);
    }
}
 
开发者ID:GirafiStudios,项目名称:Waddles,代码行数:13,代码来源:PenguinRegistry.java

示例7: setMobColours

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
public static void setMobColours(Map<String, Integer> mobColours)
{
    if (mobColours == null || mobColours.isEmpty())
        idealMobColours = null;
    else
    {
        idealMobColours = new HashMap<String, Integer>();
        // Convert the names from our XML entity type into recognisable entity names:
        String id = null;
        for (String oldname : mobColours.keySet())
        {
            for (EntityEntry ent : net.minecraftforge.fml.common.registry.ForgeRegistries.ENTITIES)
            {
               if (ent.getName().equals(oldname))
               {
                   id = ent.getRegistryName().toString();
                   break;
               }
            }
            if (id != null)
            {
                idealMobColours.put(id, mobColours.get(oldname));
            }
        }
    }
    texturesToColours.clear();
}
 
开发者ID:Microsoft,项目名称:malmo,代码行数:28,代码来源:TextureHelper.java

示例8: register

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void register(InfinityMod mod, IForgeRegistry<EntityEntry> registry) {
    ResourceLocation registryName = new ResourceLocation(mod.getModId(), this.getName());
    if(hasEgg) {
        this.setEgg(new EntityList.EntityEggInfo(registryName, primaryColor, secondaryColor));
    }
    if(doSpawn && EntityLiving.class.isAssignableFrom(this.getEntityClass())) {
        EntityRegistry.addSpawn((Class<? extends EntityLiving>) this.getEntityClass(), weight, min, max, type, biomes);
    }
    InfinityLib.proxy.register(mod, registry, this, this.getName());
    this.callback.run();
}
 
开发者ID:InfinityRaider,项目名称:InfinityLib,代码行数:13,代码来源:EntityRegistryEntry.java

示例9: registerEntities

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
@Override
public void registerEntities(InfinityMod mod, IForgeRegistry<EntityEntry> registry) {
    ReflectionHelper.forEachIn(mod.getModEntityRegistry(), EntityRegistryEntry.class, (EntityRegistryEntry entry) -> {
        if(entry.isEnabled()) {
            entry.registerClient(mod, registry);
        }
    });
}
 
开发者ID:InfinityRaider,项目名称:InfinityLib,代码行数:9,代码来源:ClientProxy.java

示例10: registerEntities

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
default void registerEntities(InfinityMod mod, IForgeRegistry<EntityEntry> registry) {
    ReflectionHelper.forEachIn(mod.getModEntityRegistry(), EntityRegistryEntry.class,
            (EntityRegistryEntry entry) -> {
                if (entry.isEnabled()) {
                    entry.register(mod, registry);
                }
            });
}
 
开发者ID:InfinityRaider,项目名称:InfinityLib,代码行数:9,代码来源:IProxy.java

示例11: registerEntitys

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
@SubscribeEvent
public void registerEntitys (RegistryEvent.Register<EntityEntry> event) {

    for (final EntityEntryBuilder<? extends Entity> entry : this.helper.getEntities()) {

        event.getRegistry().register(entry.build());
    }
}
 
开发者ID:Darkhax-Minecraft,项目名称:Bookshelf,代码行数:9,代码来源:AutoRegistry.java

示例12: getEntityClass

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
public Class<? extends EntityLivingBase> getEntityClass() {
	return _entityClassLookupCache.computeIfAbsent(entityID, id ->
		Optional.ofNullable(ForgeRegistries.ENTITIES.getValue(new ResourceLocation(id)))
			.map(EntityEntry::getEntityClass)
			.filter(EntityLivingBase.class::isAssignableFrom)
			.map(c -> c.asSubclass(EntityLivingBase.class))
		).orElse(null);
}
 
开发者ID:copygirl,项目名称:WearableBackpacks,代码行数:9,代码来源:BackpackRegistry.java

示例13: setValue

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
@Override
public void setValue(BackpackEntityEntry value) {
	_value = value;
	
	Optional<EntityEntry> entry = getEntityEntry(value.entityID);
	_knownEntity      = entry.isPresent();
	Severity severity = Status.getSeverity(getStatus());
	boolean isFine    = (severity == Severity.FINE);
	
	int numEntries = value.getEntries().size();
	String entriesTextKey = "config." + WearableBackpacks.MOD_ID + ".entity.entry";
	// First we try to translate "[...].entity.entry.<num>".
	String entriesText = I18n.format(entriesTextKey + "." + numEntries);
	if (entriesText.equals(entriesTextKey + "." + numEntries))
		// If not found, use "[...].entity.entry" instead.
		entriesText = I18n.format(entriesTextKey, numEntries);
	// ... I miss C#'s ?? operator :(
	
	buttonMove.setEnabled(!value.isDefault);
	buttonRemove.setEnabled(!value.isDefault);
	
	labelName.setText(getEntityEntryName(entry, value.entityID));
	labelName.setColor(value.isDefault ? GuiUtils.getColorCode('8', true)
	                 : isFine          ? GuiUtils.getColorCode('7', true)
	                                   : severity.foregroundColor);
	
	buttonEdit.setText(entriesText);
	if (!_knownEntity) buttonEdit.setTextColor(Severity.WARN.foregroundColor);
	else buttonEdit.unsetTextColor();
}
 
开发者ID:copygirl,项目名称:WearableBackpacks,代码行数:31,代码来源:EntryListEntities.java

示例14: register

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的package包/类
public static void register(IForgeRegistry<EntityEntry> event)
{
	ModelResourceLocation res0 = new ModelResourceLocation(EntityRock.GetRegistryName(), "entity");
	EntityEntry entry0 = EntityEntryBuilder.create().entity(EntityRock.class).id(res0, 0).name(EntityRock.GetRegistryName()).tracker(15, 80, true).build();
	ModelResourceLocation res1 = new ModelResourceLocation(EntityGrenade.GetRegistryName(), "entity");
	EntityEntry entry1 = EntityEntryBuilder.create().entity(EntityGrenade.class).id(res1, 1).name(EntityGrenade.GetRegistryName()).tracker(15, 80, true).build();
	ModelResourceLocation res2 = new ModelResourceLocation(EntityDynamite.GetRegistryName(), "entity");
	EntityEntry entry2 = EntityEntryBuilder.create().entity(EntityDynamite.class).id(res2, 2).name(EntityDynamite.GetRegistryName()).tracker(15, 80, true).build();
	event.registerAll(entry0, entry1, entry2);
}
 
开发者ID:lukeplechaty,项目名称:Ores-and-Tools,代码行数:11,代码来源:setEntites.java

示例15: onEntityRegister

import net.minecraftforge.fml.common.registry.EntityEntry; //导入依赖的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


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