mirror of
https://github.com/PikaMug/Quests.git
synced 2024-11-22 10:36:09 +01:00
Unstable
This commit is contained in:
parent
97a48db886
commit
b5481a7663
@ -26,6 +26,7 @@ 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.CraftingInventory;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@ -276,7 +277,19 @@ public class PlayerListener implements Listener {
|
||||
|
||||
if(evt.isShiftClick()){
|
||||
|
||||
evt.
|
||||
final int amntBefore = Quests.countInv(evt.getInventory(), evt.getCurrentItem().getType());
|
||||
final Material mat = evt.getCurrentItem().getType();
|
||||
final Inventory inv = evt.getInventory();
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable(){
|
||||
|
||||
@Override
|
||||
public void run(){
|
||||
|
||||
int amntAfter = Quests.countInv(evt.getInventory(), mat);
|
||||
|
||||
}
|
||||
|
||||
}, 5);
|
||||
|
||||
}
|
||||
|
||||
|
@ -25,9 +25,7 @@ import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.inventory.InventoryType;
|
||||
import org.bukkit.inventory.Inventory;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.bukkit.inventory.*;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
@ -3800,9 +3798,20 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
|
||||
return null;
|
||||
}
|
||||
|
||||
public int getCraftTimes(Inventory i, Recipe r){
|
||||
public static int countInv(Inventory inv, Material m){
|
||||
|
||||
return 0;
|
||||
int count = 0;
|
||||
|
||||
for(ItemStack i : inv.getContents()){
|
||||
|
||||
if(i != null){
|
||||
if(i.getType().equals(m))
|
||||
count += i.getAmount();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return count;
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,8 @@ public class StageTimer implements Runnable{
|
||||
|
||||
Player player = plugin.getServer().getPlayerExact(quester.name);
|
||||
|
||||
if(quester.currentQuest != null){
|
||||
|
||||
if(quester.currentQuest.stages.indexOf(quester.currentStage) == (quester.currentQuest.stages.size() - 1)){
|
||||
|
||||
if(quester.currentStage.script != null)
|
||||
@ -59,4 +61,6 @@ public class StageTimer implements Runnable{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user