Skip to content

Commit

Permalink
combine vigil candle hitboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
PssbleTrngle committed Oct 25, 2024
1 parent 3013247 commit 738ccbb
Showing 1 changed file with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.Shapes;
import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.Nullable;

Expand All @@ -44,21 +43,9 @@ private static VoxelShape shape(double x, double y, double z) {
private static VoxelShape[] createShapes(boolean hanging) {
return new VoxelShape[]{
shape(5, hanging ? 2 : 0, 5),
Shapes.or(
shape(6 + (hanging ? 0 : 1), hanging ? 2 : 0, 1),
shape(3, 0, 9)
),
Shapes.or(
shape(1, 0, 2 + (hanging ? 2 : 0)),
shape(9, hanging ? 2 : 0, 1),
shape(7 + (hanging ? 2 : 0), hanging ? 4 : 0, 9)
),
Shapes.or(
shape(1, hanging ? 4 : 0, 1),
shape(9, 0, 1),
shape(1, 0, 9),
shape(9, hanging ? 2 : 0, 9)
)
Block.box(3, 0, 1, hanging ? 12 : 13, hanging ? 12 : 10, 15),
Block.box(1, 0, 1, 15, hanging ? 14 : 10, 15),
Block.box(1, 0, 1, 15, hanging ? 14 : 10, 15)
};
}

Expand Down Expand Up @@ -94,8 +81,7 @@ public VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos, Co
var candles = state.getValue(CANDLES);
var hanging = state.getValue(HANGING);
var index = candles - 1;
return createShapes(hanging)[index];
//return (handing ? HANGING_SHAPES : SHAPES)[index];
return (hanging ? HANGING_SHAPES : SHAPES)[index];
}

@Override
Expand Down

0 comments on commit 738ccbb

Please sign in to comment.