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

Support for item polys and a bunch of refactoring #2

Open
wants to merge 4 commits into
base: 1.19
Choose a base branch
from

Conversation

Siphalor
Copy link

@Siphalor Siphalor commented Sep 3, 2022

This PR was created in the intention of implementing support for the item poly syntax as it can be seen in the README.

During the implementation, I refactored a bunch of the existing code so that it subjectively has a nicer structure.
For example, I made the entries, which were previously inner record classes of the parsers, their own classes (to be able to extend from a common super class).
The parsers are now inner classes of the entries and also have a common super class.

These common super classes unify some duplicated code that would have been present in block, item and entity polys.

I also noticed that the code indentation of the PolyConfig class used tabs where every other class used spaces, so I changed that too.

Since there didn't seem to be a clear concept of item groups yet (in the sense of polys), I‌ decided to create an own enum from some cases seen in PolyMC's ItemPolyGenerator.

I hope that this is at least somewhat useful, even if the changes might not be in your spirit :)

# Conflicts:
#	src/main/java/nl/theepicblock/polyconfig/PolyConfig.java
#	src/main/java/nl/theepicblock/polyconfig/block/BlockNodeParser.java
#	src/main/java/nl/theepicblock/polyconfig/block/BlockStateSubgroup.java
#	src/main/java/nl/theepicblock/polyconfig/entity/EntityNodeParser.java
@Siphalor
Copy link
Author

Merged the changes from 1.19.

Since BlockGroup still exists (unused)‌, I decided to keep my ElementGroup abstraction.
Even if it's now only really used by the item code.

@Siphalor
Copy link
Author

Siphalor commented Oct 9, 2022

Resolved the mere conflict: I already fixed the upstream bug, but moved the code to a different class, so it resulted in a small merge conflict.

Still patiently waiting for your feedback :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant