@TechGuy543 I use MCP and Eclipse, and I followed your texture tutorial ( The png files are in /mcp62/eclipse/client/bin), but how do I export those with my mod? Or do i add a new folder in minecraft.jar? Thanks in advance!
Hey TechGuy, how exactly do you use a new block with a texture from the standard terrain.png? I don't want to re-add the texture cause that's stupid
I know you can do it with forge but I was wondering how to do it with ModLoader.
Thanks
You change the 0 next to the block ID, 0 is the top left corner of the PNG, and then it goes left right until it hits the edge, then it starts on the left side of the second line... And so on... And then you leave out the texture override
1) Would it be possible to make trees with many different types of branches, leaves, bark, and wood (you break wood,you get bark and wood w/out bark is placed) or would I have to make it a generated structure?
2) How do I stop normal trees from spawning?
tanksin advanc
1. A tree is a structure. They just use very advanced maths to place the blocks so that they are random.
2. You need to make an edit to a base class. I can't remember which one though.
package net.minecraft.src;
import java.util.Random;
public class WorldGenNetherMinableFantasy extends WorldGenerator
{
/** The block ID of the ore to be placed using this generator. */
private int minableBlockId;
/** The number of blocks to generate. */
private int numberOfBlocks;
public WorldGenNetherMinableFantasy(int par1, int par2)
{
minableBlockId = par1;
numberOfBlocks = par2;
}
public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
float f = par2Random.nextFloat() * (float)Math.PI;
double d = (float)(par3 + 8) + (MathHelper.sin(f) * (float)numberOfBlocks) / 8F;
double d1 = (float)(par3 + 8) - (MathHelper.sin(f) * (float)numberOfBlocks) / 8F;
double d2 = (float)(par5 + 8) + (MathHelper.cos(f) * (float)numberOfBlocks) / 8F;
double d3 = (float)(par5 + 8) - (MathHelper.cos(f) * (float)numberOfBlocks) / 8F;
double d4 = (par4 + par2Random.nextInt(3)) - 2;
double d5 = (par4 + par2Random.nextInt(3)) - 2;
for (int i = 0; i <= numberOfBlocks; i++)
{
double d6 = d + ((d1 - d) * (double)i) / (double)numberOfBlocks;
double d7 = d4 + ((d5 - d4) * (double)i) / (double)numberOfBlocks;
double d8 = d2 + ((d3 - d2) * (double)i) / (double)numberOfBlocks;
double d9 = (par2Random.nextDouble() * (double)numberOfBlocks) / 16D;
double d10 = (double)(MathHelper.sin(((float)i * (float)Math.PI) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D;
double d11 = (double)(MathHelper.sin(((float)i * (float)Math.PI) / (float)numberOfBlocks) + 1.0F) * d9 + 1.0D;
int j = MathHelper.floor_double(d6 - d10 / 2D);
int k = MathHelper.floor_double(d7 - d11 / 2D);
int l = MathHelper.floor_double(d8 - d10 / 2D);
int i1 = MathHelper.floor_double(d6 + d10 / 2D);
int j1 = MathHelper.floor_double(d7 + d11 / 2D);
int k1 = MathHelper.floor_double(d8 + d10 / 2D);
for (int l1 = j; l1 <= i1; l1++)
{
double d12 = (((double)l1 + 0.5D) - d6) / (d10 / 2D);
if (d12 * d12 >= 1.0D)
{
continue;
}
for (int i2 = k; i2 <= j1; i2++)
{
double d13 = (((double)i2 + 0.5D) - d7) / (d11 / 2D);
if (d12 * d12 + d13 * d13 >= 1.0D)
{
continue;
}
for (int j2 = l; j2 <= k1; j2++)
{
double d14 = (((double)j2 + 0.5D) - d8) / (d10 / 2D);
if (d12 * d12 + d13 * d13 + d14 * d14 < 1.0D && par1World.getBlockId(l1, i2, j2) == Block.netherrack.blockID)
{
par1World.setBlock(l1, i2, j2, minableBlockId);
}
}
}
}
}
return true;
}
}
This should work, but it doesnt. Ive tried to generate them via Structure Generation, but that doesnt work either. There must be a problem on my side. I really dont know where it can be.
These are codes of Impium. I think they are OK, but check them please for me.
My Mod main class:
public static final Block Impium = new BlockImpium (249,0).setBlockName("Impium").setHardness(1F).setResistance(4F);
ModLoader:
Impium.blockIndexInTexture = ModLoader.addOverride("/terrain.png", "/fantasy/Impium.png");
ModLoader.registerBlock(Impium);
ModLoader.addName(Impium, "Impium");
generationSurface:
for(int i = 0; i < 100; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenNetherMinableFantasy(Impium.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ);
}
And BlockImpium class:
package net.minecraft.src;
import java.util.Random;
public class BlockImpium extends Block
{
public BlockImpium(int i, int j)
{
super(i,j, Material.rock);
}
public int idDropped(int par1, Random par2Random, int par3)
{
return mod_FantasyExpansion.ImpOrb.shiftedIndex;
}
public int quantityDropped(int par1Random)
{
return 2;
}
}
(I tried to put spaces in this code, but that didnt work so sorry if it isnt readable)
Thanks for your patience with me
That is really strange. Try putting the for loop in a generateNether method instead.
public void generateNether(World world, Random random, int i, int j)
{
for(int i = 0; i < 100; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(128);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenNetherMinableFantasy(Impium.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ);
}
}
How would you make a walking animation for your mob?
Have a look at the setRotationAngles method in ModelBiped. It contains the animation of the player. You can source off it or other model classes like ModelQuadruped.
Hey the tuts are awesome, I just have one problem:
How do I get my Custom Different Faced Block to face me when I place it? The stairs thing didnt work for me.
Its just a normal block, just different textures on the sides.
Thanks!
Have a look at the furnace. I believe it does it similar to stairs however it sets the textures to each sides differently.
Love the tuts but i have only 1 problem.
How to add 2 of these?
public void generateSurface(World world, Random rand, int chunkX, int chunkZ){
// RARE!!Coal is about 15 RARE!!!
for(int i = 0; i < 25; i++){
int randPosX = chunkX + rand.nextInt(4);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(4); //How many in a vein
(new WorldGenMinable(BronzeBlock.blockID, 5)).generate (world, rand, randPosX, randPosY, randPosZ);
}
Or of these?
public void addRenderer(Map map)
{
map.put(EntityHunter.class, new RenderBiped(new ModelBiped(), 0.5F));
map.put(EntityHunter2.class, new RenderBiped(new ModelBiped(), 0.5F));
}
//This code only lets one mob spawn
You just add another for loop.
public void generateSurface(World world, Random rand, int chunkX, int chunkZ){
// RARE!!Coal is about 15 RARE!!!
for(int i = 0; i < 25; i++){
int randPosX = chunkX + rand.nextInt(4);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(4); //How many in a vein
(new WorldGenMinable(BronzeBlock.blockID, 5)).generate (world, rand, randPosX, randPosY, randPosZ);
}
for(int i = 0; i < 25; i++){
int randPosX = chunkX + rand.nextInt(4);
int randPosY = rand.nextInt(128);
int randPosZ = chunkZ + rand.nextInt(4); //How many in a vein
(new WorldGenMinable(SecondBlock.blockID, 5)).generate (world, rand, randPosX, randPosY, randPosZ);
}
}
@TechGuy543 I use MCP and Eclipse, and I followed your texture tutorial ( The png files are in /mcp62/eclipse/client/bin), but how do I export those with my mod? Or do i add a new folder in minecraft.jar? Thanks in advance!
You just use those same textures and put them in the zip with your other classes. You only put them in eclipse/client/bin for use by the testing client.
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
You change the 0 next to the block ID, 0 is the top left corner of the PNG, and then it goes left right until it hits the edge, then it starts on the left side of the second line... And so on... And then you leave out the texture override
Cool, I didn't know that. But I figured it out, I just used:
Hi techguy, if you can also spare the time to make a Dimension TUT then that would be amazing! I am requesting a basic dimension tutorial if you can.
Thx so much
I can't "spare the time for it". I am working on 3 advanced mods and also have to go to school and work. Once I've finished the mods then I will make a tutorial utilising Forge but I am not doing anything until then.
This isnt a problem with your tutorial, but its about modding, compatibility and ModLoader possibilities.
Ive encountered problem with many ModLoader.addOverride and i couldnt figure, how to add more with ModLoader only.
So my only choice (for me) was Forge, which can add your own items.png with 256 icon (Whoa ) like Notch did.
I made 256x256 items.png with my icons (60+ pickaxes) and assigned them a .setIconCoord(X, X) to every of them (Like in this tutorial http://minecraftforg..._sprite_indexes ).
But since i "installed Forge" (I installed it correctly, new workspace, clean minecraft.jar etc. ) , Minecraft doesnt work for me.
Here is the error log:
org.lwjgl.LWJGLException: Could not create context
at org.lwjgl.opengl.WindowsContextImplementation.nCreate(Native Method)
at org.lwjgl.opengl.WindowsContextImplementation.create(WindowsContextImplementation.java:50)
at org.lwjgl.opengl.Context.<init>(Context.java:120)
at org.lwjgl.opengl.Display.create(Display.java:858)
at org.lwjgl.opengl.Display.create(Display.java:784)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:357)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Unknown Source)
org.lwjgl.LWJGLException: Could not create context
at org.lwjgl.opengl.WindowsContextImplementation.nCreate(Native Method)
at org.lwjgl.opengl.WindowsContextImplementation.create(WindowsContextImplementation.java:50)
at org.lwjgl.opengl.Context.<init>(Context.java:120)
at org.lwjgl.opengl.Display.create(Display.java:858)
at org.lwjgl.opengl.Display.create(Display.java:784)
at org.lwjgl.opengl.Display.create(Display.java:765)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:372)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Unknown Source)
VII 07, 2012 11:25:58 DOP. net.minecraft.src.PanelCrashReport <init>
SEVERE: A critical error has occurred.
org.lwjgl.LWJGLException: Could not create context
at org.lwjgl.opengl.WindowsContextImplementation.nCreate(Native Method)
at org.lwjgl.opengl.WindowsContextImplementation.create(WindowsContextImplementation.java:50)
at org.lwjgl.opengl.Context.<init>(Context.java:120)
at org.lwjgl.opengl.Display.create(Display.java:858)
at org.lwjgl.opengl.Display.create(Display.java:784)
at org.lwjgl.opengl.Display.create(Display.java:765)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:372)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Unknown Source)
Exception in thread "Minecraft main thread" java.lang.RuntimeException: sidedDelegate null when attempting to getMinecraftLogger, this is generally caused by you not installing FML properly, or installing some other mod that edits Minecraft.class on top of FML such as ModLoader, do not do this. Reinstall FML properly and try again.
at cpw.mods.fml.common.FMLCommonHandler.getMinecraftLogger(FMLCommonHandler.java:285)
at cpw.mods.fml.common.Loader.<init>(Loader.java:137)
at cpw.mods.fml.common.Loader.instance(Loader.java:128)
at net.minecraft.src.PanelCrashReport.<init>(PanelCrashReport.java:25)
at net.minecraft.src.MinecraftImpl.displayUnexpectedThrowable(MinecraftImpl.java:26)
at net.minecraft.client.Minecraft.onMinecraftCrash(Minecraft.java:297)
at net.minecraft.client.Minecraft.run(Minecraft.java:740)
at java.lang.Thread.run(Unknown Source)
Its error log from Eclipse - Minecraft gives me a White Screen Of Death .
So my questions are :
Do you know what this error means and can you help me with it?
Can i use my own Items.png without Forge (I dont like it - many many problems with modding since ive installed it) and only with ModLoader? I have many items (now its 100+) and each of them has its specific icon, so ModLoader.addOverride is impossible to do.
Thanks for Your answer
AraXis
(Thanks for your help with my nether generation problems, but now i cant try it, nothing works as i want)
You cannot use an items.png without Forge. You have to edit base classes if you don't want to use Forge but it is harder to do that than it is to use Forge.
Although, it does look like that is more of an LWJGL error. Try updating it and see if it works.
Rollback Post to RevisionRollBack
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
Ok ,thanks for useful information. Ive updated LWJGL to newest version from http://www.lwjgl.org/download.php , but still im getting this
error and WhiteScreenOfDeath
Exception in thread "Minecraft main thread" java.lang.UnsatisfiedLinkError: org.lwjgl.DefaultSysImplementation.getPointerSize()I
at org.lwjgl.DefaultSysImplementation.getPointerSize(Native Method)
at org.lwjgl.Sys.<clinit>(Sys.java:113)
at org.lwjgl.opengl.Display.<clinit>(Display.java:132)
at net.minecraft.client.Minecraft.startGame(Minecraft.java:327)
at net.minecraft.client.Minecraft.run(Minecraft.java:735)
at java.lang.Thread.run(Unknown Source)
EDIT:
I didnt update everything,now i did and its the same error log as in post #3012
EDIT 2 :
Ok, nevermind. My girlfriend came to my room and it works perfectly ...By the way, my head exploded because this, i did nothing with the code or another LWJGL update...
“Computers are incredibly fast, accurate and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination."
How Do I Use World gen i want to make it so that the huge things i made are randomly generated do i use a schematic or something like that oh and i want the new mobs i added to only spawn in that place
Error with the ore generation. It says random cannot be resolved as a type... Well here is the code...
public void generateSurface(World world, Random random, int chunkX, int chunkZ)
{
for(int i = 0; i < 5; i++)
{
int randPosX = chunkX + random.nextInt(16);
int randPosY = random.nextInt(25);
int randPosZ = chunkZ + random.nextInt(16);
(new WorldGenMinable(Huntersore.blockID, 6)).generate(world, random, randPosX, randPosY, randPosZ);}
}
Remember this is only a section, everything else has no errors.
Okay I did get the problem fixed with the mob not spawning, but now I have a new problem.
When my mob walks, it's legs don't rotate. The mob has no AI set on, so I don't know why it wouldn't swing his legs.
For some reason my mods aren't loading. Minecraft will start, and my blocks are registered(I think), but the blocks won't show up. I can't craft them or use TooManyItems to find them. Maybe there is something I missed. I have only followed the tutorials up to the block tutorial. Help!
You'll notice that the first to parameters(World and EntityPlayer) have a 1 after their variable(world1, entityPlayer1). We have to add this so that they are not the same as the private variables we previously created. You don't have to add a 1 after it, you could add anything. For example your constructor could say:
The emphasized section isn't technically true (though the idea of not reusing variable names is still good advice for beginning programmers).
If you have a variable or method from one scope (say, a class-scope variable defined outside of any methods) which is being hidden by an identically-named variable or method at a more local scope (say, a method parameter), then you can still usually access the hidden variable or method using the "this" (if within the same class) or "super" (if it's from a parent class) keywords, or a reference to the class or instance.
For instance, your code example could be re-written as:
package net.minecraft.src;
import net.minecraft.client.Minecraft;
public class GuiNameHere extends GuiScreen
{
private Minecraft mc;
private World world;
private EntityPlayer entityPlayer;
public GuiNameHere(World world, EntityPlayer entityPlayer, Minecraft mc)
{
this.world = world;
this.entityPlayer = entityPlayer;
this.mc = mc;
}
public void initGui()
{
}
public void drawScreen(int i, int j, float f)
{
}
}
-
View User Profile
-
View Posts
-
Send Message
Curse PremiumYou change the 0 next to the block ID, 0 is the top left corner of the PNG, and then it goes
left1. A tree is a structure. They just use very advanced maths to place the blocks so that they are random.
2. You need to make an edit to a base class. I can't remember which one though.
That is really strange. Try putting the for loop in a generateNether method instead.
public void generateNether(World world, Random random, int i, int j) { for(int i = 0; i < 100; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(128); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenNetherMinableFantasy(Impium.blockID, 50)).generate(world, random, randPosX, randPosY, randPosZ); } }Have a look at the setRotationAngles method in ModelBiped. It contains the animation of the player. You can source off it or other model classes like ModelQuadruped.
Thanks.
I started in September last year. The difficulty of learning Java is up to the individual. It can be easy or hard for any particular person.
You didn't install ModLoader before decompiling.
Have a look at the furnace. I believe it does it similar to stairs however it sets the textures to each sides differently.
You just add another for loop.
public void generateSurface(World world, Random rand, int chunkX, int chunkZ){ // RARE!!Coal is about 15 RARE!!! for(int i = 0; i < 25; i++){ int randPosX = chunkX + rand.nextInt(4); int randPosY = rand.nextInt(128); int randPosZ = chunkZ + rand.nextInt(4); //How many in a vein (new WorldGenMinable(BronzeBlock.blockID, 5)).generate (world, rand, randPosX, randPosY, randPosZ); } for(int i = 0; i < 25; i++){ int randPosX = chunkX + rand.nextInt(4); int randPosY = rand.nextInt(128); int randPosZ = chunkZ + rand.nextInt(4); //How many in a vein (new WorldGenMinable(SecondBlock.blockID, 5)).generate (world, rand, randPosX, randPosY, randPosZ); } }????
You just use those same textures and put them in the zip with your other classes. You only put them in eclipse/client/bin for use by the testing client.
together they are powerful beyond imagination."
-
View User Profile
-
View Posts
-
Send Message
Curse Premiumnvm, the way I read it now, the Gui is a separate class from my mod
It still crashes with the same error..
Thx so much
Try asking in Mod Development. I can't think of anything else that may be causing it.
I can't "spare the time for it". I am working on 3 advanced mods and also have to go to school and work. Once I've finished the mods then I will make a tutorial utilising Forge but I am not doing anything until then.
I added generation into the tutorial.
You cannot use an items.png without Forge. You have to edit base classes if you don't want to use Forge but it is harder to do that than it is to use Forge.
Although, it does look like that is more of an LWJGL error. Try updating it and see if it works.
together they are powerful beyond imagination."
Haha. Ok, glad you got it to work.
together they are powerful beyond imagination."
public void generateSurface(World world, Random random, int chunkX, int chunkZ) { for(int i = 0; i < 5; i++) { int randPosX = chunkX + random.nextInt(16); int randPosY = random.nextInt(25); int randPosZ = chunkZ + random.nextInt(16); (new WorldGenMinable(Huntersore.blockID, 6)).generate(world, random, randPosX, randPosY, randPosZ);} }Remember this is only a section, everything else has no errors.
When my mob walks, it's legs don't rotate. The mob has no AI set on, so I don't know why it wouldn't swing his legs.
Model file again:
package net.minecraft.src; public class ModelSoldier extends ModelBase { //fields ModelRenderer head; ModelRenderer body; ModelRenderer rightarm; ModelRenderer leftarm; ModelRenderer rightleg; ModelRenderer leftleg; public ModelSoldier() { textureWidth = 98; textureHeight = 48; head = new ModelRenderer(this, 0, 32); head.addBox(-4F, -8F, -4F, 8, 8, 8); head.setRotationPoint(0F, -15F, -1F); head.setTextureSize(98, 48); head.mirror = true; setRotation(head, 0F, 0F, 0F); body = new ModelRenderer(this, 0, 0); body.addBox(-4F, 0F, -2F, 12, 18, 6); body.setRotationPoint(-2F, -14F, 0F); body.setTextureSize(98, 48); body.mirror = true; setRotation(body, 0F, 0F, 0F); rightarm = new ModelRenderer(this, 50, 24); rightarm.addBox(-3F, -2F, -2F, 6, 18, 6); rightarm.setRotationPoint(-10F, -12F, 0F); rightarm.setTextureSize(98, 48); rightarm.mirror = true; setRotation(rightarm, 0F, 0F, 0F); leftarm = new ModelRenderer(this, 74, 24); leftarm.addBox(0F, -2F, -2F, 6, 18, 6); leftarm.setRotationPoint(7F, -12F, 0F); leftarm.setTextureSize(98, 48); leftarm.mirror = true; setRotation(leftarm, 0F, 0F, 0F); rightleg = new ModelRenderer(this, 50, 0); rightleg.addBox(-2F, 0F, -2F, 6, 18, 6); rightleg.setRotationPoint(-4F, 5F, 0F); rightleg.setTextureSize(98, 48); rightleg.mirror = true; setRotation(rightleg, 0F, 0F, 0F); leftleg = new ModelRenderer(this, 74, 0); leftleg.addBox(-2F, 0F, -2F, 6, 18, 6); leftleg.setRotationPoint(2F, 5F, 0F); leftleg.setTextureSize(98, 48); leftleg.mirror = true; setRotation(leftleg, 0F, 0F, 0F); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5); head.render(f5); body.render(f5); rightarm.render(f5); leftarm.render(f5); rightleg.render(f5); leftleg.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5) { super.setRotationAngles(f, f1, f2, f3, f4, f5); } }I created the model in Techne, and there are no errors or warnings at all.
I'm gonna follow this topic for now on
public EntitySimon(World world) { super(world); texture = "/jars/mods/dwarfredbeard.png"; moveSpeed = 1.0F; attackStrength = 5; }EDIT: Ignore this, I fixed it. lolz
* [Mod][MC - 1.2.5] Give My Spawner! [V 1.0]
The emphasized section isn't technically true (though the idea of not reusing variable names is still good advice for beginning programmers).
If you have a variable or method from one scope (say, a class-scope variable defined outside of any methods) which is being hidden by an identically-named variable or method at a more local scope (say, a method parameter), then you can still usually access the hidden variable or method using the "this" (if within the same class) or "super" (if it's from a parent class) keywords, or a reference to the class or instance.
For instance, your code example could be re-written as:
package net.minecraft.src; import net.minecraft.client.Minecraft; public class GuiNameHere extends GuiScreen { private Minecraft mc; private World world; private EntityPlayer entityPlayer; public GuiNameHere(World world, EntityPlayer entityPlayer, Minecraft mc) { this.world = world; this.entityPlayer = entityPlayer; this.mc = mc; } public void initGui() { } public void drawScreen(int i, int j, float f) { } }That would still work correctly.