Jump to content

RosarioMokaChan

Members
  • Posts

    20
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

RosarioMokaChan's Achievements

Tree Puncher

Tree Puncher (2/8)

1

Reputation

  1. Right, so now my entity spawns in the world and has a shadow, hitbox and sounds. However it's invisible. The console is saying that my entity can't be cast to EntityHorse, and i'm sure that I must be missing something in my RenderPegasus class. 2013-09-09 10:08:30 [iNFO] [sTDERR] java.lang.ClassCastException: RosarioMokaChan.RandomCraft.EntityPegasus cannot be cast to net.minecraft.entity.passive.EntityHorse 2013-09-09 10:08:30 [iNFO] [sTDERR] at RosarioMokaChan.RandomCraft.Pegasus.setLivingAnimations(Pegasus.java:362) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.renderer.entity.RendererLivingEntity.func_130000_a(RendererLivingEntity.java:153) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.renderer.entity.RenderLiving.doRenderLiving(RenderLiving.java:28) 2013-09-09 10:08:30 [iNFO] [sTDERR] at RosarioMokaChan.RandomCraft.RenderPegasus.renderPegasus(RenderPegasus.java:21) 2013-09-09 10:08:30 [iNFO] [sTDERR] at RosarioMokaChan.RandomCraft.RenderPegasus.doRender(RenderPegasus.java:31) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:312) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.renderer.entity.RenderManager.renderEntity(RenderManager.java:281) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:524) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1160) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:934) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:826) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.client.main.Main.main(Main.java:93) 2013-09-09 10:08:30 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-09-09 10:08:30 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-09-09 10:08:30 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-09-09 10:08:30 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.launchwrapper.Launch.launch(Launch.java:57) 2013-09-09 10:08:30 [iNFO] [sTDERR] at net.minecraft.launchwrapper.Launch.main(Launch.java:18)
  2. Before I started anything to do with modding, I made sure to read a few java documents and do some exercises to learn some of the stuff needed, it's just abstract classes and a few other things weren't covered. Also making the class abstract was an alternative to importing net.minecraft.entity.EntityAgeable, which I was trying to avoid doing as I was trying to cut down on the amount of unnecessary imports.
  3. To be honest, I just made it abstract because there was an error if I didn't do it. Not entirely sure what difference there is between the two though.
  4. Ok, this is what I have in the EntityPegasus class. package RosarioMokaChan.RandomCraft; import RosarioMokaChan.RandomCraft.lib.ModBlocks; import net.minecraft.block.Block; import net.minecraft.block.StepSound; import net.minecraft.entity.EnumCreatureAttribute; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIPanic; import net.minecraft.entity.ai.EntityAISwimming; import net.minecraft.entity.ai.EntityAIWander; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.passive.EntityAnimal; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.util.StatCollector; import net.minecraft.world.World; public abstract class EntityPegasus extends EntityAnimal { public EntityPegasus(World par1World) { super(par1World); this.setSize(1.4F, 1.6F); this.isImmuneToFire = true; this.getNavigator().setAvoidsWater(true); this.tasks.addTask(0, new EntityAISwimming(this)); this.tasks.addTask(1, new EntityAIPanic(this, 0.8D)); this.tasks.addTask(6, new EntityAIWander(this, 0.7D)); this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F)); this.tasks.addTask(8, new EntityAILookIdle(this)); } protected boolean isAIEnabled(){ return true; } public int getMaxHealth() { return 15; } @Override protected String getLivingSound() { return "mob.horse.idle"; } @Override protected String getHurtSound() { return "mob.horse.hit"; } @Override protected String getDeathSound() { return "mob.horse.death"; } @Override protected float getSoundVolume() { return 0.4F; } protected int getDropItemId() { return Item.leather.itemID; } protected void playStepSound(int par1, int par2, int par3, int par4) { this.playSound("mob.horse.gallop", 0.15F, 1.0F); } protected void dropRareDrop(int par1){ switch (this.rand.nextInt(3)){ case 0: this.dropItem(ModBlocks.dragonWings.itemID, 1); break; } } public EnumCreatureAttribute getCreatureAttribute(){ return EnumCreatureAttribute.UNDEFINED; } }
  5. I didn't use ModelHorse as I was going to make a new, similar model at a later date. I did this to get it setup for when I decided to do that. As for the constructors, do you think you could perhaps give a little hint as to what I need to do, as I thought that it was correct
  6. So i'm making an entity which uses a similar model to that of a horse (so I copied everything from ModelHorse into a class which will be used by my entity and renamed everything so it would work), and I made a render class along with an entity class. In the main class I registered it and made the spawn egg, but whenever I try to spawn it into the world I just get an error message in the console. Error message: 2013-09-08 18:19:48 [iNFO] [sTDERR] java.lang.InstantiationException 2013-09-08 18:19:48 [iNFO] [sTDERR] at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source) 2013-09-08 18:19:48 [iNFO] [sTDERR] at java.lang.reflect.Constructor.newInstance(Unknown Source) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.entity.EntityList.createEntityByID(EntityList.java:205) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.item.ItemMonsterPlacer.spawnCreature(ItemMonsterPlacer.java:175) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.item.ItemMonsterPlacer.onItemUse(ItemMonsterPlacer.java:81) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.item.ItemStack.tryPlaceItemIntoWorld(ItemStack.java:152) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.item.ItemInWorldManager.activateBlockOrUseItem(ItemInWorldManager.java:429) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.handlePlace(NetServerHandler.java:554) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.network.packet.Packet15Place.processPacket(Packet15Place.java:79) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.network.MemoryConnection.processReadPackets(MemoryConnection.java:89) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.network.NetServerHandler.networkTick(NetServerHandler.java:141) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.network.NetworkListenThread.networkTick(NetworkListenThread.java:54) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:109) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:689) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:129) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:482) 2013-09-08 18:19:48 [iNFO] [sTDERR] at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) 2013-09-08 18:19:48 [WARNING] [Minecraft-Server] Skipping Entity with id 301 Could it be that i'm calling it wrong, or do you think it's something else?
  7. So by using GoToLink's suggestion, it all works . Thanks Kakarotvg and GotoLink, I couldn't have done it without you .
  8. Ok, i'll try that in a minute after I recreate my Strings class.
  9. That doesn't seem to help i'm afraid. I guess minecraft just doesn't want me to make a config file lol
  10. Ok, the entire RandomCraft.java: package RosarioMokaChan.RandomCraft; import java.io.File; import RosarioMokaChan.RandomCraft.blocks.Moonstone; import RosarioMokaChan.RandomCraft.blocks.PlutoniumBlock; import RosarioMokaChan.RandomCraft.blocks.PlutoniumOre; import RosarioMokaChan.RandomCraft.blocks.RadiumBlock; import RosarioMokaChan.RandomCraft.blocks.RadiumOre; import RosarioMokaChan.RandomCraft.items.DiamondHorseChest; import RosarioMokaChan.RandomCraft.items.DiamondHorseHelm; import RosarioMokaChan.RandomCraft.items.DragonWings; import RosarioMokaChan.RandomCraft.items.EnderHatcher; import RosarioMokaChan.RandomCraft.items.GoldHorseChest; import RosarioMokaChan.RandomCraft.items.GoldHorseHelm; import RosarioMokaChan.RandomCraft.items.IronHorseChest; import RosarioMokaChan.RandomCraft.items.IronHorseHelm; import RosarioMokaChan.RandomCraft.items.MoonstoneDust; import RosarioMokaChan.RandomCraft.items.PlutoniumIngot; import RosarioMokaChan.RandomCraft.items.RadiumIngot; import RosarioMokaChan.RandomCraft.lib.BlockIds; import RosarioMokaChan.RandomCraft.lib.ItemIds; import RosarioMokaChan.RandomCraft.lib.ModInfo; import RosarioMokaChan.RandomCraft.lib.Strings; import RosarioMokaChan.RandomCraft.proxies.CommonProxy; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraftforge.common.Configuration; import net.minecraftforge.common.MinecraftForge; 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.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; // used in 1.6.2 @Mod(modid=ModInfo.ID, name=ModInfo.NAME, version=ModInfo.VERS) @NetworkMod( channels = ModInfo.CHANNEL, clientSideRequired = true, serverSideRequired = true, packetHandler = PacketHandler.class ) public class RandomCraft { public static CreativeTabs RandomCraftTab = new CreativeTabs("RandomCraftTab"){ public ItemStack getIconItemStack(){ return new ItemStack(plutoniumIngot); } }; //World Generation EventManager oreManager = new EventManager(); //Blocks public final static Block plutoniumBlock = new PlutoniumBlock(BlockIds.PLUTONIUMBLOCK_ID, Material.iron); public final static Block plutoniumOre = new PlutoniumOre(BlockIds.PLUTONIUMORE_ID, Material.rock); public final static Block radiumBlock = new RadiumBlock(BlockIds.RADIUMBLOCK_ID, Material.iron); public final static Block radiumOre = new RadiumOre(BlockIds.RADIUMORE_ID, Material.rock); public final static Block moonstone = new Moonstone(BlockIds.MOONSTONE_ID, Material.glass); //Items public final static Item enderHatcher = new EnderHatcher(BlockIds.ENDERHATCHER_ID); public final static Item plutoniumIngot = new PlutoniumIngot(BlockIds.PLUTONIUMINGOT_ID); public final static Item radiumIngot = new RadiumIngot(BlockIds.RADIUMINGOT_ID); public final static Item moonstoneDust = new MoonstoneDust(BlockIds.MOONSTONEDUST_ID); public final static Item dragonWings = new DragonWings(BlockIds.DRAGONWINGS_ID); public static Item diamondHorseChest = new DiamondHorseChest(BlockIds.DIAMONDHORSECHEST_ID); public static Item diamondHorseHelm = new DiamondHorseHelm(BlockIds.DIAMONDHORSEHELM_ID); public static Item goldHorseChest = new GoldHorseChest(BlockIds.GOLDHORSECHEST_ID); public static Item goldHorseHelm = new GoldHorseHelm(BlockIds.GOLDHORSEHELM_ID); public static Item ironHorseChest = new IronHorseChest(BlockIds.IRONHORSECHEST_ID); public static Item ironHorseHelm = new IronHorseHelm(BlockIds.IRONHORSEHELM_ID); // The instance of your mod that Forge uses. @Instance(value = ModInfo.ID) public static RandomCraft instance; // Says where the client and server 'proxy' code is loaded. @SidedProxy(clientSide= ModInfo.PROXY_LOCATION + ".ClientProxy", serverSide= ModInfo.PROXY_LOCATION + ".CommonProxy") public static CommonProxy proxy; @EventHandler // used in 1.6.2 public void preInit(FMLPreInitializationEvent event) { // Stub Method //ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath()+ File.separator + ModInfo.ID + File.separator + ModInfo.ID + ".cfg")); Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); BlockIds.createConfigfile(config); config.save(); proxy.initRenderers(); proxy.initSounds(); } @EventHandler // used in 1.6.2 public void load(FMLInitializationEvent event) { MinecraftForge.EVENT_BUS.register(new DragonDrops()); //Defining stacks for recipies ItemStack plutoniumBlockStack = new ItemStack(RandomCraft.plutoniumBlock); ItemStack plutoniumIngotStack = new ItemStack(RandomCraft.plutoniumIngot, 4); ItemStack radiumBlockStack = new ItemStack(RandomCraft.radiumBlock); ItemStack radiumIngotStack = new ItemStack(RandomCraft.radiumIngot, 4); ItemStack moonstoneStack = new ItemStack(RandomCraft.moonstone); ItemStack moonstoneDustStack = new ItemStack(RandomCraft.moonstoneDust, 4); //Shapeless recipes //Gets 4 plutonium ingots from 1 block GameRegistry.addShapelessRecipe(plutoniumIngotStack, plutoniumBlock); //Makes 1 plutonium block from 4 ingots GameRegistry.addRecipe(plutoniumBlockStack, "XX", "XX", 'X', plutoniumIngot); //Gets 4 radium ingots from 1 block GameRegistry.addShapelessRecipe(radiumIngotStack, radiumBlock); //Makes 1 radium block from 4 ingots GameRegistry.addRecipe(radiumBlockStack, "XX", "XX", 'X', radiumIngot); //Gets 4 moonstone dust from 1 moonstone GameRegistry.addShapelessRecipe(moonstoneDustStack, moonstone); //Makes 1 moonstone from 4 moonstone dust GameRegistry.addRecipe(moonstoneStack, "XX", "XX", 'X', moonstoneDust); //Ore Generation GameRegistry.registerWorldGenerator(oreManager); //Blocks //Block of Plutonium GameRegistry.registerBlock(plutoniumBlock, Strings.PLUTONIUMBLOCK_NAME); LanguageRegistry.addName(plutoniumBlock, "Block of Plutonium"); MinecraftForge.setBlockHarvestLevel(plutoniumBlock, "pickaxe", 2); //Plutonium Ore GameRegistry.registerBlock(plutoniumOre, Strings.PLUTONIUMORE_NAME); LanguageRegistry.addName(plutoniumOre, "Plutonium Ore"); MinecraftForge.setBlockHarvestLevel(plutoniumOre, "pickaxe", 2); //Block of Radium GameRegistry.registerBlock(radiumBlock, Strings.RADIUMBLOCK_NAME); LanguageRegistry.addName(radiumBlock, "Block of Radium"); MinecraftForge.setBlockHarvestLevel(radiumBlock, "pickaxe", 2); //Radium Ore GameRegistry.registerBlock(radiumOre, Strings.RADIUMORE_NAME); LanguageRegistry.addName(radiumOre, "Radium Ore"); MinecraftForge.setBlockHarvestLevel(radiumOre, "pickaxe", 2); //Moonstone GameRegistry.registerBlock(moonstone, Strings.MOONSTONE_NAME); LanguageRegistry.addName(moonstone, "Moonstone"); MinecraftForge.setBlockHarvestLevel(moonstone, "pickaxe", 0); //Items //Plutonium Ingot GameRegistry.registerItem(plutoniumIngot, Strings.PLUTONIUMINGOT_NAME); LanguageRegistry.addName(plutoniumIngot, "Plutonium Ingot"); //Plutonium Ingot GameRegistry.registerItem(radiumIngot, Strings.RADIUMINGOT_NAME); LanguageRegistry.addName(radiumIngot, "Radium Ingot"); //Ender Hatcher GameRegistry.registerItem(enderHatcher, Strings.ENDERHATCHER_NAME); LanguageRegistry.addName(enderHatcher, "Ender Hatcher"); //Moonstone Dust GameRegistry.registerItem(moonstoneDust, Strings.MOONSTONEDUST_NAME); LanguageRegistry.addName(moonstoneDust, "Moonstone Dust"); //Dragon Wings GameRegistry.registerItem(dragonWings, Strings.DRAGONWINGS_NAME); LanguageRegistry.addName(dragonWings, "Dragon Wings"); //Horse Armour GameRegistry.registerItem(diamondHorseChest, Strings.DIAMONDHORSECHEST_NAME); GameRegistry.registerItem(diamondHorseHelm, Strings.DIAMONDHORSEHELM_NAME); GameRegistry.registerItem(goldHorseChest, Strings.GOLDHORSECHEST_NAME); GameRegistry.registerItem(goldHorseHelm, Strings.GOLDHORSEHELM_NAME); GameRegistry.registerItem(ironHorseChest, Strings.IRONHORSECHEST_NAME); GameRegistry.registerItem(ironHorseHelm, Strings.IRONHORSEHELM_NAME); LanguageRegistry.addName(diamondHorseChest, "Diamond Horse Chestplate"); LanguageRegistry.addName(diamondHorseHelm, "Diamond Horse Helmet"); LanguageRegistry.addName(ironHorseChest, "Iron Horse Chestplate"); LanguageRegistry.addName(ironHorseHelm, "Iron Horse Helmet"); LanguageRegistry.addName(goldHorseChest, "Gold Horse Chestplate"); LanguageRegistry.addName(goldHorseHelm, "Gold Horse Helmet"); GameRegistry.addRecipe(new ItemStack(diamondHorseHelm,1), new Object[]{ "XXX","XYX","Z Z",'X',Item.diamond,'Y',Item.silk,'Z',Item.leather, }); GameRegistry.addRecipe(new ItemStack(diamondHorseChest,1), new Object[]{ "XZX","XYX","XXX",'X',Item.diamond,'Y',Item.silk,'Z',Item.leather, }); GameRegistry.addRecipe(new ItemStack(goldHorseHelm,1), new Object[]{ "XXX","XYX","Z Z",'X',Item.ingotGold,'Y',Item.silk,'Z',Item.leather, }); GameRegistry.addRecipe(new ItemStack(goldHorseChest,1), new Object[]{ "XZX","XYX","XXX",'X',Item.ingotGold,'Y',Item.silk,'Z',Item.leather, }); GameRegistry.addRecipe(new ItemStack(ironHorseHelm,1), new Object[]{ "XXX","XYX","Z Z",'X',Item.ingotIron,'Y',Item.silk,'Z',Item.leather, }); GameRegistry.addRecipe(new ItemStack(ironHorseChest,1), new Object[]{ "XZX","XYX","XXX",'X',Item.ingotIron,'Y',Item.silk,'Z',Item.leather, }); GameRegistry.addShapelessRecipe(new ItemStack(Item.field_111215_ce,1), new Object[]{ ironHorseChest, ironHorseHelm }); GameRegistry.addShapelessRecipe(new ItemStack(Item.field_111216_cf,1), new Object[]{ goldHorseChest, goldHorseHelm }); GameRegistry.addShapelessRecipe(new ItemStack(Item.field_111213_cg,1), new Object[]{ diamondHorseHelm, diamondHorseChest }); //Creative Tab LanguageRegistry.instance().addStringLocalization("itemGroup.RandomCraftTab", "en_US", "RandomCraft"); } @EventHandler // used in 1.6.2 public void postInit(FMLPostInitializationEvent event) { // Stub Method } }
  11. Ok, the BlockIds class is already here so i'll post a few others; package RosarioMokaChan.RandomCraft.lib; public class Strings { public static final String PLUTONIUMBLOCK_NAME = "plutoniumBlock"; public static final String PLUTONIUMORE_NAME = "plutoniumOre"; public static final String RADIUMBLOCK_NAME = "radiumBlock"; public static final String RADIUMORE_NAME = "radiumOre"; public static final String MOONSTONE_NAME = "moonstone"; public static final String ENDERHATCHER_NAME = "enderHatcher"; public static final String PLUTONIUMINGOT_NAME = "plutoniumIngot"; public static final String RADIUMINGOT_NAME = "radiumIngot"; public static final String MOONSTONEDUST_NAME = "moonstoneDust"; public static final String DRAGONWINGS_NAME = "dragonWings"; public static final String DIAMONDHORSECHEST_NAME = "diamondHorseChest"; public static final String DIAMONDHORSEHELM_NAME = "diamondHorseHelm"; public static final String GOLDHORSECHEST_NAME = "goldHorseChest"; public static final String GOLDHORSEHELM_NAME = "goldHorseHelm"; public static final String IRONHORSECHEST_NAME = "ironHorseChest"; public static final String IRONHORSEHELM_NAME = "ironHorseHelm"; } In main class under load: //Blocks //Block of Plutonium GameRegistry.registerBlock(plutoniumBlock, Strings.PLUTONIUMBLOCK_NAME); LanguageRegistry.addName(plutoniumBlock, "Block of Plutonium"); MinecraftForge.setBlockHarvestLevel(plutoniumBlock, "pickaxe", 2); //Plutonium Ore GameRegistry.registerBlock(plutoniumOre, Strings.PLUTONIUMORE_NAME); LanguageRegistry.addName(plutoniumOre, "Plutonium Ore"); MinecraftForge.setBlockHarvestLevel(plutoniumOre, "pickaxe", 2); //Block of Radium GameRegistry.registerBlock(radiumBlock, Strings.RADIUMBLOCK_NAME); LanguageRegistry.addName(radiumBlock, "Block of Radium"); MinecraftForge.setBlockHarvestLevel(radiumBlock, "pickaxe", 2); //Radium Ore GameRegistry.registerBlock(radiumOre, Strings.RADIUMORE_NAME); LanguageRegistry.addName(radiumOre, "Radium Ore"); MinecraftForge.setBlockHarvestLevel(radiumOre, "pickaxe", 2); //Moonstone GameRegistry.registerBlock(moonstone, Strings.MOONSTONE_NAME); LanguageRegistry.addName(moonstone, "Moonstone"); MinecraftForge.setBlockHarvestLevel(moonstone, "pickaxe", 0); The PlutoniumOre class: package RosarioMokaChan.RandomCraft.blocks; import RosarioMokaChan.RandomCraft.RandomCraft; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; public class PlutoniumOre extends Block { public PlutoniumOre(int id, Material material) { super(id, material); setHardness(3.8f); setStepSound(Block.soundStoneFootstep); setUnlocalizedName("plutoniumOre"); setCreativeTab(RandomCraft.RandomCraftTab); } } Anything else you'd like me to add?
  12. Sure: ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 07/09/13 17:23 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:457) 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:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 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:194) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) 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:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 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:105) at cpw.mods.fml.common.Loader.loadMods(Loader.java:510) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:182) at net.minecraft.client.Minecraft.startGame(Minecraft.java:470) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796) at net.minecraft.client.main.Main.main(Main.java:93) 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:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) Caused by: java.lang.IllegalArgumentException: Slot 0 is already occupied by RosarioMokaChan.RandomCraft.blocks.PlutoniumBlock@24ea5bd0 when adding RosarioMokaChan.RandomCraft.blocks.PlutoniumOre@1631c79f at net.minecraft.block.Block.<init>(Block.java:348) at RosarioMokaChan.RandomCraft.blocks.PlutoniumOre.<init>(PlutoniumOre.java:11) at RosarioMokaChan.RandomCraft.RandomCraft.<clinit>(RandomCraft.java:60) ... 35 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:457) 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:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 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:194) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:174) 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:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) 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:105) at cpw.mods.fml.common.Loader.loadMods(Loader.java:510) at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:182) at net.minecraft.client.Minecraft.startGame(Minecraft.java:470) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:796) at net.minecraft.client.main.Main.main(Main.java:93) 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:57) at net.minecraft.launchwrapper.Launch.main(Launch.java:18) -- System Details -- Details: Minecraft Version: 1.6.2 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.7.0_21, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 765621096 bytes (730 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 Suspicious classes: FML and Forge are installed IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v8.04 FML v6.2.35.804 Minecraft Forge 9.10.0.804 4 mods loaded, 4 mods active mcp{8.04} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed FML{6.2.35.804} [Forge Mod Loader] (coremods) Unloaded->Constructed Forge{9.10.0.804} [Minecraft Forge] (coremods) Unloaded->Constructed RandomCraft{0.0.1} [RandomCraft] (bin) Unloaded Launched Version: 1.6 LWJGL: 2.9.0 OpenGL: GeForce GTX 645/PCIe/SSE2 GL version 4.3.0, NVIDIA Corporation Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Pack: Default Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: ~~ERROR~~ NullPointerException: null
  13. After putting in: Configuration config = new Configuration(event.getSuggestedConfigurationFile()); config.load(); BlockIds.createConfigfile(config); config.save(); instead of ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath()+ File.separator + ModInfo.ID + File.separator + ModInfo.ID + ".cfg")); After commenting out all of the ConfigurationHandler class it still refuses to startup, producing the same error report.
  14. I've tried doing it in a similar way to what you described, but it still doesn't feel like working. I commented out some lines in the BlockIds class and in the ConfigurationHandler so I could try it this way as shown below: package RosarioMokaChan.RandomCraft.lib; import net.minecraftforge.common.Configuration; public class BlockIds { public static String blockids = "Block IDs"; //public static final int PLUTONIUMBLOCK_ID_DEFAULT = 3000; public static int PLUTONIUMBLOCK_ID; //public static final int PLUTONIUMORE_ID_DEFAULT = 3001; public static int PLUTONIUMORE_ID; //public static final int RADIUMBLOCK_ID_DEFAULT = 3002; public static int RADIUMBLOCK_ID; //public static final int RADIUMORE_ID_DEFAULT = 3003; public static int RADIUMORE_ID; //public static final int MOONSTONE_ID_DEFAULT = 3004; public static int MOONSTONE_ID; public static void createConfigfile(Configuration config) { // block ids PLUTONIUMBLOCK_ID = config.get(blockids, "plutoniumBlock", 3000).getInt(); PLUTONIUMORE_ID = config.get(blockids, "plutoniumOre", 3001).getInt(); RADIUMBLOCK_ID = config.get(blockids, "radiumBlock", 3002).getInt(); RADIUMORE_ID = config.get(blockids, "radiumOre", 3003).getInt(); MOONSTONE_ID = config.get(blockids, "moonstone", 3004).getInt(); } }
  15. In my BlockIds class I have the two blocks as having ids 3000 and 3001 as shown here: public class BlockIds { public static final int PLUTONIUMBLOCK_ID_DEFAULT = 3000; public static int PLUTONIUMBLOCK_ID; public static final int PLUTONIUMORE_ID_DEFAULT = 3001; public static int PLUTONIUMORE_ID; public static final int RADIUMBLOCK_ID_DEFAULT = 3002; public static int RADIUMBLOCK_ID; public static final int RADIUMORE_ID_DEFAULT = 3003; public static int RADIUMORE_ID; public static final int MOONSTONE_ID_DEFAULT = 3004; public static int MOONSTONE_ID; } Then applied to the block in the main class here: public final static Block plutoniumBlock = new PlutoniumBlock(BlockIds.PLUTONIUMBLOCK_ID, Material.iron); public final static Block plutoniumOre = new PlutoniumOre(BlockIds.PLUTONIUMORE_ID, Material.rock); So i'm not sure how i'm getting the ids messed up.
×
×
  • Create New...

Important Information

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