the problem with this new code it that it never actually tests to see if the neighbors are pipes, we changed the function to run a checkForNeighbors that doesn't check the neighbors
this.model.checkForNeighbors(entity);
the TileEntityPipe class is the one that contains the actual checkForNeighbors
because the server check for neighbors and store it in variables then it sends the sync packet.
then when you render the code will access with this.model.checkForNeighbors(entity); to the client side tileentity that will contain the variables num1-6 and it transfer them to model local variables. then you will use that variables
It's a long process but I think it's the better way to do this.
P.S. the variables can be useful in the future if you want to access it directly from the tile.
you can check for blocks directly from the model but in that way every fps tick it will try to get block in all the directions and can cause a drastic fps reduction. in the way that i'm doing the block update will be executed only when a neighbour block will update (break or place generally)
The variables aren't returning true, I think the problem may be that in the Pipe Class(just the plain block class) where we call the checkForNeighbors it looks like this
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block par5) {
if (!world.isRemote) {
TileEntityPipe tileEntity = (TileEntityPipe) world.getTileEntity(x, y, z);
if (tileEntity != null) {
tileEntity.checkForNeighbors(world, z, z, z);
}
}
}
where it says tileEntity.checkForNeighbors(world, z , z, z); is it suppose to be tileEntity.checkForNeighbors(world, x, y, z);?
--edit-- OMG THAT WAS IT!!!! the block connects to each other!!!
THANKS SO MUCH!!!! I couldn't get nearly this far with out your help!
how would I run the neighbor check when the world is loaded up(when the world is loaded up no pipes are connecting i have to place a block next to each of them)? I fixed it rendering when the block is placed.
for the update when world loads simply copy and paste the onNeighborBlockChange and rename it to onBlockAdded (they take the same arguments and they are void both)
the problem with this new code it that it never actually tests to see if the neighbors are pipes, we changed the function to run a checkForNeighbors that doesn't check the neighbors
the TileEntityPipe class is the one that contains the actual checkForNeighbors
because the server check for neighbors and store it in variables then it sends the sync packet.
then when you render the code will access with this.model.checkForNeighbors(entity); to the client side tileentity that will contain the variables num1-6 and it transfer them to model local variables. then you will use that variables
It's a long process but I think it's the better way to do this.
P.S. the variables can be useful in the future if you want to access it directly from the tile.
you can check for blocks directly from the model but in that way every fps tick it will try to get block in all the directions and can cause a drastic fps reduction. in the way that i'm doing the block update will be executed only when a neighbour block will update (break or place generally)
sorry for my bad english I'm Italian
sounds good to me, but why isn't it rendering properly?
did you check if variables are correct? (if they are true when there is the block)
anyway i'm going to sleep then i can't answer very soon if you reply
sorry for my bad english I'm Italian
Good timing I fell asleep too
The variables aren't returning true, I think the problem may be that in the Pipe Class(just the plain block class) where we call the checkForNeighbors it looks like this
where it says tileEntity.checkForNeighbors(world, z , z, z); is it suppose to be tileEntity.checkForNeighbors(world, x, y, z);?
--edit-- OMG THAT WAS IT!!!! the block connects to each other!!!
THANKS SO MUCH!!!! I couldn't get nearly this far with out your help!
how would I run the neighbor check when the world is loaded up(when the world is loaded up no pipes are connecting i have to place a block next to each of them)? I fixed it rendering when the block is placed.
ops sorry I wrote it manually
for the update when world loads simply copy and paste the onNeighborBlockChange and rename it to onBlockAdded (they take the same arguments and they are void both)
sorry for my bad english I'm Italian