
NoobminecraftModder
Members-
Posts
22 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
NoobminecraftModder's Achievements

Tree Puncher (2/8)
0
Reputation
-
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Ok thanks..I will look at the tutorial. I just wonderig that the same code that works with normal trap door didn't works.. -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
No you're not mean...you're honest So my block is a custom trap door. I looked in to the trap door class and the renderType is "0". So I looked in to the RenderBlock class and copied the method for rendering type 0. My class now looks so: package Cerebrum.Basis; import net.minecraft.block.Block; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; public class HiddenTrapDoorRender extends Render implements ISimpleBlockRenderingHandler{ @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) { } @Override public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { int l = block.colorMultiplier(world, x, y, z); float f = (float)(l >> 16 & 255) / 255.0F; float f1 = (float)(l >> 8 & 255) / 255.0F; float f2 = (float)(l & 255) / 255.0F; if (EntityRenderer.anaglyphEnable) { float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F; float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F; float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F; f = f3; f1 = f4; f2 = f5; } return false; } @Override public boolean shouldRender3DInInventory() { return false; } @Override public int getRenderId() { return 400; } @Override public void doRender(Entity entity, double d0, double d1, double d2, float f, float f1) { } } But it don't seems to work...the trap door is invisible. And with the tutorial http://www.minecraftforge.net/wiki/ISimpleBlockRenderingHandler the block render not correctly. So I thought I can copy from the RenderBlock renderType "0". -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Er...the content of the class? Empty The ISimpleBlockRenderingHandler tutorial I haven't looked at it...I will do it now. -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
I've created the ISimpleBlockRenderingHandler class... But when I run the game the block was rendered invisible. -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Sorry can someone help me to create the custom Render Class... Yes I tried it my self and I asked google. But at the moment I can't get the solution... -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Can I copy the renderer from RenderBlock or something? I can't find the tutorial that I've found yesterday -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Yes I get the texture... My problem is to set the texture different to all instances of the block.... -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Ok thanks... But I don't know exactly what I have to do... Can you help me again? I have to create a own render for the Block? And then? Isn't there an other solution? -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
I have an other idea... I set the texture with a variable and the variable is stored in a TileEntity. But i have a TileEntity: package Cerebrum.Basis; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.INetworkManager; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.Packet132TileEntityData; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class TileEntityHiddenTrapDoor extends TileEntity{ public int texture = 1; @Override public void writeToNBT(NBTTagCompound par1) { super.writeToNBT(par1); } @Override public void readFromNBT(NBTTagCompound par1) { super.readFromNBT(par1); } } @Override public TileEntity createTileEntity(World world, int metadata) { System.out.println("TileEntity registriert"); return new TileEntityHiddenTrapDoor(); } And I want to create the TileEntity with this Code in my Block file. But if I print out SSystem.out.println(this.hasTileEntity()); it's always false... And yes I have connected the tileEntity in de MainClass File. GameRegistry.registerTileEntity(TileEntityHiddenTrapDoor.class, "TileEntityHiddenTrapDoor"); -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Sorry but I don't get it.... So I have to create a spiecial render class...? How can I do that? -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Sorry I don't know exactly what you mean with TESR and ISBRH... I googled it but I no result... -
setBlock Neighbour Texture
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Thanks... I write that this.blockIcon = Block.blocksList[i1].getBlockTextureFromSide(1); in the onNeighbourBlockChange. But than the texture change for all instances of my block... -
Hello everyone I want a block, that assumes the texture from the neighbour block... I think I can do it in the Method public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) . But how can I get the block? I only know world.getBlockId(x, y, z) and world.getBlockMetadata(x, y, z) but with that I cant get the texture from the block. I know that I can get the block texture by planks.getBlockTextureFromSide(1); . But for that I must get first a instance of the neighbour block! How can I do that. If something isn't clear ask me.. Thanks in advance for every kind of help
-
Generate Trees with Items
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
Oh...sorry you understood my question false.... I don't want to spawn trees with an Item... I want to spawn trees that have an item at the trieb... Like the jungle trees with cocoa beans... Sorry for that... Can you help me with that? That would be nice -
Generate Trees with Items
NoobminecraftModder replied to NoobminecraftModder's topic in Modder Support
hmm... I think I've found the solution. public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5) { int l = par2Random.nextInt(3) + this.minTreeHeight; boolean flag = true; if (par4 >= 1 && par4 + l + 1 <= 256) { int i1; byte b0; int j1; int k1; for (i1 = par4; i1 <= par4 + 1 + l; ++i1) { b0 = 1; if (i1 == par4) { b0 = 0; } if (i1 >= par4 + 1 + l - 2) { b0 = 2; } for (int l1 = par3 - b0; l1 <= par3 + b0 && flag; ++l1) { for (j1 = par5 - b0; j1 <= par5 + b0 && flag; ++j1) { if (i1 >= 0 && i1 < 256) { k1 = par1World.getBlockId(l1, i1, j1); Block block = Block.blocksList[k1]; if (k1 != 0 && !block.isLeaves(par1World, l1, i1, j1) && k1 != Block.grass.blockID && k1 != Block.dirt.blockID && !block.isWood(par1World, l1, i1, j1)) { flag = false; } } else { flag = false; } } } } if (!flag) { return false; } else { i1 = par1World.getBlockId(par3, par4 - 1, par5); Block soil = Block.blocksList[i1]; boolean isSoil = (soil != null && soil.canSustainPlant(par1World, par3, par4 - 1, par5, ForgeDirection.UP, (BlockSapling)Block.sapling)); if (isSoil && par4 < 256 - l - 1) { soil.onPlantGrow(par1World, par3, par4 - 1, par5, par3, par4, par5); b0 = 3; byte b1 = 0; int i2; int j2; int k2; for (j1 = par4 - b0 + l; j1 <= par4 + l; ++j1) { k1 = j1 - (par4 + l); i2 = b1 + 1 - k1 / 2; for (j2 = par3 - i2; j2 <= par3 + i2; ++j2) { k2 = j2 - par3; for (int l2 = par5 - i2; l2 <= par5 + i2; ++l2) { int i3 = l2 - par5; if (Math.abs(k2) != i2 || Math.abs(i3) != i2 || par2Random.nextInt(2) != 0 && k1 != 0) { int j3 = par1World.getBlockId(j2, j1, l2); Block block = Block.blocksList[j3]; if (block == null || block.canBeReplacedByLeaves(par1World, j2, j1, l2)) { this.setBlockAndMetadata(par1World, j2, j1, l2, copper.rubberTreeLeaf.blockID, this.metaLeaves); } } } } } for (j1 = 0; j1 < l; ++j1) { k1 = par1World.getBlockId(par3, par4 + j1, par5); Block block = Block.blocksList[k1]; if (k1 == 0 || block == null || block.isLeaves(par1World, par3, par4 + j1, par5)) { this.setBlockAndMetadata(par1World, par3, par4 + j1, par5, copper.rubberTreeLog.blockID, this.metaWood); if (this.vinesGrow && j1 > 0) { if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 - 1, par4 + j1, par5)) { this.setBlockAndMetadata(par1World, par3 - 1, par4 + j1, par5, Block.vine.blockID, ; } if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3 + 1, par4 + j1, par5)) { this.setBlockAndMetadata(par1World, par3 + 1, par4 + j1, par5, Block.vine.blockID, 2); } if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + j1, par5 - 1)) { this.setBlockAndMetadata(par1World, par3, par4 + j1, par5 - 1, Block.vine.blockID, 1); } if (par2Random.nextInt(3) > 0 && par1World.isAirBlock(par3, par4 + j1, par5 + 1)) { this.setBlockAndMetadata(par1World, par3, par4 + j1, par5 + 1, Block.vine.blockID, 4); } } } } if (this.vinesGrow) { for (j1 = par4 - 3 + l; j1 <= par4 + l; ++j1) { k1 = j1 - (par4 + l); i2 = 2 - k1 / 2; for (j2 = par3 - i2; j2 <= par3 + i2; ++j2) { for (k2 = par5 - i2; k2 <= par5 + i2; ++k2) { Block block = Block.blocksList[par1World.getBlockId(j2, j1, k2)]; if (block != null && block.isLeaves(par1World, j2, j1, k2)) { if (par2Random.nextInt(4) == 0 && par1World.getBlockId(j2 - 1, j1, k2) == 0) { this.growVines(par1World, j2 - 1, j1, k2, ; } if (par2Random.nextInt(4) == 0 && par1World.getBlockId(j2 + 1, j1, k2) == 0) { this.growVines(par1World, j2 + 1, j1, k2, 2); } if (par2Random.nextInt(4) == 0 && par1World.getBlockId(j2, j1, k2 - 1) == 0) { this.growVines(par1World, j2, j1, k2 - 1, 1); } if (par2Random.nextInt(4) == 0 && par1World.getBlockId(j2, j1, k2 + 1) == 0) { this.growVines(par1World, j2, j1, k2 + 1, 4); } } } } } if (par2Random.nextInt(5) == 0 && l > 5) { for (j1 = 0; j1 < 2; ++j1) { for (k1 = 0; k1 < 4; ++k1) { if (par2Random.nextInt(4 - j1) == 0) { i2 = par2Random.nextInt(3); this.setBlockAndMetadata(par1World, par3 + Direction.offsetX[Direction.rotateOpposite[k1]], par4 + l - 5 + j1, par5 + Direction.offsetZ[Direction.rotateOpposite[k1]], Block.cocoaPlant.blockID, i2 << 2 | k1); } } } } } return true; } else { return false; } } } else { return false; } }