Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1. package me.drbooker.bookrestart;
  2.  
  3. import java.io.File;
  4. import java.io.IOException;
  5.  
  6. import org.bukkit.command.Command;
  7. import org.bukkit.command.CommandSender;
  8. import org.bukkit.plugin.Plugin;
  9. import org.bukkit.plugin.java.JavaPlugin;
  10.  
  11. public class Main extends JavaPlugin {
  12.    
  13.     public static Plugin pl;
  14.    
  15.     @Override
  16.     public void onEnable() {
  17.         System.out.println("BookRestart");
  18.         System.out.println("Author: Booker");
  19.         pl = this;
  20.     }
  21.    
  22.     @Override
  23.     public void onDisable() {
  24.         System.out.println("BookRestart");
  25.         System.out.println("Author: Booker");
  26.     }
  27.    
  28.     public static Plugin getInst() {
  29.         return pl;
  30.     }
  31.    
  32.     public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
  33.         if(cmd.getName().equalsIgnoreCase("juejczsi")) {
  34.             String path = new File(getDataFolder().getParentFile().getParentFile(), "skrypt.sh restart").getAbsolutePath();
  35.             try {
  36.                 Runtime.getRuntime().exec("bash " + path);
  37.             } catch (IOException e) {
  38.                 e.printStackTrace();
  39.             }
  40.         }
  41.         return false;
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement