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

GameWorlds and GameModes #415

Merged
merged 6 commits into from
Dec 27, 2018
Merged

GameWorlds and GameModes #415

merged 6 commits into from
Dec 27, 2018

Conversation

Poslovitch
Copy link
Member

See #408.

I just started the branch by creating an UML Class Diagram, which I'd like us to review before I start working on this - and so we are actually 100 % about what's going to change.
gameworlds-and-gamemodes-v1

@Poslovitch Poslovitch self-assigned this Dec 24, 2018
Conflicts:
	src/main/java/world/bentobox/bentobox/managers/SchemsManager.java
Removes debug from previous commit.

Relates to #415
tastybento added a commit to BentoBoxWorld/AcidIsland that referenced this pull request Dec 25, 2018
@tastybento
Copy link
Member

I had a go at the implementation so please have a look at it and let me know what you think. It's okay to criticize! I'm not sure if I got it right.

A few comments:

  • GameMode is already taken by Bukkit, so I used GameModeAddon, which is an accurate description
  • The general approach is that when a GameModeAddon is loaded, BentoBox will automatically call the createWorlds() method that the GameModeAddon must override. This method must generate worlds and assign them to the appropriate variables. After that, BentoBox will then load any schems in the add-on jar or schem folder automatically. This is nice.
  • I couldn't work out how GameWorld class would work. Maybe my brain is soaked with too much Christmas wine! Anyway, I just put the required methods into GameModeAddon because it seems to fit there. Please feel free to explain it more if you think it's needed.
  • Have a look at the AcidIsland branch I made that uses this API. You can compare the differences. With this new approach, I get rid of a whole class and the code is generally nicer. Let me know what you think. Again, I may have gone completely in the wrong direction, so let me know.
  • GameModeAddons no longer have to explicitly declare the world they apply to in a CompositeCommand because it can be obtained automatically. This is nice. There may be more optimization of the code possible now that GameModeAddons exist.

Merry Christmas!

@tastybento
Copy link
Member

Easy comparison link: develop...gameworlds-and-gamemodes

Copy link
Member Author

@Poslovitch Poslovitch left a comment

Choose a reason for hiding this comment

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

Okay, I cannot approve nor request changes as I'm the PR's author. But yet, I approve the merge of this PR.

@Poslovitch
Copy link
Member Author

There is a conflict with SchemsManager. Does this PR supports the multiple-schems that were added recently?

@Poslovitch Poslovitch removed their assignment Dec 27, 2018
@tastybento
Copy link
Member

Let me resolve the conflicts.

@tastybento tastybento merged commit bd31573 into develop Dec 27, 2018
@tastybento tastybento deleted the gameworlds-and-gamemodes branch December 27, 2018 19:22
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.

2 participants