cpw.mods.fml.common.registry.EntityRegistry Java Examples

The following examples show how to use cpw.mods.fml.common.registry.EntityRegistry. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CraftWorld.java    From Thermos with GNU General Public License v3.0 6 votes vote down vote up
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());
}
 
Example #2
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
public static void ClearVanillaMobSpawns()
{
    for (int i = 0; i < BiomeGenBase.biomeList.length; i++)
    {
        if (BiomeGenBase.biomeList[i] != null)
        {
            EntityRegistry.removeSpawn(EntityCreeper.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySkeleton.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityZombie.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySpider.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityEnderman.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityCaveSpider.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySlime.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityGhast.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityPigZombie.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityMagmaCube.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityOcelot.class, EnumCreatureType.monster, BiomeGenBase.biomeList[i]);
        }
    }
}
 
Example #3
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 6 votes vote down vote up
public static void ClearVanillaSpawnLists()
{
    for (int i = 0; i < BiomeGenBase.biomeList.length; i++)
    {
        if (BiomeGenBase.biomeList[i] != null)
        {
            EntityRegistry.removeSpawn(EntityCow.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityPig.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySheep.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityChicken.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityWolf.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntitySquid.class, EnumCreatureType.waterCreature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityOcelot.class, EnumCreatureType.creature, BiomeGenBase.biomeList[i]);
            EntityRegistry.removeSpawn(EntityBat.class, EnumCreatureType.ambient, BiomeGenBase.biomeList[i]);
        }
    }
}
 
Example #4
Source File: ModEntityList.java    From Et-Futurum with The Unlicense 6 votes vote down vote up
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);
	}
}
 
Example #5
Source File: Chisel.java    From Chisel-2 with GNU General Public License v2.0 6 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event) {
	Features.init();

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

	addWorldgen(Features.MARBLE, ChiselBlocks.marble, Configurations.marbleAmount);
	addWorldgen(Features.LIMESTONE, ChiselBlocks.limestone, Configurations.limestoneAmount);
	addWorldgen(Features.ANDESITE, ChiselBlocks.andesite, Configurations.andesiteAmount, 40, 100, 0.5);
	addWorldgen(Features.GRANITE, ChiselBlocks.granite, Configurations.graniteAmount, 40, 100, 0.5);
	addWorldgen(Features.DIORITE, ChiselBlocks.diorite, Configurations.dioriteAmount, 40, 100, 0.5);
	GameRegistry.registerWorldGenerator(GeneratorChisel.INSTANCE, 1000);

       EntityRegistry.registerModEntity(EntityChiselSnowman.class, "snowman", 0, this, 80, 1, true);

	proxy.init();
	MinecraftForge.EVENT_BUS.register(this);
	FMLCommonHandler.instance().bus().register(instance);

	FMLInterModComms.sendMessage("Waila", "register", "com.cricketcraft.chisel.compat.WailaCompat.register");
}
 
Example #6
Source File: CraftLivingEntity.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public CraftLivingEntity(final CraftServer server, final net.minecraft.entity.EntityLivingBase entity) {
    super(server, entity);
    // Cauldron start
    this.entityClass = entity.getClass();
    this.entityName = EntityRegistry.getCustomEntityTypeName(entityClass);
    if (entityName == null)
        entityName = entity.getCommandSenderName();
    // Cauldron end

    if (entity instanceof net.minecraft.entity.EntityLiving) {
        equipment = new CraftEntityEquipment(this);
    }
}
 
