mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-25 03:55:35 +01:00
Quest item clicking near completion
This commit is contained in:
parent
ad6a3eb363
commit
504bc995cf
@ -21,7 +21,6 @@ import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.inventory.CraftItemEvent;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.event.player.PlayerFishEvent.State;
|
||||
import org.bukkit.event.player.*;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@ -251,6 +250,9 @@ public class PlayerListener implements Listener {
|
||||
if(evt.getPlayer() instanceof Player){
|
||||
|
||||
Quester quester = plugin.getQuester(((Player)evt.getPlayer()).getName());
|
||||
if(quester.holdingQuestItemFromStorage){
|
||||
quester.collectItem(evt.getView().getCursor());
|
||||
}
|
||||
quester.holdingQuestItemFromStorage = false;
|
||||
|
||||
}
|
||||
@ -334,6 +336,8 @@ public class PlayerListener implements Listener {
|
||||
if(evt.getWhoClicked() instanceof Player)
|
||||
player = (Player) evt.getWhoClicked();
|
||||
|
||||
if(evt.isShiftClick() == false){
|
||||
|
||||
if (player != null && evt.getCursor() != null && evt.getCurrentItem() == null) {
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getWhoClicked().getName());
|
||||
@ -442,6 +446,28 @@ public class PlayerListener implements Listener {
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if(player != null && evt.getCurrentItem() != null){
|
||||
|
||||
Quester quester = plugin.getQuester(evt.getWhoClicked().getName());
|
||||
Material mat = evt.getCurrentItem().getType();
|
||||
|
||||
if(quester.currentQuest != null){
|
||||
|
||||
if(quester.currentQuest.questItems.containsKey(mat)){
|
||||
|
||||
String s = Quester.checkPlacement(evt.getInventory(), evt.getRawSlot());
|
||||
//CHECK
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
Loading…
Reference in New Issue
Block a user