Added an option to flap pegasus wings when gliding with elytras. Closes #204

This commit is contained in:
Sollace 2022-06-09 22:51:38 +02:00
parent c5aab0ea00
commit cd29726076
4 changed files with 16 additions and 1 deletions

View file

@ -1,12 +1,15 @@
package com.minelittlepony.api.model; package com.minelittlepony.api.model;
import com.minelittlepony.client.MineLittlePony;
public interface IPegasus extends IModel { public interface IPegasus extends IModel {
/** /**
* Returns true if the wings are spread. * Returns true if the wings are spread.
*/ */
default boolean wingsAreOpen() { default boolean wingsAreOpen() {
return (getAttributes().isSwimming || isFlying() || getAttributes().isCrouching) && !getAttributes().isGliding; return (getAttributes().isSwimming || isFlying() || getAttributes().isCrouching)
&& (MineLittlePony.getInstance().getConfig().flappyElytras.get() || !getAttributes().isGliding);
} }
/** /**

View file

@ -117,6 +117,15 @@ public class GuiPonySettings extends GameGui {
} }
} }
if (hiddenOptions) {
for (Setting<?> i : config.getByCategory("customisation")) {
Button button = content
.addButton(new Toggle(LEFT, row += 20, ((Setting<Boolean>)i).get()))
.onChange((Setting<Boolean>)i);
button.getStyle().setText(OPTIONS_PREFIX + i.name().toLowerCase());
}
}
content.addButton(new Label(LEFT, row += 20)).getStyle().setText(OPTIONS_PREFIX + "button"); content.addButton(new Label(LEFT, row += 20)).getStyle().setText(OPTIONS_PREFIX + "button");
content.addButton(new EnumSlider<>(LEFT, row += 20, config.horseButton.get()) content.addButton(new EnumSlider<>(LEFT, row += 20, config.horseButton.get())
.onChange(config.horseButton::set) .onChange(config.horseButton::set)

View file

@ -32,6 +32,8 @@ public class PonyConfig extends JsonConfig {
*/ */
public final Setting<Sizes> sizeOverride = value("sizeOverride", Sizes.UNSET); public final Setting<Sizes> sizeOverride = value("sizeOverride", Sizes.UNSET);
public final Setting<Boolean> flappyElytras = value("customisation", "flappyElytras", false);
public PonyConfig(Path path) { public PonyConfig(Path path) {
super(path); super(path);
} }

View file

@ -20,6 +20,7 @@
"minelp.options.tpsmagic": "Magic in third-person", "minelp.options.tpsmagic": "Magic in third-person",
"minelp.options.ponyskulls": "Pony Skulls", "minelp.options.ponyskulls": "Pony Skulls",
"minelp.options.frustrum": "Frustum checks", "minelp.options.frustrum": "Frustum checks",
"minelp.options.flappyelytras": "Flap Wings whilst Gliding",
"minelp.options.passivenetworking": "Passive Networking [Beta]", "minelp.options.passivenetworking": "Passive Networking [Beta]",
"minelp.options.button": "Display On Title Screen", "minelp.options.button": "Display On Title Screen",
"minelp.options.button.on": "Always Display\n\nBoth the pony button and HD Skins button are visible (if installed)", "minelp.options.button.on": "Always Display\n\nBoth the pony button and HD Skins button are visible (if installed)",