Advertisement
Guest User

RespawnHealthRunnable.java

a guest
Jul 31st, 2011
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.91 KB | None | 0 0
  1. package com.wwsean08.RespawnHealth;
  2.  
  3. import org.bukkit.entity.Player;
  4.  
  5. public class RespawnHealthRunnable implements Runnable{
  6.     @SuppressWarnings("unused")
  7.     //the variables, the plugin may not have been necessary, but I was going off of someone elses example, so i suppressed that it was unused.
  8.     private RespawnHealthPlayerListener plugin;
  9.     private Player player;
  10.     private int newHealth;
  11.     RespawnHealthRunnable(Player newPlayer, int Health, RespawnHealthPlayerListener instance){
  12.         player = newPlayer;
  13.         plugin = instance;
  14.         newHealth = Health;
  15.     }
  16.     @Override
  17.     //this is a special method that is required whenever you schedule a task, the run method is what is required when you implement runnable.
  18.     //It is what does all the work of the thread.  Like I've said before i'm not good with threads so any questions I will leave for those that are better
  19.     public void run() {
  20.         player.setHealth(newHealth);
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement