Glowstone icon indicating copy to clipboard operation
Glowstone copied to clipboard

Cannot create nether portals

Open ghost opened this issue 8 years ago • 29 comments

Right now fireNetherPortal() is called when you use flint and steel on obsidian, but that function is empty. I'm gonna start filling that function to fire the nether portal. It would be a bit more complex, at least I think, than most things in java I've done before, but I think I can do it.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

ghost avatar Dec 17 '15 16:12 ghost

On the road is the vanilla way to reach the hell, yay! The more complex thing I guess would be to create a corresponding portal in the nether, but I don't know if you're targeting this yet.

jimmikaelkael avatar Dec 17 '15 16:12 jimmikaelkael

Well, I've been messing around with some stuff in the file that contains the function to fire a nether portal, so I thought might as well work on it while I'm focused on this file.

ghost avatar Dec 17 '15 16:12 ghost

I'm just not sure how to fire an event if the player walks into the nether portal, the creation of it should be easy, just the player walking into the portal and the spawn location in the nether will be the hard part, I could rig how it spawns in the nether for now.

ghost avatar Dec 17 '15 16:12 ghost

How do I add labels, the way github says I should doesn't work for me for some reason

ghost avatar Dec 17 '15 16:12 ghost

I think you must be a collaborator to be able to set a label.

For the event, do you meant to fire a bukkit event ?

jimmikaelkael avatar Dec 17 '15 16:12 jimmikaelkael

@jimmikaelkael Yeah

ghost avatar Dec 17 '15 17:12 ghost

You can use the EventFactory, for example a grass growth event:

BlockGrowEvent growEvent = new BlockGrowEvent(b, blockState);
EventFactory.callEvent(growEvent);
if (!growEvent.isCancelled()) {
    blockState.update(true);
}

Just checked on Bukkit API, there's a bunch of different portal events.

jimmikaelkael avatar Dec 17 '15 17:12 jimmikaelkael

@jimmikaelkael Awesome!

ghost avatar Dec 17 '15 17:12 ghost

I think that as a start, lighting an obsidian block should create a portal above it, and the portal should teleport you to the nether spawn.

mastercoms avatar Dec 17 '15 17:12 mastercoms

@mastercoms you're right, I think searching for some available room space at the corresponding coordinates in the nether to place a portal can be a bit tricky.

jimmikaelkael avatar Dec 17 '15 17:12 jimmikaelkael

How do I update my local repository to Glowstone's most recent commits?

ghost avatar Dec 17 '15 17:12 ghost

git pull

mastercoms avatar Dec 17 '15 17:12 mastercoms

It's been a while, Christmas break came and over break I built a new computer and I still haven't got things set up. I'll try and start on this during this week while I have time, but I have a college class and got to get stuff done, so who knows when this will be finished

ghost avatar Feb 03 '16 00:02 ghost

No worries!

mastercoms avatar Feb 03 '16 23:02 mastercoms

This ticket needs categorization on the waffle board.

Has this ticket seen any movement or has there been any action expected since the previous comment?

gdude2002 avatar Jun 22 '16 11:06 gdude2002

Hi, everyone! After several months I re-discovered the Glowstone project again, and now that I've some spare time I'll try to do my bit working on this feature. So far I've managed to implement a very basic logic to find an arbitrary big obsidian "frame", but I can't fill it with nether portal blocks. I tried other blocks with no problems (even the ender portal block, which surprisingly creates a vertical and functional ender portal), but when using the nether portal block it simply doesn't work. I did the following with no success:

  • Changing every block with setType(Material.PORTAL): they turn into air (I think this is the expected behavior).
  • Changing every block with setType(Material.PORTAL, false) (disables applyPhysics): they stay as portal blocks, but they're invisible and behave strangely (eg if I replace one of them with any other block, it disappears if disconnecting from server and re-connecting again).
  • Using the /setblock command to manually place portal blocks in the server: same as before, they're invisible, have a strange behavior and never make any sounds nor particle effects.

I can't figure what needs to be done server side to display the nether portal texture (in single player, using /setblock portal works perfectly). Do you have any ideas?

cabidop avatar Aug 25 '16 07:08 cabidop

Looking through spigot it seems that portals store special data

DeprecatedLuke avatar Aug 25 '16 12:08 DeprecatedLuke

Most servers provides warps and prohibit own portals anyways, so this is a minor problem imo. But at some day, it would be quite useful if that starts working, too.

The ender portal works? :o it also teleports you?

FastFelix771 avatar Aug 25 '16 12:08 FastFelix771

@DeprecatedLuke Thanks for the info! I'll dig around a little bit more to see if I can find something useful.

@FastFelix771 I know it's a minor thing, that's why I've chosen it to get more familiar with the code. And yep, an obsidian frame filled with ender portal blocks actually warps you to The End! Didn't try to build a normal ender portal though, but I guess it should work the same.

cabidop avatar Aug 25 '16 12:08 cabidop

setblock triggers psychics event btw edit: my guess psychics still run even if you set it to false

DeprecatedLuke avatar Aug 25 '16 12:08 DeprecatedLuke

Portal blocks can only exist within a nether portal structure. When the block is updated and detects it is not part of such a structure, it will remove itself.

http://minecraft.gamepedia.com/Nether_Portal_(block)

Perhaps the client refuses to display the portal block because it is not part of a nether portal structure.

Also do we have a block state for Nether portals? http://minecraft.gamepedia.com/Nether_Portal_(block)#Data_values

mastercoms avatar Aug 25 '16 15:08 mastercoms

@mastercoms I finally got it working, the problem was in the direction of what @DeprecatedLuke said: I was missing the portal orientation info. As there is no block state for Nether portals, I guess it's a good idea to create a GlowPortal class to manage this and possibly other related features (teleport, find/generate active portals in Nether).

cabidop avatar Aug 25 '16 16:08 cabidop

So I'm assuming this is no longer a problem?

BSFishy avatar Jan 07 '17 03:01 BSFishy

This has still not been implemented.

mastercoms avatar Jan 07 '17 05:01 mastercoms

Is this still needed? I can take a stab at this during my free time.

jacobsandersen avatar Mar 21 '18 02:03 jacobsandersen

As far as I know, only the teleportation to the nether world when colliding with the purple nether portal block is implemented. The formation of the portal isn't.

aramperes avatar Mar 21 '18 03:03 aramperes

This is being worked on by @heisluft: #1024

~@VaiTon has a branch with some progress on this issue: https://github.com/VaiTon/Glowstone/tree/nether-portal~

Reference: #1020

aramperes avatar Feb 09 '19 00:02 aramperes

I would like to fire a PortalCreateEvent when a portal is lit (for #922), but I can't find any updated code that creates a portal in the dev branch or @VaiTon's. Has this been implemented or can I do it?

clabe45 avatar Jun 12 '19 03:06 clabe45

@clabe45 PR #1024 is in progress (under review) and implements the PortalCreateEvent along with the rest of the portal mechanincs.

aramperes avatar Jun 12 '19 04:06 aramperes