Jump to content

there is some method like world.getBlockId(x,y,z) in 1.7.10??? (SOLVED)


Recommended Posts

Posted

Goods days

 

bad english advertisment

 

im doing a mod and ineed to know what block is in certain point in the space  (x,y,z)

 

soo example i need to know if the block a just put is two spaces over a block of wood,

 

google tell mi about this method world.getBlockId()  but i dont find it in eclipse 1.7.10.

 

soo this method is wrong, has a change name is ths version o r was replaced by something else

 

there is a pice of mi code

 

###################################################

 

 

public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_){

System.out.println("se ejecuto onBlockActivated");

 

        int x1=x;

        int y1=y-2;

        int z1=z;

 

int blockID = world.getBlockId(x1,y1,z1);                //.getBlockId(x, y, z);

       

        /*    //piece of the code from google

        if(blockID != 0) //air has no block representation

{

    Block.blocksList[blockID].translateBlockName();

}//84 80 269

*/

 

return true;

}   

 

is this deprecated or is just malformed ??

 

Posted

its something.

iwass figthing whit miself and then i find the answer

 

 

the answer is converthe block to string

 

 

System.out.println("onNeighborBlockChange");

int x=84, y=80, z=269;

   

if (world.getBlock(x, y, z) == Blocks.water ){

System.out.println("es agua lo que hay en el blocke");

}else{

System.out.println("no se que sera este blocke");

}

             

                String sb= world.getBlock(x, y, z).toString();

System.out.println("String sb= "+sb);

 

 

 

 

]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:52]: onNeighborBlockChange

[12:55:58] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:59]: es agua lo que hay en el blocke

[12:55:58] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:64]: String SB= net.minecraft.block.BlockStaticLiquid@6e4a6525

 

 

[12:56:35] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:52]: onNeighborBlockChange

[12:56:35] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:61]: no se que sera este blocke

[12:56:35] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:64]: String SB= mercenary00.mercenarymod.blocks.mercenaryBlock@161020ce

 

 

[12:56:59] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:52]: onNeighborBlockChange

[12:56:59] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:61]: no se que sera este blocke

[12:56:59] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:64]: String SB= net.minecraft.block.BlockStainedGlass@26ddc9d4

[12:56:59] [server thread/INFO] [sTDOUT]: [mercenary00.mercenarymod.blocks.mercenaryBlock:onNeighborBlockChange:52]: onNeighborBlockChange

 

 

i have a question more about of method but thats another treath

very gratefull

 

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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