Skip to content

Jail integration #72

@hitechwizard

Description

@hitechwizard

I'm trying to integrate Jail with my Swear Jar plugin so that a player that doesn't have the money to pay the Swear Jar they will be jailed for x minutes. Between the Bukkit wiki and digging through source I got this far, but jailPrisoner() is protected vs. public, and I don't see anywhere to get the prisoner instance to set the jail time. Any help would be appreciated.

               if (donation < fine) {
                    Plugin plugin = getServer().getPluginManager().getPlugin("Jail");
                    if (plugin != null)
                    {
                        JailMain jailPlugin = (JailMain) plugin;
                        Jail jail = jailPlugin.getJailManager().getNearestJail(player);
                        PrisonerManager jailPM = jailPlugin.getPrisonerManager();
                        jailPlugin.getPrisonerManager().jailPrisoner(jail, null, player, "Potty Mouth");
                    }
                    else
                    {
                        Bukkit.getServer().getScheduler().callSyncMethod(this, new KickPlayer(player, "You ran out of money for the swear jar."));
                    }
                }

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions