I don't know why my HumanNPC isn't working. I am copying your code, I putted my class names etc. everywhere, and there is only one error with the public void addRenderer(Map map) part:
public void addRenderer(Map map)
{
map.put(EntityFrost.class, new RenderBiped(new ModelBiped(), 0.5F));
}
ERROR:
Mods loaded: 2
ModLoader 1.2.5
mod_MasogMod 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT c2e3a367 --------
Generated 31.07.12 14:30
Minecraft: Minecraft 1.2.5
OS: Windows 7 (x86) version 6.1
Java: 1.7.0_05, Oracle Corporation
VM: Java HotSpot™ Client VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: GeForce 8600 GT/PCI/SSE2/3DNOW! version 3.3.0, NVIDIA Corporation
java.lang.Error: Unresolved compilation problems:
void is an invalid type for the variable addRenderer
Syntax error on token "(", ; expected
Map cannot be resolved to a type
Syntax error on token ")", ; expected
at net.minecraft.src.mod_MasogMod.load(mod_MasogMod.java:71)
at net.minecraft.src.ModLoader.init(ModLoader.java:856)
at net.minecraft.src.ModLoader.addAllRenderers(ModLoader.java:157)
at net.minecraft.src.RenderManager.<init>(RenderManager.java:85)
at net.minecraft.src.RenderManager.<clinit>(RenderManager.java:12)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:424)
at net.minecraft.client.Minecraft.run(Minecraft.java:786)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 5a61c446 ----------
mod_MasogMod.java: (the thickened text is the NPC code)
package net.minecraft.src;
import java.util.Random;
public class mod_MasogMod extends BaseMod
{
public static final BiomeGenBase FrozenWorld = (new BiomeGenFrozenWorld(30)).setColor(0xfa9418).setBiomeName("Frozen World");
public static final Item CrystalIce = new ItemCrystalIce(5001).setItemName("CrystalIce");
public static final Block GoldenEssence = new BlockGoldenEssence(160, 0).setBlockName("GoldenEssence").setHardness(3F).setResistance(4F).setLightValue(1F);
public static final Item pickaxe1 = new ItemGoldenEssencePickaxe(2000, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("pickaxe1");
public static final Item axe1 = new ItemGoldenEssenceAxe(2001, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("axe1");
public static final Item shovel1 = new ItemGoldenEssenceShovel(2002, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("shovel1");
public static final Item sword1 = new ItemGoldenEssenceSword(2003, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("sword1");
public static final Item hoe1 = new ItemGoldenEssenceHoe(2004, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("hoe1");
public static final Item GoldEssence = new Item(5000).setItemName("GoldEssence");
public static final Block IceCrystal = new BlockIceCrystal(161, 0).setBlockName("IceCrystal").setHardness(3F).setResistance(4F).setLightValue(0F);
public static final Item pickaxe = new ItemIceCrystalPickaxe(2005, EnumToolMaterialIceCrystal.IceCrystal).setItemName("pickaxe");
public static final Item axe = new ItemIceCrystalAxe(2006, EnumToolMaterialIceCrystal.IceCrystal).setItemName("axe");
public static final Item shovel = new ItemIceCrystalShovel(2007, EnumToolMaterialIceCrystal.IceCrystal).setItemName("shovel");
public static final Item sword = new ItemIceCrystalSword(2008, EnumToolMaterialIceCrystal.IceCrystal).setItemName("sword");
public static final Item hoe = new ItemIceCrystalHoe(2009, EnumToolMaterialIceCrystal.IceCrystal).setItemName("hoe");
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(30);
int randPosY = random.nextInt(20);
int randPosZ = chunkZ + random.nextInt(30);
(new WorldGenMinable(GoldenEssence.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(200);
int randPosY = random.nextInt(20);
int randPosZ = chunkZ + random.nextInt(200);
(new WorldGenMinable(IceCrystal.blockID, 2)).generate(world, random, randPosX, randPosY, randPosZ);
BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
if(biomegenbase instanceof BiomeGenFrozenWorld);
}
}
public String getVersion()
{
return "1.2.5";
}
}
EntityFrost:
package net.minecraft.src;
import java.util.Random;
public class EntityFrost extends EntityMob
{
public EntityFrost(World world)
{
super(world);
texture = "/Frost.png";
moveSpeed = 1.0F;
attackStrength = 5; //take this line out if this class doesn't extend EntityMob.
}
protected int getDropItemId()
{
return Block.ice.blockID;
}
protected boolean canDespawn()
{
return false;
}
}
Help me please =)
Thanks.
You can't put a method inside another method. You are trying to put the addRenderer method inside the load method. Move it out and it will work.
Please use code tags when posting code. It makes it a lot easier to read the code.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
The Meaning of Life, the Universe, and Everything.
Join Date:
7/1/2012
Posts:
76
Minecraft:
Nukeannihilation
Member Details
Im trying to get a transparent block to work, but i get this when recompiling:
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_05\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_frontglass.java:5: error: constructor mod_fr
ontglass in class mod_frontglass cannot be applied to given types;
public static final Block mod_frontglass = new mod_frontglass(160, 0).setBlockNa
me("StoreFrontGlass").setHardness(3F).setResistance(4F).setLightValue(0F);
^
required: no arguments
found: int,int
reason: actual and formal argument lists differ in length
1 error
==================
== Recompiling server ==
> Cleaning bin
> Recompiling
- Done in 8.41 seconds
Press any key to continue . . .
This is my code:
mod_frontglass.java
package net.minecraft.src;
public class mod_frontglass extends BaseMod
{
public static final Block mod_frontglass = new mod_frontglass(160, 0).setBlockName("StoreFrontGlass").setHardness(3F).setResistance(4F).setLightValue(0F);
public void load()
{
mod_frontglass.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Buildings/StoreFrontGlass.png");
ModLoader.registerBlock(mod_frontglass);
ModLoader.addName(mod_frontglass, "Store Front Glass");
ModLoader.addRecipe(new ItemStack(mod_frontglass, 1), new Object [] {"# #", "# #", "# #", Character.valueOf('#'), Block.glass});
}
public String getVersion()
{
return "1.2.5";
}
}
frontglass.java:
package net.minecraft.src;
public class mod_frontglass extends BaseMod
{
public static final Block mod_frontglass = new mod_frontglass(160, 0).setBlockName("StoreFrontGlass").setHardness(3F).setResistance(4F).setLightValue(0F);
public void load()
{
mod_frontglass.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Buildings/StoreFrontGlass.png");
ModLoader.registerBlock(mod_frontglass);
ModLoader.addName(mod_frontglass, "Store Front Glass");
ModLoader.addRecipe(new ItemStack(mod_frontglass, 1), new Object [] {"# #", "# #", "# #", Character.valueOf('#'), Block.glass});
}
public String getVersion()
{
return "1.2.5";
}
}
any clue? My JDK is fully up to date, just updated it the other day. I am using MCP for 1.2.5. Should I go ahead and try updating to the newer version?
*EDIT* added spoilers, forgot to when I posted, lol.
I just want to say: thank you for making a very user-friendly mod tutorial. I'll probably be playing around with this for a good while, since I've got an extremely ambitious (probably TOO ambitious, to be honest) mod concept. It is a clear and concise resource for how commonly used code works.
Im trying to get a transparent block to work, but i get this when recompiling:
== MCP 6.2 (data: 6.2, client: 1.2.5, server: 1.2.5) ==
# found jad, jad patches, ff patches, osx patches, srgs, name csvs, doc csvs, pa
ram csvs, astyle, astyle config
== Recompiling client ==
> Cleaning bin
> Recompiling
'"C:\Program Files\Java\jdk1.7.0_05\bin\javac" -Xlint:-options -deprecation -g -
source 1.6 -target 1....' failed : 1
== ERRORS FOUND ==
src\minecraft\net\minecraft\src\mod_frontglass.java:5: error: constructor mod_fr
ontglass in class mod_frontglass cannot be applied to given types;
public static final Block mod_frontglass = new mod_frontglass(160, 0).setBlockNa
me("StoreFrontGlass").setHardness(3F).setResistance(4F).setLightValue(0F);
^
required: no arguments
found: int,int
reason: actual and formal argument lists differ in length
1 error
==================
== Recompiling server ==
> Cleaning bin
> Recompiling
- Done in 8.41 seconds
Press any key to continue . . .
This is my code:
mod_frontglass.java
package net.minecraft.src;
public class mod_frontglass extends BaseMod
{
public static final Block mod_frontglass = new mod_frontglass(160, 0).setBlockName("StoreFrontGlass").setHardness(3F).setResistance(4F).setLightValue(0F);
public void load()
{
mod_frontglass.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Buildings/StoreFrontGlass.png");
ModLoader.registerBlock(mod_frontglass);
ModLoader.addName(mod_frontglass, "Store Front Glass");
ModLoader.addRecipe(new ItemStack(mod_frontglass, 1), new Object [] {"# #", "# #", "# #", Character.valueOf('#'), Block.glass});
}
public String getVersion()
{
return "1.2.5";
}
}
frontglass.java:
package net.minecraft.src;
public class mod_frontglass extends BaseMod
{
public static final Block mod_frontglass = new mod_frontglass(160, 0).setBlockName("StoreFrontGlass").setHardness(3F).setResistance(4F).setLightValue(0F);
public void load()
{
mod_frontglass.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/Buildings/StoreFrontGlass.png");
ModLoader.registerBlock(mod_frontglass);
ModLoader.addName(mod_frontglass, "Store Front Glass");
ModLoader.addRecipe(new ItemStack(mod_frontglass, 1), new Object [] {"# #", "# #", "# #", Character.valueOf('#'), Block.glass});
}
public String getVersion()
{
return "1.2.5";
}
}
any clue? My JDK is fully up to date, just updated it the other day. I am using MCP for 1.2.5. Should I go ahead and try updating to the newer version?
*EDIT* added spoilers, forgot to when I posted, lol.
I have a problem. Eclipse is picking up multiple errors in the code I have written, however, I cannot see anything wrong (the parts in red are the parts with the 'errors' in. Thanks in advance!
EDIT: Huh, didn't think about that... Correction: The parts of code with the BBCode that would make them red, around them are the parts with the errors in.
mod_MineralsPlus
package net.minecraft.src;
import net.minecraft.client.Minecraft;
import java.util.List;
public class mod_MineralsPlus extends BaseMod
{
public static final Block oreQuartz = new MineralsPlusOreQuartz(200, ModLoader.addOverride("/terrain.png", "/MineralsPlus/minerals+.png")).setHardness(3F).setResistance(5F).setStepSound(Block.soundStoneFootstep).setBlockName("oreQuartz");
public static final Item gemQuartz = (new MineralsPlusQuartz(500)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/MineralsPlus/minerals+.png").setItemName("gemQuartz"[color=#ff0000])[/color];
public mod_MineralsPlus()
{
}
public void [color=#ff0000]load()[/color]
{
ModLoader.registerBlock(oreQuartz);
ModLoader.addName(oreQuartz, "Quartz Ore");
ModLoader.addName(gemQuartz, "Quartz");
}
public void GenerateSurface(World world, [color=#ff0000]Random[/color] rand, int chunkX, int chunkZ)
{
for(int l = 0; l < 25; l++)
{
int i1 = chunkX + rand.nextInt(16);
int j1 = rand.nextInt(128);
int k1 = chunkZ + rand.nextInt(16);
(new WorldGenMinable(oreQuartz.blockID, 3)).generate(world, rand, i1, j1, k1);
}
}
public void [color=#ff0000]load()[/color]
{
ModLoader.setInGameHook(this, true, false);
ModLoader.setInGUIHook(this, true, false);
}
public boolean onTickInGame(float f, Minecraft minecraft)
{
if(minecraft.currentScreen == null)
{
creativeInventory = null;
}
return true;
}
public boolean onTickInGUI(float f, Minecraft minecraft, GuiScreen guiscreen)
{
if((guiscreen instanceof GuiContainerCreative) && !(creativeInventory instanceof GuiContainerCreative) && !minecraft.theWorld.isRemote)
{
Container container = ((GuiContainer)guiscreen).inventorySlots;
List list = ((ContainerCreative)container).itemList;
int i = 0;
list.add(new ItemStack(oreQuartz, 1, i));
list.add(new ItemStack(gemQuartz, 1, i));
}
creativeInventory = guiscreen;
return true;
}
private static GuiScreen creativeInventory;
public String getVersion()
{
return "0.1";
}
}
MineralsPlusOreQuartz
package net.minecraft.src;
import java.util.Random;
public class MineralsPlusOreQuartz extends Block
{
public MineralsPlusOreQuartz(int i, int j)
{
super(i, j, Material.rock);
}
public int idDropped(int i, Random random, int j)
{
return [color=#ff0000]mod_MineralsPlus.gemQuartz.500[/color];
}
public int quantityDropped(Random random)
{
return 1;
}}
You've got two load methods. You can't have two methods with the same name and parameters in one class. Put all of the code in the second load method into the first then delete the second.
You need to import Random.
import java.util.Random;
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Ok, now I don't have any errors, but my mob isn't spawning anywhere. When I obfuscated the code and used Single Player Commands to spawn it, then it works. It just isn't spawning on my biome by itself. Could you help me?
mod_MasogMod.java
package net.minecraft.src;
import java.util.Random;
import java.util.Map;
public class mod_MasogMod extends BaseMod
{
public static final BiomeGenBase FrozenWorld = (new BiomeGenFrozenWorld(30)).setColor(0xfa9418).setBiomeName("Frozen World");
public static final Item CrystalIce = new ItemCrystalIce(5001).setItemName("CrystalIce");
public static final Block GoldenEssence = new BlockGoldenEssence(160, 0).setBlockName("GoldenEssence").setHardness(3F).setResistance(4F).setLightValue(1F);
public static final Item pickaxe1 = new ItemGoldenEssencePickaxe(2000, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("pickaxe1");
public static final Item axe1 = new ItemGoldenEssenceAxe(2001, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("axe1");
public static final Item shovel1 = new ItemGoldenEssenceShovel(2002, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("shovel1");
public static final Item sword1 = new ItemGoldenEssenceSword(2003, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("sword1");
public static final Item hoe1 = new ItemGoldenEssenceHoe(2004, EnumToolMaterialGoldenEssence.GoldenEssence).setItemName("hoe1");
public static final Item GoldEssence = new Item(5000).setItemName("GoldEssence");
public static final Block IceCrystal = new BlockIceCrystal(161, 0).setBlockName("IceCrystal").setHardness(3F).setResistance(4F).setLightValue(0F);
public static final Item pickaxe = new ItemIceCrystalPickaxe(2005, EnumToolMaterialIceCrystal.IceCrystal).setItemName("pickaxe");
public static final Item axe = new ItemIceCrystalAxe(2006, EnumToolMaterialIceCrystal.IceCrystal).setItemName("axe");
public static final Item shovel = new ItemIceCrystalShovel(2007, EnumToolMaterialIceCrystal.IceCrystal).setItemName("shovel");
public static final Item sword = new ItemIceCrystalSword(2008, EnumToolMaterialIceCrystal.IceCrystal).setItemName("sword");
public static final Item hoe = new ItemIceCrystalHoe(2009, EnumToolMaterialIceCrystal.IceCrystal).setItemName("hoe");
public void load()
{
ModLoader.addBiome(FrozenWorld);
GoldEssence.iconIndex = ModLoader.addOverride("/gui/items.png", "/GoldenEssence.png");
CrystalIce.iconIndex = ModLoader.addOverride("/gui/items.png", "/IceCrystalItem.png");
ModLoader.addName(CrystalIce, "Ice Crystal");
ModLoader.addName(GoldEssence, "Golden Essence");
GoldenEssence.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/GoldEssence.png");
ModLoader.registerBlock(GoldenEssence);
ModLoader.addName(GoldenEssence, "Golden Essence Ore");
pickaxe1.iconIndex = ModLoader.addOverride("/gui/items.png", "/GoldenEssencePickaxe.png");
axe1.iconIndex = ModLoader.addOverride("/gui/items.png", "/GoldenEssenceAxe.png");
shovel1.iconIndex = ModLoader.addOverride("/gui/items.png", "/GoldenEssenceShovel.png");
sword1.iconIndex = ModLoader.addOverride("/gui/items.png", "/GoldenEssenceSword.png");
hoe1.iconIndex = ModLoader.addOverride("/gui/items.png", "/GoldenEssenceHoe.png");
ModLoader.addName(pickaxe1, "Golden Essence Pickaxe");
ModLoader.addName(axe1, "Golden Essence Axe");
ModLoader.addName(shovel1, "Golden Essence Shovel");
ModLoader.addName(sword1, "Golden Essence Sword");
ModLoader.addName(hoe1, "Golden Essence Hoe");
ModLoader.addRecipe(new ItemStack(pickaxe1, 1), new Object [] {"###", " % ", " % ", '#', GoldEssence, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(axe1, 1), new Object [] {"##", "#%", " %", '#', GoldEssence, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(shovel1, 1), new Object [] {"#", "%", "%", '#', GoldEssence, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(sword1, 1), new Object [] {"#", "#", "%", '#', GoldEssence, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(hoe1, 1), new Object [] {"##", " %", " %", '#', GoldEssence, '%', Item.stick});
IceCrystal.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/IceCrystalBlock.png");
ModLoader.registerBlock(IceCrystal);
ModLoader.addName(IceCrystal, "Ice Crystal Block");
pickaxe.iconIndex = ModLoader.addOverride("/gui/items.png", "/IceCrystalPickaxe.png");
axe.iconIndex = ModLoader.addOverride("/gui/items.png", "/IceCrystalAxe.png");
shovel.iconIndex = ModLoader.addOverride("/gui/items.png", "/IceCrystalShovel.png");
sword.iconIndex = ModLoader.addOverride("/gui/items.png", "/IceCrystalSword.png");
hoe.iconIndex = ModLoader.addOverride("/gui/items.png", "/IceCrystalHoe.png");
ModLoader.addName(pickaxe, "Ice Crystal Pickaxe");
ModLoader.addName(axe, "Ice Crystal Axe");
ModLoader.addName(shovel, "Ice Crystal Shovel");
ModLoader.addName(sword, "Ice Crystal Sword");
ModLoader.addName(hoe, "Ice Crystal Hoe");
ModLoader.addRecipe(new ItemStack(pickaxe, 1), new Object [] {"###", " % ", " % ", '#', CrystalIce, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(axe, 1), new Object [] {"##", "#%", " %", '#', CrystalIce, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(shovel, 1), new Object [] {"#", "%", "%", '#', CrystalIce, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(sword, 1), new Object [] {"#", "#", "%", '#', CrystalIce, '%', Item.stick});
ModLoader.addRecipe(new ItemStack(hoe, 1), new Object [] {"##", " %", " %", '#', CrystalIce, '%', Item.stick});
ModLoader.registerEntityID(EntityFrost.class, "Frost", ModLoader.getUniqueEntityId());
ModLoader.addSpawn(EntityFrost.class, 12, 14, 18, EnumCreatureType.monster, new BiomeGenBase[]
{
BiomeGenBase.FrozenWorld
});
}
public void addRenderer(Map map)
{
map.put(EntityFrost.class, new RenderBiped(new ModelBiped(), 0.5F));
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(30);
int randPosY = random.nextInt(20);
int randPosZ = chunkZ + random.nextInt(30);
(new WorldGenMinable(GoldenEssence.blockID, 5)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(200);
int randPosY = random.nextInt(20);
int randPosZ = chunkZ + random.nextInt(200);
(new WorldGenMinable(IceCrystal.blockID, 2)).generate(world, random, randPosX, randPosY, randPosZ);
BiomeGenBase biomegenbase = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
if(biomegenbase instanceof BiomeGenFrozenWorld);
}
}
public String getVersion()
{
return "1.2.5";
}
}
EntityFrost.java
package net.minecraft.src;
import java.util.Random;
public class EntityFrost extends EntityMob
{
public EntityFrost(World world)
{
super(world);
texture = "/Frost.png";
moveSpeed = 2.0F;
attackStrength = 2; //take this line out if this class doesn't extend EntityMob.
}
public int getMaxHealth()
{
return 12;
}
protected String getLivingSound()
{
return "mob.villager.default";
}
protected String getHurtSound()
{
return "mob.villager.defaulthurt";
}
protected String getDeathSound()
{
return "mob.villager.defaultdeath";
}
protected int getDropItemId()
{
return Block.ice.blockID;
}
protected boolean canDespawn()
{
return true;
}
}
before adding your mob as an entry in the spawn list.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
It appears when I only have it gen one ore everything works fine but when I load two ores it quits saying saving chuncks.
package net.minecraft.src;
import java.util.Random;
public class mod_core extends BaseMod
{
public static int Tinore = ModLoader.addOverride("/terrain.png", "dock/block/tin.png");
public static int Copperore = ModLoader.addOverride("/terrain.png", "dock/block/copper.png");
public String getVersion()
{
return "1.2.5";
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Tinore, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Copperore, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}}
public void load() {
}}
Why is it still doing this after I implemented your fixes you told me?
Is there a way to make an ore only generate around another type of ore?
Yes, you need to look at WorldGenMinable make a new file, copy all of the code from WorldGenMinable into your file you should be able to find some line with "Block.Stone". just change that to the ore you want it to generate around, and then just call your file instead of WorldGenMinable in the generate method
for(int dk = 0; dk < 7; dk++)
{
int randPosX = i + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = j + random.nextInt(16);
(new YourCustomClassNameHere(Block.blockID, 7)).generate(world, random, randPosX, randPosY, randPosZ);
}
It appears when I only have it gen one ore everything works fine but when I load two ores it quits saying saving chuncks.
package net.minecraft.src;
import java.util.Random;
public class mod_core extends BaseMod
{
public static int Tinore = ModLoader.addOverride("/terrain.png", "dock/block/tin.png");
public static int Copperore = ModLoader.addOverride("/terrain.png", "dock/block/copper.png");
public String getVersion()
{
return "1.2.5";
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Tinore, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Copperore, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}}
public void load() {
}}
Why is it still doing this after I implemented your fixes you told me?
Try making your 7's and 10's lower numbers.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
I did most of the corrections and even found a few classes I missed but it still gives me the same error no matter what I do.
Mods loaded: 4
ModLoader 1.2.5
mod_colorless 1.2.5
mod_core 1.2.5
mod_oreitems 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT eee0fea5 --------
Generated 8/1/12 7:02 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 5700 Series version 4.2.11733 Compatibility Profile Context, ATI Technologies Inc.
java.lang.NullPointerException
at ack.a(SourceFile:408)
at ack.a(SourceFile:349)
at xd.d(SourceFile:392)
at eh.a(SourceFile:57)
at mod_core.generateSurface(mod_core.java:26)
at ModLoader.populateChunk(ModLoader.java:1184)
at ko.a(ko.java:125)
at ack.a(SourceFile:733)
at ko.c(ko.java:67)
at ko.b(ko.java:75)
at xd.d(SourceFile:359)
at xd.a(SourceFile:301)
at net.minecraft.client.Minecraft.e(SourceFile:1916)
at net.minecraft.client.Minecraft.a(SourceFile:1824)
at net.minecraft.client.Minecraft.a(SourceFile:1788)
at net.minecraft.client.Minecraft.a(SourceFile:1676)
at mw.c(SourceFile:171)
at iz.a(SourceFile:220)
at if.a(SourceFile:150)
at mw.a(SourceFile:192)
at lr.b(SourceFile:734)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.x(SourceFile:752)
at net.minecraft.client.Minecraft.run(SourceFile:671)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 46c969e6 ----------
I have a few questions.
Do you need mod-loader?
How do you make animals tamable/mountable?
Is it possible to make an animal faster when mounted than it is when not mounted?
Can you make an animal look different when mounted than when not mounted?
I also dont understand how to ge tthe mcp to work please help.
I am really sorry for all the questions but I really want to know all these things it would help me a lot in my mod.
I did most of the corrections and even found a few classes I missed but it still gives me the same error no matter what I do.
Mods loaded: 4
ModLoader 1.2.5
mod_colorless 1.2.5
mod_core 1.2.5
mod_oreitems 1.2.5
Minecraft has crashed!
----------------------
Minecraft has stopped running because it encountered a problem.
--- BEGIN ERROR REPORT eee0fea5 --------
Generated 8/1/12 7:02 PM
Minecraft: Minecraft 1.2.5
OS: Windows 7 (amd64) version 6.1
Java: 1.7.0_04, Oracle Corporation
VM: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
LWJGL: 2.4.2
OpenGL: ATI Radeon HD 5700 Series version 4.2.11733 Compatibility Profile Context, ATI Technologies Inc.
java.lang.NullPointerException
at ack.a(SourceFile:408)
at ack.a(SourceFile:349)
at xd.d(SourceFile:392)
at eh.a(SourceFile:57)
at mod_core.generateSurface(mod_core.java:26)
at ModLoader.populateChunk(ModLoader.java:1184)
at ko.a(ko.java:125)
at ack.a(SourceFile:733)
at ko.c(ko.java:67)
at ko.b(ko.java:75)
at xd.d(SourceFile:359)
at xd.a(SourceFile:301)
at net.minecraft.client.Minecraft.e(SourceFile:1916)
at net.minecraft.client.Minecraft.a(SourceFile:1824)
at net.minecraft.client.Minecraft.a(SourceFile:1788)
at net.minecraft.client.Minecraft.a(SourceFile:1676)
at mw.c(SourceFile:171)
at iz.a(SourceFile:220)
at if.a(SourceFile:150)
at mw.a(SourceFile:192)
at lr.b(SourceFile:734)
at EntityRendererProxy.b(EntityRendererProxy.java:21)
at net.minecraft.client.Minecraft.x(SourceFile:752)
at net.minecraft.client.Minecraft.run(SourceFile:671)
at java.lang.Thread.run(Unknown Source)
--- END ERROR REPORT 46c969e6 ----------
You are trying to generate ints that are equal to images. There is no way in the world that will work. You have to generate blocks ids which are ints called by blockID.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
is it true that every ssp only mod is going to be broken and needs to be completely rewritten?
Yes and no. SSP is going to basically be running its own 'server', so your LAN buddies can hop on if they want. This will mean more involvement in updating SSP only mods, because they first have to convert them to SMP. But not 'needs to be completely rewritten'.
So how exactly would I go about generating the ore with meta data?
CODE
package net.minecraft.src;
import java.util.Random;
public class mod_ingotblockmain extends Block
{
public mod_ingotblockmain(int id)
{
super(id, Material.rock);
this.setHardness(3.0f);
this.setResistance(3.0f);
this.setStepSound(Block.soundStoneFootstep);
this.setBlockName("stone");
}
public int idDropped(int metadata, Random Random)
{
return blockID;
}
protected int damageDropped(int metadata)
{
return metadata;
}
public int getBlockTextureFromSideMetaData(int par1, int par2)
{
switch (par2)
{
default:
return mod_oreblocks.Tinore;
case 1:
return mod_oreblocks.Copperore;
}
}
}
Generation Code
package net.minecraft.src;
import java.util.Random;
public class mod_oreitems extends BaseMod
{
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(mod_oreblocks.Tinore, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 7; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(mod_oreblocks.Copperore, 10)).generate(world, random, randPosX, randPosY, randPosZ);
}}
public void load() {
}
public String getVersion() {
return "1.2.5";
}}
i know we are now in 1.3.1 (YAY), but will these tutorials still work?
Not yet. After ModLoader has updated they should work. Risugami has been inactive for a month so hopefully someone will make an unofficial version or Risugami will update.
Also, please don't quote the entire OP. It is annoying for people scrolling down to find replies.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Well, I've created a new biome and it creates in idle form, but i want it to create my custom Trees and the lakes should be filled with my custom liquid.
So, I wrote some code, but it isn't working correctly.
mod_File only parts
public class mod_MoorCraft extends BaseMod
{
public static BiomeGenBase Moor;
public static Block MoorStill;
public static Block MoorFlowing;
public void load()
{
MoorStill = new MoorStill(MoorStillID, Material.water).setHardness(100F).setLightOpacity(3).setBlockName("Morast").disableStats().setRequiresSelfNotify();;
MoorFlowing = new MoorFlowing(MoorFlowingID, Material.water).setHardness(100F).setLightOpacity(3).setBlockName("Morast").disableStats().setRequiresSelfNotify();; ModLoader.registerBlock(MoorStill);
ModLoader.registerBlock(MoorFlowing);
Moor= new BiomeGenMoor(24).setBiomeName("Moor");
ModLoader.addBiome(Moor);
}
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
BiomeGenBase moorBase = world.getWorldChunkManager().getBiomeGenAt(chunkX, chunkZ);
WorldGenMoorTrees genMoorTrees = new WorldGenMoorTrees();
if ((moorBase instanceof BiomeGenTaiga) || moorBase instanceof BiomeGenMoor)
{
int randPosX = chunkX + random.nextInt(16) + 8;
int randPosY = random.nextInt(16) + 8;
int randPosZ = world.getHeightValue(randPosX, randPosY);
genMoorTrees.generate(world, random, randPosX, randPosZ, randPosY);
}
}
He has to update, ModLoader is one of the most used/depended on mods out there
Just because his API is used in 99% of mods doesn't mean he has to update. He has his own life to go on with. I'm sure he will update eventually but there are massive changes in single player so ModLoader is basically rendered useless. ModLoaderMP looks to be the way to go at the moment for single player. Fortunately his thread has been locked to prevent "plz update" spam.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
You can't put a method inside another method. You are trying to put the addRenderer method inside the load method. Move it out and it will work.
Please use code tags when posting code. It makes it a lot easier to read the code.
together they are powerful beyond imagination."
This is my code:
mod_frontglass.java
*EDIT* added spoilers, forgot to when I posted, lol.
Problem fixed, mod now compiles!
You've got two load methods. You can't have two methods with the same name and parameters in one class. Put all of the code in the second load method into the first then delete the second.
You need to import Random.
together they are powerful beyond imagination."
Look at the tutorial. You need to import Map.
together they are powerful beyond imagination."
before adding your mob as an entry in the spawn list.
together they are powerful beyond imagination."
Why is it still doing this after I implemented your fixes you told me?
Yes, you need to look at WorldGenMinable make a new file, copy all of the code from WorldGenMinable into your file you should be able to find some line with "Block.Stone". just change that to the ore you want it to generate around, and then just call your file instead of WorldGenMinable in the generate method
Try making your 7's and 10's lower numbers.
together they are powerful beyond imagination."
Do you need mod-loader?
How do you make animals tamable/mountable?
Is it possible to make an animal faster when mounted than it is when not mounted?
Can you make an animal look different when mounted than when not mounted?
I also dont understand how to ge tthe mcp to work please help.
I am really sorry for all the questions but I really want to know all these things it would help me a lot in my mod.
I am trying to make penguins
You are trying to generate ints that are equal to images. There is no way in the world that will work. You have to generate blocks ids which are ints called by blockID.
together they are powerful beyond imagination."
CODE
Not yet. After ModLoader has updated they should work. Risugami has been inactive for a month so hopefully someone will make an unofficial version or Risugami will update.
Also, please don't quote the entire OP. It is annoying for people scrolling down to find replies.
together they are powerful beyond imagination."
together they are powerful beyond imagination."
What isn't working? Is it just "not working" or what? I need more information.
Just because his API is used in 99% of mods doesn't mean he has to update. He has his own life to go on with. I'm sure he will update eventually but there are massive changes in single player so ModLoader is basically rendered useless. ModLoaderMP looks to be the way to go at the moment for single player. Fortunately his thread has been locked to prevent "plz update" spam.
together they are powerful beyond imagination."