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

Make the difficulty cataloguetype ID not include the resource location. Fixes SpongeAPI-#1254 #819

Merged
merged 3 commits into from
Sep 4, 2016

Conversation

me4502
Copy link
Contributor

@me4502 me4502 commented Jun 27, 2016

In reference to SpongePowered/SpongeAPI#1254

This uses just the name for the ID of Difficulty, rather than the resource location.

It makes more sense to use just the name, as it firstly fixes the issue above, and the ID should be something easily identifiable, which options.difficulty.etc isn't,

Edit:
This was tested by running

System.out.println(Sponge.getGame().getRegistry().getType(Difficulty.class, "easy"));
The output was
Optional[EASY]

this.difficultyMappings.put("easy", (Difficulty) (Object) EnumDifficulty.EASY);
this.difficultyMappings.put("normal", (Difficulty) (Object) EnumDifficulty.NORMAL);
this.difficultyMappings.put("hard", (Difficulty) (Object) EnumDifficulty.HARD);
this.difficultyMappings.put("minecraft:peaceful", (Difficulty) (Object) EnumDifficulty.PEACEFUL);
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll need to override provideCatalogMap.

@Aaron1011 Aaron1011 merged commit a3303c8 into bleeding Sep 4, 2016
Aaron1011 added a commit that referenced this pull request Sep 4, 2016
@stephan-gh stephan-gh deleted the fix/difficulty-catalogue branch September 29, 2016 20:09
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.

None yet

2 participants