Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class CoalDeposit {
- public static void depositCoal(final Player p) {
- if(p.getInventory().containsItem(453, 1)){
- CycleEventHandler.getSingleton().addEvent(p, new CycleEvent() {
- @Override
- public void execute(CycleEventContainer container) {
- if(!p.getInventory().containsOneItem(453)){
- container.stop();
- return;
- }
- if(p.depositedCoal > 120){
- p.getPackets().sendGameMessage("You cannot deposit more coal. You already deposited 120.");
- container.stop();
- return;
- }
- /*if(p.getX() != 3107 || p.getY() != 3501){
- container.stop();
- return;
- }*/
- if(p.getInventory().containsItem(453, 1)){
- //p.turnPlayerTo(3108, 3501);
- p.depositedCoal++;
- p.getPackets().sendGameMessage("You deposit some coal.. You've now deposit a total of "+p.depositedCoal+" ores.");
- p.getInventory().deleteItem(453, 1);
- }
- }
- @Override
- public void stop() {
- }
- }, 3); //9 sec
- } else {
- p.getPackets().sendGameMessage("You can only deposit coal here.");
- return;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement