rmct / AutoReferee

Bukkit plugin for automatically refereeing competitive Minecraft matches.
http://rmct.github.com/AutoReferee
GNU General Public License v3.0
35 stars 19 forks source link

Create no-enderpearl regions #240

Open skitrip42 opened 8 years ago

skitrip42 commented 8 years ago

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 commented 8 years ago

242 maybe?

skitrip42 commented 8 years ago

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 commented 8 years ago

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 commented 4 years ago

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.