Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
9b16164
Translation updates (#4027)
FabricMCBot Aug 26, 2024
3fc0e55
Dont invoke ItemGroupEvents.MODIFY_ENTRIES_ALL for the OP tab, when t…
AshyBoxy Aug 26, 2024
2122d82
After Damage Event (#4051)
TheDeathlyCow Aug 26, 2024
f054fb5
Bump version
modmuss50 Aug 26, 2024
3d2379b
Add `c:animal_foods` tag (#4080)
TelepathicGrunt Sep 10, 2024
aa34100
New Crowdin updates (#4059)
FabricMCBot Sep 10, 2024
4053855
Add missing `minecraft:enchantable/vanishing` to `c:enchantables` (#4…
TelepathicGrunt Sep 10, 2024
d38f898
Add TransferVariant.getComponentMap() (#4074)
modmuss50 Sep 10, 2024
427f7cb
Use unix line endings on all files (#4079)
modmuss50 Sep 10, 2024
e521378
Bump version
modmuss50 Sep 10, 2024
d5debae
Modify Enchantment and Fabric Component Map Builder Extensions (#4085)
TheDeathlyCow Sep 23, 2024
9d3173d
New Crowdin updates (#4086)
FabricMCBot Sep 23, 2024
9d22c5f
Create `c:obsidians` block and item tag (#4088)
TelepathicGrunt Sep 23, 2024
c7469b2
Add access to ClientConfigurationNetworkHandler in context (#4097)
Earthcomputer Sep 23, 2024
5253a6d
Add ItemVariant#withComponentChanges and FluidVariant#withComponentCh…
BasiqueEvangelist Sep 23, 2024
d831205
Fix cherry pick issues
modmuss50 Sep 23, 2024
3b9245a
Bump version
modmuss50 Sep 23, 2024
9176687
Quiltify the Fabric API
OroArmor Aug 12, 2024
7100fad
Add core:qsl_base
OroArmor Aug 16, 2024
effa407
Add core:crash_info
OroArmor Aug 16, 2024
87ec422
Add core:lifecycle_events
OroArmor Aug 16, 2024
a2db1df
Add core:networking
OroArmor Sep 27, 2024
66ac4cd
Add core:registry
OroArmor Sep 18, 2025
b306e85
Add core:resource_loader
OroArmor Sep 2, 2024
be8d022
Add block:block_content_registry
OroArmor Sep 1, 2024
705af1c
Add block:block_entity
OroArmor Sep 1, 2024
0ffc64f
Add block:block_extensions
OroArmor Sep 1, 2024
4f71fa3
Add entity:entity_events
OroArmor Sep 27, 2024
c0889dd
Add entity:entity_extensions
OroArmor Sep 27, 2024
5cd4791
Add gui:screen
OroArmor Sep 28, 2024
94acc6e
Add gui:tooltip
OroArmor Sep 28, 2024
0cd96f2
Add item:item_content_registry
OroArmor Sep 15, 2025
857f3b1
Add item:item_setting
OroArmor Sep 15, 2025
c451b93
Add management:client_command
OroArmor Sep 15, 2025
5be9d83
Add management:command
OroArmor Sep 15, 2025
e1f960d
Add rendering:entity_rendering
OroArmor Sep 15, 2025
8e9a97b
Add worldgen:biome
OroArmor Sep 15, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

import net.fabricmc.fabric.api.item.v1.EnchantmentEvents;
import net.fabricmc.fabric.api.item.v1.EnchantmentSource;
import net.fabricmc.fabric.impl.resource.loader.BuiltinModResourcePackSource;
import net.fabricmc.fabric.impl.resource.loader.FabricResource;
import net.fabricmc.fabric.impl.resource.loader.ModResourcePackCreator;
import net.fabricmc.fabric.mixin.item.EnchantmentBuilderAccessor;

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

public class EnchantmentUtil {
@SuppressWarnings("unchecked")
public static Enchantment modify(RegistryKey<Enchantment> key, Enchantment originalEnchantment, EnchantmentSource source) {
Expand Down Expand Up @@ -65,7 +65,7 @@ public static EnchantmentSource determineSource(Resource resource) {

if (packSource == ResourcePackSource.BUILTIN) {
return EnchantmentSource.VANILLA;
} else if (packSource == ModResourcePackCreator.RESOURCE_PACK_SOURCE || packSource instanceof BuiltinModResourcePackSource) {
} else if (packSource instanceof QuiltBuiltinPackProfile.BuiltinPackSource) {
return EnchantmentSource.MOD;
}
}
Expand Down
1 change: 1 addition & 0 deletions fabric-lifecycle-events-v1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ moduleDependencies(project, ['fabric-api-base'])

dependencies {
modApi getQslModule("core", "lifecycle_events")
modApi getQslModule("core", "resource_loader")
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package net.fabricmc.fabric.api.event.lifecycle.v1;

import java.util.Optional;

import net.minecraft.resource.LifecycledResourceManager;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PlayerManager;
Expand Down Expand Up @@ -104,22 +106,40 @@ private ServerLifecycleEvents() {
/**
* Called before a Minecraft server reloads data packs.
*/
public static final Event<StartDataPackReload> START_DATA_PACK_RELOAD = EventFactory.createArrayBacked(StartDataPackReload.class, callbacks -> (server, serverResourceManager) -> {
for (StartDataPackReload callback : callbacks) {
callback.startDataPackReload(server, serverResourceManager);
}
});
public static final Event<StartDataPackReload> START_DATA_PACK_RELOAD = QuiltCompatEvent.fromQuilt(
org.quiltmc.qsl.resource.loader.api.ResourceLoaderEvents.START_DATA_PACK_RELOAD,
startDataPackReload -> context -> {
// Fabric only triggers it at reloads, not startup.
if (!context.isFirst()) {
startDataPackReload.startDataPackReload(context.server(), (LifecycledResourceManager) context.resourceManager());
}
},
invokerGetter -> (server, resourceManager) -> invokerGetter.get().onStartDataPackReload(new org.quiltmc.qsl.resource.loader.impl.ResourceLoaderEventContextsImpl.ReloadStartContext(
() -> resourceManager, null
))
);

/**
* Called after a Minecraft server has reloaded data packs.
*
* <p>If reloading data packs was unsuccessful, the current data packs will be kept.
*/
public static final Event<EndDataPackReload> END_DATA_PACK_RELOAD = EventFactory.createArrayBacked(EndDataPackReload.class, callbacks -> (server, serverResourceManager, success) -> {
for (EndDataPackReload callback : callbacks) {
callback.endDataPackReload(server, serverResourceManager, success);
}
});
public static final Event<EndDataPackReload> END_DATA_PACK_RELOAD = QuiltCompatEvent.fromQuilt(
org.quiltmc.qsl.resource.loader.api.ResourceLoaderEvents.END_DATA_PACK_RELOAD,
endDataPackReload -> context -> {
// Fabric only triggers it at reloads, not startup.
// Also using an actual cast, unlike Fabric.
if (!context.isFirst()) {
endDataPackReload.endDataPackReload(context.server(), (LifecycledResourceManager) context.resourceManager(), context.error().isEmpty());
}
},
invokerGetter -> (server, resourceManager, success) -> {
invokerGetter.get().onEndDataPackReload(new org.quiltmc.qsl.resource.loader.impl.ResourceLoaderEventContextsImpl.ReloadEndContext(
resourceManager, server.getRegistryManager(), Optional.ofNullable(
success ? null : new RuntimeException("Unknown error")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this error message be more descriptive?

)));
}
);

/**
* Called before a Minecraft server begins saving data.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,6 @@

@Mixin(MinecraftServer.class)
public abstract class MinecraftServerMixin {
@Shadow
private MinecraftServer.ResourceManagerHolder resourceManagerHolder;

@Inject(method = "reloadResources", at = @At("HEAD"))
private void startResourceReload(Collection<String> collection, CallbackInfoReturnable<CompletableFuture<Void>> cir) {
ServerLifecycleEvents.START_DATA_PACK_RELOAD.invoker().startDataPackReload((MinecraftServer) (Object) this, this.resourceManagerHolder.resourceManager());
}

@Inject(method = "reloadResources", at = @At("TAIL"))
private void endResourceReload(Collection<String> collection, CallbackInfoReturnable<CompletableFuture<Void>> cir) {
cir.getReturnValue().handleAsync((value, throwable) -> {
// Hook into fail
ServerLifecycleEvents.END_DATA_PACK_RELOAD.invoker().endDataPackReload((MinecraftServer) (Object) this, this.resourceManagerHolder.resourceManager(), throwable == null);
return value;
}, (MinecraftServer) (Object) this);
}

@Inject(method = "save", at = @At("HEAD"))
private void startSave(boolean suppressLogs, boolean flush, boolean force, CallbackInfoReturnable<Boolean> cir) {
ServerLifecycleEvents.BEFORE_SAVE.invoker().onBeforeSave((MinecraftServer) (Object) this, flush, force);
Expand Down
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 @@ -24,9 +24,9 @@
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;

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

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.

Loading