Posted June 8, 201312 yr There's anyways to control what happens to a block when is placed by the player in a custom dimension without, of course, having to change the Block.java file?
June 8, 201312 yr Your own blocks or vannila blocks? If your own blocks detect at the placing part the dimension id and when the id is not the overworldID (0) then you can tell that the block sets to 0 (equals as not there)
June 8, 201312 yr Author Your own blocks or vannila blocks? If your own blocks detect at the placing part the dimension id and when the id is not the overworldID (0) then you can tell that the block sets to 0 (equals as not there) All blocks. If it was with my blocks it would be easy
June 8, 201312 yr I never had think about that^^" Hmmm thats hard. But i got an idea. Why dont you make an block which is in your dimemsion and search for all blocks from top to the bottom after special blockids. like this: public class TileEntityYourBlock extends TileEntity { public void updateEntity() { for(int i = 0; i<=255; i++) { if(!getValidBlockID(i)) { world.setBlockWithNotify(xCoord, i, zCoord, 0); } } } public boolean getValidBlockID(int i) { int blockId = worldObj.getBlockID(xCoord, i, zCoord); if(blockId = Block.planks.blockID) { return true; } return false; } } So what this code does it checks (in a tileEntity) the world from the bottom to the hight. And if there is a not valid BlockID then he set the blockID to 0. That the way i would do it when i have my own dimension^^ i hope that is what you want.
June 8, 201312 yr Author I never had think about that^^" Hmmm thats hard. But i got an idea. Why dont you make an block which is in your dimemsion and search for all blocks from top to the bottom after special blockids. like this: public class TileEntityYourBlock extends TileEntity { public void updateEntity() { for(int i = 0; i<=255; i++) { if(!getValidBlockID(i)) { world.setBlockWithNotify(xCoord, i, zCoord, 0); } } } public boolean getValidBlockID(int i) { int blockId = worldObj.getBlockID(xCoord, i, zCoord); if(blockId = Block.planks.blockID) { return true; } return false; } } So what this code does it checks (in a tileEntity) the world from the bottom to the hight. And if there is a not valid BlockID then he set the blockID to 0. That the way i would do it when i have my own dimension^^ i hope that is what you want. That's sounds like a solution but I don't think that's the best one. But thanks anyway, I'm gonna try that out. Btw,aren't those xCoord and zCoord always the same? That way it would only check the blocks above and below. And do a layer of only the blocks with this tile entity would be kinda stupid
June 8, 201312 yr The aether team did it, I would use the same method used for the end/nether, maybe have the item blown up when it is clicked on, or maybe have it so that when the player tries to place down the block, that the games checks the block ID and if it is a vanilla block, then they can't place it (I think that is what you are saying, right?)
June 8, 201312 yr you could always use a block placed event (if it exists) and if it's the wrong block and the wrong dimension, then you can cancel it.
June 8, 201312 yr Author The aether team did it, I would use the same method used for the end/nether, maybe have the item blown up when it is clicked on, or maybe have it so that when the player tries to place down the block, that the games checks the block ID and if it is a vanilla block, then they can't place it (I think that is what you are saying, right?) To do that I think that I've to change the Block.java
June 8, 201312 yr Author you could always use a block placed event (if it exists) and if it's the wrong block and the wrong dimension, then you can cancel it. there's is one but only for the interaction with a block, I don't think that it works for the placement
June 8, 201312 yr I never had think about that^^" Hmmm thats hard. But i got an idea. Why dont you make an block which is in your dimemsion and search for all blocks from top to the bottom after special blockids. like this: public class TileEntityYourBlock extends TileEntity { public void updateEntity() { for(int i = 0; i<=255; i++) { if(!getValidBlockID(i)) { world.setBlockWithNotify(xCoord, i, zCoord, 0); } } } public boolean getValidBlockID(int i) { int blockId = worldObj.getBlockID(xCoord, i, zCoord); if(blockId = Block.planks.blockID) { return true; } return false; } } So what this code does it checks (in a tileEntity) the world from the bottom to the hight. And if there is a not valid BlockID then he set the blockID to 0. That the way i would do it when i have my own dimension^^ i hope that is what you want. That's sounds like a solution but I don't think that's the best one. But thanks anyway, I'm gonna try that out. Btw,aren't those xCoord and zCoord always the same? That way it would only check the blocks above and below. And do a layer of only the blocks with this tile entity would be kinda stupid Why x and z coord are the same because badrock is the lowest Level and every block on the bottom are badrock^^ With that you can make a check it easy^^. The other ways are good to but what is when a player find a way to jump over the place function?
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.