Use immutableMap provided by kommons
This commit is contained in:
parent
118f5e1b5c
commit
3cbcd9e280
@ -32,7 +32,7 @@ import ru.dbotthepony.mc.otm.capability.moveEnergy
|
||||
import ru.dbotthepony.mc.otm.capability.moveFluid
|
||||
import ru.dbotthepony.mc.otm.util.TextComponent
|
||||
import ru.dbotthepony.mc.otm.util.getValue
|
||||
import ru.dbotthepony.mc.otm.util.immutableMap
|
||||
import ru.dbotthepony.kommons.guava.immutableMap
|
||||
import ru.dbotthepony.mc.otm.util.math.Decimal
|
||||
import ru.dbotthepony.mc.otm.util.math.RelativeSide
|
||||
import ru.dbotthepony.mc.otm.util.ITickable
|
||||
|
@ -21,7 +21,7 @@ import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
||||
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||
import ru.dbotthepony.kommons.guava.immutableList
|
||||
import ru.dbotthepony.mc.otm.util.immutableMap
|
||||
import ru.dbotthepony.kommons.guava.immutableMap
|
||||
import ru.dbotthepony.mc.otm.util.isNotEmpty
|
||||
import ru.dbotthepony.mc.otm.util.mapPresent
|
||||
import ru.dbotthepony.mc.otm.util.set
|
||||
|
@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.client.render
|
||||
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.FlowDirection
|
||||
import ru.dbotthepony.mc.otm.util.immutableMap
|
||||
import ru.dbotthepony.kommons.guava.immutableMap
|
||||
import ru.dbotthepony.mc.otm.util.math.RelativeSide
|
||||
|
||||
object Widgets18 {
|
||||
|
@ -36,7 +36,7 @@ import ru.dbotthepony.mc.otm.container.get
|
||||
import ru.dbotthepony.mc.otm.util.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.util.collect.any
|
||||
import ru.dbotthepony.kommons.guava.immutableList
|
||||
import ru.dbotthepony.mc.otm.util.immutableMap
|
||||
import ru.dbotthepony.kommons.guava.immutableMap
|
||||
import ru.dbotthepony.mc.otm.util.isNotEmpty
|
||||
import ru.dbotthepony.mc.otm.registry.CapabilitiesRegisterListener
|
||||
import java.util.function.IntSupplier
|
||||
|
@ -4,7 +4,7 @@ import ru.dbotthepony.kommons.util.getValue
|
||||
import ru.dbotthepony.kommons.util.setValue
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.FlowDirection
|
||||
import ru.dbotthepony.mc.otm.util.immutableMap
|
||||
import ru.dbotthepony.kommons.guava.immutableMap
|
||||
import ru.dbotthepony.mc.otm.util.math.RelativeSide
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryMenu
|
||||
|
||||
|
@ -4,7 +4,7 @@ import ru.dbotthepony.kommons.util.getValue
|
||||
import ru.dbotthepony.kommons.util.setValue
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.FlowDirection
|
||||
import ru.dbotthepony.mc.otm.util.immutableMap
|
||||
import ru.dbotthepony.kommons.guava.immutableMap
|
||||
import ru.dbotthepony.mc.otm.util.math.RelativeSide
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryMenu
|
||||
|
||||
|
@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.menu.input
|
||||
import ru.dbotthepony.kommons.util.getValue
|
||||
import ru.dbotthepony.kommons.util.setValue
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
||||
import ru.dbotthepony.mc.otm.util.immutableMap
|
||||
import ru.dbotthepony.kommons.guava.immutableMap
|
||||
import ru.dbotthepony.mc.otm.util.math.RelativeSide
|
||||
import ru.dbotthepony.mc.otm.menu.MatteryMenu
|
||||
|
||||
|
@ -155,18 +155,6 @@ inline var Entity.position: Vec3
|
||||
get() = position()
|
||||
set(value) { setPos(value) }
|
||||
|
||||
inline fun <K : Any, V : Any> immutableMap(initializer: ImmutableMap.Builder<K, V>.() -> Unit): ImmutableMap<K, V> {
|
||||
val builder = ImmutableMap.Builder<K, V>()
|
||||
initializer.invoke(builder)
|
||||
return builder.build()
|
||||
}
|
||||
|
||||
inline fun <K : Any, V : Any> immutableMultimap(initializer: ImmutableMultimap.Builder<K, V>.() -> Unit): ImmutableMultimap<K, V> {
|
||||
val builder = ImmutableMultimap.Builder<K, V>()
|
||||
initializer.invoke(builder)
|
||||
return builder.build()
|
||||
}
|
||||
|
||||
inline fun itemAttributes(builder: ItemAttributeModifiers.Builder.() -> Unit): ItemAttributeModifiers {
|
||||
val value = ItemAttributeModifiers.builder()
|
||||
builder(value)
|
||||
|
Loading…
Reference in New Issue
Block a user