mirror of https://github.com/kami-blue/client
Suggested changes
Signed-off-by: scorbett123 <50634068+scorbett123@users.noreply.github.com>
This commit is contained in:
parent
d7d5263825
commit
91bfeda0d8
|
@ -88,7 +88,6 @@ abstract class AbstractKamiGui<S : SettingWindow<*>, E : Any> : GuiScreen() {
|
|||
mc = Wrapper.minecraft
|
||||
windowList.add(ColorPicker)
|
||||
windowList.add(BlockPicker)
|
||||
BlockPicker.visible = false
|
||||
|
||||
safeListener<TickEvent.ClientTickEvent> { event ->
|
||||
if (event.phase != TickEvent.Phase.START) return@safeListener
|
||||
|
|
|
@ -16,6 +16,10 @@ object BlockPicker : ListWindow("Block Picker", 0.0f, 0.0f, 200.0f, 200.0f, Sett
|
|||
|
||||
val blocks = Block.REGISTRY.keys.asSequence().map { Block.REGISTRY.getObject(ResourceLocation(it.path)) }.distinctBy { it.localizedName }.filter { !it.localizedName.startsWith("tile") }.sortedBy { it.localizedName.toLowerCase() }.toList()
|
||||
|
||||
init {
|
||||
visible = false
|
||||
}
|
||||
|
||||
override fun onDisplayed() {
|
||||
super.onDisplayed()
|
||||
|
||||
|
|
|
@ -18,11 +18,10 @@ class BlockSetting(
|
|||
|
||||
override fun read(jsonElement: JsonElement?) {
|
||||
jsonElement?.asJsonPrimitive?.asString.let {
|
||||
for (block in BlockPicker.blocks) {
|
||||
if (block.translationKey == it) {
|
||||
value = block
|
||||
break
|
||||
}
|
||||
BlockPicker.blocks.find { block ->
|
||||
block.translationKey == it
|
||||
}?.let { block ->
|
||||
value = block
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue