Posted July 8, 20169 yr I'm developing my Apocalypse mod, as many people know, and I'm having issus with setting up a bounding box around one of our map objects: I've created a rediculous 8x8 bound box on the block class file: BlockBuilding_Shop1.class: public class BlockBuilding_Shop1 extends BlockContainer { public BlockBuilding_Shop1() { super(Material.wood); this.setBlockBounds(0.0F, 0.0F, 0.0F, 8.0F, 6.0F, 8.0F); } public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entityliving, ItemStack itemstack){ int rotation = MathHelper.floor_double((double)(entityliving.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; if (rotation == 0) { world.setBlockMetadataWithNotify(x, y, z, 2, 2); } if (rotation == 1) { world.setBlockMetadataWithNotify(x, y, z, 5, 2); } if (rotation == 2) { world.setBlockMetadataWithNotify(x, y, z, 3, 2); } if (rotation == 3) { world.setBlockMetadataWithNotify(x, y, z, 4, 2); } } public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z){ int meta = world.getBlockMetadata(x, y, z); if(meta==2) this.setBlockBounds(0.0F, 0.0F, 0.0F, 8.0F, 6.0F, 8.0F); if(meta==5) this.setBlockBounds(0.0F, 0.0F, 0.0F, 8.0F, 6.0F, 8.0F); if(meta==3) this.setBlockBounds(0.0F, 0.0F, 0.0F, 8.0F, 6.0F, 8.0F); if(meta==4) this.setBlockBounds(0.0F, 0.0F, 0.0F, 8.0F, 6.0F, 8.0F); } @Override public TileEntity createNewTileEntity(World world, int var1) { return new EntityBuilding_Shop1(); } @Override public int getRenderType() { return -1; } @Override public boolean isOpaqueCube() { return false; } public boolean renderAsNormalBlock() { return false; } } Anyone know why players can still enter through the sides/walls of the building apart from one 1x1 block area? Thanks, Forge Community! http://i.imgur.com/vmqyxTE.png[/img]
July 8, 20169 yr Author Ah, I see. :-) Thanks, I'll see about setting up multiple boundingboxes http://i.imgur.com/vmqyxTE.png[/img]
July 8, 20169 yr You can sorta cheat with bounding boxes, but only in the +Y direction (see: fences), but in general you can't get larger than 1x1x1 Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
July 8, 20169 yr Author That's one thing I noticed, being able to increase the Y axis. Wish it'd work for X/Z axis, but oh well. http://i.imgur.com/vmqyxTE.png[/img]
July 8, 20169 yr It doesn't work because how would the AI know that that block (which is set to air) is covered by the bounding box from that block waaaay over there? Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
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.