|
|
@ -23,14 +23,10 @@ import de.themoep.minedown.adventure.MineDown;
|
|
|
|
import dev.triumphteam.gui.builder.gui.StorageBuilder;
|
|
|
|
import dev.triumphteam.gui.builder.gui.StorageBuilder;
|
|
|
|
import dev.triumphteam.gui.guis.Gui;
|
|
|
|
import dev.triumphteam.gui.guis.Gui;
|
|
|
|
import dev.triumphteam.gui.guis.StorageGui;
|
|
|
|
import dev.triumphteam.gui.guis.StorageGui;
|
|
|
|
import net.roxeez.advancement.display.FrameType;
|
|
|
|
|
|
|
|
import net.william278.andjam.Toast;
|
|
|
|
|
|
|
|
import net.william278.husksync.BukkitHuskSync;
|
|
|
|
|
|
|
|
import net.william278.husksync.HuskSync;
|
|
|
|
import net.william278.husksync.HuskSync;
|
|
|
|
import net.william278.husksync.data.BukkitData;
|
|
|
|
import net.william278.husksync.data.BukkitData;
|
|
|
|
import net.william278.husksync.data.BukkitUserDataHolder;
|
|
|
|
import net.william278.husksync.data.BukkitUserDataHolder;
|
|
|
|
import net.william278.husksync.data.Data;
|
|
|
|
import net.william278.husksync.data.Data;
|
|
|
|
import org.bukkit.Material;
|
|
|
|
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
import org.bukkit.inventory.ItemStack;
|
|
|
|
import org.jetbrains.annotations.ApiStatus;
|
|
|
|
import org.jetbrains.annotations.ApiStatus;
|
|
|
@ -40,8 +36,6 @@ import java.util.Arrays;
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
import java.util.logging.Level;
|
|
|
|
import java.util.logging.Level;
|
|
|
|
|
|
|
|
|
|
|
|
import static net.william278.husksync.util.BukkitKeyedAdapter.matchMaterial;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Bukkit platform implementation of an {@link OnlineUser}
|
|
|
|
* Bukkit platform implementation of an {@link OnlineUser}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -68,20 +62,12 @@ public class BukkitUser extends OnlineUser implements BukkitUserDataHolder {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
|
|
|
|
@Deprecated(since = "3.6.7")
|
|
|
|
public void sendToast(@NotNull MineDown title, @NotNull MineDown description,
|
|
|
|
public void sendToast(@NotNull MineDown title, @NotNull MineDown description,
|
|
|
|
@NotNull String iconMaterial, @NotNull String backgroundType) {
|
|
|
|
@NotNull String iconMaterial, @NotNull String backgroundType) {
|
|
|
|
try {
|
|
|
|
plugin.log(Level.WARNING, "Toast notifications are deprecated. " +
|
|
|
|
final Material material = matchMaterial(iconMaterial);
|
|
|
|
"Please change your notification display slot to CHAT, ACTION_BAR or NONE.");
|
|
|
|
Toast.builder((BukkitHuskSync) plugin)
|
|
|
|
this.sendActionBar(title);
|
|
|
|
.setTitle(title.toComponent())
|
|
|
|
|
|
|
|
.setDescription(description.toComponent())
|
|
|
|
|
|
|
|
.setIcon(material != null ? material : Material.BARRIER)
|
|
|
|
|
|
|
|
.setFrameType(FrameType.valueOf(backgroundType))
|
|
|
|
|
|
|
|
.build()
|
|
|
|
|
|
|
|
.show(player);
|
|
|
|
|
|
|
|
} catch (Throwable e) {
|
|
|
|
|
|
|
|
plugin.log(Level.WARNING, "Failed to send toast to player " + player.getName(), e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|