Jump to content

[1.7.2] Crash When Adding New Creature Type UPDATED: [New Issue 1.7.10]


Recommended Posts

Posted

I am adding a new creature type to my mod to try and prevent my mobs from taking up the spawn limit and removing other mobs entirely. It seems that the new Enum isnt being registered correctly

 

here is the line for adding the new enum

public static EnumCreatureType chickens = EnumHelper.addCreatureType("chickens", EntityAnimal.class, 20, Material.air, false);

 

here is the crash report

 

 

---- Minecraft Crash Report ----
// Why is it breaking 

Time: 10/16/14 1:19 AM
Description: Initializing game

java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:420)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:484)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:201)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)
at net.minecraft.client.Minecraft.run(Minecraft.java:892)
at net.minecraft.client.main.Main.main(Main.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.RuntimeException: net.minecraft.entity.EnumCreatureType.<init>(java.lang.String, int, java.lang.Class, int, net.minecraft.block.material.Material, boolean)
at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:280)
at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:207)
at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:192)
at net.minecraftforge.common.util.EnumHelper.addCreatureType(EnumHelper.java:78)
at me.saxon564.mochickens.MoChickens.<clinit>(MoChickens.java:70)
... 35 more
Caused by: java.lang.NoSuchMethodException: net.minecraft.entity.EnumCreatureType.<init>(java.lang.String, int, java.lang.Class, int, net.minecraft.block.material.Material, boolean)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getDeclaredConstructor(Unknown Source)
at net.minecraftforge.common.util.EnumHelper.getConstructorAccessor(EnumHelper.java:148)
at net.minecraftforge.common.util.EnumHelper.makeEnum(EnumHelper.java:157)
at net.minecraftforge.common.util.EnumHelper.addEnum(EnumHelper.java:270)
... 39 more


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.constructMod(FMLModContainer.java:420)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:209)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:188)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74)
at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:314)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296)
at com.google.common.eventbus.EventBus.post(EventBus.java:267)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at cpw.mods.fml.common.Loader.loadMods(Loader.java:484)
at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:201)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:522)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:892)
at net.minecraft.client.main.Main.main(Main.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
Minecraft Version: 1.7.2
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_07, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 858105256 bytes (818 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.01-pre FML v7.2.137.1048 Minecraft Forge 10.12.0.1048 4 mods loaded, 4 mods active
mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed
FML{7.2.137.1048} [Forge Mod Loader] (forgeSrc-1.7.2-10.12.0.1048.jar) Unloaded->Constructed
Forge{10.12.0.1048} [Minecraft Forge] (forgeSrc-1.7.2-10.12.0.1048.jar) Unloaded->Constructed
mochickens{1.4.1} [Mo Chickens] (bin) Unloaded
Launched Version: 1.6
LWJGL: 2.9.0
OpenGL: Intel(R) HD Graphics 4000 GL version 3.3.0 - Build 8.15.10.2712, Intel
Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
Anisotropic Filtering: Off (1)

 

 

 

I am not sure what exactly the issue is with this. It seems like an issue within forge itself, but Im sure its not.

 

If you need to see anything else just let me know.

Posted

Hi

 

I suspect you might be right

 

net.minecraft.entity.EnumCreatureType.<init>(java.lang.String, int, java.lang.Class, int, net.minecraft.block.material.Material, boolean)

 

that constructor signature is for sure not right.  Not that I know enough about reflection to tell what's going wrong.

 

It might be worth a try changing this from a static initialiser to an explicit initialiser in preInit, just in case it's some strange initialisation order thing.  Otherwise you could try submitting a possible bug report and seeing what response you get.

 

-TGG

 

 

 

Posted

so i didnt read the post properly before, youre trying to do this for....

public static EnumCreatureType chickens = EnumHelper.addCreatureType("chickens", EntityAnimal.class, 20, Material.air, false);

youre entity is peaceful yet you have peaceful set as false? maybe there is a conflict here with entityanimal.class and you saying its not peaceful (entitymob), worth a shot correcting it anyway... set it to true and see what happens

 

the parameters are below :)

 

static EnumCreatureType net.minecraftforge.common.EnumHelper.addCreatureType(String name,Class typeClass,int maxNumber,Material material, boolean peaceful)

Posted

Hi

 

I suspect you might be right

 

net.minecraft.entity.EnumCreatureType.<init>(java.lang.String, int, java.lang.Class, int, net.minecraft.block.material.Material, boolean)

 

that constructor signature is for sure not right.  Not that I know enough about reflection to tell what's going wrong.

 

It might be worth a try changing this from a static initialiser to an explicit initialiser in preInit, just in case it's some strange initialisation order thing.  Otherwise you could try submitting a possible bug report and seeing what response you get.

 

-TGG

I just moved it around and removed the static modifier, and it still crashed with the same error

 

so i didnt read the post properly before, youre trying to do this for....

public static EnumCreatureType chickens = EnumHelper.addCreatureType("chickens", EntityAnimal.class, 20, Material.air, false);

youre entity is peaceful yet you have peaceful set as false? maybe there is a conflict here with entityanimal.class and you saying its not peaceful (entitymob), worth a shot correcting it anyway... set it to true and see what happens

 

the parameters are below :)

 

