I believe I know what is causing the visual glitch with the leaves. I was looking through the coding of the regular leaves, and in Block.java, it codes it like this
public static final BlockLeaves Leaves;
There is also a little extra where it defines it's properties in the Block.java file. It adds (BlockLeaves) before new BlockLeaves. I was experimenting with it to see if I could add this to my leaves block, but I couldn't. It kept throwing an error saying, BlockAppletreeLeaves cannot be cast to bk. That was when I tried adding it into my mod_... file. So, I tried it in the regular Block.java file, and I believe it worked. I cannot get it to use a custom texture though unless I add it to the terrain.png as it seems ModLoader doesn't see the code I put there. I'll look around some more and try to find a solution to this issue.
private void removeLeaves(World world, int i, int j, int k)
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, 0);
}
public int quantityDropped(Random random)
{
return random.nextInt(20) != 0 ? 0 : 1;
}
public int idDropped(int i, Random random)
{
return mod_WolfeTree.WolfeSapling.blockID;
}
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
{
if(!world.multiplayerWorld && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
{
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
dropBlockAsItem_do(world, i, j, k, new ItemStack(mod_WolfeTree.WolfeLeaves.blockID, 1, l & 3));
} else
{
super.harvestBlock(world, entityplayer, i, j, k, l);
}
}
protected int damageDropped(int i)
{
return i & 3;
}
public boolean isOpaqueCube()
{
return !graphicsLevel;
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if((j & 3) == 1)
{
return blockIndexInTexture + 80;
} else
{
return blockIndexInTexture;
}
}
public void onEntityWalking(World world, int i, int j, int k, Entity entity)
{
super.onEntityWalking(world, i, j, k, entity);
}
private int baseIndexInPNG;
int adjacentTreeBlocks[];
}
Note that I copied the regular BlockLeaves.java and edited to my liking for my own tree, as well as yours. So, your leaves will have a a different color depending on what biome they're in. If you don't want that, then take it out.
I also made it so that you can get Wolfe Leaves from using shears on the leaves and that they decay.
Yes, I added those two features at the bottom myself too :tongue.gif: And will it be different shades of blue? Because if it is other colors, I don't need that. I'll try it.
private void removeLeaves(World world, int i, int j, int k)
{
dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k));
world.setBlockWithNotify(i, j, k, 0);
}
public int quantityDropped(Random random)
{
return random.nextInt(20) != 0 ? 0 : 1;
}
public int idDropped(int i, Random random)
{
return mod_WolfeTree.WolfeSapling.blockID;
}
public void harvestBlock(World world, EntityPlayer entityplayer, int i, int j, int k, int l)
{
if(!world.multiplayerWorld && entityplayer.getCurrentEquippedItem() != null && entityplayer.getCurrentEquippedItem().itemID == Item.shears.shiftedIndex)
{
entityplayer.addStat(StatList.mineBlockStatArray[blockID], 1);
dropBlockAsItem_do(world, i, j, k, new ItemStack(mod_WolfeTree.WolfeLeaves.blockID, 1, l & 3));
} else
{
super.harvestBlock(world, entityplayer, i, j, k, l);
}
}
protected int damageDropped(int i)
{
return i & 3;
}
public boolean isOpaqueCube()
{
return !graphicsLevel;
}
public int getBlockTextureFromSideAndMetadata(int i, int j)
{
if((j & 3) == 1)
{
return blockIndexInTexture + 80;
} else
{
return blockIndexInTexture;
}
}
public void onEntityWalking(World world, int i, int j, int k, Entity entity)
{
super.onEntityWalking(world, i, j, k, entity);
}
private int baseIndexInPNG;
int adjacentTreeBlocks[];
}
Note that I copied the regular BlockLeaves.java and edited to my liking for my own tree, as well as yours. So, your leaves will have a a different color depending on what biome they're in. If you don't want that, then take it out.
I also made it so that you can get Wolfe Leaves from using shears on the leaves and that they decay.
I really think that the problem is the generation code in the mod_ file. Because all of the other files are the same as the base classes.
I really think that the problem is the generation code in the mod_ file. Because all of the other files are the same as the base classes.
It actually isn't. It has to do with the WorldGenNamehereTrees file from what I can see. And you wont see the wood at first, because of the glitch with the leaves. All you need to do is take away the leaves and youll see it.
It actually isn't. It has to do with the WorldGenNamehereTrees file from what I can see. And you wont see the wood at first, because of the glitch with the leaves. All you need to do is take away the leaves and youll see it.
Hey, your code solved my problem :smile.gif: Now it works perfectly well, thank you :biggrin.gif: Now I just have to figure out how to do saplings...
The tutorial did help with my coding of my tree, and it did work when I used it, but it isn't like the normal trees. So I based my coding off of Minecrafts coding. A tutorial for fixing how the leaves render and saplings would be nice.
src\minecraft\net\minecraft\src\Mod_PirateSkeleton.java:16: error: illegal start
of expression
public void AddRenderer(Map map)
^
src\minecraft\net\minecraft\src\Mod_PirateSkeleton.java:16: error: ';' expected
public void AddRenderer(Map map)
^
src\minecraft\net\minecraft\src\Mod_PirateSkeleton.java:16: error: ')' expected
public void AddRenderer(Map map)
^
src\minecraft\net\minecraft\src\Mod_PirateSkeleton.java:16: error: illegal start
of expression
public void AddRenderer(Map map)
^
src\minecraft\net\minecraft\src\Mod_PirateSkeleton.java:16: error: ';' expected
public void AddRenderer(Map map)
^
31 errors
==================
> Done in 11.74 seconds
> Recompiling server...
> Done in 15.50 seconds
Druk op een toets om door te gaan. . .
Please look at your error. Don't just quickly look over it, only see the first parts, and then post it. If you still can't figure it out, google the error. If you can't find out on google, THEN you come to the forums. If you were to look at it, you would notice that it is being caused by this line
public void AddRenderer(Map map)
If the model is a humanoid, then you do not need it. You only need it if you do not wish to use the human model already in the game.
Can you please finish the new demenssion tuto?
I really need it ;-/
Patience. Making a new dimension is complicated from what I can see. Unless you copy and paste Minecrafts and just change some things around. Just posting things like,"Hurry up on the [INSERT TUT NAME HERE] tut!", will only slow him down because he has to take his time to read it.
wats the difference between creature and a mob....(human npc tut)
A creature is a mob that does not attack the player. Or at least thats what I can find out from looking through the coding for it. A mob is, well, the exact opposite. It will attack the player.
Yes, I added those two features at the bottom myself too :tongue.gif: And will it be different shades of blue? Because if it is other colors, I don't need that. I'll try it.
Check out my Minecraft Modding Tutorials!
I really think that the problem is the generation code in the mod_ file. Because all of the other files are the same as the base classes.
Check out my Minecraft Modding Tutorials!
It actually isn't. It has to do with the WorldGenNamehereTrees file from what I can see. And you wont see the wood at first, because of the glitch with the leaves. All you need to do is take away the leaves and youll see it.
Hey, your code solved my problem :smile.gif: Now it works perfectly well, thank you :biggrin.gif: Now I just have to figure out how to do saplings...
Check out my Minecraft Modding Tutorials!
Your welcome. And Im going to look into the saplings file to see how it works. If I find anything out, Ill tell you.
it does i get a ton of errors when making the tree
The tut works, but for some reason the logs wouldn't go into the tree. But I fixed it now, with some help :biggrin.gif: And you should add saplings.
Check out my Minecraft Modding Tutorials!
The tutorial did help with my coding of my tree, and it did work when I used it, but it isn't like the normal trees. So I based my coding off of Minecrafts coding. A tutorial for fixing how the leaves render and saplings would be nice.
Please look at your error. Don't just quickly look over it, only see the first parts, and then post it. If you still can't figure it out, google the error. If you can't find out on google, THEN you come to the forums. If you were to look at it, you would notice that it is being caused by this line
If the model is a humanoid, then you do not need it. You only need it if you do not wish to use the human model already in the game.
I really need it ;-/
HELP ME! please
Here are my error:
Here is my mod_HellTree Code:
Patience. Making a new dimension is complicated from what I can see. Unless you copy and paste Minecrafts and just change some things around. Just posting things like,"Hurry up on the [INSERT TUT NAME HERE] tut!", will only slow him down because he has to take his time to read it.
You forgot to delete the name in worldgenhelltrees in the 4th line of the generator.
A creature is a mob that does not attack the player. Or at least thats what I can find out from looking through the coding for it. A mob is, well, the exact opposite. It will attack the player.