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

Portal Mechanics (Closes #130) #1024

Open
wants to merge 30 commits into
base: dev
Choose a base branch
from

Conversation

heisluft
Copy link
Contributor

@heisluft heisluft commented Feb 13, 2019

This PR implements the creation of nether portals and implements the actual travelling to the nether via portal as well as generating portals in the nether. It also implements any Bukkit / Spigot / PaperSpigot Event related to Portals and their mechanics.
This will fix one of Glowstone´s oldest issues while greatly expanding it´s functionality as a vanilla server.

What is implemented:

  • Creation of nether portals by players
  • Destroying Nether Portals
  • Zombie Pigman Portal spawns
  • Stubs of a TravelAgent (Thank you, @VaiTon )
  • Generating and linking portals
  • Travelling to the nether
  • Bukkit Portal related Event implementations
  • BUGFIX: Players somehow cannot see portal blocks

@heisluft
Copy link
Contributor Author

heisluft commented Feb 16, 2019

This is where I'm at now
State of development

@VaiTon
Copy link
Contributor

VaiTon commented Feb 17, 2019

This is where I'm at now
State of development

Good job man!

@heisluft
Copy link
Contributor Author

Next sneak peak (chance of zombie pigman spawning increased by 1000% to shorten video length :))

Copy link
Contributor

@VaiTon VaiTon left a comment

Choose a reason for hiding this comment

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

I think it would be better if we implemented two TravelAgents, one for nether worlds and one for end ones.

@heisluft
Copy link
Contributor Author

My take on this is that each GlowWorld registers one TravelAgentImpl which then deals with portal implementation.
This also would allow us to handle Portal gen in the overworld - as Overworlds need to register both a Nether and an EndTravelAgent. getTravelAgent() in Entity/PlayerPortalEvent is not strictly required to return a consistent travelAgent but two implementations would just increase complexity (as the actual porting method is the same in both nether and end portals). Of course we could define a shared superclass but managing 3 classes + different handlers in the World class looks cumbersome to me compared to one, capable-of-everything class which can be referred to by each world in the same manner. Let me know if I missed something important in my logic

@mastercoms
Copy link
Member

@heisluft Is this still WIP or ready for review?

@heisluft
Copy link
Contributor Author

I’m sorry, I kind of lost track of this PR. After loosing some of my work to faulty git usage of mine I lost motivation to actually finish this PR. There are still features to implement concerning the actual travel to the nether and I fear this PR is getting too big if I tried to mimic exact vanilla behavior.

Don’t get me wrong though, I will continue my work on this today in order to get it working, although it will be more of a quick and dirty hack as I would have to make changes to GlowKit and seemingly unrelated code making this PR too confusing and difficult to review.

I look, however, into making a follow-up PR to GlowKit and GlowStone fixing the shortcomings of my hacky implementation.

TL;DR: No, this PR is not yet ready for review, but I continue contributing and will request review as soon as I’m done

@heisluft
Copy link
Contributor Author

heisluft commented Apr 28, 2019

Next (And probably last sneak peak).
I decided not to check wheter the bounding box of the portal block intersects the one of the player for now, so players get Teleported even if they technically are not standing in a portal. This has no other reason than not having enough time today.

EDIT: Done

@heisluft heisluft changed the title [WIP] Portal Mechanics (Closes #130) Portal Mechanics (Closes #130) Apr 29, 2019
@heisluft
Copy link
Contributor Author

Finished Work on this PR, ready for review

src/main/java/net/glowstone/entity/GlowEntity.java Outdated Show resolved Hide resolved
src/main/java/net/glowstone/util/GlowTravelAgent.java Outdated Show resolved Hide resolved
src/main/java/net/glowstone/util/pattern/PortalShape.java Outdated Show resolved Hide resolved
src/main/java/net/glowstone/util/GlowTravelAgent.java Outdated Show resolved Hide resolved
src/main/java/net/glowstone/util/pattern/PortalShape.java Outdated Show resolved Hide resolved
src/main/java/net/glowstone/util/pattern/PortalShape.java Outdated Show resolved Hide resolved
@aramperes
Copy link
Member

This is some great work! I was hoping for more unit tests though, or at least setting up the ground work by separating the calculations into readable units.

Copy link
Member

@aramperes aramperes left a comment

Choose a reason for hiding this comment

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

Final stretch!

@mastercoms
Copy link
Member

@aramperes What's left for this?

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

7 participants