EssentialsX

EssentialsX

2M Downloads

Chorus Fruit and Jail

Tomographix opened this issue · 8 comments

commented

If a player is jailed with a Chorus fruit in their inventory they can eat the chorus fruit to teleport out of the jail.

commented

i don't know what that is

commented

Its a 1.9 thing. You eat it and it teleports you somewhere random in a certain block radius. I believe they grow in the end.

-----Original Message-----
From: "Trent Hensler" [email protected]
Sent: ‎04/‎03/‎2016 05:58 PM
To: "drtshock/Essentials" [email protected]
Subject: Re: [Essentials] Chorus Fruit and Jail (#459)

i don't know what that is

Reply to this email directly or view it on GitHub.

commented

What HunterGPlays said. It is a new type of plant located in the End. The fruit from it you can eat and it teleports you randomly.

commented

So it needs to disallow players to eat/use certain items while in jail. think this issue happened with enderpearls when they were first added way back when

commented

Requesting this PR be closed.

This is solved by https://github.com/EssentialsX/Essentials/blob/2.x/Essentials/src/com/earth2me/essentials/Jails.java#L224-L241 since the event sets teleporting jailed players back to the user's jail.

        @EventHandler(priority = EventPriority.HIGH)
        public void onJailPlayerTeleport(final PlayerTeleportEvent event) {
            final User user = ess.getUser(event.getPlayer());
            if (!user.isJailed() || user.getJail() == null || user.getJail().isEmpty()) {
                return;
            }

            try {
                event.setTo(getJail(user.getJail()));
            } catch (Exception ex) {
                if (ess.getSettings().isDebug()) {
                    LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()), ex);
                } else {
                    LOGGER.log(Level.INFO, tl("returnPlayerToJailError", user.getName(), ex.getLocalizedMessage()));
                }
            }
            user.sendMessage(tl("jailMessage"));
        }
commented

This is still a bug in 2.16.1.

commented

Closing as this appears to be fixed.

commented

I can't reproduce this bug on the following versions (clean Paper install, no other plugins):

[19:02:32 INFO]: CONSOLE issued server command: /ess version
[19:02:32 INFO]: Server version: 1.14.4-R0.1-SNAPSHOT git-Paper-209 (MC: 1.14.4)
[19:02:32 INFO]: EssentialsX version: 2.17.1.17
[19:02:32 INFO]: Vault is not installed. Chat and permissions may not work.