|
16 | 16 | import fr.openmc.core.features.contest.commands.ContestCommand; |
17 | 17 | import fr.openmc.core.features.contest.managers.ContestManager; |
18 | 18 | import fr.openmc.core.features.contest.models.Contest; |
| 19 | +import fr.openmc.core.features.dream.DreamUtils; |
19 | 20 | import fr.openmc.core.features.homes.command.TpHomeCommand; |
20 | 21 | import fr.openmc.core.features.mailboxes.MailboxCommand; |
21 | 22 | import fr.openmc.core.features.mainmenu.listeners.PacketListener; |
22 | 23 | import fr.openmc.core.features.milestones.menus.MainMilestonesMenu; |
23 | 24 | import fr.openmc.core.features.quests.command.QuestCommand; |
24 | 25 | import fr.openmc.core.features.settings.command.SettingsCommand; |
25 | 26 | import fr.openmc.core.utils.DateUtils; |
| 27 | +import fr.openmc.core.utils.messages.MessageType; |
| 28 | +import fr.openmc.core.utils.messages.MessagesManager; |
| 29 | +import fr.openmc.core.utils.messages.Prefix; |
26 | 30 | import net.kyori.adventure.text.Component; |
27 | 31 | import net.kyori.adventure.text.format.NamedTextColor; |
28 | 32 | import net.kyori.adventure.text.format.TextDecoration; |
29 | 33 | import net.minecraft.network.protocol.game.ClientboundUpdateAdvancementsPacket; |
30 | 34 | import net.minecraft.server.level.ServerPlayer; |
31 | 35 | import org.bukkit.Bukkit; |
32 | | -import org.bukkit.ChatColor; |
33 | 36 | import org.bukkit.Material; |
34 | 37 | import org.bukkit.NamespacedKey; |
35 | 38 | import org.bukkit.craftbukkit.entity.CraftPlayer; |
@@ -213,6 +216,12 @@ public void onInventoryClick(InventoryClickEvent event) { |
213 | 216 | return; |
214 | 217 | } |
215 | 218 |
|
| 219 | + if (DreamUtils.isInDreamWorld(player)) { |
| 220 | + PacketMenuLib.closeMenu(player); |
| 221 | + MessagesManager.sendMessage(player, Component.text("Vous ne pouvez pas interagir avec le menu principal depuis le monde des rêves.", NamedTextColor.RED), Prefix.OPENMC, MessageType.ERROR, true); |
| 222 | + return; |
| 223 | + } |
| 224 | + |
216 | 225 | int slot = event.slot(); |
217 | 226 | if (CITY_SLOTS.contains(slot)) { |
218 | 227 | Bukkit.getScheduler().runTask(OMCPlugin.getInstance(), () -> CityCommands.mainCommand(player)); |
|
0 commit comments