I'm stuck with permissions :/

Discussion in 'Plugin Development' started by godgodgodgo, Oct 21, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    godgodgodgo

    I keep getting errors in my permissions sections so I can't build my jar file :/

    Imports:
    Code:
    import java.util.Arrays;
    import java.util.HashMap;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Event;
    import org.bukkit.plugin.Plugin;
    import org.bukkit.plugin.java.JavaPlugin;
    import org.bukkit.plugin.PluginManager;
    import com.nijiko.permissions.PermissionHandler;
    import com.nijikokun.bukkit.Permissions.Permissions;

    And the sections i'm getting errors in:
    Code:
    public class AfkKick extends JavaPlugin
    {
    	public static final Logger log = Logger.getLogger("Minecraft");
    	private final AfkKickPlayerListener playerListener = new AfkKickPlayerListener(this);
    	public static PermissionHandler Permissions = null;
    	public Boolean usingpermissions = false;
        public static HashMap<String, Long> lastonline = new HashMap<String, Long>();
        public Integer afkkickseconds = 180;
        public String afkkickmessage = "You have been kicked for idling too long, please rejoin.";
        public String afkkickbroadcast = "§e%NAME% was idling for too long and has been kicked.";
        public String afkkicklog = "§e%NAME% was idling for too long and has been kicked.";
        public List<String> afkkickexempts = Arrays.asList("");
    And:

    Code:
            Plugin permissions = getServer().getPluginManager().getPlugin("Permissions");
            if (Permissions == null)
            {
                if (permissions != null)
                {
                    Permissions = ((Permissions)permissions).getHandler();
                    log.log(Level.INFO, "{0} version {1} is enabled with permissions!", new Object[]{getDescription().getName(), getDescription().getVersion()});
                    usingpermissions = true;
                }
                else
                {
                    log.log(Level.INFO, "{0} version {1} is enabled without permissions!", new Object[]{getDescription().getName(), getDescription().getVersion()});
                    usingpermissions = false;
                }
            }
    I'd like to be able to update this plugin myself, hopefully i'll understand what you guys change and why to make it correct :)
     
  2. Offline

    thehutch

    Your trying to use the old permissions plugin by theYeti who has discontinued the plugin. Therefore you should ONLY use superPerms which is bukkits own alternative and is about 100 lines of code less for example this is it:
    Code:
    if (player.hasPermission("perm.in.here")) {
        //do stuff
    }
     
  3. Offline

    godgodgodgo

    Hey thanks for the reply! Could you possibly substitute that into the code i was using? Sorry i'm a bit of a novice :)
    Thanks
     
  4. Offline

    thehutch

    I would if I could read it but I never used the old permissions, consider this a challenge Its what I had to do when I started and practice makes perfect :p and also you have written it in a very wierd way
     
Thread Status:
Not open for further replies.

Share This Page