mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2024-12-22 04:37:42 +01:00
Fixed health bonuses not working in MMOInv when logging in
This commit is contained in:
parent
c78cafd402
commit
ed76008a4f
@ -119,7 +119,9 @@ public class PlayerData extends SynchronizedDataHolder implements Closeable {
|
||||
}
|
||||
|
||||
public void updateInventory() {
|
||||
if (!isOnline()) return;
|
||||
|
||||
// Cannot update inventory unless online and fully sync
|
||||
if (!isOnline() || !getMMOPlayerData().hasFullySynchronized()) return;
|
||||
|
||||
/*
|
||||
* Very important, clear particle data AFTER canceling the runnable
|
||||
|
@ -5,6 +5,7 @@ import net.Indyuce.mmoitems.api.ConfigFile;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
import java.util.logging.Level;
|
||||
|
||||
/**
|
||||
@ -20,7 +21,7 @@ public class LanguageFile extends ConfigFile {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public String computeTranslation(String path, Provider<String> defaultTranslation) {
|
||||
public String computeTranslation(String path, Supplier<String> defaultTranslation) {
|
||||
@Nullable String found = getConfig().getString(path);
|
||||
if (found == null) {
|
||||
change = true;
|
||||
|
@ -1,6 +0,0 @@
|
||||
package net.Indyuce.mmoitems.util;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface Provider<T> {
|
||||
T get();
|
||||
}
|
@ -2,6 +2,7 @@ package net.Indyuce.mmoitems.listener;
|
||||
|
||||
import io.lumine.mythic.lib.MythicLib;
|
||||
import io.lumine.mythic.lib.api.event.PlayerAttackEvent;
|
||||
import io.lumine.mythic.lib.api.event.SynchronizedDataLoadEvent;
|
||||
import io.lumine.mythic.lib.api.event.armorequip.ArmorEquipEvent;
|
||||
import io.lumine.mythic.lib.api.item.NBTItem;
|
||||
import io.lumine.mythic.lib.api.player.EquipmentSlot;
|
||||
@ -54,6 +55,14 @@ public class PlayerListener implements Listener {
|
||||
new DelayedDeathDowngrade(event).runTaskLater(MMOItems.plugin, 3L);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void fullSync(SynchronizedDataLoadEvent event) {
|
||||
if (event.syncIsFull()) {
|
||||
final PlayerData playerData = PlayerData.get(event.getHolder().getUniqueId());
|
||||
playerData.updateInventory();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent players from dropping items which are bound to them with a
|
||||
* Soulbound. Items are cached inside a map waiting for the player to
|
||||
|
Loading…
Reference in New Issue
Block a user