Skip to content

Commit

Permalink
remove curios slot validation check & config option as its only misle…
Browse files Browse the repository at this point in the history
…ading
  • Loading branch information
PssbleTrngle committed Jul 17, 2023
1 parent c1e32cf commit 641d060
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 8 deletions.
Binary file added curios_support_datapack.zip
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ interface IServerConfig {
val swimModifier: Double
val elytraBoostEnabled: Boolean
fun isAllowed(ench: Enchantment): Boolean
val curioSlots: Collection<String>
}

data class SyncedConfig(
Expand All @@ -27,7 +26,6 @@ data class SyncedConfig(
override val hoverSpeed: Double,
override val swimModifier: Double,
override val elytraBoostEnabled: Boolean,
override val curioSlots: Collection<String>,
) : IServerConfig {
override fun isAllowed(ench: Enchantment) = true
}
Expand Down Expand Up @@ -66,7 +64,4 @@ class ServerConfig(builder: ForgeConfigSpec.Builder) : IServerConfig {
val contained = enchantmentsList.get().map(::ResourceLocation).any { key == it }
return contained != enchantmentsIsBlacklist.get()
}

private val curiosSlotList = builder.defineList("curios.allowed_slots", listOf("back")) { true }
override val curioSlots: List<String> get() = curiosSlotList.get()
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ class SyncConfigMessage(private val config: IServerConfig) {
hoverSpeed = buf.readDouble(),
swimModifier = buf.readDouble(),
elytraBoostEnabled = buf.readBoolean(),
curioSlots = buf.readList(FriendlyByteBuf::readUtf),
)
return SyncConfigMessage(config)
}
Expand All @@ -35,7 +34,6 @@ class SyncConfigMessage(private val config: IServerConfig) {
buf.writeDouble(config.hoverSpeed)
buf.writeDouble(config.swimModifier)
buf.writeBoolean(config.elytraBoostEnabled)
buf.writeCollection(config.curioSlots, FriendlyByteBuf::writeUtf)
}

fun handle(context: Supplier<Context>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class BrassJetpack(properties: Properties, blockItem: ItemEntry<BacktankBlockIte
override fun isValid(context: Context): Boolean {
return when (val source = context.source) {
is EquipmentSource -> source.slot == EquipmentSlot.CHEST
is CuriosSource -> Configs.SERVER.curioSlots.contains(source.slot)
is CuriosSource -> true
else -> false
}
}
Expand Down

0 comments on commit 641d060

Please sign in to comment.