Skip to content

Commit

Permalink
Add core:resource_loader
Browse files Browse the repository at this point in the history
  • Loading branch information
OroArmor committed Sep 4, 2024
1 parent 5f025ba commit 8ce916b
Show file tree
Hide file tree
Showing 43 changed files with 116 additions and 2,736 deletions.
4 changes: 4 additions & 0 deletions fabric-loot-api-v3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ moduleDependencies(project, [
'fabric-api-base',
'fabric-resource-loader-v0'
])

dependencies {
modImplementation getQslModule("core", "resource_loader")
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import java.util.HashMap;
import java.util.Map;

import org.quiltmc.qsl.resource.loader.impl.QuiltBuiltinPackProfile;

import net.minecraft.resource.Resource;
import net.minecraft.resource.ResourcePackSource;
import net.minecraft.util.Identifier;

import net.fabricmc.fabric.api.loot.v3.LootTableSource;
import net.fabricmc.fabric.impl.resource.loader.BuiltinModResourcePackSource;
import net.fabricmc.fabric.impl.resource.loader.FabricResource;
import net.fabricmc.fabric.impl.resource.loader.ModResourcePackCreator;

public final class LootUtil {
public static final ThreadLocal<Map<Identifier, LootTableSource>> SOURCES = ThreadLocal.withInitial(HashMap::new);
Expand All @@ -37,7 +37,7 @@ public static LootTableSource determineSource(Resource resource) {

if (packSource == ResourcePackSource.BUILTIN) {
return LootTableSource.VANILLA;
} else if (packSource == ModResourcePackCreator.RESOURCE_PACK_SOURCE || packSource instanceof BuiltinModResourcePackSource) {
} else if (packSource instanceof QuiltBuiltinPackProfile.BuiltinPackSource) {
return LootTableSource.MOD;
}
}
Expand Down
4 changes: 4 additions & 0 deletions fabric-resource-loader-v0/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ testDependencies(project, [
':fabric-api-base',
':fabric-resource-loader-v0'
])

dependencies {
modApi getQslModule("core", "resource_loader")
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 8ce916b

Please sign in to comment.