Skip to content

Commit

Permalink
Also added spawn eggs to 1.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
rubensworks committed Feb 28, 2014
1 parent 3a7b00c commit ceff08e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 7 deletions.
15 changes: 15 additions & 0 deletions common/evilcraft/api/config/elementtypeaction/MobAction.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package evilcraft.api.config.elementtypeaction;

import net.minecraft.entity.EntityEggInfo;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityLiving;
import net.minecraftforge.common.Configuration;
import cpw.mods.fml.common.registry.EntityRegistry;
Expand Down Expand Up @@ -38,6 +40,19 @@ public void postRun(MobConfig eConfig, Configuration config) {
// Add I18N
LanguageRegistry.instance().addStringLocalization("entity." + Reference.MOD_ID + ".instance." + eConfig.NAMEDID + ".name", eConfig.NAME);
LanguageRegistry.instance().addStringLocalization("entity." + Reference.MOD_ID + "." + eConfig.NAMEDID + ".name", eConfig.NAME);
registerSpawnEgg(clazz, eConfig.getBackgroundEggColor(), eConfig.getForegroundEggColor());
}

@SuppressWarnings("unchecked")
private static void registerSpawnEgg(Class<? extends EntityLiving> entity, int backgroundColor, int foregroundColor) {
int globalEntityID = 0;
while (EntityList.getStringFromID(globalEntityID) != null){
globalEntityID++;
}

EntityList.IDtoClassMapping.put(globalEntityID, entity);
EntityList.entityEggs.put(globalEntityID, new EntityEggInfo(globalEntityID, backgroundColor, foregroundColor));

}

}
7 changes: 4 additions & 3 deletions common/evilcraft/entities/monster/NetherfishConfig.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package evilcraft.entities.monster;

import net.minecraft.client.renderer.entity.Render;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.entity.Render;
import evilcraft.Reference;
import evilcraft.api.Helpers;
import evilcraft.api.config.ElementTypeCategory;
import evilcraft.api.config.MobConfig;
import evilcraft.api.config.configurable.ConfigurableProperty;
Expand Down Expand Up @@ -47,12 +48,12 @@ public boolean isEnabled() {

@Override
public int getBackgroundEggColor() {
return 123456;
return Helpers.RGBToInt(73, 27, 20);
}

@Override
public int getForegroundEggColor() {
return 654321;
return Helpers.RGBToInt(160, 45, 27);
}

@SideOnly(Side.CLIENT)
Expand Down
5 changes: 3 additions & 2 deletions common/evilcraft/entities/monster/PoisonousLibelleConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import evilcraft.Reference;
import evilcraft.api.Helpers;
import evilcraft.api.config.ElementTypeCategory;
import evilcraft.api.config.MobConfig;
import evilcraft.api.config.configurable.ConfigurableProperty;
Expand Down Expand Up @@ -51,12 +52,12 @@ public boolean isEnabled() {

@Override
public int getBackgroundEggColor() {
return 123456;
return Helpers.RGBToInt(57, 125, 27);
}

@Override
public int getForegroundEggColor() {
return 654321;
return Helpers.RGBToInt(196, 213, 57);
}

@SideOnly(Side.CLIENT)
Expand Down
5 changes: 3 additions & 2 deletions common/evilcraft/entities/monster/WerewolfConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import evilcraft.Reference;
import evilcraft.api.Helpers;
import evilcraft.api.config.ElementTypeCategory;
import evilcraft.api.config.MobConfig;
import evilcraft.api.config.configurable.ConfigurableProperty;
Expand Down Expand Up @@ -48,12 +49,12 @@ public boolean isEnabled() {

@Override
public int getBackgroundEggColor() {
return 123456;
return Helpers.RGBToInt(105, 67, 18);
}

@Override
public int getForegroundEggColor() {
return 654321;
return Helpers.RGBToInt(57, 25, 10);
}

@SideOnly(Side.CLIENT)
Expand Down

0 comments on commit ceff08e

Please sign in to comment.