Example #7
Source File: EntityRegistrator.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
public static void init(){
    // Entities
    // parms: entity class, mobname (for spawners), id, modclass, max player
    // distance for update, update frequency, boolean keep server updated
    // about velocities.
    EntityRegistry.registerModEntity(EntityVortex.class, "Vortex", 0, PneumaticCraft.instance, 80, 1, true);
    EntityRegistry.registerModEntity(EntityChopperSeeds.class, "Chopper Plant Seeds Entity", 2, PneumaticCraft.instance, 80, 1, true);
    EntityRegistry.registerModEntity(EntityPotionCloud.class, "Potion Cloud", 3, PneumaticCraft.instance, 80, 1, true);
    EntityRegistry.registerModEntity(EntityDrone.class, "Drone", 4, PneumaticCraft.instance, 80, 1, true);
    EntityRegistry.registerModEntity(EntityLogisticsDrone.class, "logisticDrone", 5, PneumaticCraft.instance, 80, 1, true);
    // Entity Eggs:
    // registerEntityEgg(EntityRook.class, 0xffffff, 0x000000);
}
 
Example #8
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 5 votes vote down vote up
private void registerEntity(Class<? extends Entity> entityClass, String entityName, int eggColor, int eggDotsColor, String visibleName)
{
    int entityID = EntityRegistry.findGlobalUniqueEntityId();
    LanguageRegistry.instance().addStringLocalization("entity." + entityName + ".name", "en_US", visibleName);
    EntityRegistry.registerGlobalEntityID(entityClass, entityName, entityID, eggColor, eggDotsColor);
    EntityRegistry.registerModEntity(entityClass, entityName, entityID, instance, 128, 1, true);
}
 
Example #9
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 5 votes vote down vote up
/**
 * For Litterbox and kittybeds
 * 
 * @param entityClass
 * @param entityName
 */
protected void registerEntity(Class<? extends Entity> entityClass, String entityName)
{
    int entityID = EntityRegistry.findGlobalUniqueEntityId();
    LanguageRegistry.instance().addStringLocalization("entity." + entityName + ".name", "en_US", entityName);
    //private static EntityEggInfo searchEggColor(Class entityClass , int entityId)
    //EntityEggInfo eggColors = MoCEggColour.searchEggColor(entityClass, entityID);
    EntityRegistry.registerGlobalEntityID(entityClass, entityName, entityID);
    EntityRegistry.registerModEntity(entityClass, entityName, entityID, instance, 128, 1, true);
}
 
Example #10
Source File: EntityDumper.java    From NEI-Integration with MIT License 5 votes vote down vote up
@Override
public Iterable<String[]> dump(int mode) {
    List<String[]> list = new LinkedList<String[]>();
    
    List<Integer> ids = new ArrayList<Integer>();
    ids.addAll(EntityList.IDtoClassMapping.keySet());
    Collections.sort(ids);
    
    for (int id : ids) {
        list.add(new String[] { GLOBAL, String.valueOf(id), EntityList.getStringFromID(id), EntityList.getClassFromID(id).getName() });
    }
    
    ListMultimap<ModContainer, EntityRegistration> modEntities = ReflectionHelper.getPrivateValue(EntityRegistry.class, EntityRegistry.instance(), "entityRegistrations");
    
    for (Entry<ModContainer, EntityRegistration> e : modEntities.entries()) {
        EntityRegistration er = e.getValue();
        list.add(new String[] { e.getKey().getModId(), String.valueOf(er.getModEntityId()), e.getKey().getModId() + "." + er.getEntityName(), er.getEntityClass().getName() });
    }
    
    Collections.sort(list, new Comparator<String[]>() {
        @Override
        public int compare(String[] s1, String[] s2) {
            if (s1[0].equals(GLOBAL) && !s1[0].equals(s2[0])) {
                return -1;
            }
            int i = s1[0].compareTo(s2[0]);
            if (i != 0) {
                return i;
            }
            return Integer.compare(Integer.valueOf(s1[1]), Integer.valueOf(s2[1]));
        }
    });
    
    return list;
}
 
Example #11
Source File: CommonProxy.java    From NOVA-Core with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void preInit(FMLPreInitializationEvent evt) {
	GameRegistry.registerTileEntity(FWTile.class, "novaTile");
	int globalUniqueEntityId = EntityRegistry.findGlobalUniqueEntityId();
	EntityRegistry.registerGlobalEntityID(FWEntity.class, "novaEntity", globalUniqueEntityId);
	EntityRegistry.registerModEntity(FWEntity.class, "novaEntity", globalUniqueEntityId, NovaMinecraft.instance, 64, 20, true);
}
 
Example #12
Source File: CraftCustomEntity.java    From Thermos with GNU General Public License v3.0 5 votes vote down vote up
public CraftCustomEntity(CraftServer server, net.minecraft.entity.Entity entity) {
    super(server, entity);
    this.entityClass = entity.getClass();
    this.entityName = EntityRegistry.getCustomEntityTypeName(entityClass);
    if (entityName == null)
        entityName = entity.getCommandSenderName();
}
 
Example #13
Source File: LookingGlass.java    From LookingGlass with GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event) {
	// Our one and only entity.
	EntityRegistry.registerModEntity(com.xcompwiz.lookingglass.entity.EntityPortal.class, "lookingglass.portal", 216, this, 64, 10, false);

	sidedProxy.init();
}
 
Example #14
Source File: ArchimedesShipMod.java    From archimedes-ships with MIT License 4 votes vote down vote up
@EventHandler
public void initMod(FMLInitializationEvent event)
{
	registerBlocksAndItems();
	
	EntityRegistry.registerModEntity(EntityShip.class, "shipmod", 1, this, 64, modConfig.shipEntitySyncRate, true);
	EntityRegistry.registerModEntity(EntityEntityAttachment.class, "attachment", 2, this, 64, 100, false);
	EntityRegistry.registerModEntity(EntitySeat.class, "attachment.seat", 3, this, 64, 100, false);
	EntityRegistry.registerModEntity(EntityParachute.class, "parachute", 4, this, 32, modConfig.shipEntitySyncRate, true);
	
	//In g/cm^3
	/*MaterialDensity.addDensity(Material.air, 0F);
	//MaterialDensity.addDensity(Material.wood, 0.700F);
	MaterialDensity.addDensity(Material.wood, 0.500F);
	MaterialDensity.addDensity(Material.rock, 2.500F);
	MaterialDensity.addDensity(Material.water, 1.000F);
	MaterialDensity.addDensity(Material.lava, 2.500F);
	MaterialDensity.addDensity(Material.ice, 0.916F);
	//MaterialDensity.addDensity(Material.iron, 7.874F);
	MaterialDensity.addDensity(Material.iron, 5.000F);
	MaterialDensity.addDensity(Material.anvil, 5.000F);
	//MaterialDensity.addDensity(Material.glass, 2.600F);
	MaterialDensity.addDensity(Material.glass, 0.400F);
	MaterialDensity.addDensity(Material.leaves, 0.200F);
	MaterialDensity.addDensity(Material.plants, 0.200F);
	//MaterialDensity.addDensity(Material.cloth, 1.314F);
	MaterialDensity.addDensity(Material.cloth, 0.700F);
	MaterialDensity.addDensity(Material.sand, 1.600F);
	MaterialDensity.addDensity(Material.ground, 2.000F);
	MaterialDensity.addDensity(Material.grass, 2.000F);
	MaterialDensity.addDensity(Material.clay, 2.000F);
	MaterialDensity.addDensity(Material.gourd, 0.900F);
	MaterialDensity.addDensity(Material.sponge, 0.400F);
	MaterialDensity.addDensity(Material.craftedSnow, 0.800F);
	MaterialDensity.addDensity(Material.tnt, 1.200F);
	MaterialDensity.addDensity(Material.piston, 1.000F);
	MaterialDensity.addDensity(Material.cloth, 0.100F);
	MaterialDensity.addDensity(materialFloater, 0.04F);
	MaterialDensity.addDensity(blockBalloon, 0.02F);*/
	
	proxy.registerKeyHandlers(modConfig);
	proxy.registerEventHandlers();
	proxy.registerRenderers();
	proxy.registerPackets(pipeline);
}
 
