public static void registerEntityEgg(Class eClass, String name, BiomeGenBase... biomes) { int id = getUniqueEntityId(); Random rand = new Random(name.hashCode()); int mainColor = rand.nextInt() * 16777215; int secondColor = rand.nextInt() * 16777215; EntityRegistry.registerGlobalEntityID(eClass, name, id); //TODO Model error //EntityRegistry.registerModEntity(eClass, name, id, ARKCraft.instance(), 64, 4, true); EntityRegistry.addSpawn(eClass, CoreBalance.DINO_PROPERTIES.SPAWN_PROBABILITY, 2, 4, EnumCreatureType.CREATURE, biomes); EntityList.idToClassMapping.put(id, eClass); EntityList.entityEggs.put(Integer.valueOf(id), new EntityList.EntityEggInfo(id, mainColor, secondColor)); }
@SuppressWarnings("unchecked") private static void addVanillaSpawnEggs() throws RuntimeException { for (EntityEggInfo info : (Collection<EntityEggInfo>) EntityList.entityEggs.values()) { int registerID = VANILLA_START + info.spawnedID; String mobID = EntityList.getStringFromID(info.spawnedID); if (registerID > Short.MAX_VALUE || registerID < Short.MIN_VALUE) throw new RuntimeException("RegisterID out of bounds for " + mobID); try { SpawnEggRegistry.registerSpawnEgg(new SpawnEggInfo((short)registerID, mobID, new NBTTagCompound(), info.primaryColor, info.secondaryColor)); } catch(IllegalArgumentException e) { throw new RuntimeException(e); } } }
public static net.minecraft.stats.StatBase getEntityStatistic(org.bukkit.Statistic stat, EntityType entity) { EntityEggInfo entityEggInfo = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(entity.getTypeId())); if (entityEggInfo != null) { return entityEggInfo.field_151512_d; } return null; }
public static EntityEggInfo registerEntityEgg(String id, Class<? extends Entity> entity, int primaryColor, int secondaryColor) { ResourceLocation res = CrystalMod.resourceL(id); EntityEggInfo info = new EntityEggInfo(res, primaryColor, secondaryColor); EntityList.ENTITY_EGGS.put(res, info); return info; }
public static void registerMonster(Class eClass, String name, BiomeGenBase... biomes) { int eggID = EntityRegistry.findGlobalUniqueEntityId(); Random rand = new Random(name.hashCode()); int mainColor = rand.nextInt() * 16777215; int secondColor = rand.nextInt() * 16777215; EntityRegistry.registerGlobalEntityID(eClass, name, eggID); EntityRegistry.addSpawn(eClass, 25, 2, 4, EnumCreatureType.CREATURE, biomes); EntityRegistry .registerModEntity(eClass, name, ++entityID, ARKCraft.instance(), 64, 3, true); EntityList.entityEggs.put(Integer.valueOf(eggID), new EntityList.EntityEggInfo(++entityID, mainColor, secondColor)); }
public static void registerMonster(Class eClass, String name) { int eggID = EntityRegistry.findGlobalUniqueEntityId(); Random rand = new Random(name.hashCode()); int mainColor = rand.nextInt() * 16777215; int secondColor = rand.nextInt() * 16777215; EntityRegistry.registerGlobalEntityID(eClass, name, eggID); EntityRegistry.addSpawn(eClass, 25, 2, 4, EnumCreatureType.CREATURE, BiomeGenBase.beach, BiomeGenBase.desert, BiomeGenBase.forest, BiomeGenBase.birchForest, BiomeGenBase.extremeHills); EntityRegistry.registerModEntity(eClass, name, entityID, ARKCraft.instance(), 64, 1, true); EntityList.entityEggs.put(Integer.valueOf(eggID), new EntityList.EntityEggInfo(entityID, mainColor, secondColor)); }
@Override protected StatBase getOverrideCallbackValue(StatBase originalValue) { if (requiresParameterBlock()) { return StatList.getBlockStats(parameterBlock); } else if (requiresParameterItem()) { String statId = originalValue.statId; if ("stat.pickup".equals(statId)) { return StatList.getObjectsPickedUpStats(parameterItem); } else if ("stat.drop".equals(statId)) { return StatList.getDroppedObjectStats(parameterItem); } else if ("stat.useItem".equals(statId)) { return StatList.getObjectUseStats(parameterItem); } else if ("stat.breakItem".equals(statId)) { return StatList.getObjectBreakStats(parameterItem); } else if ("stat.craftItem".equals(statId)) { return StatList.getCraftStats(parameterItem); } else { throw new AssertionError(); } } else if (requiresParameterEntity()) { EntityEggInfo eggInfo = EntityList.ENTITY_EGGS.get(parameterEntity); if ("stat.killEntity".equals(originalValue.statId)) { return eggInfo.killEntityStat; } else { return eggInfo.entityKilledByStat; } } else { return originalValue; } }
/** * @param entityClass a Entity__.class * @param entityName name of entity * @param the color of egg */ @Override public void registerEntity(Class<? extends Entity> entityClass, String entityName, int bkEggColor, int fgEggColor) { int id = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerGlobalEntityID(entityClass, entityName, id); EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColor, fgEggColor)); }
@Override public void registerEntity(Class<? extends Entity> entityClass, String entityName, int bkEggColor, int fgEggColor) { int id = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerGlobalEntityID(entityClass, entityName, id); EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColor, fgEggColor)); }
@Override public void registerEgg() { super.registerEgg(); int eggID = ProjectZulu_Core.getNextDefaultEggID(); while (EntityList.IDtoClassMapping.containsKey(eggID)) { eggID = ProjectZulu_Core.getNextDefaultEggID(); } EntityList.IDtoClassMapping.put(eggID, mobClass); EntityList.entityEggs.put(eggID, new EntityEggInfo(eggID, eggColor1, eggColor2)); }
@SuppressWarnings("unchecked") public static void registerEntityEgg(Class<? extends Entity> entity, int colPrim, int colSec) { int id = getUniqueEntityID(); EntityList.IDtoClassMapping.put(id, entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, colPrim, colSec)); return; }
@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); } }
public static void createZombie(String name, Class<? extends EntityLiving> entityClass, int id, int secondaryColor) { EntityRegistry.registerModEntity(entityClass, name, id, PvZ.instance, 80, 3, true); EntityList.IDtoClassMapping.put(id, entityClass); EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, primaryColor, secondaryColor)); EntityRegistry.addSpawn(entityClass, 20, 2, 6, EnumCreatureType.monster, spawnBiomes); }
public static void createPlant(int id, Class<? extends Entity> entityClass, String name, int secondaryColor) { EntityRegistry.registerModEntity(entityClass, name, id, PvZ.instance, 80, 3, true); EntityList.IDtoClassMapping.put(id, entityClass); EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor)); }
@SuppressWarnings("unchecked") public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) { int id = getUniqueEntityId(); EntityList.IDtoClassMapping.put(id, entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor)); }
private static void addMob(MappedCategory category, String soundId, ResourceLocation mobId, boolean isHostile) { final EntityEggInfo mobInfo = EntityList.ENTITY_EGGS.get(mobId); // TODO maybe some default colors for egg-less mobs? if (mobInfo != null) addMob(category, soundId, isHostile, mobInfo.primaryColor, mobInfo.secondaryColor); else addMob(category, soundId, isHostile, 0xFFFFFFFF, 0x00000000); }
private static void addEntityEgg(Class<?> entity, int i, int j) { int id = (Integer)EntityList.classToIDMapping.get(entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, i, j)); }
public static void registerEntity(Class<? extends Entity> entity, int primaryColor, int secondaryColor) { int id = getUniqueEntityId(); EntityList.idToClassMapping.put(id, entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor)); }
@Override public void initGui() { guiLeft = (width - xSize) / 2; guiTop = (height - ySize) / 2; linkCollection = WikiLinkAPI.linkRegistry.getLink(topic); topicName = linkCollection.getTopicName(); if(topic instanceof ItemStack) { stack = (ItemStack) topic; } else if(topic instanceof Entity) { EntityEggInfo egg = (EntityEggInfo) EntityList.entityEggs.get(Integer.valueOf(EntityList.getEntityID((Entity) topic))); if(egg != null) { stack = new ItemStack(Items.spawn_egg, 1, egg.spawnedID); } } browserButton = new GuiButton(0, guiLeft + 7, guiTop + 149, 68, 20, StatCollector.translateToLocal("wikilink.gui.browser")); clipboardButton = new GuiButton(1, guiLeft + 79, guiTop + 149, 68, 20, StatCollector.translateToLocal("wikilink.gui.clipboard")); summarizeButton = new GuiButton(2, guiLeft + 152, guiTop + 149, 16, 20, StatCollector.translateToLocal("wikilink.gui.summarize")); browserButton.enabled = false; clipboardButton.enabled = false; summarizeButton.enabled = false; buttonList.add(browserButton); buttonList.add(clipboardButton); buttonList.add(summarizeButton); int index = 0; linkButtons = new GuiButtonLink[linkCollection.getAllLinks().size()]; ArrayList<ILink> links = new ArrayList<ILink>(); links.addAll(linkCollection.getAllLinks()); Collections.sort(links, WikiLinkAPI.linkRegistry.getLinkComparator()); Collections.sort(links, WikiLinkAPI.linkRegistry.getLinkComparator()); for(ILink link : links) { linkButtons[index] = new GuiButtonLink(3 + index, guiLeft + 8, guiTop + 26 + index * 24, 138, 24, link); linkButtons[index].enabled = false; linkButtons[index].visible = false; buttonList.add(linkButtons[index]); index++; } scrollTo(0.0F); }
public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) { int id = getUniqueEntityId(); EntityList.IDtoClassMapping.put(id, entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor)); }
public void registerEntity(Class<? extends Entity> entityClass, String entityName, int bkEggColor, int fgEggColor) { int id = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerGlobalEntityID(entityClass, entityName, id); EntityList.entityEggs.put(Integer.valueOf(id), new EntityEggInfo(id, bkEggColor, fgEggColor)); }
public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor){ int id = getUniqueEntityId(); EntityList.IDtoClassMapping.put(id, entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor)); }
/** * In here an entity egg will be registered */ public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) { int id = getUniqueEntityId(); EntityList.IDtoClassMapping.put(id, entity); EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor)); }
/** * @param safariNet * The Safari Net that is looking for egg info. * * @return An EntityEggInfo, or null if this instance cannot handle this * mob. */ public EntityEggInfo getEgg(ItemStack safariNet);
/** * @param safariNet The Safari Net that is looking for egg info. * @return An EntityEggInfo, or null if this instance cannot handle this mob. */ public EntityEggInfo getEgg(ItemStack safariNet);