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

79 lines
2.4 KiB
Java
Raw Normal View History

2016-11-17 05:45:04 +01:00
package com.minelittlepony;
2015-08-02 00:36:33 +02:00
import com.google.gson.annotations.Expose;
import com.minelittlepony.pony.data.PonyLevel;
import com.minelittlepony.settings.SensibleConfig;
import com.mumfrey.liteloader.modconfig.ConfigStrategy;
2016-01-26 09:16:11 +01:00
import com.mumfrey.liteloader.modconfig.Exposable;
import com.mumfrey.liteloader.modconfig.ExposableOptions;
import com.voxelmodpack.hdskins.HDSkinManager;
/**
* Storage container for MineLP client settings.
*/
@ExposableOptions(filename = "minelittlepony", strategy = ConfigStrategy.Unversioned)
public class PonyConfig extends SensibleConfig implements Exposable {
@Expose private PonyLevel ponylevel = PonyLevel.PONIES;
@Expose public boolean sizes = true;
@Expose public boolean snuzzles = true;
@Expose public boolean hd = true;
@Expose public boolean showscale = true;
@Expose public boolean fpsmagic = true;
@Expose public boolean ponyskulls = true;
public enum PonySettings implements Setting {
SIZES,
SNUZZLES,
HD,
SHOWSCALE,
FPSMAGIC,
PONYSKULLS;
}
@Expose public boolean villagers = true;
@Expose public boolean zombies = true;
@Expose public boolean pigzombies = true;
@Expose public boolean skeletons = true;
@Expose public boolean illagers = true;
2018-05-11 13:52:42 +02:00
@Expose public boolean guardians = true;
2018-08-15 17:14:40 +02:00
@Expose public boolean endermen = true;
/**
* 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 09:16:11 +01:00
public PonyLevel getPonyLevel() {
if (ponylevel == null) {
ponylevel = PonyLevel.PONIES;
}
return ponylevel;
2015-08-02 00:36:33 +02:00
}
/**
* Sets the pony level. Want MOAR PONEHS? Well here you go.
*
* @param ponylevel
*/
2016-01-26 09:16:11 +01:00
public void setPonyLevel(PonyLevel ponylevel) {
// only trigger reloads when the value actually changes
if (ponylevel != this.ponylevel) {
this.ponylevel = ponylevel;
HDSkinManager.INSTANCE.parseSkins();
}
}
public float getGlobalScaleFactor() {
2018-08-30 18:42:27 +02:00
return showscale ? 0.9F : 1;
}
2015-08-02 00:36:33 +02:00
}