Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package server.skills;
- import server.client;
- import java.util.HashMap;
- public class PotEnum {
- public static int herbEmote = 363;
- public static long actionInterval = 1250;
- public static long lastAction = System.currentTimeMillis();
- static enum Pots {
- POT1 ( 3046, 3046, 3044, "2"),
- POT2 ( 6571, 94, 8150, "3");
- int firstItem, secondItem, newItem;
- String dosesLeft;
- static HashMap<Integer, Pots> combinePots = new HashMap<Integer, Pots>();
- static {
- for (final Pots f : Pots.values()) {
- Pots.combinePots.put(f.firstItem, f);
- //Pots.combinePots.put(f.secondItem, f);
- }
- }
- static Pots forId(final int id) {
- return Pots.combinePots.get(id);
- }
- Pots(int firstItem, int secondItem, int newItem, String dosesLeft) {
- this.firstItem = firstItem;
- this.secondItem = secondItem;
- this.newItem = newItem;
- this.dosesLeft = dosesLeft;
- }
- public static void potOnPot(client p, int itemUsed, int useWith) {
- if (System.currentTimeMillis() - lastAction < actionInterval)
- return;
- final Pots f = Pots.combinePots.get(itemUsed);
- //Pots.combinePots.get(useWith);
- lastAction = System.currentTimeMillis();
- p.deleteItem(f.firstItem, 1);
- p.deleteItem(f.secondItem, 1);
- p.addItem(f.newItem, 1);
- p.setAnimation(herbEmote);
- p.sM(new StringBuilder() .append("You have combined the liquid into ") .append(f.dosesLeft) .append(" doses").toString());
- }
- }
- }
Add Comment
Please, Sign In to add comment