static EnumCreatureType net.minecraftforge.common.EnumHelper.addCreatureType(String name,Class typeClass,int maxNumber,Material material, boolean peaceful)

I wouldn't think that would make a difference, but i tried it anyway. Still crashed with same error. I guess its an error in forge itself, which means it will not get fixed for 1.7.2. oh well. at least I can do this for 1.7.10

 

 

I tested it in the most recent 1.7.10 and I still get a crash, but its when adding the spawns of the chickens.

New Crash:

 

 

---- Minecraft Crash Report ----
// I'm sorry, Dave.

Time: 10/16/14 2:46 PM
Description: Initializing game

java.lang.NullPointerException: Initializing game
at cpw.mods.fml.common.registry.EntityRegistry.addSpawn(EntityRegistry.java:262)
at me.saxon564.mochickens.MoChickens.entitySpawns(MoChickens.java:306)
at me.saxon564.mochickens.MoChickens.postInit(MoChickens.java:270)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:694)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:586)
at net.minecraft.client.Minecraft.run(Minecraft.java:931)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at GradleStart.bounce(GradleStart.java:107)
at GradleStart.startClient(GradleStart.java:100)
at GradleStart.main(GradleStart.java:55)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at cpw.mods.fml.common.registry.EntityRegistry.addSpawn(EntityRegistry.java:262)
at me.saxon564.mochickens.MoChickens.entitySpawns(MoChickens.java:306)
at me.saxon564.mochickens.MoChickens.postInit(MoChickens.java:270)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
at cpw.mods.fml.common.Loader.initializeMods(Loader.java:694)
at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:586)

-- Initialization --
Details:
Stacktrace:
at net.minecraft.client.Minecraft.run(Minecraft.java:931)
at net.minecraft.client.main.Main.main(Main.java:164)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at GradleStart.bounce(GradleStart.java:107)
at GradleStart.startClient(GradleStart.java:100)
at GradleStart.main(GradleStart.java:55)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 7 (amd64) version 6.1
Java Version: 1.7.0_07, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 692121632 bytes (660 MB) / 1038876672 bytes (990 MB) up to 1038876672 bytes (990 MB)
JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.85.1226 Minecraft Forge 10.13.1.1226 4 mods loaded, 4 mods active
mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized
FML{7.10.85.1226} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.1.1226.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized
Forge{10.13.1.1226} [Minecraft Forge] (forgeSrc-1.7.10-10.13.1.1226.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized
mochickens{1.6.0.010} [Mo Chickens] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Errored
Launched Version: 1.7.10
LWJGL: 2.9.1
OpenGL: Intel(R) HD Graphics 4000 GL version 3.3.0 - Build 8.15.10.2712, Intel
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: English (US)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)

 

 

 

Main Class (Warning: Very Long):

 

 

package me.saxon564.mochickens;

import java.util.List;


