Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/09/21 in Posts

  1. I believe you are missing the rotate/mirror functions. I believe that these are called when the structure is generated and is being rotated. I got these from the StairsBlock.java class. public BlockState rotate(BlockState state, Rotation rot) { return state.with(FACING, rot.rotate(state.get(FACING))); } public BlockState mirror(BlockState state, Mirror mirrorIn) { Direction direction = state.get(FACING); StairsShape stairsshape = state.get(SHAPE); switch(mirrorIn) { case LEFT_RIGHT: if (direction.getAxis() == Direction.Axis.Z) { switch(stairsshape) { case INNER_LEFT: return state.rotate(Rotation.CLOCKWISE_180).with(SHAPE, StairsShape.INNER_RIGHT); case INNER_RIGHT: return state.rotate(Rotation.CLOCKWISE_180).with(SHAPE, StairsShape.INNER_LEFT); case OUTER_LEFT: return state.rotate(Rotation.CLOCKWISE_180).with(SHAPE, StairsShape.OUTER_RIGHT); case OUTER_RIGHT: return state.rotate(Rotation.CLOCKWISE_180).with(SHAPE, StairsShape.OUTER_LEFT); default: return state.rotate(Rotation.CLOCKWISE_180); } } break; case FRONT_BACK: if (direction.getAxis() == Direction.Axis.X) { switch(stairsshape) { case INNER_LEFT: return state.rotate(Rotation.CLOCKWISE_180).with(SHAPE, StairsShape.INNER_LEFT); case INNER_RIGHT: return state.rotate(Rotation.CLOCKWISE_180).with(SHAPE, StairsShape.INNER_RIGHT); case OUTER_LEFT: return state.rotate(Rotation.CLOCKWISE_180).with(SHAPE, StairsShape.OUTER_RIGHT); case OUTER_RIGHT: return state.rotate(Rotation.CLOCKWISE_180).with(SHAPE, StairsShape.OUTER_LEFT); case STRAIGHT: return state.rotate(Rotation.CLOCKWISE_180); } } } return super.mirror(state, mirrorIn); } You will obviously need to change up the mirror function with the shapes you have defined instead. I believe that the rotate function would probably work as is. I would recommend looking into the StairsBlock.java class if it is still having issues.
    1 point
  2. You should never create a new instance of a world, the vanilla code handles that for you. In this case, you have access to the world via ItemUseContext.getWorld().
    1 point
  3. Have a look in Minecraft's NetherFossilStructure for placement in the nether, this will give you an idea of how to check for correct positions. I did a similar thing in my mod here for a Nether Well to be generated: https://github.com/Phrille/Vanilla-Boom/blob/master/src/main/java/phrille/vanillaboom/world/structures/NetherWellStructure.java Now keep in mind that my code does not do any placement checks other than the first check to see if I start the gen on a block. For instance no checks are done to check if the is enough air to fit the structure in and so on.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.