Merge branch 'development'

This commit is contained in:
Christian Koop 2022-03-18 21:17:00 +01:00
commit 7c03d9e3de
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
3 changed files with 12 additions and 15 deletions

View File

@ -2,7 +2,7 @@
<groupId>com.songoda</groupId>
<artifactId>EpicHoppers</artifactId>
<modelVersion>4.0.0</modelVersion>
<version>4.7.3</version>
<version>4.7.4</version>
<build>
<defaultGoal>clean install</defaultGoal>
<finalName>EpicHoppers-${project.version}</finalName>
@ -133,7 +133,7 @@
<dependency>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore</artifactId>
<version>2.6.11</version>
<version>2.6.12</version>
<scope>compile</scope>
</dependency>

View File

@ -12,8 +12,7 @@ import com.songoda.core.gui.GuiManager;
import com.songoda.core.hooks.EconomyManager;
import com.songoda.core.hooks.ProtectionManager;
import com.songoda.core.locale.Locale;
import com.songoda.core.nms.NmsManager;
import com.songoda.core.nms.nbt.NBTItem;
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
import com.songoda.core.utils.TextUtils;
import com.songoda.epichoppers.boost.BoostManager;
import com.songoda.epichoppers.commands.CommandBoost;
@ -52,7 +51,6 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.plugin.PluginManager;
import java.io.File;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -156,8 +154,8 @@ public class EpicHoppers extends SongodaPlugin {
try {
SkyBlock.getInstance().getPermissionManager().registerPermission(
(BasicPermission) Class.forName("com.songoda.epichoppers.compatibility.EpicHoppersPermission").getDeclaredConstructor().newInstance());
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
e.printStackTrace();
} catch (ReflectiveOperationException ex) {
ex.printStackTrace();
}
}
});
@ -252,9 +250,9 @@ public class EpicHoppers extends SongodaPlugin {
}
item.setItemMeta(itemmeta);
NBTItem nbtItem = NmsManager.getNbt().of(item);
nbtItem.set("level", level.getLevel());
return nbtItem.finish();
NBTItem nbtItem = new NBTItem(item);
nbtItem.setInteger("level", level.getLevel());
return nbtItem.getItem();
}
@Override

View File

@ -2,7 +2,7 @@ package com.songoda.epichoppers.hopper.levels;
import com.songoda.core.nms.NmsManager;
import com.songoda.core.nms.nbt.NBTCore;
import com.songoda.core.nms.nbt.NBTItem;
import com.songoda.core.third_party.de.tr7zw.nbtapi.NBTItem;
import com.songoda.epichoppers.hopper.levels.modules.Module;
import org.bukkit.ChatColor;
import org.bukkit.inventory.ItemStack;
@ -28,11 +28,10 @@ public class LevelManager {
}
public Level getLevel(ItemStack item) {
NBTCore nbt = NmsManager.getNbt();
NBTItem nbtItem = nbt.of(item);
NBTItem nbtItem = new NBTItem(item);
if (nbtItem.has("level"))
return getLevel(nbtItem.getNBTObject("level").asInt());
if (nbtItem.hasKey("level"))
return getLevel(nbtItem.getInteger("level"));
// Legacy trash.
if (item.hasItemMeta() && item.getItemMeta().getDisplayName().contains(":")) {