import me.saxon564.mochickens.entities.mobs.EntityBeefyChicken;
import me.saxon564.mochickens.entities.mobs.EntityBlazingChicken;
import me.saxon564.mochickens.entities.mobs.EntityClayChicken;
import me.saxon564.mochickens.entities.mobs.EntityCoalChicken;
import me.saxon564.mochickens.entities.mobs.EntityCookieChicken;
import me.saxon564.mochickens.entities.mobs.EntityCreeperChicken;
import me.saxon564.mochickens.entities.mobs.EntityDiamondChicken;
import me.saxon564.mochickens.entities.mobs.EntityEmeraldChicken;
import me.saxon564.mochickens.entities.mobs.EntityEnchantedChicken;
import me.saxon564.mochickens.entities.mobs.EntityEnderChicken;
import me.saxon564.mochickens.entities.mobs.EntityGiantChicken;
import me.saxon564.mochickens.entities.mobs.EntityGlowingChicken;
import me.saxon564.mochickens.entities.mobs.EntityGoldChicken;
import me.saxon564.mochickens.entities.mobs.EntityIronChicken;
import me.saxon564.mochickens.entities.mobs.EntityLapisChicken;
import me.saxon564.mochickens.entities.mobs.EntityNuuwChicken;
import me.saxon564.mochickens.entities.mobs.EntityQuartzChicken;
import me.saxon564.mochickens.entities.mobs.EntityRainbowChicken;
import me.saxon564.mochickens.entities.mobs.EntityRedstoneChicken;
import me.saxon564.mochickens.entities.mobs.EntitySkeletonChicken;
import me.saxon564.mochickens.entities.mobs.EntitySnowChicken;
import me.saxon564.mochickens.proxies.CommonProxyMoChickens;
import me.saxon564.mochickens.recipes.CraftingRecipes;
import me.saxon564.mochickens.registers.RegisterBiomes;
import me.saxon564.mochickens.registers.RegisterBlocks;
import me.saxon564.mochickens.registers.RegisterChickens;
import me.saxon564.mochickens.registers.RegisterEggs;
import me.saxon564.mochickens.registers.RegisterGameInfo;
import me.saxon564.mochickens.registers.RegisterItems;
import me.saxon564.mochickens.registers.RegisterOreDict;
import me.saxon564.mochickens.registers.RegisterDimensions;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.passive.EntityBat;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.World;
import net.minecraft.world.WorldProvider;
import net.minecraft.world.WorldProviderHell;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.oredict.OreDictionary;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;


