Skip to content

Commit

Permalink
make elytra boost amount configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
PssbleTrngle committed Feb 27, 2024
2 parents daba15a + 3c93565 commit 343cea6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jei_version=11.6.0.1015
flywheel_version=0.6.10-20
create_version=0.5.1.e-44
registrate_version=MC1.19-1.1.5
flightlib_version=1.1.2
flightlib_version=1.2.0

curios_version=1.19.2-5.1.4.1
caelus_version=1.19.2-3.0.0.6
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface IServerConfig {
val acceleration: Double
val hoverSpeed: Double
val swimModifier: Double
val elytraBoostEnabled: Boolean
val elytraBoost: Double
fun isAllowed(ench: Enchantment): Boolean
}

Expand All @@ -25,7 +25,7 @@ data class SyncedConfig(
override val acceleration: Double,
override val hoverSpeed: Double,
override val swimModifier: Double,
override val elytraBoostEnabled: Boolean,
override val elytraBoost: Double,
) : IServerConfig {
override fun isAllowed(ench: Enchantment) = true
}
Expand Down Expand Up @@ -54,8 +54,8 @@ class ServerConfig(builder: ForgeConfigSpec.Builder) : IServerConfig {
private val swimModifierValue = builder.defineInRange("speed.swim_modifier", 1.8, 0.0, 100.0)
override val swimModifier get() = swimModifierValue.get()!!

private val elytraBoostEnabledValue = builder.define("features.elytra_boost", true)
override val elytraBoostEnabled get() = elytraBoostEnabledValue.get()!!
private val elytraBoostValue = builder.defineInRange("features.elytra_boost", 1.25, 1.0, 100.0)
override val elytraBoost get() = elytraBoostValue.get()!!

private val enchantmentsList = builder.defineList("enchantments.list", emptyList<String>()) { true }
private val enchantmentsIsBlacklist = builder.define("enchantments.is_blacklist", true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class SyncConfigMessage(private val config: IServerConfig) {
acceleration = buf.readDouble(),
hoverSpeed = buf.readDouble(),
swimModifier = buf.readDouble(),
elytraBoostEnabled = buf.readBoolean(),
elytraBoost = buf.readDouble(),
)
return SyncConfigMessage(config)
}
Expand All @@ -33,7 +33,7 @@ class SyncConfigMessage(private val config: IServerConfig) {
buf.writeDouble(config.acceleration)
buf.writeDouble(config.hoverSpeed)
buf.writeDouble(config.swimModifier)
buf.writeBoolean(config.elytraBoostEnabled)
buf.writeDouble(config.elytraBoost)
}

fun handle(context: Supplier<Context>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ open class JetpackItem(
return Configs.SERVER.swimModifier
}

override fun boostsElytra(): Boolean {
return Configs.SERVER.elytraBoostEnabled
override fun elytraBoost(): Double {
return Configs.SERVER.elytraBoost
}

private val thrusters = listOf(-0.35, 0.35).map { offset ->
Expand Down

0 comments on commit 343cea6

Please sign in to comment.