
IDuckz_
Members-
Posts
13 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
IDuckz_'s Achievements

Tree Puncher (2/8)
0
Reputation
-
Okay so the explanation was fantastic and I understood how that works. I did set everything up but is there any way that I could make it so it just makes a new cube with the texture inside the cauldron? Or is that not possible?
-
Ooh thanks for the great explanation!
-
Never mind I can't seem to be figure it out. Lol
-
Eh after checking setWaterLevel code multiple times and trying to understand it, I think I understood how it works.
-
I have but I don't really understand since it probably has something to do with levels of the block or whatever.
-
Hey, so I am making a different cauldron type block and I am wondering how can I make it so whenever you right click the block with a water bucket, it will add the water inside the cauldron, so basically just changing the shape. Would be appreciated with ideas or answers.
-
Incredibly sorry for late response, did not work while rotating it to the other way, I guess there is no possible way to do this, thanks for all the help anyways. Greatly appreciated ❤️
-
Okay, I will try rotating it to the other way.
-
I will try changing the block to use less VoxelShapes but for now I want to see how I could fix this issue. If I have already done what I asked for how come is it misaligned? Unless I misunderstood. Ok I will fix that. Thanks
-
Um ok here: package com.iduckz.usefulemeralds.blocks; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.HorizontalBlock; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.item.BlockItemUseContext; import net.minecraft.state.DirectionProperty; import net.minecraft.state.StateContainer; import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.shapes.IBooleanFunction; import net.minecraft.util.math.shapes.ISelectionContext; import net.minecraft.util.math.shapes.VoxelShape; import net.minecraft.util.math.shapes.VoxelShapes; import net.minecraft.world.IBlockReader; import net.minecraftforge.common.ToolType; import javax.annotation.Nullable; import java.util.stream.Stream; public class WitchCauldron extends Block { public WitchCauldron() { super(Block.Properties.create(Material.IRON) .hardnessAndResistance(2.5f, 3.5f) .sound(SoundType.METAL) .harvestLevel(2) .harvestTool(ToolType.PICKAXE) .setRequiresTool()); } private static final DirectionProperty FACING = HorizontalBlock.HORIZONTAL_FACING; public static final VoxelShape SHAPE_N = VoxelShapes.or( Block.makeCuboidShape(14, 6, -2, 15, 7, 7), Block.makeCuboidShape(1, 6, -2, 2, 7, 7), Block.makeCuboidShape(2, 2.6999999999999993D, -1.4600000000000009D, 14, 3.6999999999999993D, -0.46000000000000085D), Block.makeCuboidShape(9, 0, 9, 11, 2, 11), Block.makeCuboidShape(10, 0, 11, 11, 2, 12), Block.makeCuboidShape(11, 0, 10, 12, 2, 11), Block.makeCuboidShape(11, 0, 11, 13, 2, 13), Block.makeCuboidShape(12, 0, 13, 13, 2, 14), Block.makeCuboidShape(13, 0, 12, 14, 2, 13), Block.makeCuboidShape(13, 0, 13, 15, 2, 15), Block.makeCuboidShape(3, 0, 13, 4, 2, 14), Block.makeCuboidShape(1, 0, 13, 3, 2, 15), Block.makeCuboidShape(2, 0, 12, 3, 2, 13), Block.makeCuboidShape(3, 0, 11, 5, 2, 13), Block.makeCuboidShape(4, 0, 10, 5, 2, 11), Block.makeCuboidShape(5, 0, 11, 6, 2, 12), Block.makeCuboidShape(5, 0, 9, 7, 2, 11), Block.makeCuboidShape(3, 0, 2, 4, 2, 3), Block.makeCuboidShape(5, 0, 5, 7, 2, 7), Block.makeCuboidShape(3, 0, 3, 5, 2, 5), Block.makeCuboidShape(1, 0, 1, 3, 2, 3), Block.makeCuboidShape(4, 0, 5, 5, 2, 6), Block.makeCuboidShape(5, 0, 4, 6, 2, 5), Block.makeCuboidShape(2, 0, 3, 3, 2, 4), Block.makeCuboidShape(13, 0, 1, 15, 2, 3), Block.makeCuboidShape(9, 0, 5, 11, 2, 7), Block.makeCuboidShape(11, 0, 3, 13, 2, 5), Block.makeCuboidShape(10, 0, 4, 11, 2, 5), Block.makeCuboidShape(11, 0, 5, 12, 2, 6), Block.makeCuboidShape(12, 0, 2, 13, 2, 3), Block.makeCuboidShape(13, 0, 3, 14, 2, 4), Block.makeCuboidShape(7, 0, 9, 9, 2, 16), Block.makeCuboidShape(0, 0, 7, 16, 2, 9), Block.makeCuboidShape(7, 0, 0, 9, 2, 7), Block.makeCuboidShape(2, 2, 2, 14, 3, 14), Block.makeCuboidShape(3, 3, 2, 13, 13, 3), Block.makeCuboidShape(3, 3, 13, 13, 13, 14), Block.makeCuboidShape(13, 3, 2, 14, 13, 14), Block.makeCuboidShape(2, 3, 2, 3, 13, 14) ); public static final VoxelShape SHAPE_E = VoxelShapes.or( Block.makeCuboidShape(9, 6, 14, 18, 7, 15), Block.makeCuboidShape(9, 6, 1, 18, 7, 2), Block.makeCuboidShape(16.46f, 2.7f, 2, 17.46f, 3.7f, 14), Block.makeCuboidShape(5, 0, 9, 7, 2, 11), Block.makeCuboidShape(4, 0, 10, 5, 2, 11), Block.makeCuboidShape(5, 0, 11, 6, 2, 12), Block.makeCuboidShape(3, 0, 11, 5, 2, 13), Block.makeCuboidShape(2, 0, 12, 3, 2, 13), Block.makeCuboidShape(3, 0, 13, 4, 2, 14), Block.makeCuboidShape(1, 0, 13, 3, 2, 15), Block.makeCuboidShape(2, 0, 3, 3, 2, 4), Block.makeCuboidShape(1, 0, 1, 3, 2, 3), Block.makeCuboidShape(3, 0, 2, 4, 2, 3), Block.makeCuboidShape(3, 0, 3, 5, 2, 5), Block.makeCuboidShape(5, 0, 4, 6, 2, 5), Block.makeCuboidShape(4, 0, 5, 5, 2, 6), Block.makeCuboidShape(5, 0, 5, 7, 2, 7), Block.makeCuboidShape(13, 0, 3, 14, 2, 4), Block.makeCuboidShape(9, 0, 5, 11, 2, 7), Block.makeCuboidShape(11, 0, 3, 13, 2, 5), Block.makeCuboidShape(13, 0, 1, 15, 2, 3), Block.makeCuboidShape(10, 0, 4, 11, 2, 5), Block.makeCuboidShape(11, 0, 5, 12, 2, 6), Block.makeCuboidShape(12, 0, 2, 13, 2, 3), Block.makeCuboidShape(13, 0, 13, 15, 2, 15), Block.makeCuboidShape(9, 0, 9, 11, 2, 11), Block.makeCuboidShape(11, 0, 11, 13, 2, 13), Block.makeCuboidShape(11, 0, 10, 12, 2, 11), Block.makeCuboidShape(10, 0, 11, 11, 2, 12), Block.makeCuboidShape(13, 0, 12, 14, 2, 13), Block.makeCuboidShape(12, 0, 13, 13, 2, 14), Block.makeCuboidShape(0, 0, 7, 7, 2, 9), Block.makeCuboidShape(7, 0, 0, 9, 2, 16), Block.makeCuboidShape(9, 0, 7, 16, 2, 9), Block.makeCuboidShape(2, 2, 2, 14, 3, 14), Block.makeCuboidShape(13, 3, 3, 14, 13, 13), Block.makeCuboidShape(2, 3, 3, 3, 13, 13), Block.makeCuboidShape(2, 3, 13, 14, 13, 14), Block.makeCuboidShape(2, 3, 2, 14, 13, 3) ); public static final VoxelShape SHAPE_S = VoxelShapes.or( Block.makeCuboidShape(1, 6, 9, 2, 7, 18), Block.makeCuboidShape(14, 6, 9, 15, 7, 18), Block.makeCuboidShape(2, 2.6999999999999993D, 16.46f, 14, 3.6999999999999993D, 17.46f), Block.makeCuboidShape(5, 0, 5, 7, 2, 7), Block.makeCuboidShape(5, 0, 4, 6, 2, 5), Block.makeCuboidShape(4, 0, 5, 5, 2, 6), Block.makeCuboidShape(3, 0, 3, 5, 2, 5), Block.makeCuboidShape(3, 0, 2, 4, 2, 3), Block.makeCuboidShape(2, 0, 3, 3, 2, 4), Block.makeCuboidShape(1, 0, 1, 3, 2, 3), Block.makeCuboidShape(12, 0, 2, 13, 2, 3), Block.makeCuboidShape(13, 0, 1, 15, 2, 3), Block.makeCuboidShape(13, 0, 3, 14, 2, 4), Block.makeCuboidShape(11, 0, 3, 13, 2, 5), Block.makeCuboidShape(11, 0, 5, 12, 2, 6), Block.makeCuboidShape(10, 0, 4, 11, 2, 5), Block.makeCuboidShape(9, 0, 5, 11, 2, 7), Block.makeCuboidShape(12, 0, 13, 13, 2, 14), Block.makeCuboidShape(9, 0, 9, 11, 2, 11), Block.makeCuboidShape(11, 0, 11, 13, 2, 13), Block.makeCuboidShape(13, 0, 13, 15, 2, 15), Block.makeCuboidShape(11, 0, 10, 12, 2, 11), Block.makeCuboidShape(10, 0, 11, 11, 2, 12), Block.makeCuboidShape(13, 0, 12, 14, 2, 13), Block.makeCuboidShape(1, 0, 13, 3, 2, 15), Block.makeCuboidShape(5, 0, 9, 7, 2, 11), Block.makeCuboidShape(3, 0, 11, 5, 2, 13), Block.makeCuboidShape(5, 0, 11, 6, 2, 12), Block.makeCuboidShape(4, 0, 10, 5, 2, 11), Block.makeCuboidShape(3, 0, 13, 4, 2, 14), Block.makeCuboidShape(2, 0, 12, 3, 2, 13), Block.makeCuboidShape(7, 0, 0, 9, 2, 7), Block.makeCuboidShape(0, 0, 7, 16, 2, 9), Block.makeCuboidShape(7, 0, 9, 9, 2, 16), Block.makeCuboidShape(2, 2, 2, 14, 3, 14), Block.makeCuboidShape(3, 3, 13, 13, 13, 14), Block.makeCuboidShape(3, 3, 2, 13, 13, 3), Block.makeCuboidShape(2, 3, 2, 3, 13, 14), Block.makeCuboidShape(13, 3, 2, 14, 13, 14) ); public static final VoxelShape SHAPE_W = VoxelShapes.or( Block.makeCuboidShape(-2, 6, 1, 7, 7, 2), Block.makeCuboidShape(-2, 6, 14, 7, 7, 15), Block.makeCuboidShape(-1.4600000000000009D, 2.6999999999999993D, 2, -0.46000000000000085D, 3.6999999999999993D, 14), Block.makeCuboidShape(9, 0, 5, 11, 2, 7), Block.makeCuboidShape(11, 0, 5, 12, 2, 6), Block.makeCuboidShape(10, 0, 4, 11, 2, 5), Block.makeCuboidShape(11, 0, 3, 13, 2, 5), Block.makeCuboidShape(13, 0, 3, 14, 2, 4), Block.makeCuboidShape(12, 0, 2, 13, 2, 3), Block.makeCuboidShape(13, 0, 1, 15, 2, 3), Block.makeCuboidShape(13, 0, 12, 14, 2, 13), Block.makeCuboidShape(13, 0, 13, 15, 2, 15), Block.makeCuboidShape(12, 0, 13, 13, 2, 14), Block.makeCuboidShape(11, 0, 11, 13, 2, 13), Block.makeCuboidShape(10, 0, 11, 11, 2, 12), Block.makeCuboidShape(11, 0, 10, 12, 2, 11), Block.makeCuboidShape(9, 0, 9, 11, 2, 11), Block.makeCuboidShape(2, 0, 12, 3, 2, 13), Block.makeCuboidShape(5, 0, 9, 7, 2, 11), Block.makeCuboidShape(3, 0, 11, 5, 2, 13), Block.makeCuboidShape(1, 0, 13, 3, 2, 15), Block.makeCuboidShape(5, 0, 11, 6, 2, 12), Block.makeCuboidShape(4, 0, 10, 5, 2, 11), Block.makeCuboidShape(3, 0, 13, 4, 2, 14), Block.makeCuboidShape(1, 0, 1, 3, 2, 3), Block.makeCuboidShape(5, 0, 5, 7, 2, 7), Block.makeCuboidShape(3, 0, 3, 5, 2, 5), Block.makeCuboidShape(4, 0, 5, 5, 2, 6), Block.makeCuboidShape(5, 0, 4, 6, 2, 5), Block.makeCuboidShape(2, 0, 3, 3, 2, 4), Block.makeCuboidShape(3, 0, 2, 4, 2, 3), Block.makeCuboidShape(9, 0, 7, 16, 2, 9), Block.makeCuboidShape(7, 0, 0, 9, 2, 16), Block.makeCuboidShape(0, 0, 7, 7, 2, 9), Block.makeCuboidShape(2, 2, 2, 14, 3, 14), Block.makeCuboidShape(2, 3, 3, 3, 13, 13), Block.makeCuboidShape(13, 3, 3, 14, 13, 13), Block.makeCuboidShape(2, 3, 2, 14, 13, 3), Block.makeCuboidShape(2, 3, 13, 14, 13, 14) ); @Nullable @Override public BlockState getStateForPlacement(BlockItemUseContext context) { return this.getDefaultState().with(FACING, context.getPlacementHorizontalFacing().getOpposite()); } @Override public VoxelShape getShape(BlockState state, IBlockReader worldIn, BlockPos pos, ISelectionContext context) { switch(state.get(FACING)) { case NORTH: return SHAPE_N; case SOUTH: return SHAPE_S; case WEST: return SHAPE_W; default: return SHAPE_E; } } @Override public BlockState rotate(BlockState state, Rotation rot) { return state.with(FACING, rot.rotate(state.get(FACING))); } @Override public BlockState mirror(BlockState state, Mirror mirrorIn) { return state.rotate(mirrorIn.toRotation(state.get(FACING))); } @Override protected void fillStateContainer(StateContainer.Builder<Block, BlockState> builder) { builder.add(FACING); } @Override public float getAmbientOcclusionLightValue(BlockState state, IBlockReader worldIn, BlockPos pos) { return 0.3f; } }
-
It seems I have alraedy done that: https://gyazo.com/6062f42293576f15cbf56e95d2656574
-
Okay, I will try using less voxelshapes in the future and I did remove the stream#of and replaced it with VoxelShapes#or I also removed the return and reduce type at the end so the code wasn't necessary provided by BlockBench when I exported it as VoxelShapes, and it is maybe irrelevant but if I want make more custom blocks in the future it might include diagonal shapes too. Also, one question, how would I create a voxelshape for every possible rotation and change it via it's block state? Also thanks for all the help by the way, greatly appreciated.
-
Hello, I setup a custom model like this: https://gyazo.com/51fabdfc1ebaee01e766dc20aea486c2 but in game it doesn't show it correctly. It shows the block bound or voxelshape like this: https://gyazo.com/594430fbe27b6941a81afa85319f73b7 The problem is that it has diagonal shape and it doesn't seem to like diagonal shapes and it decides to break. My voxelshape code (It's a lot of code that I can't show it all since it's too big but I think you get the idea): https://gyazo.com/6e7d09f1b467f404b6fa73b5326eb62c If anyone could help, that would be greatly appreciated. Thank you