2019-03-23 21:58:50 +02:00
|
|
|
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;
|
|
|
|
|
2015-11-17 00:17:35 -05:00
|
|
|
import com.google.gson.annotations.Expose;
|
2019-03-23 21:58:50 +02:00
|
|
|
import com.minelittlepony.common.SensibleConfig;
|
2015-11-17 00:17:35 -05:00
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
2018-05-15 16:26:52 +02:00
|
|
|
* Storage container for MineLP client settings.
|
2018-04-25 21:29:49 +02:00
|
|
|
*/
|
2019-03-23 19:48:20 +02:00
|
|
|
public abstract class PonyConfig extends SensibleConfig {
|
2015-11-17 00:17:35 -05:00
|
|
|
|
2018-04-24 14:55:32 +02:00
|
|
|
@Expose private PonyLevel ponylevel = PonyLevel.PONIES;
|
2018-05-15 16:26:52 +02:00
|
|
|
|
2018-04-24 14:55:32 +02:00
|
|
|
@Expose public boolean sizes = true;
|
|
|
|
@Expose public boolean snuzzles = true;
|
|
|
|
@Expose public boolean hd = true;
|
|
|
|
@Expose public boolean showscale = true;
|
2018-06-10 09:37:15 +02:00
|
|
|
@Expose public boolean fpsmagic = true;
|
2018-06-20 23:12:12 +02:00
|
|
|
@Expose public boolean ponyskulls = true;
|
2018-09-20 14:32:54 +02:00
|
|
|
@Expose public boolean frustrum = true;
|
2018-05-15 16:26:52 +02:00
|
|
|
|
|
|
|
public enum PonySettings implements Setting {
|
|
|
|
SIZES,
|
|
|
|
SNUZZLES,
|
|
|
|
HD,
|
2018-06-10 09:37:15 +02:00
|
|
|
SHOWSCALE,
|
2018-06-20 23:12:12 +02:00
|
|
|
FPSMAGIC,
|
2018-09-20 14:32:54 +02:00
|
|
|
PONYSKULLS,
|
|
|
|
FRUSTRUM;
|
2018-05-15 16:26:52 +02:00
|
|
|
}
|
|
|
|
|
2018-04-24 14:55:32 +02:00
|
|
|
@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;
|
2018-04-24 14:55:32 +02:00
|
|
|
|
2018-10-21 17:19:00 +02:00
|
|
|
@Expose private float globalScaleFactor = 0.9F;
|
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Gets the current PonyLevel. That is the level of ponies you would like to see.
|
2018-08-26 18:27:28 -04:00
|
|
|
*
|
2018-04-25 21:29:49 +02:00
|
|
|
* @param ignorePony true to ignore whatever value the setting has.
|
|
|
|
*/
|
2018-05-01 19:33:17 +02:00
|
|
|
public PonyLevel getEffectivePonyLevel(boolean ignorePony) {
|
2018-04-24 14:55:32 +02:00
|
|
|
return ignorePony ? PonyLevel.BOTH : getPonyLevel();
|
|
|
|
}
|
2015-11-17 00:17:35 -05:00
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Actually gets the pony level value. No option to ignore reality here.
|
|
|
|
*/
|
2016-01-26 03:16:11 -05:00
|
|
|
public PonyLevel getPonyLevel() {
|
2018-05-03 14:58:05 +02:00
|
|
|
if (ponylevel == null) {
|
|
|
|
ponylevel = PonyLevel.PONIES;
|
|
|
|
}
|
2015-11-17 00:17:35 -05:00
|
|
|
return ponylevel;
|
2015-08-01 18:36:33 -04:00
|
|
|
}
|
|
|
|
|
2018-04-25 21:29:49 +02:00
|
|
|
/**
|
|
|
|
* Sets the pony level. Want MOAR PONEHS? Well here you go.
|
2018-08-26 18:27:28 -04:00
|
|
|
*
|
2018-04-25 21:29:49 +02:00
|
|
|
* @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;
|
2015-11-17 00:17:35 -05:00
|
|
|
}
|
2018-08-20 20:12:14 +02:00
|
|
|
|
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.
|
|
|
|
*/
|
2018-08-20 20:12:14 +02:00
|
|
|
public float getGlobalScaleFactor() {
|
2018-10-21 17:19:00 +02:00
|
|
|
return showscale ? globalScaleFactor : 1;
|
2018-08-20 20:12:14 +02:00
|
|
|
}
|
2015-08-01 18:36:33 -04:00
|
|
|
}
|