mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Removed the PonySettings enum and separate the ModRenderers enum from the config
This commit is contained in:
parent
da9c4ba89e
commit
3c477745e4
13 changed files with 83 additions and 131 deletions
|
@ -6,7 +6,6 @@ import net.minecraft.util.hit.HitResult;
|
||||||
import net.minecraft.util.math.Vec3d;
|
import net.minecraft.util.math.Vec3d;
|
||||||
|
|
||||||
import com.minelittlepony.pony.IPony;
|
import com.minelittlepony.pony.IPony;
|
||||||
import com.minelittlepony.settings.PonySettings;
|
|
||||||
|
|
||||||
public class HorseCam {
|
public class HorseCam {
|
||||||
/**
|
/**
|
||||||
|
@ -14,7 +13,7 @@ public class HorseCam {
|
||||||
*/
|
*/
|
||||||
public static float transformCameraAngle(float pitch) {
|
public static float transformCameraAngle(float pitch) {
|
||||||
|
|
||||||
if (!PonySettings.FILLYCAM.get()) {
|
if (!MineLittlePony.getInstance().getConfig().fillycam.get()) {
|
||||||
return pitch;
|
return pitch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,12 +46,7 @@ public class PonyRenderManager {
|
||||||
* Registers all new player skin types. (currently only pony and slimpony).
|
* Registers all new player skin types. (currently only pony and slimpony).
|
||||||
*/
|
*/
|
||||||
public void initialiseRenderers(EntityRenderDispatcher manager) {
|
public void initialiseRenderers(EntityRenderDispatcher manager) {
|
||||||
PlayerModels[] models = PlayerModels.values();
|
PlayerModels.registry.forEach(i -> registerPlayerSkin(manager, i));
|
||||||
|
|
||||||
for (int i = 1; i < models.length; i++) {
|
|
||||||
registerPlayerSkin(manager, models[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
MobRenderers.registry.forEach(i -> i.apply(this));
|
MobRenderers.registry.forEach(i -> i.apply(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@ import com.minelittlepony.common.client.gui.element.EnumSlider;
|
||||||
import com.minelittlepony.common.client.gui.element.Label;
|
import com.minelittlepony.common.client.gui.element.Label;
|
||||||
import com.minelittlepony.common.client.gui.element.Slider;
|
import com.minelittlepony.common.client.gui.element.Slider;
|
||||||
import com.minelittlepony.common.client.gui.element.Toggle;
|
import com.minelittlepony.common.client.gui.element.Toggle;
|
||||||
|
import com.minelittlepony.common.util.settings.Setting;
|
||||||
import com.minelittlepony.settings.PonyLevel;
|
import com.minelittlepony.settings.PonyLevel;
|
||||||
import com.minelittlepony.settings.PonySettings;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In-Game options menu.
|
* In-Game options menu.
|
||||||
|
@ -54,6 +54,7 @@ public class GuiPonySettings extends GameGui {
|
||||||
content.init(this::rebuildContent);
|
content.init(this::rebuildContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
private void rebuildContent() {
|
private void rebuildContent() {
|
||||||
content.padding.left = 10;
|
content.padding.left = 10;
|
||||||
|
|
||||||
|
@ -96,9 +97,10 @@ public class GuiPonySettings extends GameGui {
|
||||||
|
|
||||||
row += 20;
|
row += 20;
|
||||||
content.addButton(new Label(LEFT, row)).getStyle().setText(OPTIONS_PREFIX + "options");
|
content.addButton(new Label(LEFT, row)).getStyle().setText(OPTIONS_PREFIX + "options");
|
||||||
for (PonySettings i : PonySettings.values()) {
|
|
||||||
content.addButton(new Toggle(LEFT, row += 20, i.get()))
|
for (Setting<?> i : MineLittlePony.getInstance().getConfig().getByCategory("settings")) {
|
||||||
.onChange(i)
|
content.addButton(new Toggle(LEFT, row += 20, ((Setting<Boolean>)i).get()))
|
||||||
|
.onChange((Setting<Boolean>)i)
|
||||||
.getStyle().setText(OPTIONS_PREFIX + i.name().toLowerCase());
|
.getStyle().setText(OPTIONS_PREFIX + i.name().toLowerCase());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -116,7 +118,7 @@ public class GuiPonySettings extends GameGui {
|
||||||
content.addButton(new Label(RIGHT, row)).getStyle().setText(MOB_PREFIX + "title");
|
content.addButton(new Label(RIGHT, row)).getStyle().setText(MOB_PREFIX + "title");
|
||||||
for (MobRenderers i : MobRenderers.registry) {
|
for (MobRenderers i : MobRenderers.registry) {
|
||||||
content.addButton(new Toggle(RIGHT, row += 20, i.get()))
|
content.addButton(new Toggle(RIGHT, row += 20, i.get()))
|
||||||
.onChange(i)
|
.onChange(i::set)
|
||||||
.getStyle().setText(MOB_PREFIX + i.name().toLowerCase());
|
.getStyle().setText(MOB_PREFIX + i.name().toLowerCase());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,10 +3,10 @@ package com.minelittlepony.client.model.components;
|
||||||
import net.minecraft.client.model.Cuboid;
|
import net.minecraft.client.model.Cuboid;
|
||||||
import net.minecraft.client.model.Model;
|
import net.minecraft.client.model.Model;
|
||||||
|
|
||||||
|
import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.client.util.render.plane.PlaneRenderer;
|
import com.minelittlepony.client.util.render.plane.PlaneRenderer;
|
||||||
import com.minelittlepony.model.ICapitated;
|
import com.minelittlepony.model.ICapitated;
|
||||||
import com.minelittlepony.pony.meta.Gender;
|
import com.minelittlepony.pony.meta.Gender;
|
||||||
import com.minelittlepony.settings.PonySettings;
|
|
||||||
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.*;
|
import static com.minelittlepony.model.PonyModelConstants.*;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public class PonySnout {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGender(Gender gender) {
|
public void setGender(Gender gender) {
|
||||||
boolean show = !head.hasHeadGear() && !isHidden && PonySettings.SNUZZLES.get();
|
boolean show = !head.hasHeadGear() && !isHidden && MineLittlePony.getInstance().getConfig().snuzzles.get();
|
||||||
|
|
||||||
mare.field_3664 = !(show && gender.isMare());
|
mare.field_3664 = !(show && gender.isMare());
|
||||||
stallion.field_3664 = !(show && gender.isStallion());
|
stallion.field_3664 = !(show && gender.isStallion());
|
||||||
|
|
|
@ -13,6 +13,8 @@ import javax.annotation.Nullable;
|
||||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
@ -35,6 +37,7 @@ public enum PlayerModels {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
public static final List<PlayerModels> registry = Arrays.asList(values());
|
||||||
private static final Map<Race, PlayerModels> raceModelsMap = Maps.newEnumMap(Race.class);
|
private static final Map<Race, PlayerModels> raceModelsMap = Maps.newEnumMap(Race.class);
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import org.lwjgl.opengl.GL14;
|
||||||
import com.minelittlepony.client.MineLittlePony;
|
import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.client.util.render.Color;
|
import com.minelittlepony.client.util.render.Color;
|
||||||
import com.minelittlepony.pony.IPony;
|
import com.minelittlepony.pony.IPony;
|
||||||
import com.minelittlepony.settings.PonySettings;
|
|
||||||
|
|
||||||
import net.minecraft.client.MinecraftClient;
|
import net.minecraft.client.MinecraftClient;
|
||||||
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
import net.minecraft.client.network.AbstractClientPlayerEntity;
|
||||||
|
@ -80,7 +79,7 @@ public class LevitatingItemRenderer {
|
||||||
|
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
|
|
||||||
boolean doMagic = PonySettings.FPSMAGIC.get() && pony.getMetadata().hasMagic();
|
boolean doMagic = MineLittlePony.getInstance().getConfig().fpsmagic.get() && pony.getMetadata().hasMagic();
|
||||||
|
|
||||||
ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
|
ItemRenderer itemRenderer = MinecraftClient.getInstance().getItemRenderer();
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
package com.minelittlepony.client.render;
|
package com.minelittlepony.client.render;
|
||||||
|
|
||||||
|
import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.client.PonyRenderManager;
|
import com.minelittlepony.client.PonyRenderManager;
|
||||||
import com.minelittlepony.client.model.IPonyModel;
|
import com.minelittlepony.client.model.IPonyModel;
|
||||||
import com.minelittlepony.client.model.ModelWrapper;
|
import com.minelittlepony.client.model.ModelWrapper;
|
||||||
import com.minelittlepony.client.transform.PonyPosture;
|
import com.minelittlepony.client.transform.PonyPosture;
|
||||||
import com.minelittlepony.pony.IPony;
|
import com.minelittlepony.pony.IPony;
|
||||||
import com.minelittlepony.settings.PonySettings;
|
|
||||||
import com.minelittlepony.util.math.MathUtil;
|
import com.minelittlepony.util.math.MathUtil;
|
||||||
import com.mojang.blaze3d.platform.GlStateManager;
|
import com.mojang.blaze3d.platform.GlStateManager;
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public class RenderPony<T extends LivingEntity, M extends EntityModel<T> & IPony
|
||||||
}
|
}
|
||||||
|
|
||||||
public VisibleRegion getFrustrum(T entity, VisibleRegion vanilla) {
|
public VisibleRegion getFrustrum(T entity, VisibleRegion vanilla) {
|
||||||
if (entity.isSleeping() || !PonySettings.FRUSTRUM.get()) {
|
if (entity.isSleeping() || !MineLittlePony.getInstance().getConfig().frustrum.get()) {
|
||||||
return vanilla;
|
return vanilla;
|
||||||
}
|
}
|
||||||
return frustrum.withCamera(entity, vanilla);
|
return frustrum.withCamera(entity, vanilla);
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
package com.minelittlepony.client.render.entities;
|
package com.minelittlepony.client.render.entities;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import com.minelittlepony.client.MineLittlePony;
|
import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.client.PonyRenderManager;
|
import com.minelittlepony.client.PonyRenderManager;
|
||||||
import com.minelittlepony.common.util.settings.Config;
|
|
||||||
import com.minelittlepony.common.util.settings.Setting;
|
import com.minelittlepony.common.util.settings.Setting;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
import net.minecraft.entity.mob.*;
|
import net.minecraft.entity.mob.*;
|
||||||
import net.minecraft.entity.passive.*;
|
import net.minecraft.entity.passive.*;
|
||||||
|
@ -14,91 +14,71 @@ import net.minecraft.entity.passive.*;
|
||||||
/**
|
/**
|
||||||
* Central location where new entity renderers are registered and applied.
|
* Central location where new entity renderers are registered and applied.
|
||||||
*/
|
*/
|
||||||
public enum MobRenderers implements Setting<Boolean> {
|
public enum MobRenderers {
|
||||||
VILLAGERS {
|
VILLAGERS((state, pony) -> {
|
||||||
@Override
|
pony.switchRenderer(state, VillagerEntity.class, RenderPonyVillager::new);
|
||||||
void register(boolean state, PonyRenderManager pony) {
|
pony.switchRenderer(state, WitchEntity.class, RenderPonyWitch::new);
|
||||||
pony.switchRenderer(state, VillagerEntity.class, RenderPonyVillager::new);
|
pony.switchRenderer(state, ZombieVillagerEntity.class, RenderPonyZombieVillager::new);
|
||||||
pony.switchRenderer(state, WitchEntity.class, RenderPonyWitch::new);
|
pony.switchRenderer(state, WanderingTraderEntity.class, RenderPonyTrader::new);
|
||||||
pony.switchRenderer(state, ZombieVillagerEntity.class, RenderPonyZombieVillager::new);
|
pony.switchRenderer(state, PillagerEntity.class, RenderPonyPillager::new);
|
||||||
pony.switchRenderer(state, WanderingTraderEntity.class, RenderPonyTrader::new);
|
}),
|
||||||
pony.switchRenderer(state, PillagerEntity.class, RenderPonyPillager::new);
|
ZOMBIES((state, pony) -> {
|
||||||
}
|
pony.switchRenderer(state, ZombieEntity.class, RenderPonyZombie::new);
|
||||||
},
|
pony.switchRenderer(state, HuskEntity.class, RenderPonyZombie.Husk::new);
|
||||||
ZOMBIES {
|
pony.switchRenderer(state, GiantEntity.class, RenderPonyZombie.Giant::new);
|
||||||
@Override
|
pony.switchRenderer(state, DrownedEntity.class, RenderPonyZombie.Drowned::new);
|
||||||
void register(boolean state, PonyRenderManager pony) {
|
}),
|
||||||
pony.switchRenderer(state, ZombieEntity.class, RenderPonyZombie::new);
|
PIGZOMBIES((state, pony) -> {
|
||||||
pony.switchRenderer(state, HuskEntity.class, RenderPonyZombie.Husk::new);
|
pony.switchRenderer(state, ZombiePigmanEntity.class, RenderPonyZombie.Pigman::new);
|
||||||
pony.switchRenderer(state, GiantEntity.class, RenderPonyZombie.Giant::new);
|
}),
|
||||||
pony.switchRenderer(state, DrownedEntity.class, RenderPonyZombie.Drowned::new);
|
SKELETONS((state, pony) -> {
|
||||||
}
|
pony.switchRenderer(state, SkeletonEntity.class, RenderPonySkeleton::new);
|
||||||
},
|
pony.switchRenderer(state, StrayEntity.class, RenderPonySkeleton.Stray::new);
|
||||||
PIGZOMBIES {
|
pony.switchRenderer(state, WitherSkeletonEntity.class, RenderPonySkeleton.Wither::new);
|
||||||
@Override
|
}),
|
||||||
void register(boolean state, PonyRenderManager pony) {
|
ILLAGERS((state, pony) -> {
|
||||||
pony.switchRenderer(state, ZombiePigmanEntity.class, RenderPonyZombie.Pigman::new);
|
pony.switchRenderer(state, VexEntity.class, RenderPonyVex::new);
|
||||||
}
|
pony.switchRenderer(state, EvokerEntity.class, RenderPonyIllager.Evoker::new);
|
||||||
},
|
pony.switchRenderer(state, VindicatorEntity.class, RenderPonyIllager.Vindicator::new);
|
||||||
SKELETONS {
|
pony.switchRenderer(state, IllusionerEntity.class, RenderPonyIllager.Illusionist::new);
|
||||||
@Override
|
}),
|
||||||
void register(boolean state, PonyRenderManager pony) {
|
GUARDIANS((state, pony) -> {
|
||||||
pony.switchRenderer(state, SkeletonEntity.class, RenderPonySkeleton::new);
|
pony.switchRenderer(state, GuardianEntity.class, RenderPonyGuardian::new);
|
||||||
pony.switchRenderer(state, StrayEntity.class, RenderPonySkeleton.Stray::new);
|
pony.switchRenderer(state, ElderGuardianEntity.class, RenderPonyGuardian.Elder::new);
|
||||||
pony.switchRenderer(state, WitherSkeletonEntity.class, RenderPonySkeleton.Wither::new);
|
}),
|
||||||
}
|
ENDERMEN((state, pony) -> {
|
||||||
},
|
pony.switchRenderer(state, EndermanEntity.class, RenderEnderStallion::new);
|
||||||
ILLAGERS {
|
});
|
||||||
@Override
|
|
||||||
void register(boolean state, PonyRenderManager pony) {
|
|
||||||
pony.switchRenderer(state, VexEntity.class, RenderPonyVex::new);
|
|
||||||
pony.switchRenderer(state, EvokerEntity.class, RenderPonyIllager.Evoker::new);
|
|
||||||
pony.switchRenderer(state, VindicatorEntity.class, RenderPonyIllager.Vindicator::new);
|
|
||||||
pony.switchRenderer(state, IllusionerEntity.class, RenderPonyIllager.Illusionist::new);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
GUARDIANS {
|
|
||||||
@Override
|
|
||||||
void register(boolean state, PonyRenderManager pony) {
|
|
||||||
pony.switchRenderer(state, GuardianEntity.class, RenderPonyGuardian::new);
|
|
||||||
pony.switchRenderer(state, ElderGuardianEntity.class, RenderPonyGuardian.Elder::new);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
ENDERMEN {
|
|
||||||
@Override
|
|
||||||
void register(boolean state, PonyRenderManager pony) {
|
|
||||||
pony.switchRenderer(state, EndermanEntity.class, RenderEnderStallion::new);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public static final List<MobRenderers> registry = Lists.newArrayList(values());
|
public static final List<MobRenderers> registry = Arrays.asList(values());
|
||||||
|
|
||||||
@Override
|
private final BiConsumer<Boolean, PonyRenderManager> changer;
|
||||||
public Boolean getDefault() {
|
|
||||||
return true;
|
MobRenderers(BiConsumer<Boolean, PonyRenderManager> changer) {
|
||||||
|
this.changer = changer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public Setting<Boolean> option() {
|
||||||
public Boolean set(Boolean value) {
|
return MineLittlePony.getInstance().getConfig().<Boolean>get(name().toLowerCase());
|
||||||
value = Setting.super.set(value);
|
}
|
||||||
|
|
||||||
|
public boolean set(boolean value) {
|
||||||
|
value = option().set(value);
|
||||||
apply(PonyRenderManager.getInstance());
|
apply(PonyRenderManager.getInstance());
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
public boolean get() {
|
||||||
public Config config() {
|
return option().get();
|
||||||
return MineLittlePony.getInstance().getConfig();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void apply(PonyRenderManager pony) {
|
public void apply(PonyRenderManager pony) {
|
||||||
boolean state = get();
|
boolean state = get();
|
||||||
register(state, pony);
|
changer.accept(state, pony);
|
||||||
if (state) {
|
if (state) {
|
||||||
MineLittlePony.logger.info(name() + " are now ponies.");
|
MineLittlePony.logger.info(name() + " are now ponies.");
|
||||||
} else {
|
} else {
|
||||||
MineLittlePony.logger.info(name() + " are no longer ponies.");
|
MineLittlePony.logger.info(name() + " are no longer ponies.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
abstract void register(boolean state, PonyRenderManager pony);
|
|
||||||
}
|
}
|
|
@ -5,7 +5,6 @@ import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.client.render.LevitatingItemRenderer;
|
import com.minelittlepony.client.render.LevitatingItemRenderer;
|
||||||
import com.minelittlepony.pony.IPony;
|
import com.minelittlepony.pony.IPony;
|
||||||
import com.minelittlepony.settings.PonyConfig;
|
import com.minelittlepony.settings.PonyConfig;
|
||||||
import com.minelittlepony.settings.PonySettings;
|
|
||||||
import com.mojang.authlib.GameProfile;
|
import com.mojang.authlib.GameProfile;
|
||||||
|
|
||||||
import net.fabricmc.fabric.api.client.render.BlockEntityRendererRegistry;
|
import net.fabricmc.fabric.api.client.render.BlockEntityRendererRegistry;
|
||||||
|
@ -45,7 +44,7 @@ public class PonySkullRenderer extends SkullBlockEntityRenderer {
|
||||||
* Original/Existing renderer is stored to a backup variable as a fallback in case of mods.
|
* Original/Existing renderer is stored to a backup variable as a fallback in case of mods.
|
||||||
*/
|
*/
|
||||||
public static SkullBlockEntityRenderer resolve() {
|
public static SkullBlockEntityRenderer resolve() {
|
||||||
if (PonySettings.PONYSKULLS.get()) {
|
if (MineLittlePony.getInstance().getConfig().ponyskulls.get()) {
|
||||||
if (!(INSTANCE instanceof PonySkullRenderer)) {
|
if (!(INSTANCE instanceof PonySkullRenderer)) {
|
||||||
backup = INSTANCE;
|
backup = INSTANCE;
|
||||||
BlockEntityRendererRegistry.INSTANCE.register(SkullBlockEntity.class, ponyInstance);
|
BlockEntityRendererRegistry.INSTANCE.register(SkullBlockEntity.class, ponyInstance);
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class ClientPonyConfig extends PonyConfig {
|
||||||
public final Setting<VisibilityMode> horseButton = value("horseButton", VisibilityMode.AUTO);
|
public final Setting<VisibilityMode> horseButton = value("horseButton", VisibilityMode.AUTO);
|
||||||
|
|
||||||
public ClientPonyConfig() {
|
public ClientPonyConfig() {
|
||||||
initWith(MobRenderers.values());
|
MobRenderers.registry.forEach(r -> value(r.name().toLowerCase(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.minelittlepony.pony.meta;
|
||||||
|
|
||||||
import com.minelittlepony.client.MineLittlePony;
|
import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.pony.ITriggerPixelMapped;
|
import com.minelittlepony.pony.ITriggerPixelMapped;
|
||||||
import com.minelittlepony.settings.PonySettings;
|
|
||||||
|
|
||||||
public enum Size implements ITriggerPixelMapped<Size> {
|
public enum Size implements ITriggerPixelMapped<Size> {
|
||||||
TALL (0x764b53, 0.45f, 1.1F, 1.15F),
|
TALL (0x764b53, 0.45f, 1.1F, 1.15F),
|
||||||
|
@ -37,14 +36,14 @@ public enum Size implements ITriggerPixelMapped<Size> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getEyeHeightFactor() {
|
public float getEyeHeightFactor() {
|
||||||
if (!PonySettings.FILLYCAM.get()) {
|
if (!MineLittlePony.getInstance().getConfig().fillycam.get()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return camera * MineLittlePony.getInstance().getConfig().getGlobalScaleFactor();
|
return camera * MineLittlePony.getInstance().getConfig().getGlobalScaleFactor();
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getEyeDistanceFactor() {
|
public float getEyeDistanceFactor() {
|
||||||
if (!PonySettings.FILLYCAM.get()) {
|
if (!MineLittlePony.getInstance().getConfig().fillycam.get()) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return camera * MineLittlePony.getInstance().getConfig().getGlobalScaleFactor();
|
return camera * MineLittlePony.getInstance().getConfig().getGlobalScaleFactor();
|
||||||
|
@ -62,7 +61,7 @@ public enum Size implements ITriggerPixelMapped<Size> {
|
||||||
return sz;
|
return sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this == UNSET || !PonySettings.SIZES.get()) {
|
if (this == UNSET || !MineLittlePony.getInstance().getConfig().sizes.get()) {
|
||||||
return NORMAL;
|
return NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,15 +17,19 @@ public class PonyConfig extends JsonConfig {
|
||||||
public final Setting<PonyLevel> ponyLevel = value("ponylevel", PonyLevel.PONIES);
|
public final Setting<PonyLevel> ponyLevel = value("ponylevel", PonyLevel.PONIES);
|
||||||
private final Setting<Float> scaleFactor = value("globalScaleFactor", 0.9F);
|
private final Setting<Float> scaleFactor = value("globalScaleFactor", 0.9F);
|
||||||
|
|
||||||
|
public final Setting<Boolean> sizes = value("settings", "sizes", false);
|
||||||
|
public final Setting<Boolean> snuzzles = value("settings", "snuzzles", false);
|
||||||
|
public final Setting<Boolean> fillycam = value("settings", "fillycam", false);
|
||||||
|
private final Setting<Boolean> showscale = value("settings", "showscale", false);
|
||||||
|
public final Setting<Boolean> fpsmagic = value("settings", "fpsmagic", false);
|
||||||
|
public final Setting<Boolean> ponyskulls = value("settings", "ponyskulls", false);
|
||||||
|
public final Setting<Boolean> frustrum = value("settings", "frustrum", false);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug override for pony sizes.
|
* Debug override for pony sizes.
|
||||||
*/
|
*/
|
||||||
public final Setting<Size> sizeOverride = value("sizeOverride", Size.UNSET);
|
public final Setting<Size> sizeOverride = value("sizeOverride", Size.UNSET);
|
||||||
|
|
||||||
public PonyConfig() {
|
|
||||||
initWith(PonySettings.values());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current PonyLevel. That is the level of ponies you would like to see.
|
* Gets the current PonyLevel. That is the level of ponies you would like to see.
|
||||||
*
|
*
|
||||||
|
@ -39,7 +43,7 @@ public class PonyConfig extends JsonConfig {
|
||||||
f = Math.round(MathHelper.clamp(f, 0.1F, 3) * 100) / 100F;
|
f = Math.round(MathHelper.clamp(f, 0.1F, 3) * 100) / 100F;
|
||||||
|
|
||||||
scaleFactor.set(f);
|
scaleFactor.set(f);
|
||||||
PonySettings.SHOWSCALE.set(f != 1);
|
showscale.set(f != 1);
|
||||||
|
|
||||||
return getGlobalScaleFactor();
|
return getGlobalScaleFactor();
|
||||||
}
|
}
|
||||||
|
@ -48,6 +52,6 @@ public class PonyConfig extends JsonConfig {
|
||||||
* Gets the universal scale factor used to determine how tall ponies are.
|
* Gets the universal scale factor used to determine how tall ponies are.
|
||||||
*/
|
*/
|
||||||
public float getGlobalScaleFactor() {
|
public float getGlobalScaleFactor() {
|
||||||
return PonySettings.SHOWSCALE.get() ? scaleFactor.get() : 1;
|
return showscale.get() ? scaleFactor.get() : 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
package com.minelittlepony.settings;
|
|
||||||
|
|
||||||
import com.minelittlepony.client.MineLittlePony;
|
|
||||||
import com.minelittlepony.common.util.settings.Config;
|
|
||||||
import com.minelittlepony.common.util.settings.Setting;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Mod settings.
|
|
||||||
*/
|
|
||||||
public enum PonySettings implements Setting<Boolean> {
|
|
||||||
SIZES,
|
|
||||||
SNUZZLES,
|
|
||||||
FILLYCAM,
|
|
||||||
SHOWSCALE,
|
|
||||||
FPSMAGIC,
|
|
||||||
PONYSKULLS,
|
|
||||||
FRUSTRUM;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Boolean getDefault() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Config config() {
|
|
||||||
return MineLittlePony.getInstance().getConfig();
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in a new issue