Skip to content

Commit

Permalink
Removed SoundProvider.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Azzyypaaras committed Oct 5, 2024
1 parent 5e3a4dc commit 1f611fb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/main/java/de/dafuqs/spectrum/api/item/MergeableItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ default boolean verify(ItemStack parent, ItemStack other) {
return parNbt.getLong("pairSignature") == otherNbt.getLong("pairSignature");
return false;
}
SoundProvider getMergeSound();

void playSound(ServerPlayerEntity player);
}
9 changes: 0 additions & 9 deletions src/main/java/de/dafuqs/spectrum/api/item/SoundProvider.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ default void sign(ServerPlayerEntity player, ItemStack stack) {
stack.getOrCreateNbt().putLong("pairSignature", player.getWorld().getTime() + player.getUuid().getMostSignificantBits());
}

SoundProvider getSplitSound();
void playSound(ServerPlayerEntity player);
}
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ public boolean canSplit(ServerPlayerEntity player, Hand occupiedHand, ItemStack
case OFF_HAND -> player.getStackInHand(Hand.MAIN_HAND).isEmpty();
};
}

@Override
public SoundProvider getSplitSound() {
return (player -> player.playSound(SpectrumSoundEvents.METALLIC_UNSHEATHE, SoundCategory.PLAYERS, 0.5F, 0.8F + player.getRandom().nextFloat() * 0.4F));
public void playSound(ServerPlayerEntity player) {
player.playSound(SpectrumSoundEvents.METALLIC_UNSHEATHE, SoundCategory.PLAYERS, 0.5F, 0.8F + player.getRandom().nextFloat() * 0.4F);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ public TypedActionResult<ItemStack> use(World world, PlayerEntity user, Hand han
return TypedActionResult.fail(user.getStackInHand(hand));
return super.use(world, user, hand);
}

@Override
public SoundProvider getMergeSound() {
return (player -> player.playSound(SpectrumSoundEvents.METALLIC_UNSHEATHE, SoundCategory.PLAYERS, 0.3F, 0.4F + player.getRandom().nextFloat() * 0.2F));
public void playSound(ServerPlayerEntity player) {
player.playSound(SpectrumSoundEvents.METALLIC_UNSHEATHE, SoundCategory.PLAYERS, 0.5F, 0.8F + player.getRandom().nextFloat() * 0.4F);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private void splitItem(ItemStack stack, SplittableItem splittable) {
player.setStackInHand(Hand.MAIN_HAND, split);
player.setStackInHand(Hand.OFF_HAND, split.copy());
player.clearActiveItem();
splittable.getSplitSound().playSound(player);
splittable.playSound(player);
}

@Unique
Expand All @@ -73,6 +73,6 @@ private void mergeItems(ItemStack firstHalf, ItemStack secondHalf, MergeableItem
player.setStackInHand(Hand.OFF_HAND, ItemStack.EMPTY);
player.setStackInHand(Hand.MAIN_HAND, mergeable.getResult(player, firstHalf, secondHalf));
player.clearActiveItem();
mergeable.getMergeSound().playSound(player);
mergeable.playSound(player);
}
}

0 comments on commit 1f611fb

Please sign in to comment.