Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
1708c4bf70 | |||
415e8dc24b | |||
c4b5996256 |
2
pom.xml
2
pom.xml
@@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>net.t2code</groupId>
|
||||
<artifactId>T2CodeLib</artifactId>
|
||||
<version>14.2</version>
|
||||
<version>14.3</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
|
||||
|
@@ -55,15 +55,8 @@ public class T2Ceco {
|
||||
}
|
||||
|
||||
public static boolean itemAdd(Player player, ItemStack itemStack, int amount) {
|
||||
boolean empty = false;
|
||||
for (int i = 0; i < player.getInventory().getSize() - 5; i++) {
|
||||
if (player.getInventory().getItem(i) == null) {
|
||||
empty = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < amount; i++) {
|
||||
if (empty) {
|
||||
if (player.getInventory().firstEmpty() != -1) {
|
||||
player.getInventory().addItem(itemStack);
|
||||
} else {
|
||||
player.getLocation().getWorld().dropItem(player.getLocation(), itemStack);
|
||||
|
@@ -6,6 +6,8 @@ import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
|
||||
import net.t2code.t2codelib.Util;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class Vault {
|
||||
|
||||
public static Boolean vaultEnable;
|
||||
@@ -13,7 +15,7 @@ public class Vault {
|
||||
|
||||
public static void loadVault() throws InterruptedException {
|
||||
long long_ = System.currentTimeMillis();
|
||||
if (T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null) {
|
||||
if (T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null && Objects.requireNonNull(T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault")).isEnabled()) {
|
||||
vaultEnable = true;
|
||||
RegisteredServiceProvider<Economy> eco = T2CodeLibMain.getPlugin().getServer().getServicesManager().getRegistration(Economy.class);
|
||||
if (eco != null) {
|
||||
|
Reference in New Issue
Block a user