Skip to content

Commit

Permalink
Fix chute testmod
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Dec 6, 2023
1 parent 06cf7f8 commit eae5d23
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private static boolean moveWithSound(Storage<FluidVariant> from, Storage<FluidVa
if (!fill && handItem == Items.POTION) sound = SoundEvents.ITEM_BOTTLE_EMPTY;
}

player.getWorld().playSound(null, player.getX(), player.getEyeY(), player.getZ(), sound, SoundCategory.PLAYERS, 1, 1);
player.getWorld().playSound(player, player.getX(), player.getEyeY(), player.getZ(), sound, SoundCategory.PLAYERS, 1, 1);

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos po

@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
if (!world.isClient() && world.getBlockEntity(pos) instanceof FluidChuteBlockEntity chute) {
if (world.getBlockEntity(pos) instanceof FluidChuteBlockEntity chute) {
if (!FluidStorageUtil.interactWithFluidStorage(chute.storage, player, hand)) {
player.sendMessage(
Text.literal("Fluid: ")
.append(FluidVariantAttributes.getName(chute.storage.variant))
.append(", amount: " + chute.storage.amount),
false
);
if (!world.isClient()) {
player.sendMessage(
Text.literal("Fluid: ")
.append(FluidVariantAttributes.getName(chute.storage.variant))
.append(", amount: " + chute.storage.amount),
false
);
}

return ActionResult.CONSUME;
}
}

Expand Down

0 comments on commit eae5d23

Please sign in to comment.