Skip to content

Commit

Permalink
Fixed DataPack being disabled by default
Browse files Browse the repository at this point in the history
  • Loading branch information
RubixDev committed Mar 3, 2021
1 parent 6e3e71a commit 70eb150
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/rubixdev/rug/RugServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public void onServerLoaded(MinecraftServer server) {
@Override
public void onServerLoadedWorlds(MinecraftServer server) {
String datapackPath = server.getSavePath(WorldSavePath.DATAPACKS).toString() + "/Rug_flexibleData/";
boolean isFirstLoad = !Files.isDirectory(new File(datapackPath).toPath());
try {
Files.createDirectories(new File(datapackPath + "data/rug/recipes").toPath());
Files.createDirectories(new File(datapackPath + "data/rug/advancements").toPath());
Expand Down Expand Up @@ -119,6 +120,9 @@ public void onServerLoadedWorlds(MinecraftServer server) {
);
}
reload(server);
if (isFirstLoad) {
server.getCommandManager().execute(server.getCommandSource(), "/datapack enable \"file/Rug_flexibleData\"");
}
}

private void registerCraftingRule(String ruleName, String[] recipes, String recipeNamespace, String datapackPath, MinecraftServer server) {
Expand Down

0 comments on commit 70eb150

Please sign in to comment.