mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-03-12 13:19:23 +01:00
Small fixes
- Fixed PlayerData error - Fixed ArrayIndexOutOfBoundsException in MI command
This commit is contained in:
parent
8d876e49b0
commit
be44a8cbc5
@ -188,8 +188,13 @@ public class MMOItems extends JavaPlugin {
|
||||
* allows now to use a glitchy itemEquipEvent. must be called after
|
||||
* loading the config since it checks for a config option
|
||||
*/
|
||||
Bukkit.getScheduler().runTaskTimer(this, () -> Bukkit.getOnlinePlayers().forEach(player -> PlayerData.get(player).checkForInventoryUpdate()),
|
||||
100, getConfig().getInt("inventory-update-delay"));
|
||||
Bukkit.getScheduler().runTaskTimer(this, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
for(Player player : Bukkit.getOnlinePlayers())
|
||||
PlayerData.get(player).checkForInventoryUpdate();
|
||||
}
|
||||
}, 100, getConfig().getInt("inventory-update-delay"));
|
||||
|
||||
if (Bukkit.getPluginManager().getPlugin("Residence") != null) {
|
||||
flagPlugin = new ResidenceFlags();
|
||||
|
@ -1099,8 +1099,13 @@ public class MMOItemsCommand implements CommandExecutor {
|
||||
"Usage: /mi <type> <item> (player) (min-max) (unident-chance) (drop-chance)");
|
||||
|
||||
// target
|
||||
Player target = args.length > 2 ? Bukkit.getPlayer(args[2]) : (Player) sender;
|
||||
Validate.notNull(target, "Could not find player called '" + args[2] + "'.");
|
||||
Player target;
|
||||
if(args.length > 2) {
|
||||
target = Bukkit.getPlayer(args[2]);
|
||||
Validate.notNull(target, "Could not find player called '" + args[2] + "'.");
|
||||
}
|
||||
else
|
||||
target = (Player) sender;
|
||||
|
||||
// item
|
||||
Type type = MMOItems.plugin.getTypes().getOrThrow(args[0]);
|
||||
|
Loading…
Reference in New Issue
Block a user