Drachenbauer Posted March 6, 2019 Posted March 6, 2019 Hello i have some blocks, their models are two blocks high. But if i aim at their uper half, their boundingboxes disappear. i also cannot place blocks on top of them. The new block appears behind them. How do i make them fully act as a stack of two blocks (but still placing and destroying them as one single block)? Quote
Cadiboo Posted March 6, 2019 Posted March 6, 2019 The maximum size for a block’s bounding box is 1x1.5x1. You need multiple blocks to achieve this Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted March 6, 2019 Author Posted March 6, 2019 but a door is two blocks kigh and can be placed as one single block. Quote
Draco18s Posted March 6, 2019 Posted March 6, 2019 (edited) 54 minutes ago, Drachenbauer said: but a door is two blocks kigh and can be placed as one single block. The door is two blocks, the top half still exists as a separate block with code that causes the two halves to function as desired. It is entirely possible to use world edit to place only the top, or only the bottom, half. The same goes for the bed, cactus, reeds, and other such blocks. The reason for this has to do with things like pathfinding. Remember how animals used to perpetually try and jump over fences? That was caused by fences breaking the 1x1x1 boundary rule and the AI not having been updated to account for it. Edited March 6, 2019 by Draco18s Quote 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.
Drachenbauer Posted March 6, 2019 Author Posted March 6, 2019 do i have to split my Blockbench-models in two parts? Quote
Cadiboo Posted March 6, 2019 Posted March 6, 2019 Not necessarily. Block models can be up to 3x3x3. Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted March 7, 2019 Author Posted March 7, 2019 (edited) do i need two block-classes, one for the bottom and one for the top? in the door-class i found something named "DoubleBlockHalf" There are many positions in that file, wich use this. But i´m not shure, wich of them i need to reproduce for the most basic usage of this... Edited March 7, 2019 by Drachenbauer Quote
Cadiboo Posted March 7, 2019 Posted March 7, 2019 You just need 2 blocks in the world, how you implement it is completely up to you Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted March 7, 2019 Author Posted March 7, 2019 in the minecraft java libary i cannot find files for upper parts of such stuff... Quote
Cadiboo Posted March 7, 2019 Posted March 7, 2019 The details of the implement are simple. Override all methods that are called when a block is destroyed OR a block near a block is destroyed and handle removing both blocks (be careful not to go into an infinite loop). In your item block place method, place down your second block. Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted March 7, 2019 Author Posted March 7, 2019 but how should the class for the upper block look like? Quote
Cadiboo Posted March 7, 2019 Posted March 7, 2019 That’s up to how you decide to implement it Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted March 7, 2019 Author Posted March 7, 2019 i have no idea how i can implement it Quote
Cadiboo Posted March 8, 2019 Posted March 8, 2019 (edited) 3 hours ago, Cadiboo said: Override all methods that are called when a block is destroyed OR a block near a block is destroyed and handle removing both blocks (be careful not to go into an infinite loop). In your item block place method, place down your second block. That’s how I would do it Edited March 8, 2019 by Cadiboo Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted March 8, 2019 Author Posted March 8, 2019 (edited) I want to have the bottom part renders the 3d model, just like it already does and the top one actually is invisible, just makes another boundingbox with slightly different size-vaules. It´s a balloon, tied to a string. So the bottom part should have a narrow boundingbox and the top a whider one. Edited March 8, 2019 by Drachenbauer Quote
Drachenbauer Posted March 8, 2019 Author Posted March 8, 2019 But i still have no idea, what i must pot in a class for the top part. I find no hinds to such a class in the java-file of the BlockDoublePlant class... Should i create a new class, such like BalloonBlockTop ? Quote
Cadiboo Posted March 8, 2019 Posted March 8, 2019 If that’s how you want to implement it. You could also implement it in 1 Block or in a bottom block. I personally would use a top block. Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted April 16, 2019 Author Posted April 16, 2019 how do i make a block-class only add voxelshapes, but not a model? The upper block only should compleete the voxelshapes for my model, but not place an own model it shoultd be just invisible. Quote
Cadiboo Posted April 16, 2019 Posted April 16, 2019 There are no limitations on the collisions, but for AI pathing to work, you need to have 2 separate blocks. Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted April 17, 2019 Author Posted April 17, 2019 (edited) But this does not tell me how to make an invisible seccond block, that appears on the onBlockPlacedBy method ontop of the block with the model. I exactly mean the way how to make a block, that adds voxelshapes, but no visible model. Edited April 17, 2019 by Drachenbauer Quote
Cadiboo Posted April 18, 2019 Posted April 18, 2019 You can use World#setBlockState to place the 2nd block, and just have your 2nd block have an empty model with the particle texture being the same as your 1st blocks model. Quote About Me Spoiler My Discord - Cadiboo#8887 My Website - Cadiboo.github.io My Mods - Cadiboo.github.io/projects My Tutorials - Cadiboo.github.io/tutorials Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support. When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible. Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)
Drachenbauer Posted July 28, 2019 Author Posted July 28, 2019 How do i check, if there is enough space (one block of air above the choosen position) for the model, bevor placing? And how exactly do i use World#setBlockState (and how do i find the position above the first block)? Quote
abused_master Posted July 28, 2019 Posted July 28, 2019 1 hour ago, Drachenbauer said: How do i check, if there is enough space (one block of air above the choosen position) for the model, bevor placing? And how exactly do i use World#setBlockState (and how do i find the position above the first block)? You could use World#isAirBlock. To get the position above you simply can call .up() on the original blocks position to translate it up by 1. World#setBlockState will take in the state to place and the position to place it at. EX: world.setBlockState(pos, Blocks.STONE_BRICKS.getDefaultState()) If you were setting a state property like direction you could do it here, example with furnace: world.setBlockState(pos, Blocks.FURNACE.getDefaultState().with(FurnaceBlock.FACING, Direction.NORTH)) Quote
Drachenbauer Posted July 29, 2019 Author Posted July 29, 2019 Now i have this: @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) { worldIn.setBlockState(pos.up(), AngryBirdsBlocks.balloon_block_top.getDefaultState()); super.onBlockPlacedBy(worldIn, pos, state, placer, stack); } @Override public void onBlockHarvested(World worldIn, BlockPos pos, BlockState state, PlayerEntity player) { worldIn.setBlockState(pos.up(), Blocks.AIR.getDefaultState()); super.onBlockHarvested(worldIn, pos, state, player); } But i ned a third method, one, that is called bevore i cam place the bottom half and if i try to place it ina just one block tall gap (where the player is unable to enter), it should not be placed (like try to place a bed, where it has not enough room). Quote
Recommended Posts
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.