mirror of
https://github.com/DRE2N/DungeonsXL.git
synced 2024-11-28 13:36:33 +01:00
Remove Vault item util
This commit is contained in:
parent
7f2f199055
commit
cc19684407
4
pom.xml
4
pom.xml
@ -71,7 +71,7 @@
|
||||
<dependency>
|
||||
<groupId>net.milkbowl.vault</groupId>
|
||||
<artifactId>VaultAPI</artifactId>
|
||||
<version>1.6</version>
|
||||
<version>1.7</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -107,7 +107,7 @@
|
||||
<dependency>
|
||||
<groupId>com.griefcraft</groupId>
|
||||
<artifactId>entitylwc</artifactId>
|
||||
<version>2.0</version>
|
||||
<version>2.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
@ -16,6 +16,7 @@
|
||||
*/
|
||||
package de.erethon.dungeonsxl.world.block;
|
||||
|
||||
import de.erethon.caliburn.item.VanillaItem;
|
||||
import de.erethon.commons.chat.MessageUtil;
|
||||
import de.erethon.commons.misc.SimpleDateUtil;
|
||||
import de.erethon.dungeonsxl.DungeonsXL;
|
||||
@ -29,8 +30,6 @@ import de.erethon.dungeonsxl.reward.LevelReward;
|
||||
import de.erethon.dungeonsxl.reward.MoneyReward;
|
||||
import de.erethon.dungeonsxl.reward.Reward;
|
||||
import de.erethon.dungeonsxl.reward.RewardTypeDefault;
|
||||
import net.milkbowl.vault.item.ItemInfo;
|
||||
import net.milkbowl.vault.item.Items;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.block.Block;
|
||||
@ -197,33 +196,18 @@ public class RewardChest extends GameBlock {
|
||||
if (itemReward != null) {
|
||||
String msg = "";
|
||||
for (ItemStack itemStack : itemReward) {
|
||||
|
||||
if (itemStack == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
String name = null;
|
||||
|
||||
if (itemStack.hasItemMeta()) {
|
||||
if (itemStack.getItemMeta().hasDisplayName()) {
|
||||
name = itemStack.getItemMeta().getDisplayName();
|
||||
}
|
||||
}
|
||||
|
||||
if (name == null) {
|
||||
if (Bukkit.getPluginManager().getPlugin("Vault") != null) {
|
||||
ItemInfo itemInfo = Items.itemByStack(itemStack);
|
||||
if (itemInfo != null) {
|
||||
name = itemInfo.getName();
|
||||
} else {
|
||||
name = itemStack.getType().name();
|
||||
}
|
||||
|
||||
} else {
|
||||
name = itemStack.getType().toString();
|
||||
}
|
||||
name = VanillaItem.get(itemStack.getType()).getNewName().replace("_", " ");
|
||||
}
|
||||
|
||||
msg += ChatColor.RED + " " + itemStack.getAmount() + " " + name + ChatColor.GOLD + ",";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user