1.0.3c SNAPSHOT HOTFIX
Color fix, confirm menu fix
This commit is contained in:
1 parent
71203206d1
commit
44f3226838
3 files changed
+46
-16
No files matched your search
+1
-1
@@ -5,7 +5,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group = 'me.redtea'
|
group = 'me.redtea'
|
||||||
version = '1.0.3b-SNAPSHOT'
|
version = '1.0.3c-SNAPSHOT'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|||||||
@@ -129,7 +129,6 @@ public final class NoDropX extends JavaPlugin {
|
|||||||
StorageService storageService = new StorageServiceImpl(menuFacade, personalStorageRepo, noDropService);
|
StorageService storageService = new StorageServiceImpl(menuFacade, personalStorageRepo, noDropService);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
NoDropAPI noDropAPI = new NoDropXFacade(noDropService, noDropItemFactory, storageService, capacityService, itemStackService);
|
NoDropAPI noDropAPI = new NoDropXFacade(noDropService, noDropItemFactory, storageService, capacityService, itemStackService);
|
||||||
noDropAPIInstance = noDropAPI;
|
noDropAPIInstance = noDropAPI;
|
||||||
|
|
||||||
@@ -155,14 +154,15 @@ public final class NoDropX extends JavaPlugin {
|
|||||||
|
|
||||||
private MenuFacade initMenus() {
|
private MenuFacade initMenus() {
|
||||||
CachedMenu personalStorageCachedMenu;
|
CachedMenu personalStorageCachedMenu;
|
||||||
if(getConfig().getString("personalStorageType").equalsIgnoreCase("SINGLE_PAGE")) {
|
if (getConfig().getString("personalStorageType").equalsIgnoreCase("SINGLE_PAGE")) {
|
||||||
SinglePageGui singlePageGui = new SinglePageGui(messages, personalStorageRepo);
|
SinglePageGui singlePageGui = new SinglePageGui(messages, personalStorageRepo);
|
||||||
personalStorageCachedMenu = singlePageGui;
|
personalStorageCachedMenu = singlePageGui;
|
||||||
Bukkit.getPluginManager().registerEvents(new SinglePageGuiHandler(new SinglePageController(noDropService,
|
Bukkit.getPluginManager().registerEvents(new SinglePageGuiHandler(new SinglePageController(noDropService,
|
||||||
singlePageGui, personalStorageRepo, foliaSupportedUtils), singlePageGui), this);
|
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);
|
return new MenuFacadeImpl(personalStorageCachedMenu, confirmMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ public final class NoDropX extends JavaPlugin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkUpdates() {
|
private void checkUpdates() {
|
||||||
if(!getConfig().getBoolean("checkForUpdates")) {
|
if (!getConfig().getBoolean("checkForUpdates")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
new UpdateChecker(this, 111485, foliaSupportedUtils).getVersion(version -> {
|
new UpdateChecker(this, 111485, foliaSupportedUtils).getVersion(version -> {
|
||||||
@@ -199,13 +199,17 @@ public final class NoDropX extends JavaPlugin {
|
|||||||
|
|
||||||
|
|
||||||
private void printCredits() {
|
private void printCredits() {
|
||||||
Bukkit.getLogger().info(ChatColor.GREEN + "************************************************************");
|
printCreditLine("&a************************************************************");
|
||||||
Bukkit.getLogger().info(ChatColor.GREEN + "* " + ChatColor.YELLOW + "NoDropX version " + ChatColor.GOLD + getDescription().getVersion() + ChatColor.GRAY + " (uses CarcadeX v. 1.0.7)");
|
printCreditLine("&a* &eNoDropX version &6" + getDescription().getVersion() + "&7 (uses CarcadeX v. 1.0.7)");
|
||||||
Bukkit.getLogger().info(ChatColor.GREEN + "* " + ChatColor.YELLOW + "By " + ChatColor.RED + "itzRedTea");
|
printCreditLine("&a* &eBy &citzRedTea");
|
||||||
Bukkit.getLogger().info(ChatColor.GREEN + "* "+ ChatColor.YELLOW + "Detected bukkit version " + ChatColor.GOLD + Bukkit.getBukkitVersion());
|
printCreditLine("&a* &eDetected bukkit version &6" + Bukkit.getBukkitVersion());
|
||||||
Bukkit.getLogger().info(ChatColor.GREEN + "* "+ ChatColor.YELLOW + "support HEX colors " + (supportHEX ? ChatColor.DARK_GREEN + "YES" : ChatColor.DARK_RED + "NO"));
|
printCreditLine("&a* &esupport HEX colors " + (supportHEX ? "&2YES" : "&4NO"));
|
||||||
Bukkit.getLogger().info(ChatColor.GREEN + "* "+ ChatColor.YELLOW + "support Kyori as lore " + (supportKyoriLore ? ChatColor.DARK_GREEN + "YES" : ChatColor.DARK_RED + "NO"));
|
printCreditLine("&a* &esupport Kyori as lore " + (supportKyoriLore ? "&2YES" : "&4NO"));
|
||||||
Bukkit.getLogger().info(ChatColor.GREEN + "************************************************************");
|
printCreditLine("&a************************************************************");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void printCreditLine(String s) {
|
||||||
|
Bukkit.getLogger().info(ChatColor.translateAlternateColorCodes('&', s));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onReload() {
|
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.libs.message.container.Messages;
|
||||||
import me.redtea.nodropx.menu.Menu;
|
import me.redtea.nodropx.menu.Menu;
|
||||||
import me.redtea.nodropx.service.dropconfirm.DropConfirmService;
|
import me.redtea.nodropx.service.dropconfirm.DropConfirmService;
|
||||||
import net.kyori.adventure.text.Component;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
|
||||||
import org.bukkit.entity.Player;
|
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 {
|
public class DropConfirmMFGui implements Menu {
|
||||||
private final Gui gui;
|
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()
|
gui = Gui.gui()
|
||||||
.rows(1)
|
.rows(1)
|
||||||
.title(messages.get("gui.confirm.title").asComponent())
|
.title(messages.get("gui.confirm.title").asComponent())
|
||||||
.disableAllInteractions()
|
.disableAllInteractions()
|
||||||
.create();
|
.create();
|
||||||
|
this.plugin = plugin;
|
||||||
gui.setItem(1, ItemBuilder.from(messages.get("gui.confirm.yesButton.material").toMaterial())
|
gui.setItem(1, ItemBuilder.from(messages.get("gui.confirm.yesButton.material").toMaterial())
|
||||||
.name(messages.get("gui.confirm.yesButton.name").asComponent())
|
.name(messages.get("gui.confirm.yesButton.name").asComponent())
|
||||||
.lore(messages.get("gui.confirm.yesButton.lore").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())
|
.name(messages.get("gui.confirm.noButton.name").asComponent())
|
||||||
.lore(messages.get("gui.confirm.noButton.lore").asComponent())
|
.lore(messages.get("gui.confirm.noButton.lore").asComponent())
|
||||||
.asGuiItem((event -> event.getWhoClicked().closeInventory())));
|
.asGuiItem((event -> event.getWhoClicked().closeInventory())));
|
||||||
|
gui.setCloseGuiAction((e) -> {
|
||||||
|
inMenu.remove(e.getPlayer().getUniqueId());
|
||||||
|
});
|
||||||
|
this.dropConfirmService = dropConfirmService;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void open(Player player) {
|
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);
|
gui.open(player);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user