Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow users to define their own item/entity lists #6865

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

Warriorrrr
Copy link
Member

@Warriorrrr Warriorrrr commented Jul 19, 2023

Description:


New Nodes/Commands/ConfigOptions:


Relevant Towny Issue ticket:


  • I have tested this pull request for defects on a server.

By making this pull request, I represent that I have the right to waive copyright and related rights to my contribution, and agree that all copyright and related rights in my contributions are waived, and I acknowledge that the TownyAdvanced organization has the copyright to use and modify my contribution under the Towny License for perpetuity.

@Warriorrrr Warriorrrr force-pushed the feat/configurable-registry-lists branch from 85da3e2 to 466dcf7 Compare July 30, 2023 10:23
@Warriorrrr Warriorrrr force-pushed the feat/configurable-registry-lists branch from 7546db6 to e3f16c6 Compare November 24, 2023 07:51
@Warriorrrr Warriorrrr force-pushed the feat/configurable-registry-lists branch from e3f16c6 to 3de76da Compare February 24, 2024 20:39
@Warriorrrr Warriorrrr marked this pull request as ready for review February 25, 2024 17:26
@LlmDl
Copy link
Member

LlmDl commented Feb 26, 2024

Running the version compiled from newest commit appears to have changed my townblocktypes section to this

  
townblocktypes:
  types: ''

Comment on lines +3157 to +3284
"# This section of the config allows you to specify custom lists of blocks or entities, that can then be used elsewhere in the config.",
"# A custom syntax is used to specify whether to include or exclude certain patterns from the resulting set.",
"#",
"# Format:",
"# *string: Includes all elements that end with 'string'",
"# string*: Includes all elements that start with 'string'",
"# !*string: Excludes all elements that don't end with 'string'",
"# !string*: Excludes all elements that don't start with 'string'",
"# #tag: Includes all elements that are contained in the given tag, valid tags can be found here: https://github.com/misode/mcmeta/tree/data/data/minecraft/tags in the blocks or entity_type folders.",
"# !#tag: Excludes all elements that are contained in the given tag",
"# +string: Includes the element with name 'string'",
"# -string: Excludes the element with name 'string'",
"# ~string: Includes all elements that contain 'string' in the name",
"# !~string: Excludes all elements that contain 'string' in the name",
"# c:class: Includes all elements that are instances of the given class"),
Copy link
Member

Choose a reason for hiding this comment

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

This ought to be boxed in with a header like the other config sections, if the header is a bit wider than they are normally that's fine.

@@ -705,10 +712,10 @@ private static void setDefaults(String version, Path configPath) {
} else if (root.getRoot().equals(ConfigNodes.LAST_RUN_VERSION.getRoot())) {
setNewProperty(root.getRoot(), getLastRunVersion(version));
} else if (root.getRoot().equals(ConfigNodes.TOWNBLOCKTYPES_TYPES.getRoot())) {
setNewProperty(root.getRoot(), root.getDefault());
setNewProperty(root.getRoot(), root.defaultValue());
Copy link
Member

Choose a reason for hiding this comment

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

In my experience handling maps gets a bit weird, this is likely the point where townblocktypes stopped working. I ran into something similar in TownyChat when changing the channels.yml over to commented config.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's because setNewProperty used to always toString the value, but this is removed here

@Warriorrrr Warriorrrr marked this pull request as draft April 2, 2024 21:43
@Warriorrrr Warriorrrr mentioned this pull request May 5, 2024
1 task
@Warriorrrr Warriorrrr force-pushed the feat/configurable-registry-lists branch from e74d5ed to d074fa8 Compare May 5, 2024 08:37
@Warriorrrr Warriorrrr force-pushed the feat/configurable-registry-lists branch from d074fa8 to ddb8366 Compare September 8, 2024 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants