Skip to content

Commit

Permalink
Automatically add PALE_OAK_LOG,PALE_MOSS_BLOCK,PALE_MOSS_CARPET,PALE_…
Browse files Browse the repository at this point in the history
…OAK_SAPLING,PALE_HANGING_MOSS,PALE_OAK_LEAVES,CLOSED_EYEBLOSSOM,OPEN_EYEBLOSSOM to farm allowed blocks

Signed-off-by: Momshroom <[email protected]>
  • Loading branch information
Momshroom committed Jan 30, 2025
1 parent 81f17ce commit 824d527
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Towny/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<artifactId>towny</artifactId>
<packaging>jar</packaging>
<version>0.101.1.1</version>
<version>0.101.1.2</version>

<licenses>
<license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,16 @@ else if (Boolean.parseBoolean(config.getString("notification.notifications_appea
private static final Consumer<CommentedConfiguration> DISABLE_MODERN_ECO = config -> {
config.set(ConfigNodes.ECO_ADVANCED_MODERN.getRoot(), "false");
};

/**
* Adds 1.21.4 Pale Oak items to farm blocks
*/
private static final Consumer<CommentedConfiguration> ADD_PALE_OAK_TO_FARM_PLOT = config -> {
for (Map<?, ?> plotType : config.getMapList("townblocktypes.types")) {
if (plotType.get("name").equals("farm")) {
String allowedBlocks = (String) plotType.get("allowedBlocks");
((Map<String, Object>) plotType).replace("allowedBlocks", "PALE_OAK_LOG,PALE_MOSS_BLOCK,PALE_MOSS_CARPET,PALE_OAK_SAPLING,PALE_HANGING_MOSS,PALE_OAK_LEAVES,CLOSED_EYEBLOSSOM,OPEN_EYEBLOSSOM," + allowedBlocks);
}
}
};
}
9 changes: 9 additions & 0 deletions Towny/src/main/resources/config-migration.json
Original file line number Diff line number Diff line change
Expand Up @@ -894,5 +894,14 @@
"value": ",TRIAL_SPAWNER"
}
]
},
{
"version": "0.101.1.2",
"changes": [
{
"type": "RUNNABLE",
"key": "add_pale_oak_to_farm_plot"
}
]
}
]

0 comments on commit 824d527

Please sign in to comment.