Support for MM 5.7.1

This commit is contained in:
Jules 2024-08-14 15:00:27 -07:00
parent d792b84219
commit ed9a9353aa
3 changed files with 7 additions and 5 deletions

View File

@ -159,7 +159,7 @@
<dependency>
<groupId>io.lumine</groupId>
<artifactId>Mythic-Dist</artifactId>
<version>5.0.1</version>
<version>5.7.1</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>

View File

@ -4,7 +4,7 @@ import io.lumine.mythic.api.adapters.AbstractItemStack;
import io.lumine.mythic.api.config.MythicLineConfig;
import io.lumine.mythic.api.drops.DropMetadata;
import io.lumine.mythic.api.drops.IItemDrop;
import io.lumine.mythic.bukkit.adapters.BukkitItemStack;
import io.lumine.mythic.bukkit.BukkitAdapter;
import io.lumine.mythic.core.drops.Drop;
import net.Indyuce.mmocore.util.item.CurrencyItemBuilder;
@ -27,7 +27,8 @@ public class CurrencyItemDrop extends Drop implements IItemDrop {
@Override
public AbstractItemStack getDrop(DropMetadata dropMetadata, double v) {
return new BukkitItemStack(new CurrencyItemBuilder(key, random(minw, maxw)).build());
// Not great wrt to performance. Should build the item like MM does
return BukkitAdapter.adapt(new CurrencyItemBuilder(key, random(minw, maxw)).build());
}
private int random(int a, int b) {

View File

@ -4,7 +4,7 @@ import io.lumine.mythic.api.adapters.AbstractItemStack;
import io.lumine.mythic.api.config.MythicLineConfig;
import io.lumine.mythic.api.drops.DropMetadata;
import io.lumine.mythic.api.drops.IItemDrop;
import io.lumine.mythic.bukkit.adapters.BukkitItemStack;
import io.lumine.mythic.bukkit.BukkitAdapter;
import io.lumine.mythic.core.drops.Drop;
import io.lumine.mythic.lib.api.item.ItemTag;
import io.lumine.mythic.lib.api.item.NBTItem;
@ -49,7 +49,8 @@ public class GoldPouchDrop extends Drop implements IItemDrop {
}
nbt.addTag(new ItemTag("RpgPouchSize", 18), new ItemTag("RpgPouchMob", true), new ItemTag("RpgPouchInventory", MMOCoreUtils.toBase64(content)));
return new BukkitItemStack(nbt.toItem());
// Not great wrt to performance. Should build the item like MM does
return BukkitAdapter.adapt(nbt.toItem());
}
private ItemStack setAmount(ItemStack item, int amount) {