Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ org.gradle.jvmargs=-Xmx2G

# Mod properties
mod_id=modernfix
version=5.27.0-build.1
version=5.27.5-build.1

# Minecraft/Fabric
minecraft_version=26.1.2
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import it.unimi.dsi.fastutil.objects.ReferenceSets;
import net.fabricmc.fabric.impl.client.model.loading.UnbakedModelDeserializerRegistry;
import net.minecraft.client.color.block.BlockColors;
import net.minecraft.client.renderer.item.ClientItem;
import net.minecraft.client.renderer.block.dispatch.BlockStateModel;
import net.minecraft.client.resources.model.cuboid.ItemModelGenerator;
import net.minecraft.client.resources.model.BlockStateModelLoader;
Expand All @@ -33,7 +32,6 @@
import org.embeddedt.modernfix.common.mixin.perf.dynamic_resources.BlockStateDefinitionsAccessor;
import org.embeddedt.modernfix.common.mixin.perf.dynamic_resources.IdMapperAccessor;
import org.embeddedt.modernfix.common.mixin.perf.dynamic_resources.ModelDiscoveryAccessor;
import org.jetbrains.annotations.Nullable;

import java.io.Reader;
import java.util.AbstractSet;
Expand All @@ -48,7 +46,6 @@
public class DynamicModelSystem {
private static final FileToIdConverter MODEL_LISTER = FileToIdConverter.json("models");
private static final FileToIdConverter BLOCKSTATE_LISTER = FileToIdConverter.json("blockstates");
private static final FileToIdConverter ITEM_LISTER = FileToIdConverter.json("items");

public static final boolean DEBUG_DYNAMIC_MODEL_LOADING = Boolean.getBoolean("modernfix.debugDynamicModelLoading");

Expand Down Expand Up @@ -107,35 +104,6 @@ public BlockStateModelLoader.LoadedModels load(Identifier key) throws Exception
}));
}

public interface SingleClientItemEntryLoader {
@Nullable ClientItem loadEntry(Identifier resourceFileId, Resource resource);
}

public static ClientItemInfoLoader.LoadedClientInfos createDynamicClientInfos(Map<Identifier, Resource> resourceMap, SingleClientItemEntryLoader entryLoader) {
Set<Identifier> itemIdSet = resourceMap.keySet().stream().map(ITEM_LISTER::fileToId).collect(Collectors.toUnmodifiableSet());
return new ClientItemInfoLoader.LoadedClientInfos(Maps.asMap(itemIdSet, key -> {
if (key == null) {
return null;
}

Identifier fileId = ITEM_LISTER.idToFile(key);
Resource resource = resourceMap.get(fileId);
if (resource == null) {
return null;
}

try {
if (DEBUG_DYNAMIC_MODEL_LOADING) {
ModernFix.LOGGER.info("Loading client item info {}", key);
}
return entryLoader.loadEntry(fileId, resource);
} catch (RuntimeException e) {
ModernFix.LOGGER.warn("Failed to build dynamic client item info for {}", key, e);
return null;
}
}));
}

public record DynamicResolver(Map<Identifier, UnbakedModel> inputModels,
BlockStateModelLoader.LoadedModels loadedModels,
ClientItemInfoLoader.LoadedClientInfos loadedClientInfos) {
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/modernfix-common.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@
"perf.dynamic_resources.IdMapperAccessor",
"perf.dynamic_resources.MixinBlockState",
"perf.dynamic_resources.MixinBlockStateModelLoader",
"perf.dynamic_resources.MixinClientItemInfoLoader",
"perf.dynamic_resources.MixinModelBakery",
"perf.dynamic_resources.MixinModelManager",
"perf.dynamic_resources.ModelDiscoveryAccessor",
Expand Down
Loading