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

Create no-enderpearl regions #240

Open
skitrip42 opened this issue Apr 21, 2016 · 4 comments
Open

Create no-enderpearl regions #240

skitrip42 opened this issue Apr 21, 2016 · 4 comments

Comments

@skitrip42
Copy link

There have been issues with creating a rule whereby using pearls to bypass bedrock barriers is not allowed, but it is still allowed to pearl through the void in twisted maps. One solution to this would be to allow mapmakers to create no-pearling zones in the config files for maps that players would not be able to throw enderpearls through. Mapmakers could then place these zones to cover parts of dungeons that are open to the void.

The zone could simply destroy any pearls that enter it, but it would make sense for the player who threw the pearl to be killed in the same way that they are when they enter the void lane, (i.e. with no items dropped). This to punish them for breaking a rule, and also because it is possible that the pearl would have hit a wall if it hadn't been destroyed, killing the player anyway. It would be weird if this change actually caused someone to survive something that should have killed them because they broke a rule.

@net
Copy link
Member

net commented Oct 4, 2016

#242 maybe?

@skitrip42
Copy link
Author

So I think the best way to implement this, as I mentioned in the Slack chat, would be for the 'zone' to actually just be a 2D barrier that mapmakers could place between a dungeon and the void lane. That way the only way a pearl could hit the barrier would be if someone pearled into or out of the dungeon. Is that what Char's code does?

@net
Copy link
Member

net commented Oct 4, 2016

Char's code kills any enderpearls passing through a no-enderpearl zone without affecting the player. It could be easily modified into a barrier though.

@mxsdev
Copy link
Contributor

mxsdev commented Mar 23, 2020

Implemented in my fork of AR.

Solution is two-fold:

To remove ender-pearls in the void lane, you can create a custom EntityEnderPearl class and override the _t() method.

You also need to decide which regions are dungeons and which aren't. I accomplished this using the JGraphT library and by considering the entire map as one graph. Then the points in dungeons are computed and saved in a "regions.json" file, which is then loaded when the map loads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants