1.0.3c SNAPSHOT HOTFIX
Color fix, confirm menu fix
This commit is contained in:
1 parent
71203206d1
commit
44f3226838
3 files changed
+44
-14
No files matched your search
+1
-1
@@ -5,7 +5,7 @@ plugins {
|
||||
}
|
||||
|
||||
group = 'me.redtea'
|
||||
version = '1.0.3b-SNAPSHOT'
|
||||
version = '1.0.3c-SNAPSHOT'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
@@ -129,7 +129,6 @@ public final class NoDropX extends JavaPlugin {
|
||||
StorageService storageService = new StorageServiceImpl(menuFacade, personalStorageRepo, noDropService);
|
||||
|
||||
|
||||
|
||||
NoDropAPI noDropAPI = new NoDropXFacade(noDropService, noDropItemFactory, storageService, capacityService, itemStackService);
|
||||
noDropAPIInstance = noDropAPI;
|
||||
|
||||
@@ -160,9 +159,10 @@ public final class NoDropX extends JavaPlugin {
|
||||
personalStorageCachedMenu = singlePageGui;
|
||||
Bukkit.getPluginManager().registerEvents(new SinglePageGuiHandler(new SinglePageController(noDropService,
|
||||
singlePageGui, personalStorageRepo, foliaSupportedUtils), singlePageGui), this);
|
||||
} else personalStorageCachedMenu = new MFPageGui(messages, personalStorageRepo, noDropService, itemStackService, this);
|
||||
} else
|
||||
personalStorageCachedMenu = new MFPageGui(messages, personalStorageRepo, noDropService, itemStackService, this);
|
||||
|
||||
Menu confirmMenu = new DropConfirmMFGui(messages, dropConfirmService);
|
||||
Menu confirmMenu = new DropConfirmMFGui(messages, dropConfirmService, this);
|
||||
return new MenuFacadeImpl(personalStorageCachedMenu, confirmMenu);
|
||||
}
|
||||
|
||||
@@ -199,13 +199,17 @@ public final class NoDropX extends JavaPlugin {
|
||||
|
||||
|
||||
private void printCredits() {
|
||||
Bukkit.getLogger().info(ChatColor.GREEN + "************************************************************");
|
||||
Bukkit.getLogger().info(ChatColor.GREEN + "* " + ChatColor.YELLOW + "NoDropX version " + ChatColor.GOLD + getDescription().getVersion() + ChatColor.GRAY + " (uses CarcadeX v. 1.0.7)");
|
||||
Bukkit.getLogger().info(ChatColor.GREEN + "* " + ChatColor.YELLOW + "By " + ChatColor.RED + "itzRedTea");
|
||||
Bukkit.getLogger().info(ChatColor.GREEN + "* "+ ChatColor.YELLOW + "Detected bukkit version " + ChatColor.GOLD + Bukkit.getBukkitVersion());
|
||||
Bukkit.getLogger().info(ChatColor.GREEN + "* "+ ChatColor.YELLOW + "support HEX colors " + (supportHEX ? ChatColor.DARK_GREEN + "YES" : ChatColor.DARK_RED + "NO"));
|
||||
Bukkit.getLogger().info(ChatColor.GREEN + "* "+ ChatColor.YELLOW + "support Kyori as lore " + (supportKyoriLore ? ChatColor.DARK_GREEN + "YES" : ChatColor.DARK_RED + "NO"));
|
||||
Bukkit.getLogger().info(ChatColor.GREEN + "************************************************************");
|
||||
printCreditLine("&a************************************************************");
|
||||
printCreditLine("&a* &eNoDropX version &6" + getDescription().getVersion() + "&7 (uses CarcadeX v. 1.0.7)");
|
||||
printCreditLine("&a* &eBy &citzRedTea");
|
||||
printCreditLine("&a* &eDetected bukkit version &6" + Bukkit.getBukkitVersion());
|
||||
printCreditLine("&a* &esupport HEX colors " + (supportHEX ? "&2YES" : "&4NO"));
|
||||
printCreditLine("&a* &esupport Kyori as lore " + (supportKyoriLore ? "&2YES" : "&4NO"));
|
||||
printCreditLine("&a************************************************************");
|
||||
}
|
||||
|
||||
private void printCreditLine(String s) {
|
||||
Bukkit.getLogger().info(ChatColor.translateAlternateColorCodes('&', s));
|
||||
}
|
||||
|
||||
public void onReload() {
|
||||
|
||||
@@ -5,18 +5,26 @@ import dev.triumphteam.gui.guis.Gui;
|
||||
import me.redtea.nodropx.libs.message.container.Messages;
|
||||
import me.redtea.nodropx.menu.Menu;
|
||||
import me.redtea.nodropx.service.dropconfirm.DropConfirmService;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
public class DropConfirmMFGui implements Menu {
|
||||
private final Gui gui;
|
||||
public DropConfirmMFGui(Messages messages, DropConfirmService dropConfirmService) {
|
||||
private final Set<UUID> inMenu = new HashSet<>();
|
||||
private final DropConfirmService dropConfirmService;
|
||||
private final Plugin plugin;
|
||||
public DropConfirmMFGui(Messages messages, DropConfirmService dropConfirmService, Plugin plugin) {
|
||||
gui = Gui.gui()
|
||||
.rows(1)
|
||||
.title(messages.get("gui.confirm.title").asComponent())
|
||||
.disableAllInteractions()
|
||||
.create();
|
||||
this.plugin = plugin;
|
||||
gui.setItem(1, ItemBuilder.from(messages.get("gui.confirm.yesButton.material").toMaterial())
|
||||
.name(messages.get("gui.confirm.yesButton.name").asComponent())
|
||||
.lore(messages.get("gui.confirm.yesButton.lore").asComponent())
|
||||
@@ -29,10 +37,28 @@ public class DropConfirmMFGui implements Menu {
|
||||
.name(messages.get("gui.confirm.noButton.name").asComponent())
|
||||
.lore(messages.get("gui.confirm.noButton.lore").asComponent())
|
||||
.asGuiItem((event -> event.getWhoClicked().closeInventory())));
|
||||
gui.setCloseGuiAction((e) -> {
|
||||
inMenu.remove(e.getPlayer().getUniqueId());
|
||||
});
|
||||
this.dropConfirmService = dropConfirmService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void open(Player player) {
|
||||
if(inMenu.contains(player.getUniqueId())) {
|
||||
dropConfirmService.forceConfirm(player);
|
||||
player.closeInventory();
|
||||
try {
|
||||
Bukkit.getScheduler().runTaskLater(plugin,
|
||||
() -> dropConfirmService.removeForceConfirm(player),
|
||||
20*15L);
|
||||
} catch (Throwable e) {
|
||||
plugin.getLogger().severe("Can not start task. Maybe will bugs. Do you run on Folia?");
|
||||
e.printStackTrace();
|
||||
}
|
||||
return;
|
||||
}
|
||||
inMenu.add(player.getUniqueId());
|
||||
gui.open(player);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user