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

Nether portals and mechanics #426

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Conversation

JustTalDevelops
Copy link
Member

@JustTalDevelops JustTalDevelops commented Feb 19, 2022

Heavily based around the MiNET, GlowstoneMC, and DimensionPortals implementations.

I'm not entirely sure on the API of this still but I believe this should all work functionality wise.

Closes #385.

@JustTalDevelops
Copy link
Member Author

@T14Raptor @Sandertv Would appreciate your feedback on this!

server/world/world.go Outdated Show resolved Hide resolved
server/player/player.go Outdated Show resolved Hide resolved
@T14Raptor
Copy link
Member

Just realized that this will need to support all entities and not just players

Copy link
Member

@Sandertv Sandertv left a comment

Choose a reason for hiding this comment

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

Couple of comments, I have yet to actually check the portal logic.

server/block/portal.go Outdated Show resolved Hide resolved
}

// AABB ...
func (p Portal) AABB(cube.Pos, *world.World) []physics.AABB {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this should return a non-empty AABB. Once we implement suffocation I imagine it'll use the AABB of the block to decide if an entity should suffocate, but this wouldn't work properly with that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, this would cause issues with the logic to check if the player is intersecting with a portal block though, no?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it would. We might need to put the AABB for that somewhere else. Blocks like water have a zero AABB as well at the moment.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe models should have a function to tell whether the block is "solid" or not.

Copy link
Member Author

Choose a reason for hiding this comment

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

Any idea if/how I should change this? I am a bit stuck here.

Copy link
Member

@T14Raptor T14Raptor Mar 15, 2022

Choose a reason for hiding this comment

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

Maybe models should have a function to tell whether the block is "solid" or not.

@Sandertv

Copy link
Member Author

Choose a reason for hiding this comment

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

Is this still a big issue, given suffocation is now implemented? Although I do think a function to tell if blocks are solid or not would be helpful, especially for MovementComputer-based entities.

server/entity/travel.go Outdated Show resolved Hide resolved
}

// Traveller represents a world.Entity that can travel between worlds.
type Traveller interface {
Copy link
Member

Choose a reason for hiding this comment

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

Not sure if I'm a massive fan of the term Travel and Traveller, it really doesn't make it clear that this is about portals. Do you reckon we could name this anything else?

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 am honestly not sure, I'm pretty awful at naming things lmao

Copy link
Member Author

Choose a reason for hiding this comment

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

Do you have any suggestions?

server/player/player.go Outdated Show resolved Hide resolved
server/world/entity.go Show resolved Hide resolved
server/world/world.go Outdated Show resolved Hide resolved
server/entity/travel.go Outdated Show resolved Hide resolved
@JustTalDevelops JustTalDevelops added the feature New feature or request label Jul 14, 2022
@DaPigGuy DaPigGuy mentioned this pull request Jul 14, 2022
89 tasks
# Conflicts:
#	server/block/fire.go
#	server/block/register.go
#	server/entity/item.go
#	server/entity/movement.go
#	server/player/player.go
#	server/world/dimension.go
#	server/world/world.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement nether portals and their mechanics
3 participants