PaperMC/paper-server/patches/sources/net/minecraft/server/packs/VanillaPackResourcesBuilder.java.patch
2024-12-14 17:39:31 +01:00

18 lines
928 B
Diff

--- a/net/minecraft/server/packs/VanillaPackResourcesBuilder.java
+++ b/net/minecraft/server/packs/VanillaPackResourcesBuilder.java
@@ -137,6 +_,15 @@
public VanillaPackResourcesBuilder applyDevelopmentConfig() {
developmentConfig.accept(this);
+ if (Boolean.getBoolean("Paper.pushPaperAssetsRoot")) {
+ try {
+ this.pushAssetPath(net.minecraft.server.packs.PackType.SERVER_DATA, net.minecraft.server.packs.VanillaPackResourcesBuilder.safeGetPath(java.util.Objects.requireNonNull(
+ // Important that this is a patched class
+ VanillaPackResourcesBuilder.class.getResource("/data/.paperassetsroot"), "Missing required .paperassetsroot file").toURI()).getParent());
+ } catch (java.net.URISyntaxException | IOException ex) {
+ throw new RuntimeException(ex);
+ }
+ }
return this;
}