Jump to content

jaojake1804

Members
  • Posts

    7
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • URL
    http://www.medievalcraft2.com
  • Personal Text
    MedievalCraft2 Dev

jaojake1804's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Pardon? I thought icon index was items. Have I done that somewhere? Edit: I didn't put static(i, j, ...) I forgot the j.... Stupid stupid stupid! Thanks
  2. package MedievalCraft2; import java.util.ArrayList; import java.util.Random; import net.minecraft.*; import net.minecraft.src.ItemStack; import net.minecraft.src.Material; import net.minecraft.src.Block; import net.minecraft.src.forge.ITextureProvider; public class BlockPlatinumOre extends Block implements ITextureProvider { public BlockPlatinumOre(int i, int j) { super(i, Material.rock); setHardness(6F); setResistance(1.0F); setLightValue(0.4F); } public String getTextureFile() { return "/MeC2/Terrain/terrain.png"; } public int idDropped(int par1, Random par2Random, int par3) { return MeC2Items.shardPlatinum.shiftedIndex; } public int quantityDroppedWithBonus(int par1, Random par2Random) { return this.quantityDropped(par2Random) + par2Random.nextInt(par1 + 1); } public int quantityDropped(Random par1Random) { return 1 + par1Random.nextInt(2); } public void addCreativeItems(ArrayList itemList) { itemList.add(new ItemStack(this, 1, 5)); } } package MedievalCraft2; import net.minecraft.src.*; import net.minecraft.src.forge.AchievementPage; import net.minecraft.src.forge.IEntityInteractHandler; import net.minecraft.src.forge.MinecraftForge; import net.minecraft.src.forge.MinecraftForgeClient; import net.minecraft.src.forge.ITextureProvider; import net.minecraft.src.forge.NetworkMod; import java.util.ArrayList; import java.util.Map; import java.util.Random; import net.minecraft.client.Minecraft; public class mod_MedievalCraft2 extends BaseMod { public static OreHandler oreHandler; public static final Block limestone = new BlockLimestone(125, 16).setBlockName("limestone"); public static final Block slate = new BlockSlate(126, 17).setBlockName("slate"); public static final Block oreZerzerite = new BlockZerzeriteOre(127, 0).setBlockName("oreZerzerite"); public static final Block orePlatinum = new BlockPlatinumOre(130, 3).setBlockName("orePlatinum"); public void load() { MinecraftForgeClient.preloadTexture("/MeC2/Terrain/terrain.png"); MinecraftForgeClient.preloadTexture("/MeC2/GUI/mec2_items1.png"); MinecraftForgeClient.preloadTexture("/MeC2/GUI/guialchemicalTable.png"); MinecraftForgeClient.preloadTexture("/MeC2/GUI/guiDrawbridge.png"); //MinecraftForge.versionDetect(MeC2Default.MeC2, 3, 0, 0); MeC2Config.load(); oreHandler = new OreHandler(); MinecraftForge.registerOreHandler(oreHandler); //MinecraftForge.registerPickupHandler(new IPickupHandler()); ModLoader.registerBlock(limestone); ModLoader.registerBlock(slate); ModLoader.registerBlock(oreZerzerite); ModLoader.registerBlock(orePlatinum); ModLoader.addName(limestone, "Limestone"); ModLoader.addName(slate, "Slate"); ModLoader.addName(oreZerzerite, "Zerzerite Ore"); ModLoader.addName(orePlatinum, "Platinum Ore"); MinecraftForge.setBlockHarvestLevel(slate, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(limestone, "pickaxe", 1); MinecraftForge.setBlockHarvestLevel(oreZerzerite, "pickaxe", 2); MinecraftForge.setBlockHarvestLevel(orePlatinum, "pickaxe", 2); AchievementPage page1 = new AchievementPage("Medieval Craft 2" /*ach1, ach2, ach3, ach4*/); MinecraftForge.registerAchievementPage(page1); ModLoader.addRecipe(new ItemStack(orePlatinum, 4), new Object[]{ "*", Character.valueOf('*'), Block.dirt }); } public String getPriorities() { return ""; } public int addFuel(int i, int j) { if (i == MeC2Items.fuelZerzericCoal.shiftedIndex) { return 1600; } return 0; } public void generateSurface(World world, Random random, int chunkX, int chunkZ) { if (MeC2Config.generatePlatinumOre) { for (int i = 0; i < 8; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(30) + 4; int randPosZ = chunkZ + random.nextInt(16); new WorldGenMinable(orePlatinum.blockID, 4).generate(world, random, randPosX, randPosY, randPosZ); } } } public String getVersion() { String version = "1.0.0"; return "1.0.0"; } } All the textures are reading off the first 16x16 block in the "/MeC2/Terrain/terrain.png"
  3. My blocks all appear to have the same texture, even though I have checked over and over my code, and designated the texture from mec2terrain.png they should be using. Any help would be amazing. Thanks in advance Jake
  4. Gotcha, without realising I put a null statement, I didnt even see it Must of write it when I wasnt full aware. Thanks anyway Lex, a question completely off topic. Does Forge support 128 textures and if yes, do I go about making a blahblahblah.png as normal, but all 128 x 128 and it will work? If so, thats amazing. If not, it should be in there :L
  5. Thanks for the reply on the post, but it still wasnt that. Yes [---] is mod_MedievalCraft2 but I have consulted Alblaka about continueing his old mod before continueing. There is no Null statement on which I can see, as you suggested. I have checked over the code to make sure of this. And any Nulls that shouldn't be there have been removed. It apppears on lin 74, which is the line which designates the block to generate, the meta value and the vein size, followed by the generate command. However, I am using WorldGenMineableMeta, and there are no nulls in there. If you would like to look at that to see if you can debug it. Feel free to ask, I will continue on weapons and machines untill the ore gen is working. Cheers, Jake
  6. the if statement is so that the generation of the ore is configurable, and the 0 is a custom from my WorldGenMineableMeta. Even when I remove them I still get an error
  7. I didnt want to come on to a forum to get help, but this is the only thing that is bugging me insanly. Here is the error I get when I Create A New World java.lang.NullPointerException at MedievalCraft2.MeC2Core.generateSurface(MeC2Core.java:60) at MedievalCraft2.mod_MedievalCraft2.generateSurface(mod_MedievalCraft2.java:44) at net.minecraft.src.BaseMod.generate(BaseMod.java:151) at cpw.mods.fml.common.FMLCommonHandler.handleWorldGeneration(FMLCommonHandler.java:546) at cpw.mods.fml.client.FMLClientHandler.onChunkPopulate(FMLClientHandler.java:316) at net.minecraft.src.ChunkProvider.populate(ChunkProvider.java:206) at net.minecraft.src.Chunk.populateChunk(Chunk.java:1192) at net.minecraft.src.ChunkProvider.loadChunk(ChunkProvider.java:115) at net.minecraft.src.ChunkProvider.provideChunk(ChunkProvider.java:128) at net.minecraft.src.World.getChunkFromChunkCoords(World.java:648) at net.minecraft.src.World.getBlockId(World.java:563) at net.minecraft.client.Minecraft.preloadWorld(Minecraft.java:2199) at net.minecraft.client.Minecraft.changeWorld(Minecraft.java:2085) at net.minecraft.client.Minecraft.changeWorld2(Minecraft.java:2032) at net.minecraft.client.Minecraft.startWorld(Minecraft.java:1943) at net.minecraft.src.GuiCreateWorld.actionPerformed(GuiCreateWorld.java:209) at net.minecraft.src.GuiScreen.mouseClicked(GuiScreen.java:114) at net.minecraft.src.GuiCreateWorld.mouseClicked(GuiCreateWorld.java:315) at net.minecraft.src.GuiScreen.handleMouseInput(GuiScreen.java:186) at net.minecraft.src.GuiScreen.handleInput(GuiScreen.java:165) at net.minecraft.client.Minecraft.runTick(Minecraft.java:1567) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:822) at net.minecraft.client.Minecraft.run(Minecraft.java:750) at java.lang.Thread.run(Unknown Source) and here is the worldGen code: public static void generateSurface(World world, Random rand, int posX, int posZ) { if ([---].generatePlatinumOre) { for (int i = 0; i < 8; i++) { int randPosX = posX + rand.nextInt(16); int randPosY = rand.nextInt(30); int randPosZ = posZ + rand.nextInt(16); (new WorldGenMineableMeta([---].blockID, 0, 4)).generate(world, rand, randPosX, randPosY, randPosZ); } } } Any help is very helpfull. [---] means a file name, I will not show this for my own reasons
×
×
  • Create New...

Important Information

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