Advertisement
Guest User

Hunt

a guest
Jul 26th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.20 KB | None | 0 0
  1. package me.Ruud.Hunt;
  2.  
  3. import org.bukkit.Location;
  4. import org.bukkit.block.Block;
  5.  
  6. import java.util.ArrayList;
  7.  
  8. /**
  9.  * @author Ruud.
  10.  */
  11. public class Hunt {
  12.  
  13.     private static ArrayList<Hunt> hunts = new ArrayList<>();
  14.     private String name;
  15.     private ArrayList<PressurePlate> pressurePlates = new ArrayList<>();
  16.  
  17.     public Hunt(String name) {
  18.         this.name = name;
  19.     }
  20.  
  21.     public static Hunt getHunt(String name) {
  22.         if (!hunts.contains(name)) {
  23.             System.out.println("This hunt isn't created yet.");
  24.             return null;
  25.         }
  26.         return hunts.get(hunts.indexOf(name));
  27.     }
  28.  
  29.     public void addPressurePlate(Location location, Block block) {
  30.         if (getHunt(name) != null) {
  31.             getHunt(name).pressurePlates.add(new PressurePlate(location, block));
  32.         }
  33.     }
  34.  
  35.     public String getName() {
  36.         return name;
  37.     }
  38.  
  39.     public void setName(String name) {
  40.         this.name = name;
  41.     }
  42.  
  43.     public ArrayList<PressurePlate> getPressurePlates() {
  44.         return pressurePlates;
  45.     }
  46.  
  47.     public void setPressurePlates(ArrayList<PressurePlate> pressurePlates) {
  48.         this.pressurePlates = pressurePlates;
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement