Fix dice and minor refactoring
This commit is contained in:
parent
83a976ae8b
commit
5db68cbf85
27 changed files with 167 additions and 23 deletions
|
@ -37,7 +37,13 @@ public class DiceItem extends Item {
|
|||
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)), !Config.INSTANCE.shouldAnnounceDice());
|
||||
if (Config.INSTANCE.shouldAnnounceDice()) {
|
||||
world.getPlayers().forEach(player -> {
|
||||
player.sendMessage(Text.translatable(itemStack.getCount() == 1 ? "item.new_soviet.dice.thrown_announce" : "item.new_soviet.dice.thrown_multiple_announce", user.getDisplayName()).append(" " + output.subSequence(0, output.length() - 2)), false);
|
||||
});
|
||||
} else {
|
||||
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)), true);
|
||||
}
|
||||
}
|
||||
|
||||
user.increaseStat(Stats.USED.getOrCreateStat(this), itemStack.getCount());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue