Jump to content

erik19borgnia

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by erik19borgnia

  1. Thanks No I haven't edited the base classes. And yes, I'm in Eclipse . Minecraft works fine, so it was just curiosity . Probably it's that. Thanks again .
  2. I don't know why I checked this just right now, but I found this: What is that? This is some problem of Minecraft Forge or is my fault? Thanks
  3. It's not. func_94575_c only uses the setBlockAndMetadataWithNotify: [spoiler=func_94575_c]public boolean func_94575_c(int par1, int par2, int par3, int par4) { return this.setBlockAndMetadataWithNotify(par1, par2, par3, par4, 0, 3); } As I said, the setBlockAndMetadataWithNotify: [spoiler=setBlockAndMetadataWithNotify]public boolean setBlockAndMetadataWithNotify(int par1, int par2, int par3, int par4, int par5, int par6) { if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { if (par2 < 0) { return false; } else if (par2 >= 256) { return false; } else { Chunk chunk = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); int k1 = 0; if ((par6 & 1) != 0) { k1 = chunk.getBlockID(par1 & 15, par2, par3 & 15); } boolean flag = chunk.setBlockIDWithMetadata(par1 & 15, par2, par3 & 15, par4, par5); this.theProfiler.startSection("checkLight"); this.updateAllLightTypes(par1, par2, par3); this.theProfiler.endSection(); if (flag) { if ((par6 & 2) != 0 && (!this.isRemote || (par6 & 4) == 0)) { this.markBlockForUpdate(par1, par2, par3); } if (!this.isRemote && (par6 & 1) != 0) { this.notifyBlockChange(par1, par2, par3, k1); Block block = Block.blocksList[par4]; if (block != null && block.func_96468_q_()) { this.func_96440_m(par1, par2, par3, par4); } } } return flag; } } else { return false; } } The red text is the part where the notify is used, with func_94575_c it enters the if. (3 & 1 returns 1) Searching more I found that the function called is: setBlockIDWithMetadata (in green), and in the old "setBlock" use setBlockID. Searching in the Chunk class I've found that... there is no setBlockID method anymore. So setBlock method in the World class doesn't exist. I think that now we can only use the setBlockAndMetadataWithNotify. BUT WELL, we can use that function, the only bad thing is that is weird to use a method named func_94575_c and remember what it do.
  4. MMMM I disagree, that method is different from the "setBlock" in the 1.4.7. [spoiler=func_96440_m from Forge for 1.5]public void func_96440_m(int par1, int par2, int par3, int par4) { for (int i1 = 0; i1 < 4; ++i1) { int j1 = par1 + Direction.offsetX[i1]; int k1 = par3 + Direction.offsetZ[i1]; int l1 = this.getBlockId(j1, par2, k1); if (l1 != 0) { Block block = Block.blocksList[l1]; if (Block.field_94346_cn.func_94487_f(l1)) { block.onNeighborBlockChange(this, j1, par2, k1, par4); } else if (Block.isNormalCube(l1)) { j1 += Direction.offsetX[i1]; k1 += Direction.offsetZ[i1]; l1 = this.getBlockId(j1, par2, k1); block = Block.blocksList[l1]; if (Block.field_94346_cn.func_94487_f(l1)) { block.onNeighborBlockChange(this, j1, par2, k1, par4); } } } } } [spoiler=setBlock from Forge for 1.4.7]public boolean setBlock(int par1, int par2, int par3, int par4) { if (par1 >= -30000000 && par3 >= -30000000 && par1 < 30000000 && par3 < 30000000) { if (par2 < 0) { return false; } else if (par2 >= 256) { return false; } else { Chunk var5 = this.getChunkFromChunkCoords(par1 >> 4, par3 >> 4); boolean var6 = var5.setBlockID(par1 & 15, par2, par3 & 15, par4); this.theProfiler.startSection("checkLight"); this.updateAllLightTypes(par1, par2, par3); this.theProfiler.endSection(); if (var6 && (this.isRemote || var5.deferRender)) { this.markBlockForUpdate(par1, par2, par3); } return var6; } } else { return false; } } EDIT: The only solution I've got is using the setBlockAndMetadataWithNotify. Example: Hope this helps :3
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.