@Mod(modid = MoChickensReference.MODID, name = MoChickensReference.MODNAME, version = MoChickensReference.VERSION)
public class MoChickens {
@SidedProxy(clientSide = "me.saxon564.mochickens.client.ClientProxyMoChickens", serverSide = "me.saxon564.mochickens.proxies.CommonProxyMoChickens")
public static CommonProxyMoChickens proxy;

@Instance("mochickens")
public static MoChickens instance;
//EnumCreatureType.creature

public static EnumCreatureType chickens = EnumHelper.addCreatureType("Chickens", EntityAnimal.class, 20, Material.air, false, true);

// Public Biome Data
public static int[] cold = new int[500];
public static int coldNum = 0;
public static int[] hot = new int[500];
public static int hotNum = 0;
public static int[] moderate = new int[500];
public static int moderateNum = 0;
public static int[] clay = new int[500];
public static int clayNum = 0;
public static Class[] egg = new Class[500];
public static int eggNum = 0;

// Initialize Items
public static Item tamingDisc;
public static Item innerTamingDisc;
public static Item coalStick;
public static Item ironStick;
public static Item goldStick;
public static Item redstoneStick;
public static Item lapisStick;
public static Item diamondStick;
public static Item emeraldStick;
public static Item quartzStick;
public static Item randomEgg;
public static Item itemRedstoneFeather;
public static Item itemCoalFeather;
public static Item itemIronFeather;
public static Item itemGoldFeather;
public static Item itemLapisFeather;
public static Item itemDiamondFeather;
public static Item itemEmeraldFeather;
public static Item itemQuartzFeather;
public static Item itemEnchantedFeather;
public static Item itemLighter;

//Initialize Blocks
public static Block blockFeatherPortal;
public static Block blockFeatherBlock;
public static Block blockRedstoneFeatherBlock;
public static Block blockCoalFeatherBlock;
public static Block blockIronFeatherBlock;
public static Block blockGoldFeatherBlock;
public static Block blockLapisFeatherBlock;
public static Block blockDiamondFeatherBlock;
public static Block blockEmeraldFeatherBlock;
public static Block blockQuartzFeatherBlock;
public static Block blockEnchantedFeatherBlock;
public static Block blockMasterFeatherBlock;
public static Block blockCoalGemOreBlock;
public static Block blockChickenFire;

// Initialize spawn checks
public static boolean coalSpawn;
public static boolean ironSpawn;
public static boolean goldSpawn;
public static boolean redstoneSpawn;
public static boolean lapisSpawn;
public static boolean diamondSpawn;
public static boolean emeraldSpawn;
public static boolean giantSpawn;
public static boolean quartzSpawn;
public static boolean cookieSpawn;
public static boolean snowSpawn;
public static boolean claySpawn;
public static boolean rainbowSpawn;
public static boolean skeletonSpawn;
public static boolean enderSpawn;
public static boolean creeperSpawn;
public static boolean beefySpawn;
public static boolean glowingSpawn;
public static boolean blazingSpawn;
public static boolean enchantedSpawn;
public static boolean nuuwSpawn;

// Initialize untamed despawn checks
public static boolean coalUntamedDespawn;
public static boolean ironUntamedDespawn;
public static boolean goldUntamedDespawn;
public static boolean redstoneUntamedDespawn;
public static boolean lapisUntamedDespawn;
public static boolean diamondUntamedDespawn;
public static boolean emeraldUntamedDespawn;
public static boolean giantUntamedDespawn;
public static boolean quartzUntamedDespawn;
public static boolean cookieUntamedDespawn;
public static boolean snowUntamedDespawn;
public static boolean clayUntamedDespawn;
public static boolean rainbowUntamedDespawn;
public static boolean skeletonUntamedDespawn;
public static boolean enderUntamedDespawn;
public static boolean creeperUntamedDespawn;
public static boolean beefyUntamedDespawn;
public static boolean glowingUntamedDespawn;
public static boolean blazingUntamedDespawn;
public static boolean enchantedUntamedDespawn;
public static boolean nuuwUntamedDespawn;


// Initialize tamed despawn checks
public static boolean coalTamedDespawn;
public static boolean ironTamedDespawn;
public static boolean goldTamedDespawn;
public static boolean redstoneTamedDespawn;
public static boolean lapisTamedDespawn;
public static boolean diamondTamedDespawn;
public static boolean emeraldTamedDespawn;
public static boolean giantTamedDespawn;
public static boolean quartzTamedDespawn;
public static boolean cookieTamedDespawn;
public static boolean snowTamedDespawn;
public static boolean clayTamedDespawn;
public static boolean rainbowTamedDespawn;
public static boolean skeletonTamedDespawn;
public static boolean enderTamedDespawn;
public static boolean creeperTamedDespawn;
public static boolean beefyTamedDespawn;
public static boolean glowingTamedDespawn;
public static boolean blazingTamedDespawn;
public static boolean enchantedTamedDespawn;
public static boolean nuuwTamedDespawn;

//Chickens IDs
public static int coalChickenId;
public static int ironChickenId;
public static int goldChickenId;
public static int redstoneChickenId;
public static int lapisChickenId;
public static int diamondChickenId;
public static int emeraldChickenId;
public static int quartzChickenId;
public static int giantChickenId;
public static int cookieChickenId;
public static int snowChickenId;
public static int clayChickenId;
public static int rainbowChickenId;
public static int skeletonChickenId;
public static int enderChickenId;
public static int creeperChickenId;
public static int beefyChickenId;
public static int glowingChickenId;
public static int blazingChickenId;
public static int enchantedChickenId;
public static int nuuwChickenId;

//Dimensions
public static int chickenDimensionId;

//Biomes
public static BiomeGenBase biomeChickenForest;
public static BiomeGenBase biomeChickenPlains;
public static int biomeChickenForestId;
public static int biomeChickenPlainsId;

public static int startEntityId = 300;

public static CreativeTabs moChickensTab = new CreativeTabs("MoChickens") {
	public Item getTabIconItem() {
		return Items.egg;
	}
};

@EventHandler
public void preInit(FMLPreInitializationEvent event) {

	ConfigSet.Config(event);

	RegisterItems.itemRegisters();
	RegisterBlocks.blockRegisters();
	RegisterDimensions.dimensionRegisters();
	RegisterBiomes.biomeRegisters();
}

@EventHandler
public void load(FMLInitializationEvent event) {
	RegisterChickens.entityRegisters();
	RegisterEggs.EggRegisters();
	// RegisterGameInfo.GameRegisters();
	CraftingRecipes.CraftingRecipieManager();
	RegisterOreDict.AddOres();
	proxy.registerSounds();
	proxy.registerRenders();
}

@EventHandler
public void postInit(FMLPostInitializationEvent event) {
	generateBiomeData();
	entitySpawns();
	randomSpawnEgg(EntityCoalChicken.class);
	randomSpawnEgg(EntityIronChicken.class);
	randomSpawnEgg(EntityGoldChicken.class);
	randomSpawnEgg(EntityLapisChicken.class);
	randomSpawnEgg(EntityRedstoneChicken.class);
	randomSpawnEgg(EntityDiamondChicken.class);
	randomSpawnEgg(EntityEmeraldChicken.class);
	randomSpawnEgg(EntityQuartzChicken.class);
	randomSpawnEgg(EntityGiantChicken.class);
	randomSpawnEgg(EntityClayChicken.class);
	randomSpawnEgg(EntityRainbowChicken.class);
	randomSpawnEgg(EntitySnowChicken.class);
	randomSpawnEgg(EntityCookieChicken.class);
	randomSpawnEgg(EntitySkeletonChicken.class);
	randomSpawnEgg(EntityCreeperChicken.class);
	randomSpawnEgg(EntityEnderChicken.class);
	randomSpawnEgg(EntityBeefyChicken.class);
	randomSpawnEgg(EntityGlowingChicken.class);
	randomSpawnEgg(EntityBlazingChicken.class);
	randomSpawnEgg(EntityEnchantedChicken.class);
	randomSpawnEgg(EntityNuuwChicken.class);
	randomSpawnEgg(EntityBat.class);
	randomSpawnEgg(EntityBat.class);
	randomSpawnEgg(EntityBat.class);
}

public static void randomSpawnEgg(Class c) {
	egg[eggNum] = c;
	eggNum++;
}

// Add Spawns
public void entitySpawns() {
	if (diamondSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityDiamondChicken.class, 5, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityDiamondChicken.class, 5, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (coalSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityCoalChicken.class, 10, 1, 5,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityCoalChicken.class, 10, 1, 5,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (ironSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityIronChicken.class, 9, 1, 3,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityIronChicken.class, 9, 1, 3,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (goldSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityGoldChicken.class, 7, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityGoldChicken.class, 7, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (lapisSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityLapisChicken.class, 7, 1, 3,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityLapisChicken.class, 7, 1, 3,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (redstoneSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityRedstoneChicken.class, 6, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityRedstoneChicken.class, 6, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (emeraldSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityEmeraldChicken.class, 5, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityEmeraldChicken.class, 5, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (giantSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityGiantChicken.class, 4, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityGiantChicken.class, 4, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (quartzSpawn == true) {
		EntityRegistry.addSpawn(EntityQuartzChicken.class, 5, 1, 4,
				this.chickens, BiomeGenBase.hell);
	}

	if (cookieSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityCookieChicken.class, 8, 2, 4,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityCookieChicken.class, 8, 2, 4,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (snowSpawn == true) {
		for (int i = 0; i <= coldNum; i++) {
			EntityRegistry.addSpawn(EntitySnowChicken.class, 3, 1, 5,
					this.chickens,
					BiomeGenBase.getBiome(cold[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}
	if (claySpawn == true) {
		for (int i = 0; i <= clayNum; i++) {
			EntityRegistry.addSpawn(EntityClayChicken.class, 6, 1, 2,
					this.chickens,
					BiomeGenBase.getBiome(clay[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (rainbowSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityRainbowChicken.class, 7, 2, 5,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityRainbowChicken.class, 7, 2, 5,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (skeletonSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntitySkeletonChicken.class, 7, 1, 3,
					EnumCreatureType.monster,
					BiomeGenBase.getBiome(moderate[i]));
			//System.out.println("Skeleton can spawn in biome: " +
			//BiomeGenBase.getBiome(moderate[i]).biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntitySkeletonChicken.class, 7, 1, 3,
					EnumCreatureType.monster,
					BiomeGenBase.getBiome(cold[i]));
			 //System.out.println("Skeleton can spawn in biome: " +
			 //BiomeGenBase.getBiome(hot[i]).biomeName.toLowerCase());
		}
		for (int i = 0; i <= coldNum; i++) {
			EntityRegistry.addSpawn(EntitySkeletonChicken.class, 5, 1, 3,
					EnumCreatureType.monster,
					BiomeGenBase.getBiome(cold[i]));
			 //System.out.println("Skeleton can spawn in biome: " +
			 //BiomeGenBase.getBiome(cold[i]).biomeName.toLowerCase());
		}
	}

	if (enderSpawn == true) {
		for (int i = 0; i <= coldNum; i++) {
			EntityRegistry.addSpawn(EntityEnderChicken.class, 3, 1, 4,
					this.chickens,
					BiomeGenBase.getBiome(cold[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityEnderChicken.class, 3, 1, 4,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityEnderChicken.class, 3, 1, 4,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		// EntityRegistry.addSpawn(EntityEnderChickenMob.class, 10, 1, 10,
		// this.chickens, BiomeGenBase.sky);
	}

	if (creeperSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityCreeperChicken.class, 5, 1, 3,
					EnumCreatureType.monster,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry
					.addSpawn(EntityCreeperChicken.class, 5, 1, 3,
							EnumCreatureType.monster,
							BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= coldNum; i++) {
			EntityRegistry.addSpawn(EntityCreeperChicken.class, 5, 1, 3,
					EnumCreatureType.monster,
					BiomeGenBase.getBiome(cold[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (beefySpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityBeefyChicken.class, 8, 2, 4,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityBeefyChicken.class, 8, 2, 4,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (glowingSpawn == true) {
		EntityRegistry.addSpawn(EntityGlowingChicken.class, 5, 1, 4,
				this.chickens, BiomeGenBase.hell);
	}

	if (blazingSpawn == true) {
		EntityRegistry.addSpawn(EntityGlowingChicken.class, 5, 1, 4,
				this.chickens, BiomeGenBase.hell);
	}

	if (enchantedSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityEnchantedChicken.class, 8, 2, 4,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			 //System.out.println("Can spawn in biome: " +
			 //BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityEnchantedChicken.class, 8, 2, 4,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			 //System.out.println("Can spawn in biome: " +
			 //BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}

	if (nuuwSpawn == true) {
		for (int i = 0; i <= moderateNum; i++) {
			EntityRegistry.addSpawn(EntityNuuwChicken.class, 8, 2, 4,
					this.chickens,
					BiomeGenBase.getBiome(moderate[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
		for (int i = 0; i <= hotNum; i++) {
			EntityRegistry.addSpawn(EntityNuuwChicken.class, 8, 2, 4,
					this.chickens,
					BiomeGenBase.getBiome(hot[i]));
			// System.out.println("Can spawn in biome: " +
			// BiomeGenBase.biomeList[cold[i]].biomeName.toLowerCase());
		}
	}
}

public static void generateBiomeData() {
	int coldMin = 0;
	int moderateMin = 0;
	int hotMin = 0;
	int clayMin = 0;
	for (int i = 0; i < BiomeGenBase.getBiomeGenArray().length; i++) {
		BiomeGenBase biome = BiomeGenBase.getBiome(i);
		if ((biome != null) && (!biome.biomeName.toLowerCase().equalsIgnoreCase("chicken forest")) && (!biome.biomeName.toLowerCase().equalsIgnoreCase("chicken plains")))
			if (biome.biomeName == null) {
				System.out
						.println("[Mo' Chickens] Biome (id "
								+ i
								+ ") has null name, could not build spawn information.");
			} else {
				String name = biome.biomeName.toLowerCase();
				float E = biome.temperature;
				float F = biome.rainfall;
				float H = biome.rootHeight;
				int I = biome.theBiomeDecorator.flowersPerChunk;
				int J = biome.theBiomeDecorator.grassPerChunk;
				int K = biome.theBiomeDecorator.treesPerChunk;
				int C = biome.theBiomeDecorator.clayPerChunk;
				// System.out.println("Name:" + name + " Temp: " + E +
				// " id: " + i);
				if (E <= 0.1) {
					// System.out.println("min is: " + coldMin + " i is: " +
					// i);
					cold[coldMin] = i;
					coldNum = coldMin;
					coldMin++;
				}
				if (E >= 0.1 && E <= 1.0) {
					// System.out.println("min is: " + moderateMin +
					// " i is: " + i);
					moderate[moderateMin] = i;
					moderateNum = moderateMin;
					moderateMin++;
				}
				if (E >= 1.0) {
					// System.out.println("min is: " + hotMin + " i is: " +
					// i);
					hot[hotMin] = i;
					hotNum = hotMin;
					hotMin++;
				}
				if (C >= 3.0) {
					// System.out.println("min is: " + clayMin + " i is: " +
					// i);
					clay[clayMin] = i;
					clayNum = clayMin;
					clayMin++;
				}
			}
	}
}
}

 

 

Posted

Hi

 

Looks like - if you add a new creature type, you must only spawn it in biomes that you have created yourself.

 

Look at BiomeGenBase.getSpawnableList() - if it can't find your enum creature value, it returns null list instead of an empty list, which causes this NPE.

 

I think it's probably more trouble than it's worth to create a new creature type, unless you've got a really good reason for doing so?

 

-TGG

Posted

Hi

 

Looks like - if you add a new creature type, you must only spawn it in biomes that you have created yourself.

 

Look at BiomeGenBase.getSpawnableList() - if it can't find your enum creature value, it returns null list instead of an empty list, which causes this NPE.

 

I think it's probably more trouble than it's worth to create a new creature type, unless you've got a really good reason for doing so?

 

-TGG

 

Now come on TGG last time you told me something along these lines I worked around it. lol remember? http://www.minecraftforge.net/forum/index.php/topic,18850.html

Still appreciate the help though, and I'm sure theres a way to do this. The reason I want to is because I have gotten numerous people say that when they have Mo Creatures installed, the chickens are no where to be found. I know it's not id conflicts, and the only other thing that makes sense is that Mo Creatures if filling up the spawn cap for the creature type. So I want to make a chicken type so that the chickens can still spawn even with Mo Creature installed.

Posted

Now come on TGG last time you told me something along these lines I worked around it. lol remember? http://www.minecraftforge.net/forum/index.php/topic,18850.html

Well surely I'll be right eventually and then I can say "I told you so!" :)

 

Still appreciate the help though, and I'm sure theres a way to do this. The reason I want to is because I have gotten numerous people say that when they have Mo Creatures installed, the chickens are no where to be found. I know it's not id conflicts, and the only other thing that makes sense is that Mo Creatures if filling up the spawn cap for the creature type. So I want to make a chicken type so that the chickens can still spawn even with Mo Creature installed.

For sure there's a way to make your chickens spawn more often.  Have you tried adjusting the spawn weights?  You could also consider WorldEvent.PotentialSpawns to force a list of chickens every few spawns.

 

-TGG

 

 

 

Posted

Now come on TGG last time you told me something along these lines I worked around it. lol remember? http://www.minecraftforge.net/forum/index.php/topic,18850.html

Well surely I'll be right eventually and then I can say "I told you so!" :)

I think you may get to this time...

 

Still appreciate the help though, and I'm sure theres a way to do this. The reason I want to is because I have gotten numerous people say that when they have Mo Creatures installed, the chickens are no where to be found. I know it's not id conflicts, and the only other thing that makes sense is that Mo Creatures if filling up the spawn cap for the creature type. So I want to make a chicken type so that the chickens can still spawn even with Mo Creature installed.

For sure there's a way to make your chickens spawn more often.  Have you tried adjusting the spawn weights?  You could also consider WorldEvent.PotentialSpawns to force a list of chickens every few spawns.

 

-TGG

 

 

 

Well then 2 new files to clean it up, here I come! Since as it is, the spawning codes are very long to accommodate spawning configs.

 

On the other hand, I wonder if that's actually the case because Ender Chickens aren't spawning in the end, and Mo Creatures doesn't add any mobs to the end.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.