Example #15
Source File: BaseEntityRegistry.java    From Electro-Magic-Tools with GNU General Public License v3.0 4 votes vote down vote up
public static void registerEMTEntities() {

        EntityRegistry.registerModEntity(EntityLaser.class, "entityLaser", entityIDs++, ElectroMagicTools.instance, 80, 3, true);
        EntityRegistry.registerModEntity(EntityArcher.class, "entityArcher", entityIDs++, ElectroMagicTools.instance, 80, 3, true);
        registerEntityEgg(ARCHER_CLASS, 0x99111F, 0xE5685);
    }
 
Example #16
Source File: Chisel.java    From Chisel with GNU General Public License v2.0 4 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    File configFile = event.getSuggestedConfigurationFile();
    Configurations.configExists = configFile.exists();
    Configurations.config = new Configuration(configFile);
    Configurations.config.load();
    Configurations.refreshConfig();

    tabChisel = new CreativeTabs("tabChisel")
    {
        @Override
        public Item getTabIconItem()
        {
            return chisel;
        }
    };

    chisel = (ItemChisel) new ItemChisel(Carving.chisel).setTextureName("chisel:chisel").setCreativeTab(CreativeTabs.tabTools);
    GameRegistry.registerItem(chisel, "chisel");

    if(Configurations.featureEnabled("cloud"))
    {
        itemCloudInABottle = (ItemCloudInABottle) new ItemCloudInABottle().setTextureName("Chisel:cloudinabottle").setCreativeTab(CreativeTabs.tabTools);
        EntityRegistry.registerModEntity(EntityCloudInABottle.class, "CloudInABottle", 1, this, 40, 1, true);
        GameRegistry.registerItem(itemCloudInABottle, "cloudinabottle");
    }

    if(Configurations.featureEnabled("ballOfMoss"))
    {
        itemBallOMoss = (ItemBallOMoss) new ItemBallOMoss().setTextureName("Chisel:ballomoss").setCreativeTab(CreativeTabs.tabTools);
        EntityRegistry.registerModEntity(EntityBallOMoss.class, "BallOMoss", 2, this, 40, 1, true);
        GameRegistry.registerItem(itemBallOMoss, "ballomoss");
    }

    if(Configurations.featureEnabled("smashingRock"))
    {
        smashingRock = (ItemSmashingRock) new ItemSmashingRock().setTextureName("Chisel:smashingrock").setCreativeTab(CreativeTabs.tabTools);
        EntityRegistry.registerModEntity(EntitySmashingRock.class, "SmashingRock", 2, this, 40, 1, true);
        GameRegistry.registerItem(smashingRock, "smashingrock");
    }
    ChiselBlocks.load();
    proxy.preInit();
}
 
