Improve registration and do small dependency cleanup
This commit is contained in:
parent
2dcf58e405
commit
ca2c5aa93e
18 changed files with 61 additions and 83 deletions
|
@ -10,11 +10,11 @@ import net.minecraft.text.Text;
|
|||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.TypedActionResult;
|
||||
import net.minecraft.world.World;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import su.a71.new_soviet.NewSoviet;
|
||||
import su.a71.new_soviet.sounds.Sounds;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import java.util.List;
|
||||
import su.a71.new_soviet.NewSoviet;
|
||||
import su.a71.new_soviet.registration.NSE_Sounds;
|
||||
|
||||
public class DiceItem extends Item {
|
||||
private final int sides;
|
||||
|
@ -32,7 +32,7 @@ public class DiceItem extends Item {
|
|||
if (!world.isClient) {
|
||||
StringBuilder output = new StringBuilder();
|
||||
for (var i = 0; i < itemStack.getCount(); i++) {
|
||||
world.playSound((PlayerEntity)null, user.getX(), user.getY(), user.getZ(), Sounds.DICE_SOUND, SoundCategory.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||
world.playSound((PlayerEntity)null, user.getX(), user.getY(), user.getZ(), NSE_Sounds.DICE_SOUND, SoundCategory.NEUTRAL, 0.5F, 0.4F / (world.getRandom().nextFloat() * 0.4F + 0.8F));
|
||||
output.append(NewSoviet.RANDOM.nextBetween(1, this.getSides())).append(", ");
|
||||
}
|
||||
user.sendMessage(Text.translatable(itemStack.getCount() == 1 ? "item.new_soviet.dice.thrown" : "item.new_soviet.dice.thrown_multiple").append(" " + output.subSequence(0, output.length() - 2)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue