Help Compiling a .JAVA

Discussion in 'Plugin Development' started by waco001, Dec 9, 2012.

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

    waco001

    Hi guys, I was wondering if someone could or maybe help me compile my .java file? I made a listener for my votifier plugin... I just can't compile it in my own computer for some reason... I wrote it in eclipse but I cant get teh .class file! I looked in the bin part of my project and its not there and when it was there once, it was an empty file... Can someone help me? Idk if this is a problem, but I included Votifier.jar and the latest Craftbukkit beta build in my build path... Ill include my code for anyone who wants it... Please Help Me and Thanks =D

    Code:
    import java.io.BufferedWriter;
    import java.io.FileWriter;
    import java.util.logging.Level;
    import java.util.logging.Logger;
     
    import org.bukkit.Bukkit;
    import org.bukkit.ChatColor;
    import org.bukkit.entity.Player;
    import org.bukkit.potion.PotionEffect;
    import org.bukkit.potion.PotionEffectType;
     
    import com.vexsoftware.votifier.model.Vote;
    import com.vexsoftware.votifier.model.VoteListener;
     
    public abstract class WCListener
    implements VoteListener
    {
        public static final String FILE = "./plugins/Votifier/votes.log";
        private static final Logger log = Logger.getLogger("WCVoteListener");
        public void voteMade(Vote vote)
        {
            String username = vote.getUsername();
            Player player = Bukkit.getServer().getPlayer(username);
            try
            {
                BufferedWriter writer = new BufferedWriter(new FileWriter("./plugins/Votifier/votes.log", true));
                writer.write(vote.toString());
                writer.newLine();
                writer.flush();
     
                writer.close();
            } catch (Exception ex) {
                log.log(Level.WARNING, "Unable to log vote: " + vote);
            }
            player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 60 * 20, 5));
            Bukkit.getServer().broadcastMessage("[" + ChatColor.GREEN + "Wackocraft" + ChatColor.RESET + "] " + ChatColor.GREEN + player.getDisplayName() + " has voted and recieved special effects!");
        }
    }
     
  2. Offline

    tommycake50

    you can export it as a .jar and then extract the .class file out of it.
     
  3. Offline

    waco001

    I just need the class file to be compiled into.
     
  4. Offline

    tommycake50

    Ik
     
  5. Offline

    waco001

    Ok Ill try that Thx
     
  6. Offline

    fireblast709

    waco001 final question: why the heck do you need the .class files when you write a plugin, which is .jar?
     
  7. Offline

    waco001

    Im writing a votifier listener that needs to be in a class file
     
  8. Offline

    tommycake50

    votifier loads .class files.
     
  9. Offline

    lenis0012

    export is as a jar file and open it with a.k.a win.rar then get the class file out of it
     
  10. Offline

    fireblast709

    O...m...g... worst way I have ever seen. Why do they not just use dependecy >->
     
  11. Offline

    tommycake50

    it doesnt load plugins it loads listeners.
    there are many different types of listeners that anyone can make.
    it calls the voteMade() method in the listener classes when a vote is made.
    its actually not that bad a way to do it.
     
  12. Offline

    fireblast709

    Have you ever took a look into their source code?
     
  13. Offline

    tommycake50

    no i havn't.
     
  14. Offline

    fireblast709

  15. Offline

    tommycake50

Thread Status:
Not open for further replies.

Share This Page