add basic config
This commit is contained in:
68
src/main/java/net/lizistired/cavedust/CaveDust.java
Normal file
68
src/main/java/net/lizistired/cavedust/CaveDust.java
Normal file
@@ -0,0 +1,68 @@
|
||||
package net.lizistired.cavedust;
|
||||
|
||||
//minecraft imports
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.world.World;
|
||||
//other imports
|
||||
import com.minelittlepony.common.util.GamePaths;
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
//java imports
|
||||
import java.nio.file.Path;
|
||||
//static imports
|
||||
import static net.lizistired.cavedust.utils.MathHelper.*;
|
||||
|
||||
|
||||
public class CaveDust implements ClientModInitializer {
|
||||
//logger
|
||||
public static final Logger LOGGER = LoggerFactory.getLogger("caveDust");
|
||||
//make class static
|
||||
private static CaveDust instance;
|
||||
public static CaveDust getInstance() {
|
||||
return instance;
|
||||
}
|
||||
public CaveDust() {
|
||||
instance = this;
|
||||
}
|
||||
//config assignment
|
||||
private static CaveDustConfig config;
|
||||
public CaveDustConfig getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
//config path and loading
|
||||
Path CaveDustFolder = GamePaths.getConfigDirectory().resolve("cavedust");
|
||||
config = new CaveDustConfig(CaveDustFolder.getParent().resolve("cavedust.json"), this);
|
||||
config.load();
|
||||
//register end client tick to create cave dust function, using end client tick for async
|
||||
ClientTickEvents.END_CLIENT_TICK.register(this::createCaveDust);
|
||||
}
|
||||
|
||||
private void createCaveDust(MinecraftClient client) {
|
||||
|
||||
if (client.world == null) return;
|
||||
World world = client.world;
|
||||
|
||||
if (shouldParticlesSpawn(client, config)) {
|
||||
double probabilityNormalized = normalize(config.getLowerLimit(), config.getUpperLimit(), client.player.getBlockY());
|
||||
|
||||
for (int i = 0; i < probabilityNormalized * config.getParticleMultiplier(); i++) {
|
||||
try {
|
||||
double x = client.player.getPos().getX() + generateRandomDouble(config.getDimensionsMinX(), config.getDimensionsMaxX());
|
||||
double y = client.player.getPos().getY() + generateRandomDouble(config.getDimensionsMinX(), config.getDimensionsMaxY());
|
||||
double z = client.player.getPos().getZ() + generateRandomDouble(config.getDimensionsMinX(), config.getDimensionsMaxZ());
|
||||
|
||||
world.addParticle(config.getParticle(), x, y, z, 0, 0, 0);}
|
||||
|
||||
catch (NullPointerException e) {
|
||||
LOGGER.error(String.valueOf(e));
|
||||
getConfig().setParticle("minecraft:white_ash");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
205
src/main/java/net/lizistired/cavedust/CaveDustConfig.java
Normal file
205
src/main/java/net/lizistired/cavedust/CaveDustConfig.java
Normal file
@@ -0,0 +1,205 @@
|
||||
package net.lizistired.cavedust;
|
||||
|
||||
import net.lizistired.cavedust.utils.JsonFile;
|
||||
import net.minecraft.particle.ParticleEffect;
|
||||
import net.minecraft.particle.ParticleTypes;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import static net.lizistired.cavedust.CaveDust.*;
|
||||
|
||||
import java.nio.file.Path;
|
||||
|
||||
public class CaveDustConfig extends JsonFile {
|
||||
private transient final CaveDust CaveDust;
|
||||
|
||||
|
||||
private int dimensionMaxX = 5;
|
||||
private int dimensionMaxY = 5;
|
||||
private int dimensionMaxZ = 5;
|
||||
private int dimensionMinX = -5;
|
||||
private int dimensionMinY = -5;
|
||||
private int dimensionMinZ = -5;
|
||||
|
||||
private boolean caveDustEnabled = true;
|
||||
private String particleName = "white_ash";
|
||||
private boolean seaLevelCheck = true;
|
||||
private float upperLimit = 64;
|
||||
private float lowerLimit = -64;
|
||||
private float particleMultiplier = 1;
|
||||
|
||||
public CaveDustConfig(Path file, CaveDust caveDust) {
|
||||
super(file);
|
||||
this.CaveDust = caveDust;
|
||||
}
|
||||
|
||||
public float setDimensionsMinX(float size){
|
||||
if (this.dimensionMinX != size) {
|
||||
this.dimensionMinX = (int)size;
|
||||
save();
|
||||
}
|
||||
return getDimensionsMinX();
|
||||
}
|
||||
|
||||
public float setDimensionsMinY(float size){
|
||||
if (this.dimensionMinY != size) {
|
||||
this.dimensionMinY = (int)size;
|
||||
save();
|
||||
}
|
||||
return getDimensionsMinY();
|
||||
}
|
||||
|
||||
public float setDimensionsMinZ(float size){
|
||||
if (this.dimensionMinZ != size) {
|
||||
this.dimensionMinZ = (int)size;
|
||||
save();
|
||||
}
|
||||
return getDimensionsMinZ();
|
||||
}
|
||||
|
||||
public float getDimensionsMinX(){
|
||||
return dimensionMinX;
|
||||
}
|
||||
|
||||
public float getDimensionsMinY(){
|
||||
return dimensionMinY;
|
||||
}
|
||||
|
||||
public float getDimensionsMinZ(){
|
||||
return dimensionMinZ;
|
||||
}
|
||||
|
||||
public float setDimensionsMaxX(float size){
|
||||
if (this.dimensionMaxX != size) {
|
||||
this.dimensionMaxX = (int)size;
|
||||
save();
|
||||
}
|
||||
return getDimensionsMaxX();
|
||||
}
|
||||
|
||||
public float setDimensionsMaxY(float size){
|
||||
if (this.dimensionMaxY != size) {
|
||||
this.dimensionMaxY = (int)size;
|
||||
save();
|
||||
}
|
||||
return getDimensionsMaxY();
|
||||
}
|
||||
|
||||
public float setDimensionsMaxZ(float size){
|
||||
if (this.dimensionMaxZ != size) {
|
||||
this.dimensionMaxZ = (int)size;
|
||||
save();
|
||||
}
|
||||
return getDimensionsMaxZ();
|
||||
}
|
||||
|
||||
public float getDimensionsMaxX(){
|
||||
return dimensionMaxX;
|
||||
}
|
||||
|
||||
public float getDimensionsMaxY(){
|
||||
return dimensionMaxY;
|
||||
}
|
||||
|
||||
public float getDimensionsMaxZ(){
|
||||
return dimensionMaxZ;
|
||||
}
|
||||
|
||||
public float setUpperLimit(float upperLimit){
|
||||
if (this.upperLimit - 1 < getLowerLimit())
|
||||
{
|
||||
return getUpperLimit();
|
||||
}
|
||||
if (this.upperLimit != upperLimit) {
|
||||
this.upperLimit = (int)upperLimit;
|
||||
save();
|
||||
}
|
||||
return getUpperLimit();
|
||||
}
|
||||
|
||||
public float getUpperLimit(){
|
||||
return upperLimit;
|
||||
}
|
||||
|
||||
public float setLowerLimit(float lowerLimit){
|
||||
if (this.lowerLimit + 1 > getUpperLimit())
|
||||
{
|
||||
return getLowerLimit();
|
||||
}
|
||||
if (this.lowerLimit != lowerLimit) {
|
||||
this.lowerLimit = (int)lowerLimit;
|
||||
save();
|
||||
}
|
||||
return getLowerLimit();
|
||||
}
|
||||
|
||||
public float getLowerLimit(){
|
||||
return lowerLimit;
|
||||
}
|
||||
|
||||
public float getParticleMultiplier(){
|
||||
return particleMultiplier;
|
||||
}
|
||||
|
||||
public float setParticleMultiplier(float particleMultiplier){
|
||||
this.particleMultiplier = particleMultiplier;
|
||||
save();
|
||||
return getParticleMultiplier();
|
||||
}
|
||||
|
||||
public boolean toggleCaveDust(){
|
||||
caveDustEnabled = !caveDustEnabled;
|
||||
save();
|
||||
return caveDustEnabled;
|
||||
}
|
||||
|
||||
public boolean getCaveDustEnabled(){
|
||||
return caveDustEnabled;
|
||||
}
|
||||
|
||||
public ParticleEffect setParticle(String particleType){
|
||||
particleName = particleType;
|
||||
save();
|
||||
return getParticle();
|
||||
}
|
||||
|
||||
public ParticleEffect getParticle(){
|
||||
try {
|
||||
return (ParticleEffect) Registry.PARTICLE_TYPE.get(Identifier.tryParse(particleName.toLowerCase()));
|
||||
} catch (ClassCastException e) {
|
||||
LOGGER.error(e + "\nThere was an error loading the specified particle from the config, make sure a valid particle name is specified. Falling back to \"minecraft:white_ash\".");
|
||||
particleName = "minecraft:white_ash";
|
||||
save();
|
||||
return ParticleTypes.WHITE_ASH;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getSeaLevelCheck() {
|
||||
return seaLevelCheck;
|
||||
}
|
||||
|
||||
public boolean setSeaLevelCheck() {
|
||||
seaLevelCheck = !seaLevelCheck;
|
||||
save();
|
||||
return getSeaLevelCheck();
|
||||
}
|
||||
|
||||
public void resetConfig(){
|
||||
dimensionMinX = -5;
|
||||
dimensionMinY = -5;
|
||||
dimensionMinZ = -5;
|
||||
|
||||
dimensionMaxX = 5;
|
||||
dimensionMaxY = 5;
|
||||
dimensionMaxZ = 5;
|
||||
|
||||
upperLimit = 64;
|
||||
lowerLimit = -64;
|
||||
|
||||
particleMultiplier = 1;
|
||||
|
||||
seaLevelCheck = true;
|
||||
caveDustEnabled = true;
|
||||
particleName = "minecraft:white_ash";
|
||||
save();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package net.lizistired.cavedust;
|
||||
|
||||
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
|
||||
import com.terraformersmc.modmenu.api.ModMenuApi;
|
||||
|
||||
public class CaveDustModMenuFactory implements ModMenuApi {
|
||||
@Override
|
||||
public ConfigScreenFactory<?> getModConfigScreenFactory() {
|
||||
return net.lizistired.cavedust.ModMenuScreen::new;
|
||||
}
|
||||
}
|
||||
97
src/main/java/net/lizistired/cavedust/ModMenuScreen.java
Normal file
97
src/main/java/net/lizistired/cavedust/ModMenuScreen.java
Normal file
@@ -0,0 +1,97 @@
|
||||
package net.lizistired.cavedust;
|
||||
|
||||
import com.minelittlepony.common.client.gui.GameGui;
|
||||
import com.minelittlepony.common.client.gui.element.*;
|
||||
import net.lizistired.cavedust.utils.TranslatableTextHelper;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ModMenuScreen extends GameGui {
|
||||
public ModMenuScreen(@Nullable Screen parent) {
|
||||
super(new TranslatableText("menu.cavedust.title"), parent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
int left = width / 2 - 100;
|
||||
int row = height / 4 + 14;
|
||||
|
||||
CaveDustConfig config = CaveDust.getInstance().getConfig();
|
||||
TranslatableTextHelper transText = new TranslatableTextHelper();
|
||||
config.load();
|
||||
|
||||
addButton(new Label(width / 2, 30)).setCentered().getStyle()
|
||||
.setText(getTitle());
|
||||
|
||||
addButton(new Button(left, row += -60).onClick(sender -> {
|
||||
sender.getStyle().setText("menu.cavedust.global." + config.toggleCaveDust()).setTooltip(new TranslatableText("menu.cavedust.global.tooltip." + config.getCaveDustEnabled()));
|
||||
})).getStyle()
|
||||
.setText("menu.cavedust.global." + config.getCaveDustEnabled())
|
||||
.setTooltip(new TranslatableText("menu.cavedust.global.tooltip." + config.getCaveDustEnabled()));
|
||||
|
||||
addButton(new Slider(left += -110, row += 24, -50, 0, config.getDimensionsMinX()))
|
||||
.onChange(config::setDimensionsMinX)
|
||||
.setTextFormat(transText::formatMinX)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.minX.tooltip"));
|
||||
|
||||
addButton(new Slider(left, row += 24, -50, 0, config.getDimensionsMinY()))
|
||||
.onChange(config::setDimensionsMinY)
|
||||
.setTextFormat(transText::formatMinY)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.minY.tooltip"));
|
||||
|
||||
addButton(new Slider(left, row += 24, -50, 0, config.getDimensionsMinZ()))
|
||||
.onChange(config::setDimensionsMinZ)
|
||||
.setTextFormat(transText::formatMinZ)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.minZ.tooltip"));
|
||||
|
||||
addButton(new Slider(left += 220, row += -48, 0, 50, config.getDimensionsMaxX()))
|
||||
.onChange(config::setDimensionsMaxX)
|
||||
.setTextFormat(transText::formatMaxX)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.maxX.tooltip"));
|
||||
|
||||
addButton(new Slider(left, row += 24, 0, 50, config.getDimensionsMaxY()))
|
||||
.onChange(config::setDimensionsMaxY)
|
||||
.setTextFormat(transText::formatMaxY)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.maxY.tooltip"));
|
||||
|
||||
addButton(new Slider(left, row += 24, 0, 50, config.getDimensionsMaxZ()))
|
||||
.onChange(config::setDimensionsMaxZ)
|
||||
.setTextFormat(transText::formatMaxZ)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.maxZ.tooltip"));
|
||||
|
||||
addButton(new Slider(left += -110, row += 24, -64, 319, config.getUpperLimit()))
|
||||
.onChange(config::setUpperLimit)
|
||||
.setTextFormat(transText::formatUpperLimit)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.upperlimit.tooltip"));
|
||||
|
||||
addButton(new Slider(left, row += 24, -64, 319, config.getLowerLimit()))
|
||||
.onChange(config::setLowerLimit)
|
||||
.setTextFormat(transText::formatLowerLimit)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.lowerlimit.tooltip"));
|
||||
|
||||
addButton(new Slider(left, row += 24, 0, 10, config.getParticleMultiplier()))
|
||||
.onChange(config::setParticleMultiplier)
|
||||
.setTextFormat(transText::formatParticleMultiplier)
|
||||
.getStyle().setTooltip(new TranslatableText("menu.cavedust.particlemultiplier.tooltip"));
|
||||
|
||||
|
||||
addButton(new Button(left, row += 24).onClick(sender -> {
|
||||
config.resetConfig();
|
||||
finish();
|
||||
})).getStyle().setText(new TranslatableText("menu.cavedust.reset")).setTooltip(new TranslatableText("menu.cavedust.reset.tooltip"));
|
||||
|
||||
addButton(new Button(left, row += 180)
|
||||
.onClick(sender -> finish())).getStyle()
|
||||
.setText("gui.done");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
|
||||
renderBackground(matrices);
|
||||
super.render(matrices, mouseX, mouseY, partialTicks);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package net.lizistired.cavedust.mixin;
|
||||
|
||||
|
||||
import net.minecraft.client.gui.hud.DebugHud;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Unique;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import java.lang.management.BufferPoolMXBean;
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import static net.lizistired.cavedust.utils.MathHelper.*;
|
||||
|
||||
@Mixin(DebugHud.class)
|
||||
public abstract class MixinDebugScreenOverlay {
|
||||
@Unique
|
||||
private static final List<BufferPoolMXBean> pools = ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class);
|
||||
|
||||
@Unique
|
||||
private static final BufferPoolMXBean directPool;
|
||||
|
||||
static {
|
||||
BufferPoolMXBean found = null;
|
||||
|
||||
for (BufferPoolMXBean pool : pools) {
|
||||
if (pool.getName().equals("direct")) {
|
||||
found = pool;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
directPool = Objects.requireNonNull(found);
|
||||
}
|
||||
@Inject(method = "getRightText", at = @At("RETURN"))
|
||||
private void appendShaderPackText(CallbackInfoReturnable<List<String>> cir) {
|
||||
List<String> messages = cir.getReturnValue();
|
||||
|
||||
messages.add("");
|
||||
messages.add("Should particles spawn: " + shouldParticlesSpawn);
|
||||
messages.add("");
|
||||
}
|
||||
}
|
||||
54
src/main/java/net/lizistired/cavedust/utils/JsonFile.java
Normal file
54
src/main/java/net/lizistired/cavedust/utils/JsonFile.java
Normal file
@@ -0,0 +1,54 @@
|
||||
package net.lizistired.cavedust.utils;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.google.gson.InstanceCreator;
|
||||
import net.lizistired.cavedust.CaveDust;
|
||||
|
||||
public class JsonFile {
|
||||
protected transient final Gson gson = new GsonBuilder()
|
||||
.registerTypeAdapter(getClass(), (InstanceCreator<JsonFile>)t -> this)
|
||||
.setPrettyPrinting()
|
||||
.create();
|
||||
|
||||
private transient Path file;
|
||||
|
||||
JsonFile() { }
|
||||
|
||||
public JsonFile(Path file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public final void load() {
|
||||
if (Files.isReadable(file)) {
|
||||
try (Reader reader = Files.newBufferedReader(file)) {
|
||||
load(reader);
|
||||
} catch (Exception e) {
|
||||
CaveDust.LOGGER.error("Invalid config", e);
|
||||
}
|
||||
}
|
||||
|
||||
save();
|
||||
}
|
||||
|
||||
public final void load(Reader reader) {
|
||||
gson.fromJson(reader, getClass());
|
||||
}
|
||||
|
||||
public final void save() {
|
||||
try {
|
||||
Files.createDirectories(file.getParent());
|
||||
try (BufferedWriter writer = Files.newBufferedWriter(file)) {
|
||||
gson.toJson(this, writer);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
73
src/main/java/net/lizistired/cavedust/utils/MathHelper.java
Normal file
73
src/main/java/net/lizistired/cavedust/utils/MathHelper.java
Normal file
@@ -0,0 +1,73 @@
|
||||
package net.lizistired.cavedust.utils;
|
||||
|
||||
import net.lizistired.cavedust.CaveDustConfig;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.render.DimensionEffects;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraft.world.biome.OverworldBiomeCreator;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
import net.minecraft.world.gen.feature.OceanRuinFeature;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
import java.util.concurrent.ThreadLocalRandom;
|
||||
|
||||
import static net.minecraft.world.biome.BiomeKeys.LUSH_CAVES;
|
||||
|
||||
public class MathHelper {
|
||||
private static float timer;
|
||||
public static boolean shouldParticlesSpawn;
|
||||
|
||||
public static double normalize(double min, double max, double val) {
|
||||
return 1 - ((val - min) / (max - min));
|
||||
}
|
||||
|
||||
public static int getRandomNumberUsingInts(int min, int max) {
|
||||
Random random = new Random();
|
||||
|
||||
return random.ints(min, max)
|
||||
.findFirst()
|
||||
.getAsInt();
|
||||
}
|
||||
|
||||
|
||||
public static double generateRandomDouble(double min, double max) {
|
||||
return ThreadLocalRandom.current().nextDouble(min, max);
|
||||
}
|
||||
|
||||
public static boolean shouldParticlesSpawn(MinecraftClient client, CaveDustConfig config) {
|
||||
|
||||
//checks if the config is enabled, if the game isn't paused, if the world is valid, if the particle is valid and if the player isn't in a lush caves biome
|
||||
if (!config.getCaveDustEnabled()
|
||||
|| client.isPaused()
|
||||
|| client.world == null
|
||||
|| !client.world.getDimension().isBedWorking()
|
||||
|| Objects.equals(client.world.getBiomeKey(Objects.requireNonNull(client.player).getBlockPos()), Optional.of(LUSH_CAVES)))
|
||||
{
|
||||
timer = 0;
|
||||
shouldParticlesSpawn = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
World world = client.world;
|
||||
int seaLevel = world.getSeaLevel();
|
||||
|
||||
if (!client.player.clientWorld.isSkyVisible(client.player.getBlockPos())) {
|
||||
if (client.player.getBlockPos().getY() < seaLevel){
|
||||
timer = timer + 1;
|
||||
if (timer > 10){
|
||||
timer = 10;
|
||||
shouldParticlesSpawn = true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
shouldParticlesSpawn = false;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.lizistired.cavedust.utils;
|
||||
|
||||
import com.minelittlepony.common.client.gui.element.AbstractSlider;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
|
||||
public class TranslatableTextHelper {
|
||||
public Text formatMinX(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.minX", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
public Text formatMinY(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.minY", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
public Text formatMinZ(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.minZ", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
public Text formatMaxX(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.maxX", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
public Text formatMaxY(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.maxY", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
public Text formatMaxZ(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.maxZ", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
public Text formatUpperLimit(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.upperlimit", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
public Text formatLowerLimit(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.lowerlimit", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
public Text formatParticleMultiplier(AbstractSlider<Float> slider) {
|
||||
return new TranslatableText("menu.cavedust.particlemultiplier", (int)Math.floor(slider.getValue()));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package net.lizistired.caveDust.utils;
|
||||
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
|
||||
public class WindowFocusHelper {
|
||||
private static boolean unpaused;
|
||||
public boolean unpausedMenu(MinecraftClient client){
|
||||
return unpaused;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user