Skip to content

Instantly share code, notes, and snippets.

@WillR27
Created July 4, 2014 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save WillR27/4dc74083bc4cd7f37d3d to your computer and use it in GitHub Desktop.
Save WillR27/4dc74083bc4cd7f37d3d to your computer and use it in GitHub Desktop.
package com.blocklings.entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.world.biome.BiomeGenBase;
import com.blocklings.main.Blocklings;
import cpw.mods.fml.common.registry.EntityRegistry;
public class RegisterBlockling {
public static void registerEntity() {
createEntity(EntityBlockling.class, "entity_blockling", 0x79553A, 0x6FAE44);
}
public static void createEntity(Class entityClass, String entityName, int solidColour, int spotColour) {
int randomID = EntityRegistry.findGlobalUniqueEntityId();
EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomID);
EntityRegistry.registerModEntity(entityClass, entityName, randomID, Blocklings.modInstance, 64, 1, true);
EntityRegistry.addSpawn(entityName, 50, 1, 1, EnumCreatureType.monster,
BiomeGenBase.birchForest,
BiomeGenBase.birchForestHills,
BiomeGenBase.coldBeach,
BiomeGenBase.coldTaiga,
BiomeGenBase.extremeHills,
BiomeGenBase.extremeHillsEdge,
BiomeGenBase.extremeHillsPlus,
BiomeGenBase.forest,
BiomeGenBase.forestHills,
BiomeGenBase.jungle,
BiomeGenBase.jungleEdge,
BiomeGenBase.jungleHills,
BiomeGenBase.megaTaiga,
BiomeGenBase.megaTaigaHills,
BiomeGenBase.plains,
BiomeGenBase.roofedForest,
BiomeGenBase.swampland,
BiomeGenBase.taiga,
BiomeGenBase.taigaHills);
CreateEgg(randomID, solidColour, spotColour);
}
private static void CreateEgg(int randomID, int solidColour, int spotColour) {
EntityList.entityEggs.put(Integer.valueOf(randomID), new EntityList.EntityEggInfo(randomID, solidColour, spotColour));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment