I've got a little problem even it sounds pretty easy ...
The method :
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
gives me the block that changes, but how do I get the direction in which this block is?
I can't find any "getPos" methods in the world / block / blockstate ... if I had the Positon of the block I simply could get the direction.
So do you know a way to get the position of a block in Forge 1.8.8? Or is there another way to get the direction the block is in?
You wanna know why I need this? I'm currently coding a one block / two block wide table ... and I need this to check when ever there is a second table added / removed ...
I don't think you can get the direction that the change came from, you'll just need to check every neighbouring block.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
The problem is that I have to rotate the block model in the direction of the other block (I don't have one big model, I have two half blocks which rotate to each other an visually connect
So if I can't get the direction I'll have to find another way
Actually I have the table working right now (Just using onBlockPlacedBy and breakBlock) but the problem is I need to detect if one of the tables for example get pushed away by a piston etc
If you check whether each neighbouring block on the horizontal plane (north, south, east, west) is another table, you can determine which direction to connect the model to (if any).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Hello Everybody,
I've got a little problem even it sounds pretty easy ...
The method :
public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock)
gives me the block that changes, but how do I get the direction in which this block is?
I can't find any "getPos" methods in the world / block / blockstate ... if I had the Positon of the block I simply could get the direction.
So do you know a way to get the position of a block in Forge 1.8.8? Or is there another way to get the direction the block is in?
You wanna know why I need this? I'm currently coding a one block / two block wide table ... and I need this to check when ever there is a second table added / removed ...
Thanks for your help in advance
Nice Greetings
TechMage66
I don't think you can get the direction that the change came from, you'll just need to check every neighbouring block.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Thanks for your fast answer ...
The problem is that I have to rotate the block model in the direction of the other block (I don't have one big model, I have two half blocks which rotate to each other an visually connect
So if I can't get the direction I'll have to find another way
Actually I have the table working right now (Just using onBlockPlacedBy and breakBlock) but the problem is I need to detect if one of the tables for example get pushed away by a piston etc
Nice Greetings
TechMage66
If you check whether each neighbouring block on the horizontal plane (north, south, east, west) is another table, you can determine which direction to connect the model to (if any).
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
Oh now I get what you mean
Thanks for your help man
Edit: After fixing some errors etc ... I got it finally working without bugs (I hope )
Nice Greetings
TechMage66