Example #17
Source File: CommonProxy.java    From Et-Futurum with The Unlicense 4 votes vote down vote up
public void registerEntities() {
	if (EtFuturum.enableBanners)
		GameRegistry.registerTileEntity(TileEntityBanner.class, Utils.getUnlocalisedName("banner"));
	if (EtFuturum.enableArmourStand)
		ModEntityList.registerEntity(EntityArmourStand.class, "wooden_armorstand", 0, EtFuturum.instance, 64, 1, true);
	if (EtFuturum.enableEndermite)
		ModEntityList.registerEntity(EntityEndermite.class, "endermite", 1, EtFuturum.instance, 64, 1, true, 1447446, 7237230);
	if (EtFuturum.enableChorusFruit)
		GameRegistry.registerTileEntity(TileEntityEndRod.class, Utils.getUnlocalisedName("end_rod"));
	if (EtFuturum.enableTippedArrows)
		ModEntityList.registerEntity(EntityTippedArrow.class, "tipped_arrow", 2, EtFuturum.instance, 64, 20, true);
	if (EtFuturum.enableBrewingStands)
		GameRegistry.registerTileEntity(TileEntityNewBrewingStand.class, Utils.getUnlocalisedName("brewing_stand"));
	if (EtFuturum.enableColourfulBeacons)
		GameRegistry.registerTileEntity(TileEntityNewBeacon.class, Utils.getUnlocalisedName("beacon"));

	if (EtFuturum.enableRabbit) {
		ModEntityList.registerEntity(EntityRabbit.class, "rabbit", 3, EtFuturum.instance, 80, 3, true, 10051392, 7555121);

		List<BiomeGenBase> biomes = new LinkedList<BiomeGenBase>();
		label: for (BiomeGenBase biome : BiomeGenBase.getBiomeGenArray())
			if (biome != null)
				// Check if pigs can spawn on this biome
				for (Object obj : biome.getSpawnableList(EnumCreatureType.creature))
					if (obj instanceof SpawnListEntry) {
						SpawnListEntry entry = (SpawnListEntry) obj;
						if (entry.entityClass == EntityPig.class) {
							biomes.add(biome);
							continue label;
						}
					}
		EntityRegistry.addSpawn(EntityRabbit.class, 10, 3, 3, EnumCreatureType.creature, biomes.toArray(new BiomeGenBase[biomes.size()]));
	}

	if (EtFuturum.enableLingeringPotions) {
		ModEntityList.registerEntity(EntityLingeringPotion.class, "lingering_potion", 4, EtFuturum.instance, 64, 10, true);
		ModEntityList.registerEntity(EntityLingeringEffect.class, "lingering_effect", 5, EtFuturum.instance, 64, 1, true);
	}

	if (EtFuturum.enableVillagerZombies)
		ModEntityList.registerEntity(EntityZombieVillager.class, "villager_zombie", 6, EtFuturum.instance, 80, 3, true, 44975, 7969893);

	if (EtFuturum.enableDragonRespawn) {
		ModEntityList.registerEntity(EntityPlacedEndCrystal.class, "end_crystal", 7, EtFuturum.instance, 256, Integer.MAX_VALUE, false);
		ModEntityList.registerEntity(EntityRespawnedDragon.class, "ender_dragon", 8, EtFuturum.instance, 160, 3, true);
	}

	if (EtFuturum.enableShearableGolems)
		ModEntityList.registerEntity(EntityNewSnowGolem.class, "snow_golem", 9, EtFuturum.instance, 80, 3, true);
}
 
Example #18
Source File: RegisteredEntities.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
private static void registerEntity(Class<? extends Entity> entityClass, String name, int trackingRange, int updateFreq, boolean sendVelUpdates) {
    int id = EntityRegistry.findGlobalUniqueEntityId();
    EntityRegistry.registerGlobalEntityID(entityClass, name, id);
    EntityRegistry.registerModEntity(entityClass, name, id, Gadomancy.instance, trackingRange, updateFreq, sendVelUpdates);
}
 
Example #19
Source File: MoCreatures.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Populates spawn lists with MoCreatures or MoCreatures plus vanilla and other custom mobs (if modifyVanillaSpawns is true)
 * if useCustomSpawner is false, it will populate the Forge/MC spawn lists
 */
public static void populateSpawns()
{
    if (proxy.debugLogging) log.info("Populating spawns...");

    MoCConfigCategory entities = proxy.MoCconfig.getCategory(proxy.CATEGORY_ENTITY_BIOME_SETTINGS);
    Map<String, MoCEntityData> entityList = proxy.mocEntityMap; // add mocreatures only
    if (proxy.modifyVanillaSpawns) // if we are modifying the vanilla spawns then use the complete entity list containing all entities
    {
        entityList = proxy.entityMap;
    }
    if (proxy.debugLogging) log.info("Scanning MoCProperties.cfg for entities...");
    for (Entry<String, MoCProperty> entityEntry : entities.entrySet())
    {
        if (proxy.debugLogging) log.info("Found entity " + entityEntry.getKey());
        if (proxy.entityMap.containsKey(entityEntry.getKey()));
        {
            if (proxy.debugLogging) log.info("Entity " + entityEntry.getKey() + " exists in entityMap, proceeding...");
            MoCProperty biomeGroups = entityEntry.getValue();
            if (proxy.debugLogging) log.info("Detected " + biomeGroups.valueList.size() + " Biome Groups for entity, verifying list...");

            for (int i = 0; i < biomeGroups.valueList.size(); i++)
            {
                if (proxy.debugLogging) log.info("Found Biome Group " + biomeGroups.valueList.get(i));
                if (proxy.biomeGroupMap.containsKey(biomeGroups.valueList.get(i))) // if valid biome group from MoCBiomeGroups.cfg continue
                {
                    if (proxy.debugLogging) log.info("Group is valid, scanning biomes...");
                    List biomeGroup = proxy.biomeGroupMap.get(biomeGroups.valueList.get(i)).getBiomeList();
                    List<BiomeGenBase> entitySpawnBiomes = new ArrayList<BiomeGenBase>();
                    MoCEntityData entityData = entityList.get(entityEntry.getKey());//entityClass.getValue();
                    for (int j = 0; j < biomeGroup.size(); j++)
                    {
                        if (proxy.debugLogging) log.info("Found biome " + biomeGroup.get(j));
                        if (proxy.biomeMap.get(biomeGroup.get(j)) != null)
                        {
                            entitySpawnBiomes.add(proxy.biomeMap.get(biomeGroup.get(j)).getBiome());
                            if (proxy.debugLogging) log.info("Added biome " + biomeGroup.get(j) + " for entity " + entityEntry.getKey());
                        }else
                        {
                            if (proxy.debugLogging) log.info("Skipping biome " + biomeGroup.get(j) + " for entity " + entityEntry.getKey() + " as that biome is not loaded");
                        }
                    }
                    if (entitySpawnBiomes.size() > 0 && entityData != null)
                    {
                        if (proxy.debugLogging) log.info("entitySpawnBiomes size = " + entitySpawnBiomes.size());
                        BiomeGenBase[] biomesToSpawn = new BiomeGenBase[entitySpawnBiomes.size()];
                        biomesToSpawn = entitySpawnBiomes.toArray(biomesToSpawn);
                        if (proxy.useCustomSpawner)
                        {
                        	if (entityData.frequency > 0 && entityData.minGroup > 0 && entityData.maxGroup > 0)
                        	{
                        		myCustomSpawner.AddCustomSpawn(entityData.getEntityClass(), entityData.frequency, entityData.minGroup, entityData.maxGroup, entityData.getType(), biomesToSpawn);
                                if (proxy.debugLogging) log.info("Added " + entityData.getEntityClass() + " to CustomSpawner spawn lists");
                        	}else
                        	{
                        		//myCustomSpawner.RemoveCustomSpawn(entityData.getEntityClass(), entityData.getType(), biomesToSpawn);
                        	}
                            
                            //otherwise the Forge spawnlist remains pouplated with duplicated entries on CMS
                            EntityRegistry.removeSpawn(entityData.getEntityClass(), entityData.getType(), biomesToSpawn); 
                            if (proxy.debugLogging) log.info("Removed " + entityData.getEntityClass() + " from Vanilla spawn lists");
                        }
                        else //use Forge Spawn method instead
                        {
                        	if (entityData.frequency > 0 && entityData.minGroup > 0 && entityData.maxGroup > 0)
                        	{
                        		EntityRegistry.addSpawn(entityData.getEntityClass(), entityData.frequency, entityData.minGroup, entityData.maxGroup, entityData.getType(), biomesToSpawn);
                                if (proxy.debugLogging) log.info("Added " + entityData.getEntityClass() + " to Vanilla spawn lists");
                        	}else
                        	{
                        	    if (proxy.debugLogging) log.info("Removed " + entityData.getEntityClass() + " from Vanilla spawn lists");
                        		EntityRegistry.removeSpawn(entityData.getEntityClass(), entityData.getType(), biomesToSpawn); 
                        	}
                            
                        }
                    }
                    
                }
            }
        }
    }
}
 
Example #20
Source File: ClientProxy.java    From PneumaticCraft with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void registerRenders(){
    SPECIAL_RENDER_TYPE_VALUE = RenderingRegistry.getNextAvailableRenderId();
    blockRenderers.add(new RenderElevatorFrame());
    blockRenderers.add(new RenderChargingStationPad());

    for(ISBRHPneumatic renderer : blockRenderers) {
        RenderingRegistry.registerBlockHandler(renderer);
    }

    RenderingRegistry.registerBlockHandler(new RenderModelBase());
    // RenderingRegistry.registerBlockHandler(new RendererSpecialBlock());
    registerBaseModelRenderer(Blockss.airCompressor, TileEntityAirCompressor.class, new ModelAirCompressor("airCompressor"));
    registerBaseModelRenderer(Blockss.advancedAirCompressor, TileEntityAdvancedAirCompressor.class, new ModelAirCompressor("advancedAirCompressor"));
    registerBaseModelRenderer(Blockss.assemblyController, TileEntityAssemblyController.class, new ModelAssemblyController());
    registerBaseModelRenderer(Blockss.assemblyDrill, TileEntityAssemblyDrill.class, new ModelAssemblyDrill());
    registerBaseModelRenderer(Blockss.assemblyIOUnit, TileEntityAssemblyIOUnit.class, new ModelAssemblyIOUnit());
    registerBaseModelRenderer(Blockss.assemblyLaser, TileEntityAssemblyLaser.class, new ModelAssemblyLaser());
    registerBaseModelRenderer(Blockss.assemblyPlatform, TileEntityAssemblyPlatform.class, new ModelAssemblyPlatform());
    registerBaseModelRenderer(Blockss.chargingStation, TileEntityChargingStation.class, new ModelChargingStation());
    registerBaseModelRenderer(Blockss.creativeCompressor, TileEntityCreativeCompressor.class, new BaseModel("creativeCompressor.obj"));
    registerBaseModelRenderer(Blockss.electrostaticCompressor, TileEntityElectrostaticCompressor.class, new BaseModel("electrostaticCompressor.obj"));
    registerBaseModelRenderer(Blockss.elevatorBase, TileEntityElevatorBase.class, new ModelElevatorBase());
    registerBaseModelRenderer(Blockss.pneumaticDoor, TileEntityPneumaticDoor.class, new ModelPneumaticDoor());
    registerBaseModelRenderer(Blockss.pneumaticDoorBase, TileEntityPneumaticDoorBase.class, new ModelPneumaticDoorBase());
    registerBaseModelRenderer(Blockss.pressureChamberInterface, TileEntityPressureChamberInterface.class, new ModelPressureChamberInterface());
    registerBaseModelRenderer(Blockss.securityStation, TileEntitySecurityStation.class, new ModelComputer(Textures.MODEL_SECURITY_STATION));
    registerBaseModelRenderer(Blockss.universalSensor, TileEntityUniversalSensor.class, new ModelUniversalSensor());
    registerBaseModelRenderer(Blockss.uvLightBox, TileEntityUVLightBox.class, new ModelUVLightBox());
    registerBaseModelRenderer(Blockss.vacuumPump, TileEntityVacuumPump.class, new ModelVacuumPump());
    registerBaseModelRenderer(Blockss.omnidirectionalHopper, TileEntityOmnidirectionalHopper.class, new ModelOmnidirectionalHopper(Textures.MODEL_OMNIDIRECTIONAL_HOPPER));
    registerBaseModelRenderer(Blockss.liquidHopper, TileEntityLiquidHopper.class, new ModelLiquidHopper());
    registerBaseModelRenderer(Blockss.programmer, TileEntityProgrammer.class, new ModelComputer(Textures.MODEL_PROGRAMMER));
    registerBaseModelRenderer(Blockss.plasticMixer, TileEntityPlasticMixer.class, new ModelPlasticMixer());
    registerBaseModelRenderer(Blockss.liquidCompressor, TileEntityLiquidCompressor.class, new BaseModel("liquidCompressor.obj"));
    registerBaseModelRenderer(Blockss.advancedLiquidCompressor, TileEntityAdvancedLiquidCompressor.class, new BaseModel("liquidCompressor.obj", "advancedLiquidCompressor.png"));
    registerBaseModelRenderer(Blockss.heatSink, TileEntityHeatSink.class, new ModelHeatSink());
    registerBaseModelRenderer(Blockss.vortexTube, TileEntityVortexTube.class, new ModelVortexTube());
    registerBaseModelRenderer(Blockss.thermopneumaticProcessingPlant, TileEntityThermopneumaticProcessingPlant.class, new ModelThermopneumaticProcessingPlant());
    registerBaseModelRenderer(Blockss.refinery, TileEntityRefinery.class, new ModelRefinery());
    registerBaseModelRenderer(Blockss.gasLift, TileEntityGasLift.class, new ModelGasLift());
    registerBaseModelRenderer(Blockss.keroseneLamp, TileEntityKeroseneLamp.class, new ModelKeroseneLamp());
    registerBaseModelRenderer(Blockss.sentryTurret, TileEntitySentryTurret.class, new ModelSentryTurret());

    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityPressureTube.class, new RenderPressureTube());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAirCannon.class, new RenderAirCannon());
    // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElevatorBase.class, new RenderElevatorBase());
    // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAdvancedPressureTube.class, new RenderAdvancedPressureTube());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityAphorismTile.class, new RenderAphorismTile());
    ClientRegistry.bindTileEntitySpecialRenderer(TileEntityElevatorCaller.class, new RenderElevatorCaller());
    // ClientRegistry.bindTileEntitySpecialRenderer(TileEntityProgrammableController.class, new RenderProgrammableController());
    // ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySentryTurret.class, new RenderSentryTurret());

    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Blockss.pressureTube), new RenderItemPressureTube(false));
    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Blockss.advancedPressureTube), new RenderItemPressureTube(true));

    MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Blockss.airCannon), new RenderModelBase(new ModelAirCannon()));
    MinecraftForgeClient.registerItemRenderer(Itemss.vortexCannon, new RenderItemVortexCannon());
    // MinecraftForgeClient.registerItemRenderer(Blocks.elevatorBase, new RenderItemElevatorBase());
    MinecraftForgeClient.registerItemRenderer(Itemss.cannonBarrel, new RenderItemCannonParts(false));
    MinecraftForgeClient.registerItemRenderer(Itemss.stoneBase, new RenderItemCannonParts(true));
    MinecraftForgeClient.registerItemRenderer(Itemss.pneumaticCylinder, new RenderItemPneumaticCilinder());
    //   MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(Blockss.advancedPressureTube), new RenderItemAdvancedPressureTube());
    MinecraftForgeClient.registerItemRenderer(Itemss.drone, new RenderItemDrone(false));
    MinecraftForgeClient.registerItemRenderer(Itemss.logisticsDrone, new RenderItemDrone(true));
    MinecraftForgeClient.registerItemRenderer(Itemss.programmingPuzzle, new RenderItemProgrammingPuzzle());
    MinecraftForgeClient.registerItemRenderer(Itemss.minigun, new RenderItemMinigun());
    if(Config.useHelmetModel) MinecraftForgeClient.registerItemRenderer(Itemss.pneumaticHelmet, new RenderItemPneumaticHelmet());

    RenderingRegistry.registerEntityRenderingHandler(EntityVortex.class, new RenderEntityVortex());
    RenderingRegistry.registerEntityRenderingHandler(EntityChopperSeeds.class, new RenderEntityChopperSeeds());
    RenderingRegistry.registerEntityRenderingHandler(EntityPotionCloud.class, new RenderEntityPotionCloud());
    RenderingRegistry.registerEntityRenderingHandler(EntityDrone.class, new RenderDrone(false));
    RenderingRegistry.registerEntityRenderingHandler(EntityLogisticsDrone.class, new RenderDrone(true));
    RenderingRegistry.registerEntityRenderingHandler(EntityProgrammableController.class, new RenderDrone(false));

    RenderingRegistry.registerEntityRenderingHandler(EntityRing.class, new RenderEntityRing());
    EntityRegistry.registerModEntity(EntityRing.class, "Ring", 100, PneumaticCraft.instance, 80, 1, true);

    registerModuleRenderers();
    super.registerRenders();
}