MineLittlePony/src/main/java/com/minelittlepony/settings/PonyConfig.java

72 lines
2 KiB
Java
Raw Normal View History

package com.minelittlepony.settings;
2015-08-01 18:36:33 -04:00
2018-10-21 17:19:00 +02:00
import net.minecraft.util.math.MathHelper;
import com.google.gson.annotations.Expose;
/**
* Storage container for MineLP client settings.
*/
2019-05-28 01:50:45 +02:00
public abstract class PonyConfig extends SensibleJsonConfig {
@Expose private PonyLevel ponylevel = PonyLevel.PONIES;
2019-05-28 10:26:26 +02:00
@Expose boolean sizes = true;
@Expose boolean snuzzles = true;
@Expose boolean hd = true;
@Expose boolean showscale = true;
@Expose boolean fpsmagic = true;
@Expose boolean ponyskulls = true;
@Expose boolean frustrum = true;
@Expose boolean villagers = true;
@Expose boolean zombies = true;
@Expose boolean pigzombies = true;
@Expose boolean skeletons = true;
@Expose boolean illagers = true;
@Expose boolean guardians = true;
@Expose boolean endermen = true;
2018-10-21 17:19:00 +02:00
@Expose private float globalScaleFactor = 0.9F;
/**
* Gets the current PonyLevel. That is the level of ponies you would like to see.
*
* @param ignorePony true to ignore whatever value the setting has.
*/
public PonyLevel getEffectivePonyLevel(boolean ignorePony) {
return ignorePony ? PonyLevel.BOTH : getPonyLevel();
}
/**
* Actually gets the pony level value. No option to ignore reality here.
*/
2016-01-26 03:16:11 -05:00
public PonyLevel getPonyLevel() {
if (ponylevel == null) {
ponylevel = PonyLevel.PONIES;
}
return ponylevel;
2015-08-01 18:36:33 -04:00
}
/**
* Sets the pony level. Want MOAR PONEHS? Well here you go.
*
* @param ponylevel
*/
2016-01-26 03:16:11 -05:00
public void setPonyLevel(PonyLevel ponylevel) {
2019-03-24 11:30:57 +02:00
this.ponylevel = ponylevel;
}
2018-10-21 17:19:00 +02:00
public void setGlobalScaleFactor(float f) {
2018-10-23 09:59:29 +02:00
globalScaleFactor = Math.round(MathHelper.clamp(f, 0.1F, 3) * 100) / 100F;
showscale = globalScaleFactor != 1;
2018-10-21 17:19:00 +02:00
}
/**
* Gets the universal scale factor used to determine how tall ponies are.
*/
public float getGlobalScaleFactor() {
2018-10-21 17:19:00 +02:00
return showscale ? globalScaleFactor : 1;
}
2015-08-01 18:36:33 -04:00
}