бакпорт изменений curios под смачный пердёж
This commit is contained in:
parent
b97e18ca5f
commit
1cbf73cdfd
@ -321,7 +321,6 @@ repositories {
|
||||
url = uri("https://maven.dbotthepony.ru")
|
||||
|
||||
content {
|
||||
includeGroup("top.theillusivec4.curios")
|
||||
includeGroup("yalter.mousetweaks")
|
||||
includeGroup("mekanism")
|
||||
includeGroup("lain.mods.cos")
|
||||
@ -357,6 +356,14 @@ repositories {
|
||||
}
|
||||
}
|
||||
|
||||
maven {
|
||||
url = uri("https://maven.theillusivec4.top/")
|
||||
|
||||
content {
|
||||
includeGroup("top.theillusivec4.curios")
|
||||
}
|
||||
}
|
||||
|
||||
// mavenCentral()
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ mixin_version=0.8.5
|
||||
jei_version=11.3.0.262
|
||||
jupiter_version=5.8.2
|
||||
mekanism_version=10.3.5.homebaked
|
||||
curios_version=5.1.1.0
|
||||
curios_version=5.1.4.1
|
||||
cosmetic_armor_reworked_version=v1
|
||||
jade_id=4010505
|
||||
configured_id=4011355
|
||||
|
@ -34,6 +34,7 @@ import ru.dbotthepony.mc.otm.client.model.GravitationStabilizerModel;
|
||||
import ru.dbotthepony.mc.otm.client.model.TritaniumArmorModel;
|
||||
import ru.dbotthepony.mc.otm.client.render.ShockwaveRenderer;
|
||||
import ru.dbotthepony.mc.otm.client.render.WidgetAtlasHolder;
|
||||
import ru.dbotthepony.mc.otm.compat.curios.CuriosCompatKt;
|
||||
import ru.dbotthepony.mc.otm.compat.mekanism.QIOKt;
|
||||
import ru.dbotthepony.mc.otm.compat.mekanism.TooltipsKt;
|
||||
import ru.dbotthepony.mc.otm.core.Decimal;
|
||||
@ -197,6 +198,10 @@ public final class OverdriveThatMatters {
|
||||
EVENT_BUS.addGenericListener(BlockEntity.class, EventPriority.NORMAL, QIOKt::attachCapabilities);
|
||||
}
|
||||
|
||||
if (ModList.get().isLoaded("curios")) {
|
||||
EVENT_BUS.addListener(EventPriority.NORMAL, CuriosCompatKt::onCuriosSlotModifiersUpdated);
|
||||
}
|
||||
|
||||
OreGen.INSTANCE.register();
|
||||
}
|
||||
|
||||
|
@ -165,6 +165,10 @@ class MatteryPlayerCapability(val ply: Player) : ICapabilityProvider, INBTSerial
|
||||
return _exoPackMenu!!
|
||||
}
|
||||
|
||||
fun recreateExoPackMenu() {
|
||||
_exoPackMenu = ExoPackInventoryMenu(this)
|
||||
}
|
||||
|
||||
private var shouldSendIteration = false
|
||||
var iteration = 0
|
||||
private set
|
||||
|
@ -6,20 +6,26 @@ import net.minecraft.world.inventory.Slot
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraftforge.fml.ModList
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.container.awareStream
|
||||
import ru.dbotthepony.mc.otm.container.stream
|
||||
import ru.dbotthepony.mc.otm.core.AwareItemStack
|
||||
import ru.dbotthepony.mc.otm.core.orNull
|
||||
import top.theillusivec4.curios.api.CuriosApi
|
||||
import top.theillusivec4.curios.api.event.SlotModifiersUpdatedEvent
|
||||
import top.theillusivec4.curios.common.inventory.CosmeticCurioSlot
|
||||
import top.theillusivec4.curios.common.inventory.CurioSlot
|
||||
import java.util.*
|
||||
import java.util.stream.Stream
|
||||
|
||||
val isCuriosLoaded by lazy {
|
||||
ModList.get().isLoaded(CuriosApi.MODID)
|
||||
}
|
||||
|
||||
fun onCuriosSlotModifiersUpdated(event: SlotModifiersUpdatedEvent) {
|
||||
check(isCuriosLoaded) { "Curios is not loaded!" }
|
||||
event.entity.matteryPlayer?.recreateExoPackMenu()
|
||||
}
|
||||
|
||||
private fun Player.getCuriosSlotsImpl(): Collection<Pair<Slot, Slot?>> {
|
||||
val handler = getCapability(MatteryCapability.CURIOS_INVENTORY).orNull() ?: return listOf()
|
||||
|
||||
@ -28,9 +34,9 @@ private fun Player.getCuriosSlotsImpl(): Collection<Pair<Slot, Slot?>> {
|
||||
val sortedIdentifiers = ArrayList<String>(handler.curios.keys.size)
|
||||
sortedIdentifiers.addAll(handler.curios.keys)
|
||||
|
||||
if (handler.curios !is LinkedHashMap) {
|
||||
sortedIdentifiers.sort()
|
||||
}
|
||||
//if (handler.curios !is LinkedHashMap) {
|
||||
// sortedIdentifiers.sort()
|
||||
//}
|
||||
|
||||
for (identifier in sortedIdentifiers) {
|
||||
val curio = handler.curios[identifier]!!
|
||||
@ -69,7 +75,7 @@ val Player.curiosSlots: Collection<Pair<Slot, Slot?>> get() {
|
||||
private fun Player.curiosStreamImpl(includeCosmetics: Boolean): Stream<out ItemStack> {
|
||||
val handler = getCapability(MatteryCapability.CURIOS_INVENTORY).orNull() ?: return Stream.empty()
|
||||
|
||||
val result = LinkedList<Stream<out ItemStack>>()
|
||||
val result = ArrayList<Stream<out ItemStack>>()
|
||||
|
||||
for ((identifier, curio) in handler.curios) {
|
||||
result.add(curio.stacks.stream())
|
||||
@ -79,7 +85,7 @@ private fun Player.curiosStreamImpl(includeCosmetics: Boolean): Stream<out ItemS
|
||||
}
|
||||
}
|
||||
|
||||
return Streams.concat(*result.toTypedArray())
|
||||
return result.stream().flatMap { it }
|
||||
}
|
||||
|
||||
fun Player.curiosStream(includeCosmetics: Boolean = true): Stream<out ItemStack> {
|
||||
@ -93,7 +99,7 @@ fun Player.curiosStream(includeCosmetics: Boolean = true): Stream<out ItemStack>
|
||||
private fun Player.curiosAwareStreamImpl(includeCosmetics: Boolean): Stream<out AwareItemStack> {
|
||||
val handler = getCapability(MatteryCapability.CURIOS_INVENTORY).orNull() ?: return Stream.empty()
|
||||
|
||||
val result = LinkedList<Stream<out AwareItemStack>>()
|
||||
val result = ArrayList<Stream<out AwareItemStack>>()
|
||||
|
||||
for ((identifier, curio) in handler.curios) {
|
||||
result.add(curio.stacks.awareStream())
|
||||
|
Loading…
Reference in New Issue
Block a user