Improve dice, fix models and lang
This commit is contained in:
parent
9ba3a3cf76
commit
fc5097e354
6 changed files with 23 additions and 11 deletions
|
@ -4,6 +4,7 @@ import java.io.*;
|
|||
|
||||
public class Config {
|
||||
private boolean invert_lamps = false;
|
||||
private boolean announce_dice = false;
|
||||
|
||||
public static Config INSTANCE;
|
||||
|
||||
|
@ -14,9 +15,13 @@ public class Config {
|
|||
public boolean shouldInvertLamps() {
|
||||
return invert_lamps;
|
||||
}
|
||||
public boolean shouldAnnounceDice() {
|
||||
return announce_dice;
|
||||
}
|
||||
|
||||
|
||||
private static void generateDefault() {
|
||||
NewSoviet.LOG.info("Generated config file at config/new_soviet.json");
|
||||
File file = new File("config/new_soviet.json");
|
||||
if(!file.getParentFile().exists()) {
|
||||
file.getParentFile().mkdirs();
|
||||
|
|
|
@ -13,6 +13,8 @@ import net.minecraft.world.World;
|
|||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
import su.a71.new_soviet.Config;
|
||||
import su.a71.new_soviet.NewSoviet;
|
||||
import su.a71.new_soviet.registration.NSE_Sounds;
|
||||
|
||||
|
@ -35,7 +37,7 @@ 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)));
|
||||
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());
|
||||
}
|
||||
|
||||
user.increaseStat(Stats.USED.getOrCreateStat(this), itemStack.getCount());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue