Skip to content

Commit

Permalink
fixed boat pick mechanic
Browse files Browse the repository at this point in the history
  • Loading branch information
Goby56 committed Aug 18, 2024
1 parent 6ef85dd commit 8b4dbe9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/com/goby56/wakes/event/PickBoat.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ public class PickBoat implements ClientPickBlockGatherCallback {
@Override
public ItemStack pick(PlayerEntity player, HitResult result) {
if (CONFIG_INSTANCE.pickBoat) {
if (player.raycast(5, 0, true) instanceof BlockHitResult fluidHit) {
if (player.raycast(5, 0, false).getType().equals(HitResult.Type.BLOCK)) return ItemStack.EMPTY;
if (player.raycast(5, 0, true) instanceof BlockHitResult fluidHit &&
fluidHit.getType().equals(HitResult.Type.BLOCK)) {
if (player.getWorld().getFluidState(fluidHit.getBlockPos()).isOf(Fluids.WATER)) {
var boatTypes = BoatEntity.Type.values();
for (BoatEntity.Type boatType : boatTypes) {
Expand Down

0 comments on commit 8b4dbe9

Please sign in to comment.