Could you please make a tut on saplings for the trees? I really really really need one :smile.gif: Thanks :biggrin.gif: Or can you at least tell me what classes I need to edit?
Am I the only one who has the problem with the new tree where the leaves act like glass, rather than regular leaves, and there aren't any logs inbetween the leaves? And if Im not, does anyone know how to fix this? Thanks
Am I the only one who has the problem with the new tree where the leaves act like glass, rather than regular leaves, and there aren't any logs inbetween the leaves? And if Im not, does anyone know how to fix this? Thanks
I have the same problem where the logs are on the outside, I think it's just in the coding :sad.gif: But it makes it look unrealistic.
Hey, strength, how do we make it so (on your trees tutorial) logs are actually inside of the tree, not just a couple logs under the pile of leaves, like the other minecraft trees?
Hey, strength, how do we make it so (on your trees tutorial) logs are actually inside of the tree, not just a couple logs under the pile of leaves, like the other minecraft trees?
I found the code to fix it, though the leaves are still acting up. At the end of the WorldGenNamehereTrees.java, replace the last part of the code with this. Note that the code will look almost identical.
I found the code to fix it, though the leaves are still acting up. At the end of the WorldGenNamehereTrees.java, replace the last part of the code with this. Note that the code will look almost identical.
package net.minecraft.src;
import java.util.Random;
public class BlockWolfeWood extends Block
{
protected BlockWolfeWood(int i, int j)
{
super(i, j, Material.wood);
baseIndexInPNG = j;
}
public int quantityDropped(Random random)
{
return 1;
}
public int idDropped(int i, Random random)
{
return mod_WolfeTree.WolfeWood.blockID;
}
public int getBlockTextureFromSide(int i)
{
if(i == 1 || i == 0)
{
return 21;
} else
{
return baseIndexInPNG;
}
}
private int baseIndexInPNG;
}
I was also working on making saplings for my tree, but I don't think that they work, do you know how to do that?
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.
Check out my Minecraft Modding Tutorials!
Check out my Minecraft Modding Tutorials!
haha, :wink.gif:
Check out my Minecraft Modding Tutorials!
Can you make a tut on saplings? I really want to add them to my new tree from this tutorial :smile.gif: But strength isn't online.
Check out my Minecraft Modding Tutorials!
I was wondering if you could add a weapon tutorial, and maybe how to change the attack range. (not shooting entities)
Check out my Minecraft Modding Tutorials!
@Dimension tut lovers, I'm still kind of working on it but It should be "finished" within a week.
@Teh Flubausterus, I was thinking of doing an Advanced Item tutorial... Maybe.
@Veloraptor, At the moment it's impossible to make a new liquid without editing quite a alot of base classes and my tut's don't edit any.
@bobsimpleton69, Where it has the modloader.addarmor blabla Take out that Modtextures/ part. It will read it from the armor folder then.
@Haters, Ouch, who's voted 1 and 2 out of 10? If you don't like my tutorials then please feel free to post how they can be improved.
I have the same problem where the logs are on the outside, I think it's just in the coding :sad.gif: But it makes it look unrealistic.
Check out my Minecraft Modding Tutorials!
Check out my Minecraft Modding Tutorials!
I found the code to fix it, though the leaves are still acting up. At the end of the WorldGenNamehereTrees.java, replace the last part of the code with this. Note that the code will look almost identical.
If you have any issues, please include your WorldGenNamhereTrees with your post.
That doesn't do anything :/ The outcome is the same.
Check out my Minecraft Modding Tutorials!
Please post your files.
Sure :smile.gif: And by the way, this is a test for my released mod, that's why it had Wolfe in it :tongue.gif:
mod_WolfeTree
WorldGenWolfeTrees
BlockWolfeLeaves
BlockWolfeWood
I was also working on making saplings for my tree, but I don't think that they work, do you know how to do that?
Check out my Minecraft Modding Tutorials!
Alright, I just tested it, and it works. Also, I was planning on going through the BlockSapling.java soon to find out.
Here are the files.
mod_WolfeTree
WorldGenWolfeTrees
BlockWolfeLeaves
import java.util.Random;
public class BlockWolfeLeaves extends BlockLeavesBase
{
protected BlockWolfeLeaves(int i, int j)
{
super(i, j, Material.leaves, false);
baseIndexInPNG = j;
setTickOnLoad(true);
}
public int getRenderColor(int i)
{
if((i & 1) == 1)
{
return ColorizerFoliage.getFoliageColorPine();
}
if((i & 2) == 2)
{
return ColorizerFoliage.getFoliageColorBirch();
} else
{
return ColorizerFoliage.func_31073_c();
}
}
public int colorMultiplier(IBlockAccess iblockaccess, int i, int j, int k)
{
int l = iblockaccess.getBlockMetadata(i, j, k);
if((l & 1) == 1)
{
return ColorizerFoliage.getFoliageColorPine();
}
if((l & 2) == 2)
{
return ColorizerFoliage.getFoliageColorBirch();
} else
{
iblockaccess.getWorldChunkManager().func_4069_a(i, k, 1, 1);
double d = iblockaccess.getWorldChunkManager().temperature[0];
double d1 = iblockaccess.getWorldChunkManager().humidity[0];
return ColorizerFoliage.getFoliageColor(d, d1);
}
}
public void onBlockRemoval(World world, int i, int j, int k)
{
int l = 1;
int i1 = l + 1;
if(world.checkChunksExist(i - i1, j - i1, k - i1, i + i1, j + i1, k + i1))
{
for(int j1 = -l; j1 <= l; j1++)
{
for(int k1 = -l; k1 <= l; k1++)
{
for(int l1 = -l; l1 <= l; l1++)
{
int i2 = world.getBlockId(i + j1, j + k1, k + l1);
if(i2 == mod_WolfeTree.WolfeLeaves.blockID)
{
int j2 = world.getBlockMetadata(i + j1, j + k1, k + l1);
world.setBlockMetadata(i + j1, j + k1, k + l1, j2 | 8);
}
}
}
}
}
}
public void updateTick(World world, int i, int j, int k, Random random)
{
if(world.multiplayerWorld)
{
return;
}
int l = world.getBlockMetadata(i, j, k);
if((l & 8) != 0)
{
byte byte0 = 4;
int i1 = byte0 + 1;
byte byte1 = 32;
int j1 = byte1 * byte1;
int k1 = byte1 / 2;
if(adjacentTreeBlocks == null)
{
adjacentTreeBlocks = new int[byte1 * byte1 * byte1];
}
if(world.checkChunksExist(i - i1, j - i1, k - i1, i + i1, j + i1, k + i1))
{
for(int l1 = -byte0; l1 <= byte0; l1++)
{
for(int k2 = -byte0; k2 <= byte0; k2++)
{
for(int i3 = -byte0; i3 <= byte0; i3++)
{
int k3 = world.getBlockId(i + l1, j + k2, k + i3);
if(k3 == mod_WolfeTree.WolfeWood.blockID)
{
adjacentTreeBlocks[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = 0;
continue;
}
if(k3 == mod_WolfeTree.WolfeLeaves.blockID)
{
adjacentTreeBlocks[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = -2;
} else
{
adjacentTreeBlocks[(l1 + k1) * j1 + (k2 + k1) * byte1 + (i3 + k1)] = -1;
}
}
}
}
for(int i2 = 1; i2 <= 4; i2++)
{
for(int l2 = -byte0; l2 <= byte0; l2++)
{
for(int j3 = -byte0; j3 <= byte0; j3++)
{
for(int l3 = -byte0; l3 <= byte0; l3++)
{
if(adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] != i2 - 1)
{
continue;
}
if(adjacentTreeBlocks[((l2 + k1) - 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] == -2)
{
adjacentTreeBlocks[((l2 + k1) - 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] = i2;
}
if(adjacentTreeBlocks[(l2 + k1 + 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] == -2)
{
adjacentTreeBlocks[(l2 + k1 + 1) * j1 + (j3 + k1) * byte1 + (l3 + k1)] = i2;
}
if(adjacentTreeBlocks[(l2 + k1) * j1 + ((j3 + k1) - 1) * byte1 + (l3 + k1)] == -2)
{
adjacentTreeBlocks[(l2 + k1) * j1 + ((j3 + k1) - 1) * byte1 + (l3 + k1)] = i2;
}
if(adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1 + 1) * byte1 + (l3 + k1)] == -2)
{
adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1 + 1) * byte1 + (l3 + k1)] = i2;
}
if(adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + ((l3 + k1) - 1)] == -2)
{
adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + ((l3 + k1) - 1)] = i2;
}
if(adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1 + 1)] == -2)
{
adjacentTreeBlocks[(l2 + k1) * j1 + (j3 + k1) * byte1 + (l3 + k1 + 1)] = i2;
}
}
}
}
}
}
int j2 = adjacentTreeBlocks[k1 * j1 + k1 * byte1 + k1];
if(j2 >= 0)
{
world.setBlockMetadata(i, j, k, l & -9);
} else
{
removeLeaves(world, i, j, k);
}
}
}
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 setGraphicsLevel(boolean flag)
{
graphicsLevel = flag;
blockIndexInTexture = baseIndexInPNG + (flag ? 0 : 1);
}
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[];
}
I also made it so that you can get Wolfe Leaves from using shears on the leaves and that they decay.