🔖 LambdaControls v1.1.1: Add more precision in the fly drifting tooltips.

This commit is contained in:
LambdAurora
2020-02-05 15:39:19 +01:00
parent e13569b71d
commit 0050b0216c
3 changed files with 42 additions and 31 deletions

View File

@@ -28,7 +28,7 @@ public class LambdaControlsFeature implements Nameable
{ {
private static final List<LambdaControlsFeature> FEATURES = new ArrayList<>(); private static final List<LambdaControlsFeature> FEATURES = new ArrayList<>();
public static final LambdaControlsFeature FRONT_BLOCK_PLACING = new LambdaControlsFeature("front_block_placing", true, false); public static final LambdaControlsFeature FRONT_BLOCK_PLACING = new LambdaControlsFeature("front_block_placing", true, false);
public static final LambdaControlsFeature FAST_BLOCK_PLACEMENT = new LambdaControlsFeature("fast_block_placement", true, true); public static final LambdaControlsFeature FAST_BLOCK_INTERACTION = new LambdaControlsFeature("fast_block_interaction", true, true);
private final String key; private final String key;
private final boolean defaultAllowed; private final boolean defaultAllowed;
@@ -156,6 +156,6 @@ public class LambdaControlsFeature implements Nameable
static { static {
FEATURES.add(FRONT_BLOCK_PLACING); FEATURES.add(FRONT_BLOCK_PLACING);
FEATURES.add(FAST_BLOCK_PLACEMENT); FEATURES.add(FAST_BLOCK_INTERACTION);
} }
} }

View File

@@ -41,7 +41,7 @@ public class LambdaControlsConfig
private static final HudSide DEFAULT_HUD_SIDE = HudSide.LEFT; private static final HudSide DEFAULT_HUD_SIDE = HudSide.LEFT;
// Gameplay // Gameplay
private static final boolean DEFAULT_FRONT_BLOCK_PLACING = false; private static final boolean DEFAULT_FRONT_BLOCK_PLACING = false;
private static final boolean DEFAULT_FAST_BLOCK_INTERACT = true; private static final boolean DEFAULT_FAST_BLOCK_INTERACTION = true;
private static final boolean DEFAULT_FLY_DRIFTING = false; private static final boolean DEFAULT_FLY_DRIFTING = false;
private static final boolean DEFAULT_FLY_VERTICAL_DRIFTING = true; private static final boolean DEFAULT_FLY_VERTICAL_DRIFTING = true;
// Controller // Controller
@@ -85,7 +85,7 @@ public class LambdaControlsConfig
this.hudSide = HudSide.byId(this.config.getOrElse("hud.side", DEFAULT_HUD_SIDE.getName())).orElse(DEFAULT_HUD_SIDE); this.hudSide = HudSide.byId(this.config.getOrElse("hud.side", DEFAULT_HUD_SIDE.getName())).orElse(DEFAULT_HUD_SIDE);
// Gameplay // Gameplay
LambdaControlsFeature.FRONT_BLOCK_PLACING.setEnabled(this.config.getOrElse("gameplay.front_block_placing", DEFAULT_FRONT_BLOCK_PLACING)); LambdaControlsFeature.FRONT_BLOCK_PLACING.setEnabled(this.config.getOrElse("gameplay.front_block_placing", DEFAULT_FRONT_BLOCK_PLACING));
LambdaControlsFeature.FAST_BLOCK_INTERACT.setEnabled(this.config.getOrElse("gameplay.fast_block_interact", DEFAULT_FAST_BLOCK_INTERACT)); LambdaControlsFeature.FAST_BLOCK_INTERACTION.setEnabled(this.config.getOrElse("gameplay.fast_block_interaction", DEFAULT_FAST_BLOCK_INTERACTION));
// Controller settings. // Controller settings.
this.controllerType = ControllerType.byId(this.config.getOrElse("controller.type", DEFAULT_CONTROLLER_TYPE.getName())).orElse(DEFAULT_CONTROLLER_TYPE); this.controllerType = ControllerType.byId(this.config.getOrElse("controller.type", DEFAULT_CONTROLLER_TYPE.getName())).orElse(DEFAULT_CONTROLLER_TYPE);
this.deadZone = this.config.getOrElse("controller.dead_zone", DEFAULT_DEAD_ZONE); this.deadZone = this.config.getOrElse("controller.dead_zone", DEFAULT_DEAD_ZONE);
@@ -134,7 +134,7 @@ public class LambdaControlsConfig
this.setHudSide(DEFAULT_HUD_SIDE); this.setHudSide(DEFAULT_HUD_SIDE);
// Gameplay // Gameplay
this.setFrontBlockPlacing(DEFAULT_FRONT_BLOCK_PLACING); this.setFrontBlockPlacing(DEFAULT_FRONT_BLOCK_PLACING);
this.setFastBlockInteract(DEFAULT_FAST_BLOCK_INTERACT); this.setFastBlockInteraction(DEFAULT_FAST_BLOCK_INTERACTION);
this.setFlyDrifting(DEFAULT_FLY_DRIFTING); this.setFlyDrifting(DEFAULT_FLY_DRIFTING);
this.setFlyVerticalDrifting(DEFAULT_FLY_VERTICAL_DRIFTING); this.setFlyVerticalDrifting(DEFAULT_FLY_VERTICAL_DRIFTING);
// Controller // Controller
@@ -239,6 +239,27 @@ public class LambdaControlsConfig
Gameplay settings Gameplay settings
*/ */
/**
* Gets whether fast block interaction is enabled or not.
*
* @return True if fast block interaction is enabled, else false.
*/
public boolean hasFastBlockInteraction()
{
return LambdaControlsFeature.FAST_BLOCK_INTERACTION.isEnabled();
}
/**
* Sets whether fast block interaction is enabled or not.
*
* @param enable True if fast block interaction is enabled, else false.
*/
public void setFastBlockInteraction(boolean enable)
{
LambdaControlsFeature.FAST_BLOCK_INTERACTION.setEnabled(enable);
this.config.set("gameplay.fast_block_interaction", enable);
}
/** /**
* Returns whether front block placing is enabled or not. * Returns whether front block placing is enabled or not.
* *
@@ -260,16 +281,6 @@ public class LambdaControlsConfig
this.config.set("gameplay.front_block_placing", enable); this.config.set("gameplay.front_block_placing", enable);
} }
/**
* Gets whether fast block interaction is enabled or not.
*
* @return True if fast block interaction is enabled, else false.
*/
public boolean hasFastBlockPlacement()
{
return LambdaControlsFeature.FAST_BLOCK_PLACEMENT.isEnabled();
}
/** /**
* Returns whether fly drifting is enabled or not. * Returns whether fly drifting is enabled or not.
* *

View File

@@ -13,10 +13,10 @@ auto_switch_mode = false
# Gameplay settings # Gameplay settings
[gameplay] [gameplay]
# Enables fast block interaction like in Bedrock Edition.
fast_block_interaction = true
# Enables front block placing like in Bedrock Edition. # Enables front block placing like in Bedrock Edition.
front_block_placing = false front_block_placing = false
# Enables fast block interaction like in Bedrock Edition.
fast_block_interact = true
# Fly behaviors # Fly behaviors
[gameplay.fly] [gameplay.fly]
# Enables fly drifting. # Enables fly drifting.