Posted June 30, 201213 yr 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
June 30, 201213 yr Code I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
June 30, 201213 yr Author 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"
June 30, 201213 yr You dont ever set the icon index. I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
June 30, 201213 yr Author 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
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.