Trying to get my plugin to work on a paying hosting >:I

Discussion in 'Plugin Development' started by ForbiddenGaming, Jun 25, 2015.

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

    ForbiddenGaming

    I tried my plugin on my cracked server, it worked, however when I put my plugin into my friend's paying hosting, it wouldn't load.
    Here is the java code:
    package me.MCGamingGod.BountyGUI;


    import java.util.logging.Logger;

    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.World;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;

    public class BountyGUI extends JavaPlugin{
    public final Logger logger = Logger.getLogger("Minecraft");
    public static BountyGUI plugin;

    public void onDIsable() {
    this.logger.info("Hub Has Been Disabled!");

    }

    public void onEnable() {

    this.logger.info("Hub Enabled!");
    }


    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    Player player = (Player) sender;
    if(commandLabel.equalsIgnoreCase("hub")){
    player.sendMessage(ChatColor.GREEN + "Sending You To Hub");
    World world = Bukkit.getWorld("world");
    Location Hub = new Location(world, 2.5, 7, -2.5 );
    player.teleport(Hub);
    return true;



    }



    return false;
    }
    }
     
  2. Offline

    Fizz_

    It could be a plethora of reasons, you never provided the error. Ask your friend what the error is in the console then we can help you. Also when you post code enclose it in [.CODE][/.CODE] without the period, like this:

    Code:
    package me.MCGamingGod.BountyGUI;
    
    
    import java.util.logging.Logger;
    
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.World;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class BountyGUI extends JavaPlugin{
    public final Logger logger = Logger.getLogger("Minecraft");
    public static BountyGUI plugin;
    
    public void onDIsable() {
    this.logger.info("Hub Has Been Disabled!");
    
    }
    
    public void onEnable() {
    
    this.logger.info("Hub Enabled!");
    }
    
    
    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){ 
    Player player = (Player) sender;
    if(commandLabel.equalsIgnoreCase("hub")){ 
    player.sendMessage(ChatColor.GREEN + "Sending You To Hub");
    World world = Bukkit.getWorld("world");
    Location Hub = new Location(world, 2.5, 7, -2.5 );
    player.teleport(Hub);
    return true;
    
    
    
    }
    
    
    
    return false; 
    }
    }
     
  3. Offline

    TehHypnoz

    Can you post the stacktrace? You most likely compiled your plugin with a higher Java version than the version that the server is running.
     
  4. Offline

    WingedMLGPro

    @ForbiddenGaming It could be the Servers Java and the Java u use! Thats what happened to me!
     
  5. Offline

    MCMatters

    naming conventions.
     
    KingFaris11 likes this.
  6. Code:
    public void onDIsable() {
      this.logger.info("Hub Has Been Disabled!");
    }
    This will never get called, use @Override to make sure it it overridden properly. And as MCMatters said, java naming conventions. Look on google for further info.
     
  7. Offline

    Hawktasard

    @Fizz_
    My guess is that you compiled the code with a version older than what the provider has installed (probably Java 7/8)
    Other than that you should remove the static instance, it is never used and can not be used as you never actually set it to anything, and for a logger you can use getLogger() instead of using the "Minecraft" logger.
     
  8. What do you mean by cracked server? Do you mean cracked as in its set in offline mode?
     
Thread Status:
Not open for further replies.

Share This Page