Skip to content

Commit

Permalink
Fixed error in data gen on forge servers
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Nov 5, 2023
1 parent 5df12b7 commit 85a5be8
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
@Mixin(MinecraftServer.class)
public class PFMMinecraftServerMixin {

@Inject(method = "lambda$reloadResources$15", at = @At(value = "RETURN"), cancellable = true, remap = false)
@Inject(method = "lambda$reloadResources$15", at = @At(value = "RETURN"), remap = false)
private void createReload(CallbackInfoReturnable<ImmutableList<ResourcePack>> cir) {
PFMRuntimeResources.RESOURCE_PACK_LIST = new ArrayList<>(cir.getReturnValue());
List<ResourcePack> resourcePacks = new ArrayList<>(cir.getReturnValue());
PackResourceMetadata packResourceMetadata = new PackResourceMetadata(new LiteralText("pfm-runtime-resources"), SharedConstants.getGameVersion().getPackVersion(PackType.RESOURCE));
resourcePacks.add(new PathPackRPWrapper(Suppliers.memoize(() -> {
PFMRuntimeResources.prepareAndRunResourceGen(false); return PFMRuntimeResources.ASSETS_PACK;}), packResourceMetadata));
cir.setReturnValue(ImmutableList.copyOf(resourcePacks));
resourcePacks.removeIf(pack -> pack instanceof PathPackRPWrapper);
PFMRuntimeResources.RESOURCE_PACK_LIST = resourcePacks;
}
}

0 comments on commit 85a5be8

Please sign in to comment.