diff options
7 files changed, 7 insertions, 83 deletions
diff --git a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt index 9c8d8f4..4d00a4f 100644 --- a/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt +++ b/src/compat/rei/java/moe/nea/firmament/compat/rei/recipes/SBReforgeRecipe.kt @@ -171,9 +171,10 @@ class SBReforgeRecipe( is Reforge.ReforgeEligibilityFilter.AllowsItemType -> ReforgeStore.resolveItemType(it.itemType) - .flatMap { - RepoItemTypeCache.byItemType[it] ?: listOf() - } + .flatMapTo(mutableSetOf()) { + (RepoItemTypeCache.byItemType[it] ?: listOf()) + + (RepoItemTypeCache.byItemType[it.dungeonVariant] ?: listOf()) + }.toList() is Reforge.ReforgeEligibilityFilter.AllowsVanillaItemType -> { listOf() // TODO: add filter support for this and potentially rework this to search for the declared item type in repo, instead of remapped item type diff --git a/src/main/kotlin/events/BakeExtraModelsEvent.kt b/src/main/kotlin/events/BakeExtraModelsEvent.kt deleted file mode 100644 index 35bfecb..0000000 --- a/src/main/kotlin/events/BakeExtraModelsEvent.kt +++ /dev/null @@ -1,29 +0,0 @@ -package moe.nea.firmament.events - -import java.util.function.BiConsumer -import net.minecraft.client.item.ItemAssetsLoader -import net.minecraft.client.render.model.ReferencedModelsCollector -import net.minecraft.client.util.ModelIdentifier -import net.minecraft.util.Identifier - -// TODO: This event may be removed now since ItemAssetsLoader seems to load all item models now (probably to cope with servers setting the item_model component). Check whether this also applies to blocks now. -//@Deprecated(level = DeprecationLevel.ERROR, message = "This is no longer needed, since ItemAssetsLoader loads all item models.") -class BakeExtraModelsEvent( - private val addAnyModel: BiConsumer<ModelIdentifier, Identifier>, -) : FirmamentEvent() { - - fun addNonItemModel(modelIdentifier: ModelIdentifier, identifier: Identifier) { - this.addAnyModel.accept(modelIdentifier, identifier) - } - - fun addItemModel(modelIdentifier: ModelIdentifier) { - // TODO: If this is still needed: ItemAssetsLoader.FINDER - // addNonItemModel( -// modelIdentifier, -// modelIdentifier.id.withPrefixedPath()) - } - -// @Deprecated(level = DeprecationLevel.ERROR, message = "This is no longer needed, since ItemAssetsLoader loads all item models.") - @Suppress("DEPRECATION") - companion object : FirmamentEventBus<BakeExtraModelsEvent>() -} diff --git a/src/main/kotlin/repo/ReforgeStore.kt b/src/main/kotlin/repo/ReforgeStore.kt index f03903b..4c01974 100644 --- a/src/main/kotlin/repo/ReforgeStore.kt +++ b/src/main/kotlin/repo/ReforgeStore.kt @@ -68,6 +68,7 @@ object ReforgeStore : ExtraRecipeProvider, IReloadable { val actualItemTypes = resolveItemType(eligibleItem.itemType) for (itemType in actualItemTypes) { byType.getOrPut(itemType, ::mutableListOf).add(reforge) + byType.getOrPut(itemType.dungeonVariant, ::mutableListOf).add(reforge) } } diff --git a/src/main/kotlin/util/skyblock/ItemType.kt b/src/main/kotlin/util/skyblock/ItemType.kt index 7149379..6c7096c 100644 --- a/src/main/kotlin/util/skyblock/ItemType.kt +++ b/src/main/kotlin/util/skyblock/ItemType.kt @@ -65,6 +65,8 @@ value class ItemType private constructor(val name: String) { val PET = ofName("PET") } + val dungeonVariant get() = ofName("DUNGEON $name") + override fun toString(): String { return name } diff --git a/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomBlockTextures.kt b/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomBlockTextures.kt index e7c379b..dc3b109 100644 --- a/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomBlockTextures.kt +++ b/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomBlockTextures.kt @@ -30,7 +30,6 @@ import net.minecraft.util.math.BlockPos import net.minecraft.util.profiler.Profiler import moe.nea.firmament.Firmament import moe.nea.firmament.annotations.Subscribe -import moe.nea.firmament.events.BakeExtraModelsEvent import moe.nea.firmament.events.EarlyResourceReloadEvent import moe.nea.firmament.events.FinalizeResourceManagerEvent import moe.nea.firmament.events.SkyblockServerUpdateEvent @@ -238,15 +237,6 @@ object CustomBlockTextures { { prepare(event.resourceManager) }, event.preparationExecutor) } - @Subscribe - fun bakeExtraModels(event: BakeExtraModelsEvent) { - preparationFuture.join().data.values - .flatMap { it.lookup.values } - .flatten() - .mapTo(mutableSetOf()) { it.replacement.blockModelIdentifier } - .forEach { event.addNonItemModel(it, it.id) } - } - private fun prepare(manager: ResourceManager): BakedReplacements { val resources = manager.findResources("overrides/blocks") { it.namespace == "firmskyblock" && it.path.endsWith(".json") diff --git a/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt b/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt index ad44b03..02c0714 100644 --- a/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt +++ b/src/texturePacks/java/moe/nea/firmament/features/texturepack/CustomGlobalTextures.kt @@ -16,7 +16,6 @@ import net.minecraft.util.Identifier import net.minecraft.util.profiler.Profiler import moe.nea.firmament.Firmament import moe.nea.firmament.annotations.Subscribe -import moe.nea.firmament.events.BakeExtraModelsEvent import moe.nea.firmament.events.CustomItemModelEvent import moe.nea.firmament.events.EarlyResourceReloadEvent import moe.nea.firmament.events.FinalizeResourceManagerEvent @@ -69,15 +68,6 @@ object CustomGlobalTextures : SinglePreparationResourceReloader<CustomGlobalText }, event.preparationExecutor) } - @Subscribe - fun onBakeModels(event: BakeExtraModelsEvent) { - for (guiClassOverride in preparationFuture.join().classes) { - for (override in guiClassOverride.overrides) { - event.addItemModel(ModelIdentifier(override.model, "inventory")) - } - } - } - @Volatile var preparationFuture: CompletableFuture<CustomGuiTextureOverride> = CompletableFuture.completedFuture( CustomGuiTextureOverride(listOf())) diff --git a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReferenceCustomModelsPatch.java b/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReferenceCustomModelsPatch.java deleted file mode 100644 index bbabeb5..0000000 --- a/src/texturePacks/java/moe/nea/firmament/mixins/custommodels/ReferenceCustomModelsPatch.java +++ /dev/null @@ -1,31 +0,0 @@ -package moe.nea.firmament.mixins.custommodels; - -import com.llamalad7.mixinextras.sugar.Local; -import moe.nea.firmament.events.BakeExtraModelsEvent; -import net.minecraft.client.item.ItemAssetsLoader; -import net.minecraft.client.render.model.BakedModelManager; -import net.minecraft.client.render.model.BlockStatesLoader; -import net.minecraft.client.render.model.ReferencedModelsCollector; -import net.minecraft.client.render.model.UnbakedModel; -import net.minecraft.client.util.ModelIdentifier; -import net.minecraft.util.Identifier; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - -import java.util.Map; - -@Mixin(BakedModelManager.class) -public abstract class ReferenceCustomModelsPatch { - @Inject(method = "collect", at = @At("RETURN")) - private static void addFirmamentReferencedModels( - UnbakedModel missingModel, Map<Identifier, UnbakedModel> models, BlockStatesLoader.BlockStateDefinition blockStates, ItemAssetsLoader.Result itemAssets, CallbackInfoReturnable<ReferencedModelsCollector> cir, - @Local ReferencedModelsCollector collector) { - // TODO: Insert fake models based on firmskyblock models for a smoother transition - - } -} |