Skip to content

Conversation

@Earthcomputer
Copy link
Member

@Earthcomputer Earthcomputer commented Jul 2, 2020

This PR adds Fabric support. Along with simply porting what was on my fork to the new project creator refactor, I decided to go a little further and add the following features which are not on my fork:

  • Bumped the TemplateMakerFabric dependency which fixes one or two bugs
  • Method entry points are now supported
  • Smarter entry point creation
  • Added the ability to choose the license of your mod and generate a license file with the template
  • Added some references to the fabric.mod.json, and basic fabric.mod.json validation
  • Removed 1.7.10 support (okay maybe not this last one)

Closes #663

Earthcomputer and others added 2 commits July 3, 2020 10:14
Copy link
Member

@RedNesto RedNesto left a comment

Choose a reason for hiding this comment

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

Make sure to catch IOExceptions when instanciating JarFiles, this is the only real issue I found in this PR. There's also a TODO that's not been taken care of (I guess?), the rest is pretty much formatting/styling comments.
I'll test it soon, but overall it looks good.

Comment on lines +161 to +163
StandardOpenOption.CREATE,
StandardOpenOption.WRITE,
StandardOpenOption.TRUNCATE_EXISTING
Copy link
Member

Choose a reason for hiding this comment

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

These options are redundant, they can be removed. From the method's javadoc:

If no options are present then this method works as if the CREATE, TRUNCATE_EXISTING, and WRITE options are present.

Copy link
Member Author

Choose a reason for hiding this comment

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

I copied that from CreatorStep.writeTextToFile, and those options are present explicitly in many places throughout the codebase. Someone should go through and clean that up really.

Copy link
Member

Choose a reason for hiding this comment

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

Neat, I didn't realize those were the defaults. That's good to know.

@Earthcomputer
Copy link
Member Author

Earthcomputer commented Jul 3, 2020

I had to change a little how the semver parser works. Fabric converts Minecraft versions to semver e.g. with 20w22a -> 1.16-alpha.20.22.a. However, mcdev's semver parser didn't like this perfectly valid version. Now, there are three types of version parts rather than two: ReleasePart, TextPart and PreReleasePart. The PreReleasePart consists of the last part of the main version plus "sub-parts" after the - or _. Thus, 1.16-alpha.20.22.a Is now parsed as ReleasePart.PreReleasePart, where the PreReleasePart has sub-parts TextPart.ReleasePart.ReleasePart.TextPart. Version parts are always ordered like ReleasePart > PreReleasePart > TextPart, and TextParts are ordered first by hard-coded special-cased priorities (this already existed), then lexicographically to break ties.
All old semver behaviour should have been kept; if there are no dots in sub-parts, and the sub-part is text followed by a number, then it is parsed as if the text and the number were separated by a dot.

@DarkiBoi
Copy link

DarkiBoi commented Jul 3, 2020

If this gets approved, maybe you could change the README.md and the Website accordingly too? Aka add Fabric to the supported Minecraft Development Platforms

@Earthcomputer
Copy link
Member Author

Oh right, good point

@DarkiBoi
Copy link

When is this going to get merged?

@kotx
Copy link

kotx commented Jul 21, 2020

Awesome! It'd be great if this were merged soon so we don't need to switch between plugin versions every time we need to use Fabric.

@DenWav
Copy link
Member

DenWav commented Jul 27, 2020

Took a bit of a break, sorry. Everything looks sane to me, nothing sticks out that I think really needs to be changed.

@DenWav DenWav merged commit 9e604c2 into minecraft-dev:dev Jul 27, 2020
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.

Add support for FabricMC

10 participants