From 830b4008604ead99425a9471f1bc322a601f93ba Mon Sep 17 00:00:00 2001 From: Nocolm Date: Sun, 13 Sep 2026 16:55:39 +0200 Subject: [PATCH 1/6] ajout de la ""base"" --- .../halloween/SEHalloweenManager.java | 29 +++++++++++ .../dimension/advancement/Advancements.java | 15 ++++++ .../halloween/model/SEHalloweenEventData.java | 51 +++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/SEHalloweenManager.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/dimension/advancement/Advancements.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java diff --git a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/SEHalloweenManager.java b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/SEHalloweenManager.java new file mode 100644 index 000000000..2b9d2545e --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/SEHalloweenManager.java @@ -0,0 +1,29 @@ +package fr.openmc.core.features.events.contents.seasonevents.halloween; + +import com.j256.ormlite.support.ConnectionSource; +import fr.openmc.core.bootstrap.features.Feature; +import fr.openmc.core.bootstrap.features.types.HasCommands; +import fr.openmc.core.bootstrap.features.types.HasDatabase; +import fr.openmc.core.bootstrap.features.types.HasListeners; +import fr.openmc.core.bootstrap.listeners.ListenerFactory; + +import java.sql.SQLException; +import java.util.Set; + +public class SEHalloweenManager extends Feature implements HasDatabase, HasListeners, HasCommands { + + @Override + public void initDB(ConnectionSource connectionSource) throws SQLException { + + } + + @Override + public Set getListeners() { + return Set.of(); + } + + @Override + public Set getCommands() { + return Set.of(); + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/dimension/advancement/Advancements.java b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/dimension/advancement/Advancements.java new file mode 100644 index 000000000..631e5f81d --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/dimension/advancement/Advancements.java @@ -0,0 +1,15 @@ +package fr.openmc.core.features.events.contents.seasonevents.halloween.dimension.advancement; + +import lombok.Getter; + +@Getter +public enum Advancements { + ROOM_1(1000) + ; + + private final int require; + + Advancements(int require) { + this.require = require; + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java new file mode 100644 index 000000000..c68faab23 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java @@ -0,0 +1,51 @@ +package fr.openmc.core.features.events.contents.seasonevents.halloween.model; + +import com.google.gson.Gson; +import com.j256.ormlite.field.DatabaseField; +import com.j256.ormlite.table.DatabaseTable; +import fr.openmc.core.features.events.contents.weeklyevents.models.WeeklyEvent; +import fr.openmc.core.features.events.contents.weeklyevents.models.WeeklyEventPhase; +import lombok.Getter; +import lombok.Setter; + +@Getter +@DatabaseTable(tableName = "halloween_season_event_data") +public class SEHalloweenEventData { + + @DatabaseField(id = true, columnName = "id") + private int id = 1; + + @Setter + @DatabaseField(columnName = "advancement") + private String currentAdvencement; + + @Setter + @DatabaseField(columnName = "unlocked_room") + private String currentUnlocked; + + @Setter + @DatabaseField(columnName = "is_active") + private boolean active; + + public SEHalloweenEventData() {} + + public SEHalloweenEventData(WeeklyEvent currentEvent, WeeklyEventPhase currentPhase) { + this.currentEvent = currentEvent.getId(); + if (currentPhase == null) + this.currentPhase = null; + else + this.currentPhase = currentPhase.getId(); + } + + private static final Gson GSON = new Gson(); + + public void setContent(String[] array) { + currentUnlocked = GSON.toJson(array); + } + + public String[] getContent() { + if (currentUnlocked == null) return new String[0]; + return GSON.fromJson(currentUnlocked, String[].class); + } + +} From 3d5f3ce97c5c1a265aa368dedaba25fbd68f9b09 Mon Sep 17 00:00:00 2001 From: Nocolm Date: Mon, 14 Sep 2026 22:14:14 +0200 Subject: [PATCH 2/6] =?UTF-8?q?update=201=20pc=20<->=20pc=20lyc=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../halloween/SEHalloweenManager.java | 72 +++++++++++++++++++ .../halloween/dimension/DimensionManager.java | 60 ++++++++++++++++ .../dimension/advancement/Advancements.java | 15 ++++ .../halloween/model/HalloweenDB.java | 46 ++++++++++++ 4 files changed, 193 insertions(+) create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/SEHalloweenManager.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/DimensionManager.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/Advancements.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/model/HalloweenDB.java diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/SEHalloweenManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/SEHalloweenManager.java new file mode 100644 index 000000000..0299ed740 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/SEHalloweenManager.java @@ -0,0 +1,72 @@ +package fr.openmc.core.features.events.contents.halloween.halloween; + +import com.j256.ormlite.dao.Dao; +import com.j256.ormlite.dao.DaoManager; +import com.j256.ormlite.support.ConnectionSource; +import com.j256.ormlite.table.TableUtils; +import fr.openmc.core.bootstrap.features.Feature; +import fr.openmc.core.bootstrap.features.types.HasCommands; +import fr.openmc.core.bootstrap.features.types.HasDatabase; +import fr.openmc.core.bootstrap.features.types.HasListeners; +import fr.openmc.core.bootstrap.integration.OMCLogger; +import fr.openmc.core.bootstrap.listeners.ListenerFactory; +import fr.openmc.core.features.corpse.npc.CorpseNPCManager; +import fr.openmc.core.features.events.contents.halloween.halloween.model.HalloweenDB; +import lombok.Getter; + +import java.sql.SQLException; +import java.util.*; + +public class SEHalloweenManager extends Feature implements HasDatabase, HasListeners, HasCommands { + + @Getter + private static HalloweenDB halloweenDB; + + private static Dao halloweenDao; + + public static String[] unlockedRooms; + + @Override + public void init() { + CorpseNPCManager.init(); + halloweenDB = loadEvent(); + unlockedRooms = halloweenDB.getContent(); + } + + @Override + public void initDB(ConnectionSource connectionSource) throws SQLException { + TableUtils.createTableIfNotExists(connectionSource, HalloweenDB.class); + halloweenDao = DaoManager.createDao(connectionSource, HalloweenDB.class); + } + + @Override + protected void save() { + saveEvent(); + } + + public static HalloweenDB loadEvent() { + try { + return halloweenDao.queryForFirst(); + } catch (SQLException e) { + throw new RuntimeException(e); + } + } + + private static void saveEvent() { + try { + halloweenDao.createOrUpdate(halloweenDB); + } catch (Exception e) { + OMCLogger.error("Impossible de sauvegarder les corpses pendant l'arret.", e); + } + } + + @Override + public Set getListeners() { + return Set.of(); + } + + @Override + public Set getCommands() { + return Set.of(); + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/DimensionManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/DimensionManager.java new file mode 100644 index 000000000..07b3ca096 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/DimensionManager.java @@ -0,0 +1,60 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.dimension; + +import fr.openmc.core.OMCPlugin; +import fr.openmc.core.bootstrap.integration.OMCLogger; +import fr.openmc.core.features.dream.DreamDimensionManager; +import org.bukkit.Bukkit; +import org.bukkit.GameRules; +import org.bukkit.World; +import org.bukkit.entity.SpawnCategory; + +import java.io.File; + +public class DimensionManager { + + public static final String DIMENSION_NAME = "world_omc_halloween_witch_house"; + public static World HALLOWEEN_WORLD; + + public static void init() { +// seedFile = new File(OMCPlugin.getInstance().getDataFolder() + "/data/dream", "seed.yml"); +// loadSeed(); + HALLOWEEN_WORLD = Bukkit.getWorld(DIMENSION_NAME); + + setupDimension(); + } + + //TODO setup la dimension : + // - monde vide + ajout de la structure de Mcross + // - ambiant custom + + private static void setupDimension() { + if (!HALLOWEEN_WORLD.getName().equals(DreamDimensionManager.DIMENSION_NAME)) return; + + // ** SPAWNING RULES ** + HALLOWEEN_WORLD.setSpawnLimit(SpawnCategory.MONSTER, 10); + HALLOWEEN_WORLD.setSpawnLimit(SpawnCategory.AMBIENT, 10); + HALLOWEEN_WORLD.setSpawnLimit(SpawnCategory.ANIMAL, 6); + + HALLOWEEN_WORLD.setTicksPerSpawns(SpawnCategory.MONSTER, 30); + HALLOWEEN_WORLD.setTicksPerSpawns(SpawnCategory.AMBIENT, 15); + HALLOWEEN_WORLD.setTicksPerSpawns(SpawnCategory.ANIMAL, 30); + + // ** SET GAMERULE FOR THE WORLD ** + HALLOWEEN_WORLD.setGameRule(GameRules.ADVANCE_TIME, false); + HALLOWEEN_WORLD.setGameRule(GameRules.SHOW_ADVANCEMENT_MESSAGES, false); + HALLOWEEN_WORLD.setGameRule(GameRules.ADVANCE_WEATHER, false); + HALLOWEEN_WORLD.setGameRule(GameRules.RAIDS, true); + HALLOWEEN_WORLD.setGameRule(GameRules.SPAWN_PATROLS, false); + HALLOWEEN_WORLD.setGameRule(GameRules.SPAWN_WANDERING_TRADERS, false); + HALLOWEEN_WORLD.setGameRule(GameRules.NATURAL_HEALTH_REGENERATION, false); + HALLOWEEN_WORLD.setGameRule(GameRules.LOCATOR_BAR, false); + HALLOWEEN_WORLD.setGameRule(GameRules.ALLOW_ENTERING_NETHER_USING_PORTALS, false); + + // ** SET WORLD BORDER AND TIME ** + HALLOWEEN_WORLD.getWorldBorder().setSize(10000); + HALLOWEEN_WORLD.setTime(18000); + + OMCLogger.infoFormatted("Dimension des rêves setup (gamerules, worldborder, time)"); + } + +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/Advancements.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/Advancements.java new file mode 100644 index 000000000..88c2ab606 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/Advancements.java @@ -0,0 +1,15 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.dimension.advancement; + +import lombok.Getter; + +@Getter +public enum Advancements { + ROOM_1(1000) + ; + + private final int require; + + Advancements(int require) { + this.require = require; + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/model/HalloweenDB.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/model/HalloweenDB.java new file mode 100644 index 000000000..b40d67d40 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/model/HalloweenDB.java @@ -0,0 +1,46 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.model; + +import com.google.gson.Gson; +import com.j256.ormlite.field.DatabaseField; +import com.j256.ormlite.table.DatabaseTable; +import lombok.Getter; +import lombok.Setter; + +@Getter +@DatabaseTable(tableName = "halloween_season_event_data") +public class HalloweenDB { + + @Setter + @DatabaseField(columnName = "advancement") + private String currentAdvancement; + + @Setter + @DatabaseField(columnName = "unlocked_room") + private String unlockedRooms; + + @Setter + @DatabaseField(columnName = "is_active") + private boolean active; + + private static final Gson GSON = new Gson(); + + public HalloweenDB() { + + } + + public HalloweenDB(String currentAdvancement, String currentUnlocked, boolean active) { + this.currentAdvancement = currentAdvancement; + this.unlockedRooms = currentUnlocked; + this.active = active; + } + + public void setContent(String[] array) { + unlockedRooms = GSON.toJson(array); + } + + public String[] getContent() { + if (unlockedRooms == null) return new String[0]; + return GSON.fromJson(unlockedRooms, String[].class); + } + +} From 635ca6d7bd11b3a882cd4899ef1a9699683076a0 Mon Sep 17 00:00:00 2001 From: Nocolm Date: Sat, 19 Sep 2026 12:54:08 +0200 Subject: [PATCH 3/6] add Managers, base Dimension, start of the menus --- src/main/java/fr/openmc/core/OMCRegistry.java | 4 + ...weenManager.java => HalloweenManager.java} | 2 +- .../halloween/dimension/DimensionManager.java | 26 ++- .../dimension/WitchHouseManager.java | 4 + .../halloween/halloween/shop/ShopMoney.java | 15 ++ .../halloween/shop/WitchShopItem.java | 37 ++++ .../halloween/shop/WitchShopManager.java | 144 ++++++++++++ .../halloween/shop/menu/ConfirmMenu.java | 209 ++++++++++++++++++ .../shop/menu/WitchShopMainMenu.java | 76 +++++++ .../shop/menu/WitchShopStoreMenu.java | 170 ++++++++++++++ .../shop/menu/buttons/WitchHouseButton.java | 34 +++ .../shop/menu/buttons/WitchStoreButton.java | 42 ++++ .../halloween/model/SEHalloweenEventData.java | 10 +- .../registry/structures/CustomStructure.java | 69 ++++++ .../structures/CustomStructureRegistry.java | 36 +++ .../contents/omc_menus/configs/menus.yml | 6 + .../textures/halloween_event_main_menu.png | Bin 0 -> 6468 bytes .../omc_halloween/dimension/witch_house.json | 12 + .../datapacks/omc_halloween/pack.mcmeta | 8 + 19 files changed, 888 insertions(+), 16 deletions(-) rename src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/{SEHalloweenManager.java => HalloweenManager.java} (95%) create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/WitchHouseManager.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/ConfirmMenu.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopStoreMenu.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchHouseButton.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchStoreButton.java create mode 100644 src/main/java/fr/openmc/core/registry/structures/CustomStructure.java create mode 100644 src/main/java/fr/openmc/core/registry/structures/CustomStructureRegistry.java create mode 100644 src/main/resources/contents/omc_menus/textures/halloween_event_main_menu.png create mode 100644 src/main/resources/datapacks/omc_halloween/data/omc_halloween/dimension/witch_house.json create mode 100644 src/main/resources/datapacks/omc_halloween/pack.mcmeta diff --git a/src/main/java/fr/openmc/core/OMCRegistry.java b/src/main/java/fr/openmc/core/OMCRegistry.java index 1681ea3ef..b2d410890 100644 --- a/src/main/java/fr/openmc/core/OMCRegistry.java +++ b/src/main/java/fr/openmc/core/OMCRegistry.java @@ -14,6 +14,7 @@ import fr.openmc.core.registry.loottable.CustomLootTableRegistry; import fr.openmc.core.registry.mobs.CustomMobRegistry; import fr.openmc.core.registry.regions.CustomRegionRegistry; +import fr.openmc.core.registry.structures.CustomStructureRegistry; import io.papermc.paper.plugin.bootstrap.BootstrapContext; import java.io.IOException; @@ -30,6 +31,7 @@ public final class OMCRegistry { public static CustomLootTableRegistry CUSTOM_LOOT_TABLES; public static CustomAmbientRegistry CUSTOM_AMBIENTS; public static CustomLootboxRegistry CUSTOM_LOOTBOXES; + public static CustomStructureRegistry CUSTOM_STRUCTURES; public static CustomRegionRegistry CUSTOM_REGIONS; // * Registre des features @@ -56,6 +58,8 @@ public final class OMCRegistry { RegistryLoadingType.AFTER_IA), new RegistryContext(() -> CUSTOM_MOBS = new CustomMobRegistry(), RegistryLoadingType.AFTER_IA), + new RegistryContext(() -> CUSTOM_STRUCTURES = new CustomStructureRegistry(), + RegistryLoadingType.RUNTIME), new RegistryContext(() -> WEEKLY_EVENTS = new WeeklyEventsRegistry(), RegistryLoadingType.AFTER_IA), new RegistryContext(() -> DAILY_EVENTS = new DailyEventsRegistry(), diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/SEHalloweenManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/HalloweenManager.java similarity index 95% rename from src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/SEHalloweenManager.java rename to src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/HalloweenManager.java index 0299ed740..fea3ad91a 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/SEHalloweenManager.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/HalloweenManager.java @@ -17,7 +17,7 @@ import java.sql.SQLException; import java.util.*; -public class SEHalloweenManager extends Feature implements HasDatabase, HasListeners, HasCommands { +public class HalloweenManager extends Feature implements HasDatabase, HasListeners, HasCommands { @Getter private static HalloweenDB halloweenDB; diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/DimensionManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/DimensionManager.java index 07b3ca096..ac7c714df 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/DimensionManager.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/DimensionManager.java @@ -1,26 +1,21 @@ package fr.openmc.core.features.events.contents.halloween.halloween.dimension; -import fr.openmc.core.OMCPlugin; import fr.openmc.core.bootstrap.integration.OMCLogger; -import fr.openmc.core.features.dream.DreamDimensionManager; import org.bukkit.Bukkit; import org.bukkit.GameRules; import org.bukkit.World; import org.bukkit.entity.SpawnCategory; -import java.io.File; - public class DimensionManager { public static final String DIMENSION_NAME = "world_omc_halloween_witch_house"; public static World HALLOWEEN_WORLD; public static void init() { -// seedFile = new File(OMCPlugin.getInstance().getDataFolder() + "/data/dream", "seed.yml"); -// loadSeed(); HALLOWEEN_WORLD = Bukkit.getWorld(DIMENSION_NAME); setupDimension(); +// loadRegions(); } //TODO setup la dimension : @@ -28,7 +23,7 @@ public static void init() { // - ambiant custom private static void setupDimension() { - if (!HALLOWEEN_WORLD.getName().equals(DreamDimensionManager.DIMENSION_NAME)) return; + if (!HALLOWEEN_WORLD.getName().equals(DIMENSION_NAME)) return; // ** SPAWNING RULES ** HALLOWEEN_WORLD.setSpawnLimit(SpawnCategory.MONSTER, 10); @@ -51,10 +46,21 @@ private static void setupDimension() { HALLOWEEN_WORLD.setGameRule(GameRules.ALLOW_ENTERING_NETHER_USING_PORTALS, false); // ** SET WORLD BORDER AND TIME ** - HALLOWEEN_WORLD.getWorldBorder().setSize(10000); - HALLOWEEN_WORLD.setTime(18000); + HALLOWEEN_WORLD.getWorldBorder().setSize(500); + HALLOWEEN_WORLD.setTime(14000); - OMCLogger.infoFormatted("Dimension des rêves setup (gamerules, worldborder, time)"); + OMCLogger.infoFormatted("Dimension de la Maison de la Sorcière setup (gamerules, worldborder, time)"); } + //TODO modifier avec les region de bibi +// private static void loadRegions() { +// MultiRegion multiRegion = new MultiRegion( +// HALLOWEEN_WORLD, +// new SquareRegion(0.0, 60.0, 0.0, 6.0, 70.0, 3.0, HALLOWEEN_WORLD), +// new SquareRegion(0.0, 60.0, 6.0, 3.0, 70.0, 3.0, HALLOWEEN_WORLD) +// ); +// +// multiRegion.addDetection(); +// } + } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/WitchHouseManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/WitchHouseManager.java new file mode 100644 index 000000000..3b0e0e870 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/WitchHouseManager.java @@ -0,0 +1,4 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.dimension; + +public class WitchHouseManager { +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java new file mode 100644 index 000000000..cf3e688ba --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java @@ -0,0 +1,15 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.shop; + +import lombok.Getter; + +@Getter +public enum ShopMoney { + MONSTER_CANDY(WitchShopManager.getMoneyItemIcon("")), + ; + + private final String icon; + + ShopMoney(String icon) { + this.icon = icon; + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java new file mode 100644 index 000000000..810b75715 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java @@ -0,0 +1,37 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.shop; + +import fr.openmc.core.features.events.contents.halloween.halloween.dimension.advancement.Advancements; +import fr.openmc.core.registry.items.CustomItem; +import lombok.Getter; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.TextDecoration; + +public class WitchShopItem { + + @Getter public final Advancements advancements; + @Getter public final CustomItem item; + public final Component name; + @Getter public final ShopMoney shopMoney; + @Getter public final int price; + + + public WitchShopItem(Advancements advancements, CustomItem item, Component name, ShopMoney moneyItem, int price) { + this.advancements = advancements; + this.item = item; + this.name = name; + this.shopMoney = moneyItem; + this.price = price; + } + public WitchShopItem(Advancements advancements, CustomItem item, Component name, int price) { + this.advancements = advancements; + this.item = item; + this.name = name; + this.shopMoney = ShopMoney.MONSTER_CANDY; + this.price = price; + } + + public Component getName() { + // TODO get current advancement + return Component.text("aaaaaaaaaa").decoration(TextDecoration.OBFUSCATED, false); + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java new file mode 100644 index 000000000..56957ff40 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java @@ -0,0 +1,144 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.shop; + +import dev.lone.itemsadder.api.FontImages.FontImageWrapper; +import fr.openmc.core.features.adminshop.AdminShopUtils; +import fr.openmc.core.hooks.itemsadder.ItemsAdderHook; +import fr.openmc.core.utils.bukkit.ItemUtils; +import fr.openmc.core.utils.text.messages.MessageType; +import fr.openmc.core.utils.text.messages.MessagesManager; +import fr.openmc.core.utils.text.messages.Prefix; +import fr.openmc.core.utils.text.messages.TranslationManager; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; +import net.kyori.adventure.text.format.TextDecoration; +import org.bukkit.Sound; +import org.bukkit.entity.Player; + +import java.util.*; + +public class WitchShopManager { + + //TODO idée : + // bruit de sorcière quand on buy un item + + public static Set witchStoreItems; + public static Map> paginateWitchStoreItems; + + public static int maxPage; + + public static int SLOT_FACTOR = 28; + private static final Sound BUY_SOUND = Sound.ENTITY_WITCH_CELEBRATE; + + public void init() { + witchStoreItems = getWitchStoreItems(); + paginateWitchStoreItems = getPaginateWitchStoreItems(); + maxPage = getWitchStorePages(); + } + + private static Set getWitchStoreItems() { + return Set.of( + new WitchShopItem() + ); + } + + private static Map> getPaginateWitchStoreItems() { + Map> paginateItems = new HashMap<>(); + + List list = new ArrayList<>(witchStoreItems); + + int page = 1; + + for (int i = 0; i < list.size(); i += SLOT_FACTOR) { + + List subList = list.subList(i, Math.min(i + SLOT_FACTOR, list.size())); + + paginateItems.put(page++, new HashSet<>(subList)); + } + + return paginateItems; + } + + public static Set getStoreContent(int page) { + if (paginateWitchStoreItems == null) + paginateWitchStoreItems = getPaginateWitchStoreItems(); + + if (page > maxPage) + page = maxPage; + + return paginateWitchStoreItems.get(page); + } + + private static int getWitchStorePages() { + return witchStoreItems.size() / SLOT_FACTOR; + } + + public static void buyItem(Player player, WitchShopItem item, int amount) { + if (item == null) return; + + if (amount <= 0) { + sendError(player, TranslationManager.translation("feature.adminshop.amount_sup")); + return; + } + + if (!ItemUtils.hasEnoughSpace(player, item.getItem().getBest(), amount)) { + sendError(player, TranslationManager.translation("feature.adminshop.inventory_full")); + return; + } + + if (item.getPrice() <= 0) { + sendError(player, TranslationManager.translation("feature.adminshop.item_not_sellable")); + return; + } + + int totalPrice = item.getPrice() * amount; + if (ItemUtils.hasEnoughItems(player, item.getItem().getBest(), totalPrice)) { + + ItemUtils.giveItem(player, item.getItem().getBest(), amount); + + sendInfo(player, TranslationManager.translation("feature.adminshop.player_buy_item", + Component.text(amount), item.getName(), Component.text(AdminShopUtils.formatPrice(totalPrice)) + )); + + player.playSound(player, BUY_SOUND, 1f, 1f); //TODO random pitch + } else { + sendError(player, TranslationManager.translation("feature.adminshop.have_enough_money")); //TODO + } + } + + private static void sendError(Player player, Component message) { + MessagesManager.sendMessage(player, message, Prefix.ADMINSHOP, MessageType.ERROR, true); //TODO prefix + } + + private static void sendInfo(Player player, Component message) { + MessagesManager.sendMessage(player, message, Prefix.ADMINSHOP, MessageType.INFO, true); //TODO prefix + } + + public static List extractLoreForItem(WitchShopItem item) { + List lore = new ArrayList<>(); + + if (true) { + lore.add(TranslationManager.translation("feature.adminshop.lore_item.buy", //TODO dire a qu'elle room on le débloque + Component.text(item.getAdvancements().name()) + ).color(NamedTextColor.GREEN).decoration(TextDecoration.ITALIC, false)); + } // TODO check the item advancement and compare with the currents + else { + lore.add(TranslationManager.translation("feature.adminshop.lore_item.buy", //TODO + Component.text(getPrice(item)) + ).color(NamedTextColor.GREEN).decoration(TextDecoration.ITALIC, false)); + } + + return lore; + } + + public static String getPrice(WitchShopItem item) { + return item.getPrice() + " " + item.getShopMoney(); + } + + public static String getMoneyItemIcon(String icon) { + if (ItemsAdderHook.isEnable()) { + return FontImageWrapper.replaceFontImages("§f:"+icon+":"); //TODO omc_icons + } else { + return "Ⓐ"; + } + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/ConfirmMenu.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/ConfirmMenu.java new file mode 100644 index 000000000..e2bda17a3 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/ConfirmMenu.java @@ -0,0 +1,209 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.shop.menu; + +import dev.lone.itemsadder.api.FontImages.FontImageWrapper; +import fr.openmc.api.input.dialog.DialogInput; +import fr.openmc.api.menulib.Menu; +import fr.openmc.api.menulib.utils.InventorySize; +import fr.openmc.api.menulib.utils.ItemMenuBuilder; +import fr.openmc.core.OMCRegistry; +import fr.openmc.core.features.adminshop.AdminShopManager; +import fr.openmc.core.features.adminshop.ShopItem; +import fr.openmc.core.features.economy.EconomyManager; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.WitchShopItem; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.WitchShopManager; +import fr.openmc.core.registry.items.CustomItem; +import fr.openmc.core.utils.bukkit.ItemUtils; +import fr.openmc.core.utils.text.messages.TranslationManager; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; +import net.kyori.adventure.text.format.TextDecoration; +import org.bukkit.Material; +import org.bukkit.Sound; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.ClickType; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; + +public class ConfirmMenu extends Menu { + + private final WitchShopItem shopItem; + private int quantity; + private final int maxQuantity; + + public ConfirmMenu(Player owner, WitchShopItem shopItem) { + super(owner); + this.shopItem = shopItem; + this.quantity = 1; + this.maxQuantity = getMaxBuyQuantity(owner, shopItem); + } + + @Override + public @NotNull Component getName() { + return TranslationManager.translation("feature.adminshop.menu.confirm.name"); + } + + @Override + public String getTexture() { + return FontImageWrapper.replaceFontImages("§r§f:offset_-11::adminshop:"); + } + + @Override + public @NotNull InventorySize getInventorySize() { + return InventorySize.NORMAL; + } + + @Override + public void onInventoryClick(InventoryClickEvent inventoryClickEvent) {} + + @Override + public @NotNull Map getContent() { + Map content = new HashMap<>(); + int pricePerUnit = shopItem.getPrice(); + int totalPrice = pricePerUnit * quantity; + int quantityToStack = Math.max(0, quantity / 64); + + List lore = TranslationManager.translationLore("feature.adminshop.menu.confirm.lore", + Component.text(String.valueOf(quantity), NamedTextColor.WHITE), + Component.text(String.valueOf(quantityToStack), NamedTextColor.WHITE), + quantityToStack > 1 ? Component.text("s", NamedTextColor.WHITE) : Component.empty(), + Component.text(AdminShopManager.priceFormat.format(pricePerUnit), NamedTextColor.GREEN), + Component.text(shopItem.getShopMoney().getIcon(), NamedTextColor.GREEN), + Component.text(AdminShopManager.priceFormat.format(totalPrice), NamedTextColor.GREEN), + Component.text(shopItem.getShopMoney().getIcon(), NamedTextColor.GREEN) + + ); + + content.put(9, new ItemMenuBuilder(this, OMCRegistry.CUSTOM_ITEMS.REFUSE_BTN, true)); + + content.put(10, createQuantityButton("-64", OMCRegistry.CUSTOM_ITEMS.BTN_64, event -> { + if (quantity > 64) quantity -= 64; + else quantity = 1; + this.open(); + })); + + content.put(11, createQuantityButton("-10", OMCRegistry.CUSTOM_ITEMS.MINUS_BTN, event -> { + if (quantity > 10) quantity -= 10; + else quantity = 1; + this.open(); + })); + + content.put(12, createQuantityButton("-1", OMCRegistry.CUSTOM_ITEMS.BTN_1, event -> { + if (quantity > 1) quantity--; + else quantity = 1; + this.open(); + })); + + content.put(13, new ItemMenuBuilder(this, shopItem.getItem(), meta -> { + meta.displayName(shopItem.getName().color(NamedTextColor.WHITE).decoration(TextDecoration.ITALIC, false)); + meta.lore(lore); + }).setOnClick(event -> { + if (event.getClick() == ClickType.MIDDLE) { + DialogInput.sendFloat( + getOwner(), + TranslationManager.translation("feature.adminshop.menu.confirm.input"), + 1, + maxQuantity, + quantity, + input -> { + if (input != null) { + int inputQuantity = (int) input.doubleValue(); + if (inputQuantity > 0) { + quantity = Math.min(inputQuantity, maxQuantity); + this.open(); + } + } + } + ); + } + })); + + content.put(14, createQuantityButton("+1", OMCRegistry.CUSTOM_ITEMS.BTN_1, event -> increaseQuantity(1))); + + content.put(15, createQuantityButton("+10", OMCRegistry.CUSTOM_ITEMS.BTN_10, event -> increaseQuantity(10))); + + content.put(16, createQuantityButton("+64", OMCRegistry.CUSTOM_ITEMS.BTN_64, event -> increaseQuantity(64))); + + content.put(17, new ItemMenuBuilder(this, OMCRegistry.CUSTOM_ITEMS.ACCEPT_BTN, meta -> { + meta.displayName(TranslationManager.translation("messages.global.accept")); + }).setOnClick(event -> { + getOwner().closeInventory(); + WitchShopManager.buyItem(getOwner(), shopItem, quantity); + })); + + return content; + } + + /** + * Creates a quantity button with the specified text and item stack. + * + * @param text The text to display on the button. + * @param itemStack The item stack to use for the button. + * @param action The action to perform when the button is clicked. + * @return The created item stack. + */ + private ItemMenuBuilder createQuantityButton(String text, ItemStack itemStack, Consumer action) { + boolean plus = text.contains("+"); + return new ItemMenuBuilder(this, itemStack, meta -> + meta.displayName(TranslationManager.translation("feature.adminshop.menu.confirm.quantity", + plus ? + TranslationManager.translation("feature.adminshop.menu.confirm.add") : + TranslationManager.translation("feature.adminshop.menu.confirm.remove"), + Component.text(text.replace("+", "").replace("-", ""))) + .color(plus ? NamedTextColor.GREEN : NamedTextColor.RED) + .decoration(TextDecoration.ITALIC, false))) + .setItemId("quantity_" + text.replace("+", "plus").replace("-", "minus")) + .setOnClick(action); + } + + /** + * Creates a quantity button with the specified text and item stack. + * + * @param text The text to display on the button. + * @param customItem The CustomItem to use for the button. + * @param action The action to perform when the button is clicked. + * @return The created item stack. + */ + private ItemMenuBuilder createQuantityButton(String text, CustomItem customItem, Consumer action) { + return this.createQuantityButton(text, customItem.getBest(), action); + } + + /** + * Increases the quantity by the specified amount, ensuring it does not exceed the maximum allowed quantity. + * + * @param amount The amount to increase the quantity by. + */ + private void increaseQuantity(int amount) { + quantity = Math.min(quantity + amount, maxQuantity); + this.open(); + } + + private int getMaxBuyQuantity(Player player, WitchShopItem shopItem) { + int freePlaces = ItemUtils.getFreePlacesForItem(player, shopItem.getItem().getBest()); + + double buyPrice = shopItem.getPrice(); + if (buyPrice <= 0) return freePlaces; + + double balance = ItemUtils.countItems(player, shopItem.getItem().getBest()); + int affordable = (int) Math.floor(balance / buyPrice); + + return Math.min(freePlaces, affordable); + } + + + @Override + public void onClose(InventoryCloseEvent event) { + //empty + } + + @Override + public List getTakableSlot() { + return List.of(); + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java new file mode 100644 index 000000000..d31fb770e --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java @@ -0,0 +1,76 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.shop.menu; + +import fr.openmc.api.menulib.Menu; +import fr.openmc.api.menulib.utils.InventorySize; +import fr.openmc.api.menulib.utils.ItemMenuBuilder; +import fr.openmc.core.features.city.City; +import fr.openmc.core.features.city.CityManager; +import fr.openmc.core.features.city.menu.main.buttons.*; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.menu.buttons.WitchHouseButton; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.menu.buttons.WitchStoreButton; +import fr.openmc.core.utils.text.messages.TranslationManager; +import net.kyori.adventure.text.Component; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.jetbrains.annotations.NotNull; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WitchShopMainMenu extends Menu { + + private static final int[] WITCH_HOUSE_SLOTS = {8, 9, 10, 11, 12, 13, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49}; + private static final int[] WITCH_SHOP_SLOTS = {23, 24, 25, 26, 32, 33, 34, 35, 41, 42, 43, 44, 50, 51, 52, 53}; + + public WitchShopMainMenu(Player owner) { + super(owner); + } + + @Override + public @NotNull Component getName() { + return TranslationManager.translation("feature.city.menus.main.name"); //TODO + } + + @Override + public String getTexture() { + return "§r§f:offset_-48::halloween.event_main_menu:"; + } + + @Override + public @NotNull InventorySize getInventorySize() { + return InventorySize.LARGEST; + } + + @Override + public @NotNull Map getContent() { + Map inventory = new HashMap<>(); + Player player = getOwner(); + + City city = CityManager.getPlayerCity(player.getUniqueId()); + assert city != null; + + // ** Witch House Button + WitchHouseButton.init(this, inventory, WITCH_HOUSE_SLOTS); + + // ** Witch Store Button + WitchStoreButton.init(this, inventory, WITCH_SHOP_SLOTS); + + return inventory; + } + + @Override + public List getTakableSlot() { + return List.of(); + } + + @Override + public void onClose(InventoryCloseEvent event) { + //TODO bruit de sorcière + } + + @Override + public void onInventoryClick(InventoryClickEvent click) { + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopStoreMenu.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopStoreMenu.java new file mode 100644 index 000000000..470ca207d --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopStoreMenu.java @@ -0,0 +1,170 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.shop.menu; + +import fr.openmc.api.menulib.MenuLib; +import fr.openmc.api.menulib.PaginatedMenu; +import fr.openmc.api.menulib.utils.InventorySize; +import fr.openmc.api.menulib.utils.ItemMenuBuilder; +import fr.openmc.api.menulib.utils.MenuUtils; +import fr.openmc.api.menulib.utils.StaticSlots; +import fr.openmc.core.OMCPlugin; +import fr.openmc.core.OMCRegistry; +import fr.openmc.core.commands.utils.Restart; +import fr.openmc.core.features.city.City; +import fr.openmc.core.features.city.CityManager; +import fr.openmc.core.features.city.CityPermission; +import fr.openmc.core.features.city.actions.CityChestAction; +import fr.openmc.core.features.city.menu.CityChestMenu; +import fr.openmc.core.features.city.sub.milestone.rewards.ChestPageLimitRewards; +import fr.openmc.core.features.economy.EconomyManager; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.WitchShopItem; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.WitchShopManager; +import fr.openmc.core.utils.text.messages.TranslationManager; +import lombok.Getter; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; +import net.minecraft.world.level.levelgen.Column; +import org.bukkit.Bukkit; +import org.bukkit.Material; +import org.bukkit.entity.HumanEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.inventory.InventoryClickEvent; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.ItemStack; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.*; +import java.util.stream.IntStream; +import java.util.stream.Stream; + +import static fr.openmc.core.features.city.conditions.CityChestConditions.*; + +public class WitchShopStoreMenu extends PaginatedMenu { + + @Getter + private final int page; + + private final Column.Range line = new Column.Range(10, 16); + private final int column = 4; + + public WitchShopStoreMenu(Player owner, int page) { + super(owner); + this.page = page; + + if (this.page < 1) { + throw new IllegalArgumentException("Page must be greater than 0"); + } + + if (this.page > WitchShopManager.maxPage) { + throw new IllegalArgumentException("Page must be less than or equal to " + WitchShopManager.maxPage); + } + } + + @Override + public @Nullable Material getBorderMaterial() { + return Material.AIR; + } + + @Override + public @NotNull List getStaticSlots() { + return StaticSlots.getBottomSlots(getInventorySize()); + } + + @Override + public List getItems() { + return List.of(); + } + + @Override + public Map getButtons() { + if (Restart.isRestarting) return null; + + Map map = new HashMap<>(); + + if (hasPreviousPage()) { + map.put(45, new ItemMenuBuilder(this, OMCRegistry.CUSTOM_ITEMS.ICON_BACK_ORANGE, itemMeta -> { + itemMeta.displayName(TranslationManager.translation("messages.menus.previous_page")); + }).setPreviousPageButton()); + } + + map.put(49, new ItemMenuBuilder(this, OMCRegistry.CUSTOM_ITEMS.ICON_CANCEL, itemMeta -> { + itemMeta.displayName(TranslationManager.translation("messages.menus.close")); + }).setOnClick(event -> { + //TODO open the WitchShopMainMenu + })); + + if (hasNextPage()) { + map.put(53, new ItemMenuBuilder(this, OMCRegistry.CUSTOM_ITEMS.ICON_NEXT_ORANGE, itemMeta -> { + itemMeta.displayName(TranslationManager.translation("messages.menus.next_page")); + }).setNextPageButton()); + } + + Iterator contents = WitchShopManager.getStoreContent(this.page).iterator(); + + for (int c = 0; c < column; c++) { + for (int l = line.floor(); l <= line.ceiling(); l++) { + + if (!contents.hasNext()) break; + + WitchShopItem item = contents.next(); + + map.put(l + (9 * c), new ItemMenuBuilder(this, item.getItem(), itemMeta -> { + itemMeta.displayName(item.getName()); + itemMeta.lore(WitchShopManager.extractLoreForItem(item)); + }).setOnClick(event -> { + //TODO open confirm menu if has enough moneyItem + })); + } + } + + return map; + } + + @Override + public @NotNull Component getName() { + return TranslationManager.translation("feature.city.menus.chest.name", + Component.text(""), Component.text(this.page)); //TODO + } + + @Override + public String getTexture() { + return "§r§f:offset_-48::city_template6x9:"; //TODO + } + + @Override + public void onInventoryClick(InventoryClickEvent inventoryClickEvent) { + } + + @Override + public @NotNull InventorySize getInventorySize() { + return InventorySize.LARGEST; + } + + @Override + public int getSizeOfItems() { + return getItems().size(); + } + + @Override + public void onClose(InventoryCloseEvent event) { + if (Restart.isRestarting) return; + HumanEntity humanEntity = event.getPlayer(); + if (!(humanEntity instanceof Player player)) return; + // fixes #1007 + Bukkit.getScheduler().runTaskLater(OMCPlugin.getInstance(), ()-> MenuLib.updateMenu(player), 5L); + } + + @Override + public List getTakableSlot() { + return List.of(); + } + + public boolean hasNextPage() { + return this.page < WitchShopManager.maxPage; + } + + public boolean hasPreviousPage() { + return this.page > 1; + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchHouseButton.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchHouseButton.java new file mode 100644 index 000000000..d53ef41f4 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchHouseButton.java @@ -0,0 +1,34 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.shop.menu.buttons; + +import fr.openmc.api.menulib.Menu; +import fr.openmc.api.menulib.utils.ItemMenuBuilder; +import fr.openmc.api.menulib.utils.MenuUtils; +import fr.openmc.core.utils.text.messages.TranslationManager; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Player; + +import java.util.Map; + +public class WitchHouseButton { + public static void init(Menu menu, Map contents, int[] slots) { + Player player = menu.getOwner(); + + MenuUtils.createButtonItem( + contents, + slots, + new ItemMenuBuilder(menu, Material.PAPER, itemMeta -> { + itemMeta.displayName(TranslationManager.translation("feature.city.menus.main.ranks.title"));//TODO + itemMeta.lore(TranslationManager.translationLore( + "feature.city.menus.main.ranks.lore.unlocked", //TODO + Component.text("").color(NamedTextColor.LIGHT_PURPLE) + )); + itemMeta.setItemModel(NamespacedKey.minecraft("air")); + }).setOnClick(inventoryClickEvent -> { //TODO tp dans la dimension + + }) + ); + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchStoreButton.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchStoreButton.java new file mode 100644 index 000000000..0266329a2 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchStoreButton.java @@ -0,0 +1,42 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.shop.menu.buttons; + +import fr.openmc.api.menulib.Menu; +import fr.openmc.api.menulib.utils.ItemMenuBuilder; +import fr.openmc.api.menulib.utils.MenuUtils; +import fr.openmc.core.features.city.City; +import fr.openmc.core.features.city.sub.milestone.rewards.FeaturesRewards; +import fr.openmc.core.features.city.sub.rank.menus.CityRanksMenu; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.menu.WitchShopStoreMenu; +import fr.openmc.core.utils.text.messages.MessageType; +import fr.openmc.core.utils.text.messages.MessagesManager; +import fr.openmc.core.utils.text.messages.Prefix; +import fr.openmc.core.utils.text.messages.TranslationManager; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; +import org.bukkit.Material; +import org.bukkit.NamespacedKey; +import org.bukkit.entity.Player; + +import java.util.List; +import java.util.Map; + +public class WitchStoreButton { + public static void init(Menu menu, Map contents, int[] slots) { + Player player = menu.getOwner(); + + MenuUtils.createButtonItem( + contents, + slots, + new ItemMenuBuilder(menu, Material.PAPER, itemMeta -> { + itemMeta.displayName(TranslationManager.translation("feature.city.menus.main.ranks.title")); //TODO + itemMeta.lore(TranslationManager.translationLore( + "feature.city.menus.main.ranks.lore.unlocked", //TODO + Component.text("").color(NamedTextColor.LIGHT_PURPLE) + )); + itemMeta.setItemModel(NamespacedKey.minecraft("air")); + }).setOnClick(inventoryClickEvent -> { + new WitchShopStoreMenu(player, 1).open(); + }) + ); + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java index c68faab23..43b427fa6 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java +++ b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java @@ -30,11 +30,11 @@ public class SEHalloweenEventData { public SEHalloweenEventData() {} public SEHalloweenEventData(WeeklyEvent currentEvent, WeeklyEventPhase currentPhase) { - this.currentEvent = currentEvent.getId(); - if (currentPhase == null) - this.currentPhase = null; - else - this.currentPhase = currentPhase.getId(); +// this.currentEvent = currentEvent.getId(); +// if (currentPhase == null) +// this.currentPhase = null; +// else +// this.currentPhase = currentPhase.getId(); } private static final Gson GSON = new Gson(); diff --git a/src/main/java/fr/openmc/core/registry/structures/CustomStructure.java b/src/main/java/fr/openmc/core/registry/structures/CustomStructure.java new file mode 100644 index 000000000..9c5741f0d --- /dev/null +++ b/src/main/java/fr/openmc/core/registry/structures/CustomStructure.java @@ -0,0 +1,69 @@ +package fr.openmc.core.registry.structures; + +import lombok.Getter; +import net.minecraft.core.BlockPos; +import net.minecraft.core.registries.Registries; +import net.minecraft.nbt.CompoundTag; +import net.minecraft.nbt.NbtAccounter; +import net.minecraft.nbt.NbtIo; +import net.minecraft.server.level.ServerLevel; +import net.minecraft.world.level.block.Mirror; +import net.minecraft.world.level.block.Rotation; +import net.minecraft.world.level.levelgen.structure.templatesystem.StructurePlaceSettings; +import net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate; +import org.bukkit.Location; +import org.bukkit.craftbukkit.CraftWorld; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; + +public class CustomStructure { + + @Getter + String id; + File file; + + public CustomStructure(String id, File file) { + this.id = id; + this.file = file; + } + + public void placeStructure(Location origin, boolean mirrorX, boolean mirrorZ) { + ServerLevel level = ((CraftWorld) origin.getWorld()).getHandle(); + + try (InputStream in = new FileInputStream(file)) { + + CompoundTag tag = NbtIo.readCompressed(in, NbtAccounter.unlimitedHeap()); + + StructureTemplate template = new StructureTemplate(); + + template.load( + level.registryAccess().lookupOrThrow(Registries.BLOCK), + tag + ); + + StructurePlaceSettings settings = new StructurePlaceSettings(); + + if (mirrorX) settings.setMirror(Mirror.FRONT_BACK); + if (mirrorZ) settings.setMirror(Mirror.LEFT_RIGHT); + + settings.setRotation(Rotation.NONE); + + BlockPos pos = new BlockPos(origin.getBlockX(), origin.getBlockY(), origin.getBlockZ()); + + template.placeInWorld( + level, + pos, + pos, + settings, + level.getRandom(), + 2 + ); + + } catch (Exception e) { + e.printStackTrace(); + } + } +} + diff --git a/src/main/java/fr/openmc/core/registry/structures/CustomStructureRegistry.java b/src/main/java/fr/openmc/core/registry/structures/CustomStructureRegistry.java new file mode 100644 index 000000000..002f6a35b --- /dev/null +++ b/src/main/java/fr/openmc/core/registry/structures/CustomStructureRegistry.java @@ -0,0 +1,36 @@ +package fr.openmc.core.registry.structures; + +import fr.openmc.core.OMCPlugin; +import fr.openmc.core.bootstrap.registries.KeyedRegistry; +import fr.openmc.core.bootstrap.registries.Registry; +import fr.openmc.core.utils.FilesUtils; + +import java.io.File; + +public class CustomStructureRegistry extends Registry + implements KeyedRegistry { + + private static final File structureFolder = new File(OMCPlugin.getInstance().getDataFolder(), "data/omc_structure"); + + // ** REGISTER STRUCTURES ** + public final CustomStructure TEST = register("omc_structure:test","pillar.nbt"); + + public CustomStructureRegistry() { + FilesUtils.createDirectoryIfNotExists(structureFolder); + } + + @Override + public String key(CustomStructure registryObject) { + return registryObject.getId(); + } + + public CustomStructure register(String name, String fileName) { + return register(name, new File(structureFolder, fileName)); + } + + public CustomStructure register(String name, File file) { + if (file == null || name == null) return null; + if (!file.exists()) return null; + return KeyedRegistry.super.register(new CustomStructure(name, file)); + } +} \ No newline at end of file diff --git a/src/main/resources/contents/omc_menus/configs/menus.yml b/src/main/resources/contents/omc_menus/configs/menus.yml index 6732011ac..dff153e67 100644 --- a/src/main/resources/contents/omc_menus/configs/menus.yml +++ b/src/main/resources/contents/omc_menus/configs/menus.yml @@ -61,6 +61,12 @@ font_images: suggestion_in_command: false path: "city_template6x9.png" y_position: 30 + halloween_event_main_menu: + permission: halloween.event_main_menu + show_in_gui: true + suggestion_in_command: false + path: "halloween.event_main_menu.png" + y_position: 30 home_mailbox: permission: mailbox.home show_in_gui: true diff --git a/src/main/resources/contents/omc_menus/textures/halloween_event_main_menu.png b/src/main/resources/contents/omc_menus/textures/halloween_event_main_menu.png new file mode 100644 index 0000000000000000000000000000000000000000..18ce06fbdabe3bb1a83cca69e0da4b1af49bda77 GIT binary patch literal 6468 zcmeG>^Tnm0BMvikrouCM@SdM^M)08d)~EyNK^5PGIwVzDyQw>wQw72# z-Y38Bx;LPb+|49v>^HzF|M;ik55-t#I&guOO{|ME|6iX(88%&-r@1_6tyNL9NG@j< z;n{!vRp*fj+gtcKCj6OfrUT##O63(T7NMsX*@lp|7GptFh zVz3a!e{#=#G>UBwH4akQoasKu{#;GT7c0hC9m-xVt60qBDAueGu|?5!NdglAoBB&m zIyrk=f)QMjvT1|il)9LFWmuaZY8Y)UUA`Z#7>>A*>BS_(f8QNj$&=~$jq;y*v+dW^JXp%sYJ(nBrOPb14 zkE66No|t;R{l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Q7;7+;L_2nmEuN%Pz~RbJ6RW&GgP%JwT{9sQYL&T%}F zUj6U%6X9YDI>#6=0nc>rXz7(ptc2P+SR+`!!Lu%HIUiY>uXeGo-Fg3?!x{%buls!x zsTcsrg^7IwKoqi50IXw_7T2=Tx|`E};gD+U%rI9`cbbS8* O&EMBE1J~*}$NdkYG!B9Q literal 0 HcmV?d00001 diff --git a/src/main/resources/datapacks/omc_halloween/data/omc_halloween/dimension/witch_house.json b/src/main/resources/datapacks/omc_halloween/data/omc_halloween/dimension/witch_house.json new file mode 100644 index 000000000..25b5d79f6 --- /dev/null +++ b/src/main/resources/datapacks/omc_halloween/data/omc_halloween/dimension/witch_house.json @@ -0,0 +1,12 @@ +{ + "type": "minecraft:overworld", + "generator": { + "type": "minecraft:flat", + "settings": { + "biome": "draft:draft", + "lakes": false, + "features": false, + "layers": [] + } + } +} \ No newline at end of file diff --git a/src/main/resources/datapacks/omc_halloween/pack.mcmeta b/src/main/resources/datapacks/omc_halloween/pack.mcmeta new file mode 100644 index 000000000..a409a42ca --- /dev/null +++ b/src/main/resources/datapacks/omc_halloween/pack.mcmeta @@ -0,0 +1,8 @@ +{ + "pack": { + "description": "Le Pack de données de la Witch House d'OpenMC", + "pack_format": 107.1, + "min_format": 107.1, + "max_format": 107.1 + } +} \ No newline at end of file From 06f3e1c6c1b41285138c56beb0916d54500c1299 Mon Sep 17 00:00:00 2001 From: Nocolm Date: Sun, 20 Sep 2026 22:54:02 +0200 Subject: [PATCH 4/6] grosse update, ajout menu shop, bcp de Todo, DB... --- src/main/java/fr/openmc/core/OMCPlugin.java | 1 + .../halloween/halloween/HalloweenManager.java | 29 +++++-- .../dimension/advancement/Advancements.java | 3 +- .../halloween/model/HalloweenDB.java | 31 ++++---- .../halloween/halloween/shop/ShopMoney.java | 3 +- .../halloween/shop/WitchShopItem.java | 7 +- .../halloween/shop/WitchShopManager.java | 73 +++++++++++------- .../shop/menu/WitchShopMainMenu.java | 6 +- .../shop/menu/WitchShopStoreMenu.java | 52 ++++++++----- .../halloween/SEHalloweenManager.java | 29 ------- .../dimension/advancement/Advancements.java | 15 ---- .../halloween/model/SEHalloweenEventData.java | 51 ------------ .../contents/omc_icons/configs/fonts.yml | 30 +++++++ .../textures/font/candy/candy_blue.png | Bin 0 -> 352 bytes .../textures/font/candy/candy_brown.png | Bin 0 -> 454 bytes .../textures/font/candy/candy_green.png | Bin 0 -> 349 bytes .../textures/font/candy/candy_red.png | Bin 0 -> 312 bytes .../textures/font/candy/candy_yellow.png | Bin 0 -> 335 bytes .../textures/items/candy/candy_blue.png | Bin 0 -> 352 bytes .../textures/items/candy/candy_brown.png | Bin 0 -> 454 bytes .../textures/items/candy/candy_green.png | Bin 0 -> 349 bytes .../textures/items/candy/candy_red.png | Bin 0 -> 312 bytes .../textures/items/candy/candy_yellow.png | Bin 0 -> 335 bytes .../contents/omc_menus/configs/menus.yml | 2 +- 24 files changed, 160 insertions(+), 172 deletions(-) delete mode 100644 src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/SEHalloweenManager.java delete mode 100644 src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/dimension/advancement/Advancements.java delete mode 100644 src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java create mode 100644 src/main/resources/contents/omc_icons/textures/font/candy/candy_blue.png create mode 100644 src/main/resources/contents/omc_icons/textures/font/candy/candy_brown.png create mode 100644 src/main/resources/contents/omc_icons/textures/font/candy/candy_green.png create mode 100644 src/main/resources/contents/omc_icons/textures/font/candy/candy_red.png create mode 100644 src/main/resources/contents/omc_icons/textures/font/candy/candy_yellow.png create mode 100644 src/main/resources/contents/omc_items/textures/items/candy/candy_blue.png create mode 100644 src/main/resources/contents/omc_items/textures/items/candy/candy_brown.png create mode 100644 src/main/resources/contents/omc_items/textures/items/candy/candy_green.png create mode 100644 src/main/resources/contents/omc_items/textures/items/candy/candy_red.png create mode 100644 src/main/resources/contents/omc_items/textures/items/candy/candy_yellow.png diff --git a/src/main/java/fr/openmc/core/OMCPlugin.java b/src/main/java/fr/openmc/core/OMCPlugin.java index 4c3fee7c0..68cf59f5a 100644 --- a/src/main/java/fr/openmc/core/OMCPlugin.java +++ b/src/main/java/fr/openmc/core/OMCPlugin.java @@ -118,6 +118,7 @@ public class OMCPlugin extends JavaPlugin { MailboxManager::new, DiscordLinkManager::new, ProfileManager::new, + () -> new fr.openmc.core.features.events.contents.halloween.halloween.HalloweenManager(), () -> new ElevatorManager(), () -> new CorpseManager(), QuestsManager::new, diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/HalloweenManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/HalloweenManager.java index fea3ad91a..b331c4c97 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/HalloweenManager.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/HalloweenManager.java @@ -8,29 +8,31 @@ import fr.openmc.core.bootstrap.features.types.HasCommands; import fr.openmc.core.bootstrap.features.types.HasDatabase; import fr.openmc.core.bootstrap.features.types.HasListeners; +import fr.openmc.core.bootstrap.features.types.LoadAfterItemsAdder; import fr.openmc.core.bootstrap.integration.OMCLogger; import fr.openmc.core.bootstrap.listeners.ListenerFactory; -import fr.openmc.core.features.corpse.npc.CorpseNPCManager; +import fr.openmc.core.features.events.contents.halloween.halloween.dimension.advancement.Advancements; import fr.openmc.core.features.events.contents.halloween.halloween.model.HalloweenDB; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.WitchShopManager; import lombok.Getter; import java.sql.SQLException; import java.util.*; -public class HalloweenManager extends Feature implements HasDatabase, HasListeners, HasCommands { +public class HalloweenManager extends Feature implements LoadAfterItemsAdder, HasDatabase, HasListeners, HasCommands { @Getter private static HalloweenDB halloweenDB; private static Dao halloweenDao; - public static String[] unlockedRooms; + public static List unlockedRooms; @Override public void init() { - CorpseNPCManager.init(); halloweenDB = loadEvent(); - unlockedRooms = halloweenDB.getContent(); + unlockedRooms = halloweenDB.getUnlockedRooms(); + WitchShopManager.init(); } @Override @@ -46,7 +48,10 @@ protected void save() { public static HalloweenDB loadEvent() { try { - return halloweenDao.queryForFirst(); + HalloweenDB halloweenDB = halloweenDao.queryForFirst(); + if (halloweenDB == null) + halloweenDB = new HalloweenDB(0, List.of(Advancements.ROOM_1.name()), false); + return halloweenDB; } catch (SQLException e) { throw new RuntimeException(e); } @@ -60,6 +65,14 @@ private static void saveEvent() { } } + public static boolean hasUnlock(Advancements advancements) { + return unlockedRooms.contains(advancements.name()); + } + + public static boolean unlockNewRoom(Advancements advancements) { + return unlockedRooms.add(advancements.name()); + } + @Override public Set getListeners() { return Set.of(); @@ -67,6 +80,8 @@ public Set getListeners() { @Override public Set getCommands() { - return Set.of(); + return Set.of( + + ); } } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/Advancements.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/Advancements.java index 88c2ab606..8c47fa78d 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/Advancements.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/Advancements.java @@ -4,7 +4,8 @@ @Getter public enum Advancements { - ROOM_1(1000) + ROOM_1(0), + ROOM_2(1000) ; private final int require; diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/model/HalloweenDB.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/model/HalloweenDB.java index b40d67d40..a80866c35 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/model/HalloweenDB.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/model/HalloweenDB.java @@ -1,46 +1,51 @@ package fr.openmc.core.features.events.contents.halloween.halloween.model; import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; import com.j256.ormlite.field.DatabaseField; import com.j256.ormlite.table.DatabaseTable; import lombok.Getter; import lombok.Setter; +import java.util.ArrayList; +import java.util.List; + @Getter @DatabaseTable(tableName = "halloween_season_event_data") public class HalloweenDB { - @Setter @DatabaseField(columnName = "advancement") - private String currentAdvancement; + private int currentAdvancement; - @Setter @DatabaseField(columnName = "unlocked_room") private String unlockedRooms; - @Setter @DatabaseField(columnName = "is_active") private boolean active; private static final Gson GSON = new Gson(); public HalloweenDB() { - } - public HalloweenDB(String currentAdvancement, String currentUnlocked, boolean active) { + public HalloweenDB(int currentAdvancement, List unlockedRooms, boolean active) { this.currentAdvancement = currentAdvancement; - this.unlockedRooms = currentUnlocked; + this.unlockedRooms = GSON.toJson(unlockedRooms); this.active = active; } - public void setContent(String[] array) { - unlockedRooms = GSON.toJson(array); + public void setUnlockedRooms(List unlockedRooms) { + this.unlockedRooms = GSON.toJson(unlockedRooms); } - public String[] getContent() { - if (unlockedRooms == null) return new String[0]; - return GSON.fromJson(unlockedRooms, String[].class); - } + public List getUnlockedRooms() { + if (unlockedRooms == null || unlockedRooms.isBlank()) { + return new ArrayList<>(); + } + return GSON.fromJson( + unlockedRooms, + new TypeToken>() {}.getType() + ); + } } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java index cf3e688ba..3b3853323 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java @@ -4,7 +4,8 @@ @Getter public enum ShopMoney { - MONSTER_CANDY(WitchShopManager.getMoneyItemIcon("")), + //TODO rajouter les crafts des bonbons et les autre dans le shopMoney + MONSTER_CANDY(WitchShopManager.getMoneyItemIcon("candy_brown")), ; private final String icon; diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java index 810b75715..1b9ce1ed4 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java @@ -1,7 +1,9 @@ package fr.openmc.core.features.events.contents.halloween.halloween.shop; +import fr.openmc.core.features.events.contents.halloween.halloween.HalloweenManager; import fr.openmc.core.features.events.contents.halloween.halloween.dimension.advancement.Advancements; import fr.openmc.core.registry.items.CustomItem; +import fr.openmc.core.utils.text.messages.TranslationManager; import lombok.Getter; import net.kyori.adventure.text.Component; import net.kyori.adventure.text.format.TextDecoration; @@ -31,7 +33,8 @@ public WitchShopItem(Advancements advancements, CustomItem item, Component name, } public Component getName() { - // TODO get current advancement - return Component.text("aaaaaaaaaa").decoration(TextDecoration.OBFUSCATED, false); + if (HalloweenManager.hasUnlock(advancements)) + return name; + return Component.text("§knotunlockyet"); } } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java index 56957ff40..36b6731ac 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java @@ -1,7 +1,10 @@ package fr.openmc.core.features.events.contents.halloween.halloween.shop; import dev.lone.itemsadder.api.FontImages.FontImageWrapper; +import fr.openmc.core.OMCRegistry; import fr.openmc.core.features.adminshop.AdminShopUtils; +import fr.openmc.core.features.events.contents.halloween.halloween.HalloweenManager; +import fr.openmc.core.features.events.contents.halloween.halloween.dimension.advancement.Advancements; import fr.openmc.core.hooks.itemsadder.ItemsAdderHook; import fr.openmc.core.utils.bukkit.ItemUtils; import fr.openmc.core.utils.text.messages.MessageType; @@ -29,18 +32,12 @@ public class WitchShopManager { public static int SLOT_FACTOR = 28; private static final Sound BUY_SOUND = Sound.ENTITY_WITCH_CELEBRATE; - public void init() { + public static void init() { witchStoreItems = getWitchStoreItems(); paginateWitchStoreItems = getPaginateWitchStoreItems(); maxPage = getWitchStorePages(); } - private static Set getWitchStoreItems() { - return Set.of( - new WitchShopItem() - ); - } - private static Map> getPaginateWitchStoreItems() { Map> paginateItems = new HashMap<>(); @@ -69,24 +66,24 @@ public static Set getStoreContent(int page) { } private static int getWitchStorePages() { - return witchStoreItems.size() / SLOT_FACTOR; + return (int) Math.ceil((double) witchStoreItems.size() / SLOT_FACTOR); } public static void buyItem(Player player, WitchShopItem item, int amount) { if (item == null) return; if (amount <= 0) { - sendError(player, TranslationManager.translation("feature.adminshop.amount_sup")); + sendError(player, TranslationManager.translation("feature.adminshop.amount_sup")); //TODO return; } if (!ItemUtils.hasEnoughSpace(player, item.getItem().getBest(), amount)) { - sendError(player, TranslationManager.translation("feature.adminshop.inventory_full")); + sendError(player, TranslationManager.translation("feature.adminshop.inventory_full")); //TODO return; } if (item.getPrice() <= 0) { - sendError(player, TranslationManager.translation("feature.adminshop.item_not_sellable")); + sendError(player, TranslationManager.translation("feature.adminshop.item_not_sellable")); //TODO return; } @@ -95,50 +92,74 @@ public static void buyItem(Player player, WitchShopItem item, int amount) { ItemUtils.giveItem(player, item.getItem().getBest(), amount); - sendInfo(player, TranslationManager.translation("feature.adminshop.player_buy_item", + sendInfo(player, TranslationManager.translation("feature.adminshop.player_buy_item", //TODO Component.text(amount), item.getName(), Component.text(AdminShopUtils.formatPrice(totalPrice)) )); - player.playSound(player, BUY_SOUND, 1f, 1f); //TODO random pitch + player.playSound(player, BUY_SOUND, 1f, new Random().nextFloat(0.6f, 1.4f)); } else { sendError(player, TranslationManager.translation("feature.adminshop.have_enough_money")); //TODO } } private static void sendError(Player player, Component message) { - MessagesManager.sendMessage(player, message, Prefix.ADMINSHOP, MessageType.ERROR, true); //TODO prefix + MessagesManager.sendMessage(player, message, Prefix.HALLOWEEN, MessageType.ERROR, true); } private static void sendInfo(Player player, Component message) { - MessagesManager.sendMessage(player, message, Prefix.ADMINSHOP, MessageType.INFO, true); //TODO prefix + MessagesManager.sendMessage(player, message, Prefix.HALLOWEEN, MessageType.INFO, true); } public static List extractLoreForItem(WitchShopItem item) { List lore = new ArrayList<>(); - if (true) { - lore.add(TranslationManager.translation("feature.adminshop.lore_item.buy", //TODO dire a qu'elle room on le débloque - Component.text(item.getAdvancements().name()) - ).color(NamedTextColor.GREEN).decoration(TextDecoration.ITALIC, false)); - } // TODO check the item advancement and compare with the currents - else { + if (HalloweenManager.hasUnlock(item.getAdvancements())) { lore.add(TranslationManager.translation("feature.adminshop.lore_item.buy", //TODO - Component.text(getPrice(item)) + getPrice(item) ).color(NamedTextColor.GREEN).decoration(TextDecoration.ITALIC, false)); + + } + else { + lore.add(TranslationManager.translation("feature.adminshop.lore_item.buy." + item.getAdvancements().name().toLowerCase()) //TODO change key + .color(NamedTextColor.GREEN).decoration(TextDecoration.ITALIC, false)); } return lore; } - public static String getPrice(WitchShopItem item) { - return item.getPrice() + " " + item.getShopMoney(); + public static Component getPrice(WitchShopItem item) { + return Component.text(item.getPrice() + " " + item.getShopMoney().getIcon()); } public static String getMoneyItemIcon(String icon) { if (ItemsAdderHook.isEnable()) { - return FontImageWrapper.replaceFontImages("§f:"+icon+":"); //TODO omc_icons + return FontImageWrapper.replaceFontImages("§f:"+icon+":"); } else { - return "Ⓐ"; + return "Ⓐ"; //TODO Translationmanager.translate("<...>." + icon) } } + + //TODO mettre les vrais items + private static LinkedHashSet getWitchStoreItems() { + return new LinkedHashSet<>(List.of( + new WitchShopItem( + Advancements.ROOM_1, + OMCRegistry.CUSTOM_ITEMS.AYWENITE, + OMCRegistry.CUSTOM_ITEMS.AYWENITE.getBest().displayName(), + 10 + ), + new WitchShopItem( + Advancements.ROOM_2, + OMCRegistry.CUSTOM_ITEMS.KEBAB, + OMCRegistry.CUSTOM_ITEMS.KEBAB.getBest().displayName(), + 10 + ), + new WitchShopItem( + Advancements.ROOM_2, + OMCRegistry.CUSTOM_ITEMS.NETHERITE_HAMMER, + OMCRegistry.CUSTOM_ITEMS.NETHERITE_HAMMER.getBest().displayName(), + 1000 + ) + )); + } } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java index d31fb770e..26ecb5952 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java @@ -35,7 +35,7 @@ public WitchShopMainMenu(Player owner) { @Override public String getTexture() { - return "§r§f:offset_-48::halloween.event_main_menu:"; + return "§r§f:offset_-48::halloween_event_main_menu:"; } @Override @@ -46,10 +46,6 @@ public String getTexture() { @Override public @NotNull Map getContent() { Map inventory = new HashMap<>(); - Player player = getOwner(); - - City city = CityManager.getPlayerCity(player.getUniqueId()); - assert city != null; // ** Witch House Button WitchHouseButton.init(this, inventory, WITCH_HOUSE_SLOTS); diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopStoreMenu.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopStoreMenu.java index 470ca207d..a6e92ac56 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopStoreMenu.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopStoreMenu.java @@ -8,6 +8,7 @@ import fr.openmc.api.menulib.utils.StaticSlots; import fr.openmc.core.OMCPlugin; import fr.openmc.core.OMCRegistry; +import fr.openmc.core.bootstrap.integration.OMCLogger; import fr.openmc.core.commands.utils.Restart; import fr.openmc.core.features.city.City; import fr.openmc.core.features.city.CityManager; @@ -68,12 +69,33 @@ public WitchShopStoreMenu(Player owner, int page) { @Override public @NotNull List getStaticSlots() { - return StaticSlots.getBottomSlots(getInventorySize()); + return StaticSlots.getStandardSlots(getInventorySize()); } @Override public List getItems() { - return List.of(); + + List items = new ArrayList<>(); + + Iterator contents = WitchShopManager.getStoreContent(this.page).iterator(); + + for (int c = 0; c < column; c++) { + for (int l = line.floor(); l <= line.ceiling(); l++) { + + if (!contents.hasNext()) break; + + WitchShopItem item = contents.next(); + + items.add(new ItemMenuBuilder(this, item.getItem(), itemMeta -> { + itemMeta.displayName(item.getName()); + itemMeta.lore(WitchShopManager.extractLoreForItem(item)); + }).setOnClick(event -> { + //TODO open confirm menu if has enough moneyItem + })); + } + } + + return items; } @Override @@ -91,33 +113,21 @@ public Map getButtons() { map.put(49, new ItemMenuBuilder(this, OMCRegistry.CUSTOM_ITEMS.ICON_CANCEL, itemMeta -> { itemMeta.displayName(TranslationManager.translation("messages.menus.close")); }).setOnClick(event -> { - //TODO open the WitchShopMainMenu + new WitchShopMainMenu(getOwner()).open(); })); + //TODO filter : + // - room + // - unlocked + // - lower cost + // - highest cost + if (hasNextPage()) { map.put(53, new ItemMenuBuilder(this, OMCRegistry.CUSTOM_ITEMS.ICON_NEXT_ORANGE, itemMeta -> { itemMeta.displayName(TranslationManager.translation("messages.menus.next_page")); }).setNextPageButton()); } - Iterator contents = WitchShopManager.getStoreContent(this.page).iterator(); - - for (int c = 0; c < column; c++) { - for (int l = line.floor(); l <= line.ceiling(); l++) { - - if (!contents.hasNext()) break; - - WitchShopItem item = contents.next(); - - map.put(l + (9 * c), new ItemMenuBuilder(this, item.getItem(), itemMeta -> { - itemMeta.displayName(item.getName()); - itemMeta.lore(WitchShopManager.extractLoreForItem(item)); - }).setOnClick(event -> { - //TODO open confirm menu if has enough moneyItem - })); - } - } - return map; } diff --git a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/SEHalloweenManager.java b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/SEHalloweenManager.java deleted file mode 100644 index 2b9d2545e..000000000 --- a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/SEHalloweenManager.java +++ /dev/null @@ -1,29 +0,0 @@ -package fr.openmc.core.features.events.contents.seasonevents.halloween; - -import com.j256.ormlite.support.ConnectionSource; -import fr.openmc.core.bootstrap.features.Feature; -import fr.openmc.core.bootstrap.features.types.HasCommands; -import fr.openmc.core.bootstrap.features.types.HasDatabase; -import fr.openmc.core.bootstrap.features.types.HasListeners; -import fr.openmc.core.bootstrap.listeners.ListenerFactory; - -import java.sql.SQLException; -import java.util.Set; - -public class SEHalloweenManager extends Feature implements HasDatabase, HasListeners, HasCommands { - - @Override - public void initDB(ConnectionSource connectionSource) throws SQLException { - - } - - @Override - public Set getListeners() { - return Set.of(); - } - - @Override - public Set getCommands() { - return Set.of(); - } -} diff --git a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/dimension/advancement/Advancements.java b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/dimension/advancement/Advancements.java deleted file mode 100644 index 631e5f81d..000000000 --- a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/dimension/advancement/Advancements.java +++ /dev/null @@ -1,15 +0,0 @@ -package fr.openmc.core.features.events.contents.seasonevents.halloween.dimension.advancement; - -import lombok.Getter; - -@Getter -public enum Advancements { - ROOM_1(1000) - ; - - private final int require; - - Advancements(int require) { - this.require = require; - } -} diff --git a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java b/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java deleted file mode 100644 index 43b427fa6..000000000 --- a/src/main/java/fr/openmc/core/features/events/contents/seasonevents/halloween/model/SEHalloweenEventData.java +++ /dev/null @@ -1,51 +0,0 @@ -package fr.openmc.core.features.events.contents.seasonevents.halloween.model; - -import com.google.gson.Gson; -import com.j256.ormlite.field.DatabaseField; -import com.j256.ormlite.table.DatabaseTable; -import fr.openmc.core.features.events.contents.weeklyevents.models.WeeklyEvent; -import fr.openmc.core.features.events.contents.weeklyevents.models.WeeklyEventPhase; -import lombok.Getter; -import lombok.Setter; - -@Getter -@DatabaseTable(tableName = "halloween_season_event_data") -public class SEHalloweenEventData { - - @DatabaseField(id = true, columnName = "id") - private int id = 1; - - @Setter - @DatabaseField(columnName = "advancement") - private String currentAdvencement; - - @Setter - @DatabaseField(columnName = "unlocked_room") - private String currentUnlocked; - - @Setter - @DatabaseField(columnName = "is_active") - private boolean active; - - public SEHalloweenEventData() {} - - public SEHalloweenEventData(WeeklyEvent currentEvent, WeeklyEventPhase currentPhase) { -// this.currentEvent = currentEvent.getId(); -// if (currentPhase == null) -// this.currentPhase = null; -// else -// this.currentPhase = currentPhase.getId(); - } - - private static final Gson GSON = new Gson(); - - public void setContent(String[] array) { - currentUnlocked = GSON.toJson(array); - } - - public String[] getContent() { - if (currentUnlocked == null) return new String[0]; - return GSON.fromJson(currentUnlocked, String[].class); - } - -} diff --git a/src/main/resources/contents/omc_icons/configs/fonts.yml b/src/main/resources/contents/omc_icons/configs/fonts.yml index d72d0d785..81299e65e 100644 --- a/src/main/resources/contents/omc_icons/configs/fonts.yml +++ b/src/main/resources/contents/omc_icons/configs/fonts.yml @@ -30,4 +30,34 @@ font_images: show_in_gui: true path: "font/bits.png" scale_ratio: 12 + y_position: 9 + candy_red: + permission: candy_red + show_in_gui: true + path: "font/candy/candy_red.png" + scale_ratio: 12 + y_position: 9 + candy_yellow: + permission: candy_yellow + show_in_gui: true + path: "font/candy/candy_yellow.png" + scale_ratio: 12 + y_position: 9 + candy_green: + permission: candy_green + show_in_gui: true + path: "font/candy/candy_green.png" + scale_ratio: 12 + y_position: 9 + candy_blue: + permission: candy_blue + show_in_gui: true + path: "font/candy/candy_blue.png" + scale_ratio: 12 + y_position: 9 + candy_brown: + permission: candy_brown + show_in_gui: true + path: "font/candy/candy_brown.png" + scale_ratio: 12 y_position: 9 \ No newline at end of file diff --git a/src/main/resources/contents/omc_icons/textures/font/candy/candy_blue.png b/src/main/resources/contents/omc_icons/textures/font/candy/candy_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..be6fd4e7363c4a12451bd79e7724904683e3d650 GIT binary patch literal 352 zcmV-m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!ftIE3=6 zA!)#M7O&{SQAZA4D?mz{z5@oT3;;sN>1)j?Wj#iCJo=eBH=8j@N_Gk{W}8mO`_2^3 zXIryIgB*PvH@{_RYcadPx$2}wjjR5*>LQ#%gAFbsVK1~$q8Kw@VKNQ?-^9)>FvuE1d!i;!3t=)_(D2Ow-n zfXt94sgo2TVX12B`aM5?5~0R~NT~Xq=bI=L=Q%a-xZW`TXpwv+GGHPik{Qt+{5hvY zMC2;-!P;D~%*-#3!~?r3%IsCsBn`uISpxU1I=>{)9@q?>sq$&laR4GA5;6_zr54a0 z0L>UUbb)c9{Eq@S%~@kxtd{Gld^-)&L;-6Ay#O$|*>epTfTI8ahMAK8mX_!(mHhjT zE7c}M!p20;8=u0XP(D4Ka~haJXI9Y_+iZZ!-imEpf9co4cA?C|mMO3U^&~EM4^yHG h{`)f3-mG7*^9N_eC7BywT|)o>002ovPDHLkV1m>piCO>v literal 0 HcmV?d00001 diff --git a/src/main/resources/contents/omc_items/textures/items/candy/candy_blue.png b/src/main/resources/contents/omc_items/textures/items/candy/candy_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..be6fd4e7363c4a12451bd79e7724904683e3d650 GIT binary patch literal 352 zcmV-m0iXVfP)Px$8c9S!R5*=|Q%i2bFc5t~Ea;Bh0D1)H0H}0R#mC?ZtSX^^dX65Wh)sgHfNucd z1SGq3H(glcU+jvJBH1r~Z=Pp784@8xN$y^$V-`C%O%c_{kB>vre?o>#MATe~@acb5 zO+-W#IvbHWLUMDp|3)GqIds9<-C&Uki|iZVeADax7g**t!D^u~4n79}nGhv$!K!yl zSmwa|1<1dEcB}EW1J>V;^ON+uaH!+OWuaJ1;xN$d>^emTBJZHtX#4$Oh5A9;zuXf} zg($r?b%Wo9_MtKEPE|*`@b>E5d1kW#I{SQP&+XSi4U{@&MIjC7wh8bn4**3W&673` yT#?Itd`}j2$pA1KjN~w#q)FuB$;oPx$fJsC_R5*=wld)^UKorKmgc_8B1SdC3Cnuqqf`c83Q0!tCp@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A?C|mMO3U^&~EM4^yHG h{`)f3-mG7*^9N_eC7BywT|)o>002ovPDHLkV1m>piCO>v literal 0 HcmV?d00001 diff --git a/src/main/resources/contents/omc_menus/configs/menus.yml b/src/main/resources/contents/omc_menus/configs/menus.yml index dff153e67..411ed932c 100644 --- a/src/main/resources/contents/omc_menus/configs/menus.yml +++ b/src/main/resources/contents/omc_menus/configs/menus.yml @@ -65,7 +65,7 @@ font_images: permission: halloween.event_main_menu show_in_gui: true suggestion_in_command: false - path: "halloween.event_main_menu.png" + path: "halloween_event_main_menu.png" y_position: 30 home_mailbox: permission: mailbox.home From 38bf0e49c9bb04a22d981d888686b575061d42b3 Mon Sep 17 00:00:00 2001 From: Nocolm Date: Tue, 22 Sep 2026 12:32:29 +0200 Subject: [PATCH 5/6] move items and font to omc_halloween + SquareRegion --- .../halloween/commands/HalloweenCommands.java | 7 ++ .../halloween/halloween/CandyItem.java | 37 ++++++ .../dimension/WitchHouseManager.java | 3 + .../dimension/advancement/HouseRoom.java | 11 ++ .../halloween/listeners/CandyListener.java | 46 ++++++++ .../halloween/halloween/shop/ShopMoney.java | 12 +- .../halloween/shop/WitchShopItem.java | 12 +- .../halloween/shop/WitchShopManager.java | 39 +++---- .../shop/menu/WitchShopMainMenu.java | 10 +- .../shop/menu/buttons/WitchHouseButton.java | 6 +- .../registry/items/CustomItemRegistry.java | 8 ++ .../registry/regions/preset/SquareRegion.java | 59 ++++++++++ .../core/utils/text/messages/Prefix.java | 3 +- .../contents/omc_daily_events/items.yml | 65 +++++++++++ .../textures}/candy/candy_blue.png | Bin .../textures}/candy/candy_brown.png | Bin .../textures}/candy/candy_green.png | Bin .../textures}/candy/candy_red.png | Bin .../textures}/candy/candy_yellow.png | Bin .../contents/omc_halloween/configs/fonts.yml | 33 ++++++ .../contents/omc_halloween/configs/items.yml | 110 ++++++++++++++++++ .../textures}/candy/candy_blue.png | Bin .../textures}/candy/candy_brown.png | Bin .../textures}/candy/candy_green.png | Bin .../textures}/candy/candy_red.png | Bin .../textures}/candy/candy_yellow.png | Bin .../contents/omc_icons/configs/fonts.yml | 30 ----- .../textures/halloween_event_main_menu.png | Bin 6468 -> 7203 bytes 28 files changed, 419 insertions(+), 72 deletions(-) create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/CandyItem.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/HouseRoom.java create mode 100644 src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/listeners/CandyListener.java create mode 100644 src/main/java/fr/openmc/core/registry/regions/preset/SquareRegion.java rename src/main/resources/contents/{omc_icons/textures/font => omc_daily_events/textures}/candy/candy_blue.png (100%) rename src/main/resources/contents/{omc_icons/textures/font => omc_daily_events/textures}/candy/candy_brown.png (100%) rename src/main/resources/contents/{omc_icons/textures/font => omc_daily_events/textures}/candy/candy_green.png (100%) rename src/main/resources/contents/{omc_icons/textures/font => omc_daily_events/textures}/candy/candy_red.png (100%) rename src/main/resources/contents/{omc_icons/textures/font => omc_daily_events/textures}/candy/candy_yellow.png (100%) create mode 100644 src/main/resources/contents/omc_halloween/configs/fonts.yml create mode 100644 src/main/resources/contents/omc_halloween/configs/items.yml rename src/main/resources/contents/{omc_items/textures/items => omc_halloween/textures}/candy/candy_blue.png (100%) rename src/main/resources/contents/{omc_items/textures/items => omc_halloween/textures}/candy/candy_brown.png (100%) rename src/main/resources/contents/{omc_items/textures/items => omc_halloween/textures}/candy/candy_green.png (100%) rename src/main/resources/contents/{omc_items/textures/items => omc_halloween/textures}/candy/candy_red.png (100%) rename src/main/resources/contents/{omc_items/textures/items => omc_halloween/textures}/candy/candy_yellow.png (100%) diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/commands/HalloweenCommands.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/commands/HalloweenCommands.java index 11bde75c0..4bc8a71b3 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/commands/HalloweenCommands.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/commands/HalloweenCommands.java @@ -1,6 +1,8 @@ package fr.openmc.core.features.events.contents.halloween.commands; +import fr.openmc.core.features.events.contents.halloween.halloween.shop.menu.WitchShopMainMenu; import fr.openmc.core.features.events.contents.halloween.managers.HalloweenManager; +import org.bukkit.entity.Player; import revxrsal.commands.annotation.Command; import revxrsal.commands.annotation.Subcommand; import revxrsal.commands.bukkit.annotation.CommandPermission; @@ -12,4 +14,9 @@ public class HalloweenCommands { public void endHalloweenCommand() { HalloweenManager.endEvent(); } + + @Subcommand("test") + public void tst(Player player) { + new WitchShopMainMenu(player).open(); + } } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/CandyItem.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/CandyItem.java new file mode 100644 index 000000000..ea0698f7e --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/CandyItem.java @@ -0,0 +1,37 @@ +package fr.openmc.core.features.events.contents.halloween.halloween; + +import fr.openmc.core.registry.items.CustomItem; +import fr.openmc.core.registry.items.CustomItemMeta; +import fr.openmc.core.utils.text.messages.TranslationManager; +import lombok.Getter; +import org.bukkit.Material; +import org.bukkit.inventory.ItemStack; +import org.jspecify.annotations.NonNull; + +import java.util.HashMap; +import java.util.Map; + +public class CandyItem extends CustomItem { + + @Getter + public int diabetesIndex; + public Material baseItem; + + public static final Map candies = new HashMap<>(); + + public CandyItem(String candyID , int diabetesIndex, Material baseItem) { + super(new CustomItemMeta(candyID)); + this.diabetesIndex = diabetesIndex; + this.baseItem = baseItem; + candies.put(candyID, this); + } + + @Override + public @NonNull ItemStack getVanilla() { + ItemStack item = new ItemStack(baseItem); + item.editMeta(meta -> meta.itemName( + TranslationManager.translation("feature." + super.getId().replace(":", ".") + ".name") + )); + return item; + } +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/WitchHouseManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/WitchHouseManager.java index 3b0e0e870..e96a767fc 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/WitchHouseManager.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/WitchHouseManager.java @@ -1,4 +1,7 @@ package fr.openmc.core.features.events.contents.halloween.halloween.dimension; public class WitchHouseManager { + + + } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/HouseRoom.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/HouseRoom.java new file mode 100644 index 000000000..653e97276 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/dimension/advancement/HouseRoom.java @@ -0,0 +1,11 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.dimension.advancement; + +import fr.openmc.core.registry.regions.types.Region; + +public class HouseRoom { + + public Region region; + + + +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/listeners/CandyListener.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/listeners/CandyListener.java new file mode 100644 index 000000000..0170731a1 --- /dev/null +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/listeners/CandyListener.java @@ -0,0 +1,46 @@ +package fr.openmc.core.features.events.contents.halloween.halloween.listeners; + +import dev.lone.itemsadder.api.CustomStack; +import fr.openmc.core.OMCRegistry; +import fr.openmc.core.features.events.contents.halloween.halloween.CandyItem; +import org.bukkit.entity.Player; +import org.bukkit.event.EventHandler; +import org.bukkit.event.Listener; +import org.bukkit.event.player.PlayerItemConsumeEvent; +import org.bukkit.inventory.ItemStack; + +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; + +public class CandyListener implements Listener { + + private final Map diabetes = new HashMap<>(); + + @EventHandler + public void onCandyEat(PlayerItemConsumeEvent event) { + Player player = event.getPlayer(); + ItemStack item = event.getItem(); + + CustomStack stack = CustomStack.byItemStack(item); + + if (stack == null) return; + + if (!CandyItem.candies.containsKey(stack.getId())) return; + + CandyItem candy = CandyItem.candies.get(stack.getId()); + + UUID uuid = player.getUniqueId(); + + int diabete = diabetes.computeIfAbsent(uuid, key -> 0); + + diabete += candy.getDiabetesIndex(); + + if (diabete >= 20) { + //TODO faire un truc + diabetes.put(uuid, 0); + } else + diabetes.put(uuid, diabete); + } + +} diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java index 3b3853323..e16e67881 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/ShopMoney.java @@ -1,16 +1,24 @@ package fr.openmc.core.features.events.contents.halloween.halloween.shop; +import fr.openmc.core.OMCRegistry; +import fr.openmc.core.registry.items.CustomItem; import lombok.Getter; @Getter public enum ShopMoney { //TODO rajouter les crafts des bonbons et les autre dans le shopMoney - MONSTER_CANDY(WitchShopManager.getMoneyItemIcon("candy_brown")), + RED_CANDY(WitchShopManager.getMoneyItemIcon("candy_brown"), OMCRegistry.CUSTOM_ITEMS.CANDY_RED), + YELLOW_CANDY(WitchShopManager.getMoneyItemIcon("candy_brown"), OMCRegistry.CUSTOM_ITEMS.CANDY_YELLOW), + GREEN_CANDY(WitchShopManager.getMoneyItemIcon("candy_brown"), OMCRegistry.CUSTOM_ITEMS.CANDY_GREEN), + BLUE_CANDY(WitchShopManager.getMoneyItemIcon("candy_brown"), OMCRegistry.CUSTOM_ITEMS.CANDY_BLUE), + MONSTER_CANDY(WitchShopManager.getMoneyItemIcon("candy_brown"), OMCRegistry.CUSTOM_ITEMS.CANDY_BROWN), ; private final String icon; + private final CustomItem item; - ShopMoney(String icon) { + ShopMoney(String icon, CustomItem item) { this.icon = icon; + this.item = item; } } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java index 1b9ce1ed4..31e1ecbd7 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopItem.java @@ -3,10 +3,8 @@ import fr.openmc.core.features.events.contents.halloween.halloween.HalloweenManager; import fr.openmc.core.features.events.contents.halloween.halloween.dimension.advancement.Advancements; import fr.openmc.core.registry.items.CustomItem; -import fr.openmc.core.utils.text.messages.TranslationManager; import lombok.Getter; import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.format.TextDecoration; public class WitchShopItem { @@ -25,11 +23,11 @@ public WitchShopItem(Advancements advancements, CustomItem item, Component name, this.price = price; } public WitchShopItem(Advancements advancements, CustomItem item, Component name, int price) { - this.advancements = advancements; - this.item = item; - this.name = name; - this.shopMoney = ShopMoney.MONSTER_CANDY; - this.price = price; + this(advancements, item, name, ShopMoney.MONSTER_CANDY, price); + } + + public WitchShopItem(Advancements advancements, CustomItem item, int price) { + this(advancements, item, item.getBest().displayName(), price); } public Component getName() { diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java index 36b6731ac..64573ea10 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/WitchShopManager.java @@ -21,16 +21,14 @@ public class WitchShopManager { - //TODO idée : - // bruit de sorcière quand on buy un item - - public static Set witchStoreItems; + public static LinkedHashSet witchStoreItems; public static Map> paginateWitchStoreItems; public static int maxPage; public static int SLOT_FACTOR = 28; private static final Sound BUY_SOUND = Sound.ENTITY_WITCH_CELEBRATE; + private static final Sound ERROR_SOUND = Sound.ENTITY_WITCH_AMBIENT; public static void init() { witchStoreItems = getWitchStoreItems(); @@ -104,6 +102,7 @@ public static void buyItem(Player player, WitchShopItem item, int amount) { private static void sendError(Player player, Component message) { MessagesManager.sendMessage(player, message, Prefix.HALLOWEEN, MessageType.ERROR, true); + player.playSound(player, ERROR_SOUND, 1f,1f); } private static void sendInfo(Player player, Component message) { @@ -141,25 +140,17 @@ public static String getMoneyItemIcon(String icon) { //TODO mettre les vrais items private static LinkedHashSet getWitchStoreItems() { - return new LinkedHashSet<>(List.of( - new WitchShopItem( - Advancements.ROOM_1, - OMCRegistry.CUSTOM_ITEMS.AYWENITE, - OMCRegistry.CUSTOM_ITEMS.AYWENITE.getBest().displayName(), - 10 - ), - new WitchShopItem( - Advancements.ROOM_2, - OMCRegistry.CUSTOM_ITEMS.KEBAB, - OMCRegistry.CUSTOM_ITEMS.KEBAB.getBest().displayName(), - 10 - ), - new WitchShopItem( - Advancements.ROOM_2, - OMCRegistry.CUSTOM_ITEMS.NETHERITE_HAMMER, - OMCRegistry.CUSTOM_ITEMS.NETHERITE_HAMMER.getBest().displayName(), - 1000 - ) - )); + LinkedHashSet items = new LinkedHashSet<>(); + + items.add(new WitchShopItem( + Advancements.ROOM_1, OMCRegistry.CUSTOM_ITEMS.AYWENITE, 10)); + + items.add(new WitchShopItem( + Advancements.ROOM_2, OMCRegistry.CUSTOM_ITEMS.KEBAB, 10)); + + items.add(new WitchShopItem( + Advancements.ROOM_2, OMCRegistry.CUSTOM_ITEMS.NETHERITE_HAMMER, 1000)); + + return items; } } diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java index 26ecb5952..3b0b700be 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/WitchShopMainMenu.java @@ -3,13 +3,11 @@ import fr.openmc.api.menulib.Menu; import fr.openmc.api.menulib.utils.InventorySize; import fr.openmc.api.menulib.utils.ItemMenuBuilder; -import fr.openmc.core.features.city.City; -import fr.openmc.core.features.city.CityManager; -import fr.openmc.core.features.city.menu.main.buttons.*; import fr.openmc.core.features.events.contents.halloween.halloween.shop.menu.buttons.WitchHouseButton; import fr.openmc.core.features.events.contents.halloween.halloween.shop.menu.buttons.WitchStoreButton; import fr.openmc.core.utils.text.messages.TranslationManager; import net.kyori.adventure.text.Component; +import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryCloseEvent; @@ -21,8 +19,9 @@ public class WitchShopMainMenu extends Menu { - private static final int[] WITCH_HOUSE_SLOTS = {8, 9, 10, 11, 12, 13, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49}; + private static final int[] WITCH_HOUSE_SLOTS = {9, 10, 11, 12, 13, 18, 19, 20, 21, 22, 27, 28, 29, 30, 31, 36, 37, 38, 39, 40, 45, 46, 47, 48, 49}; private static final int[] WITCH_SHOP_SLOTS = {23, 24, 25, 26, 32, 33, 34, 35, 41, 42, 43, 44, 50, 51, 52, 53}; + private static final Sound WITCH_MENU_CLOSE = Sound.ENTITY_WITCH_AMBIENT; public WitchShopMainMenu(Player owner) { super(owner); @@ -63,7 +62,8 @@ public List getTakableSlot() { @Override public void onClose(InventoryCloseEvent event) { - //TODO bruit de sorcière + Player player = getOwner(); + player.playSound(player, WITCH_MENU_CLOSE, 1f, 1f); } @Override diff --git a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchHouseButton.java b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchHouseButton.java index d53ef41f4..73d49c62f 100644 --- a/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchHouseButton.java +++ b/src/main/java/fr/openmc/core/features/events/contents/halloween/halloween/shop/menu/buttons/WitchHouseButton.java @@ -26,9 +26,9 @@ public static void init(Menu menu, Map contents, int[] Component.text("").color(NamedTextColor.LIGHT_PURPLE) )); itemMeta.setItemModel(NamespacedKey.minecraft("air")); - }).setOnClick(inventoryClickEvent -> { //TODO tp dans la dimension - - }) + }).setCloseButton()//.setOnClick(inventoryClickEvent -> { //TODO tp dans la dimension +// inventoryClickEvent.getClickedInventory().close(); +// }) ); } } diff --git a/src/main/java/fr/openmc/core/registry/items/CustomItemRegistry.java b/src/main/java/fr/openmc/core/registry/items/CustomItemRegistry.java index 597c02ab5..d44d5d2f4 100644 --- a/src/main/java/fr/openmc/core/registry/items/CustomItemRegistry.java +++ b/src/main/java/fr/openmc/core/registry/items/CustomItemRegistry.java @@ -15,6 +15,7 @@ import fr.openmc.core.features.events.contents.dailyevents.contents.miraculousfishing.contents.items.FishingFurnitureLootbox; import fr.openmc.core.features.events.contents.dailyevents.contents.miraculousfishing.contents.items.LegendaryFishingTreasureLootbox; import fr.openmc.core.features.events.contents.dailyevents.contents.miraculousfishing.contents.items.RareFishingTreasureLootbox; +import fr.openmc.core.features.events.contents.halloween.halloween.CandyItem; import fr.openmc.core.features.itemsadder.elevator.ElevatorBlock; import fr.openmc.core.features.itemsadder.elevator.ElevatorColor; import fr.openmc.core.hooks.itemsadder.ItemsAdderHook; @@ -194,6 +195,13 @@ public class CustomItemRegistry extends Registry public final CustomItem ABONDANCE_LEGGINGS = register("omc_daily_events:abondance_leggings", Material.IRON_LEGGINGS); public final CustomItem ABONDANCE_BOOTS = register("omc_daily_events:abondance_boots", Material.IRON_BOOTS); + public final CustomItem CANDY_RED = register(new CandyItem("omc_halloween:candy_red", 4, Material.APPLE)); + public final CustomItem CANDY_YELLOW = register(new CandyItem("omc_halloween:candy_yellow", 2, Material.APPLE)); + public final CustomItem CANDY_GREEN = register(new CandyItem("omc_halloween:candy_green", 3, Material.APPLE)); + public final CustomItem CANDY_BLUE = register(new CandyItem("omc_halloween:candy_blue", 5, Material.APPLE)); + public final CustomItem CANDY_BROWN = register(new CandyItem("omc_halloween:candy_brown", 20, Material.APPLE)); + + /* Lootbox */ public final CustomItem KITCHEN_BARSTOOL = register("kitchen:kitchen_barstool", Material.PAPER); public final CustomItem KITCHEN_BIN = register("kitchen:kitchen_bin", Material.PAPER); public final CustomItem KITCHEN_CHAIR = register("kitchen:kitchen_chair", Material.PAPER); diff --git a/src/main/java/fr/openmc/core/registry/regions/preset/SquareRegion.java b/src/main/java/fr/openmc/core/registry/regions/preset/SquareRegion.java new file mode 100644 index 000000000..ab809e99b --- /dev/null +++ b/src/main/java/fr/openmc/core/registry/regions/preset/SquareRegion.java @@ -0,0 +1,59 @@ +package fr.openmc.core.registry.regions.preset; + +import com.sk89q.worldedit.math.BlockVector3; +import fr.openmc.core.registry.regions.CustomRegion; +import net.kyori.adventure.key.Key; +import org.bukkit.World; + +public class SquareRegion extends CustomRegion { + + public World world; + public BlockVector3 min; + public BlockVector3 max; + public Key key; + + public SquareRegion(World world, BlockVector3 min, BlockVector3 max) { + this(world, min, max, null); + } + + public SquareRegion(World world, BlockVector3 min, BlockVector3 max, Key key) { + this.world = world; + this.min = min; + this.max = max; + this.key = key; + } + + @Override + public Key getKey() { + return key; + } + + @Override + public World getWorld() { + return world; + } + + @Override + public boolean contains(BlockVector3 pos) { + double x = pos.x(); + double y = pos.y(); + double z = pos.z(); + + return x >= Math.min(getMin().x(), getMax().x()) && + x <= Math.max(getMin().x(), getMax().x()) && + y >= Math.min(getMin().y(), getMax().y()) && + y <= Math.max(getMin().y(), getMax().y()) && + z >= Math.min(getMin().z(), getMax().z()) && + z <= Math.max(getMin().z(), getMax().z()); + } + + @Override + public BlockVector3 getMin() { + return min; + } + + @Override + public BlockVector3 getMax() { + return max; + } +} diff --git a/src/main/java/fr/openmc/core/utils/text/messages/Prefix.java b/src/main/java/fr/openmc/core/utils/text/messages/Prefix.java index bf240ee3b..ee8651e4e 100644 --- a/src/main/java/fr/openmc/core/utils/text/messages/Prefix.java +++ b/src/main/java/fr/openmc/core/utils/text/messages/Prefix.java @@ -37,7 +37,8 @@ public enum Prefix { HALLOWEEN("halloween"), DIMOPENER("dimopener"), GOLDEN_HARVEST("golden harvest"), - MIRACULOUS_FISHING("miraculous fishing"); + MIRACULOUS_FISHING("miraculous fishing"), + LUCKYBLOCK("luckyblock"); @Getter private final Component prefix; diff --git a/src/main/resources/contents/omc_daily_events/items.yml b/src/main/resources/contents/omc_daily_events/items.yml index 8bd96d2aa..f96c925bf 100644 --- a/src/main/resources/contents/omc_daily_events/items.yml +++ b/src/main/resources/contents/omc_daily_events/items.yml @@ -66,6 +66,71 @@ items: - - + candy_red: + display_name: + resource: + generate: true + textures: + - candy/candy_red + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + + candy_yellow: + display_name: + resource: + generate: true + textures: + - candy/candy_yellow + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + + candy_green: + display_name: + resource: + generate: true + textures: + - candy/candy_green + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + + candy_blue: + display_name: + resource: + generate: true + textures: + - candy/candy_blue + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + + candy_brown: + display_name: + resource: + generate: true + textures: + - candy/candy_brown + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + recipes: iaa_crafting_table: fermentum: diff --git a/src/main/resources/contents/omc_icons/textures/font/candy/candy_blue.png b/src/main/resources/contents/omc_daily_events/textures/candy/candy_blue.png similarity index 100% rename from src/main/resources/contents/omc_icons/textures/font/candy/candy_blue.png rename to src/main/resources/contents/omc_daily_events/textures/candy/candy_blue.png diff --git a/src/main/resources/contents/omc_icons/textures/font/candy/candy_brown.png b/src/main/resources/contents/omc_daily_events/textures/candy/candy_brown.png similarity index 100% rename from src/main/resources/contents/omc_icons/textures/font/candy/candy_brown.png rename to src/main/resources/contents/omc_daily_events/textures/candy/candy_brown.png diff --git a/src/main/resources/contents/omc_icons/textures/font/candy/candy_green.png b/src/main/resources/contents/omc_daily_events/textures/candy/candy_green.png similarity index 100% rename from src/main/resources/contents/omc_icons/textures/font/candy/candy_green.png rename to src/main/resources/contents/omc_daily_events/textures/candy/candy_green.png diff --git a/src/main/resources/contents/omc_icons/textures/font/candy/candy_red.png b/src/main/resources/contents/omc_daily_events/textures/candy/candy_red.png similarity index 100% rename from src/main/resources/contents/omc_icons/textures/font/candy/candy_red.png rename to src/main/resources/contents/omc_daily_events/textures/candy/candy_red.png diff --git a/src/main/resources/contents/omc_icons/textures/font/candy/candy_yellow.png b/src/main/resources/contents/omc_daily_events/textures/candy/candy_yellow.png similarity index 100% rename from src/main/resources/contents/omc_icons/textures/font/candy/candy_yellow.png rename to src/main/resources/contents/omc_daily_events/textures/candy/candy_yellow.png diff --git a/src/main/resources/contents/omc_halloween/configs/fonts.yml b/src/main/resources/contents/omc_halloween/configs/fonts.yml new file mode 100644 index 000000000..e17c69365 --- /dev/null +++ b/src/main/resources/contents/omc_halloween/configs/fonts.yml @@ -0,0 +1,33 @@ +info: + namespace: omc_halloween +font_images: + candy_red: + permission: candy_red + show_in_gui: true + path: "candy/candy_red.png" + scale_ratio: 12 + y_position: 9 + candy_yellow: + permission: candy_yellow + show_in_gui: true + path: "candy/candy_yellow.png" + scale_ratio: 12 + y_position: 9 + candy_green: + permission: candy_green + show_in_gui: true + path: "candy/candy_green.png" + scale_ratio: 12 + y_position: 9 + candy_blue: + permission: candy_blue + show_in_gui: true + path: "candy/candy_blue.png" + scale_ratio: 12 + y_position: 9 + candy_brown: + permission: candy_brown + show_in_gui: true + path: "candy/candy_brown.png" + scale_ratio: 12 + y_position: 9 \ No newline at end of file diff --git a/src/main/resources/contents/omc_halloween/configs/items.yml b/src/main/resources/contents/omc_halloween/configs/items.yml new file mode 100644 index 000000000..040fa93ed --- /dev/null +++ b/src/main/resources/contents/omc_halloween/configs/items.yml @@ -0,0 +1,110 @@ +info: + namespace: omc_halloween + +items: + candy_red: + display_name: + resource: + generate: true + textures: + - candy/candy_red + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + + candy_yellow: + display_name: + resource: + generate: true + textures: + - candy/candy_yellow + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + + candy_green: + display_name: + resource: + generate: true + textures: + - candy/candy_green + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + + candy_blue: + display_name: + resource: + generate: true + textures: + - candy/candy_blue + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + + candy_brown: + display_name: + resource: + generate: true + textures: + - candy/candy_brown + material: PAPER + lore: + - + consumable: + nutrition: 1 + saturation: 0.6 + +recipes: + iaa_crafting_table: + fermentum: + shapeless: true + ingredients: + - item: omc_daily_events:golden_wheat + amount: 5 + - item: omc_daily_events:golden_beetroot + amount: 5 + - item: omc_daily_events:really_golden_carrot + amount: 5 + - item: omc_daily_events:golden_potato + amount: 5 + - item: omc_daily_events:golden_melon + amount: 5 + - item: omc_daily_events:golden_pumpkin + amount: 5 + result: + item: omc_daily_events:fermentum + + blessed_bread: + enabled: true + pattern: + - FFF + - XXX + - XXX + pattern_2: + - XXX + - FFF + - XXX + pattern_3: + - XXX + - XXX + - FFF + ingredients: + F: + item: omc_daily_events:golden_wheat + amount: 192 + result: + item: omc_daily_events:blessed_bread + amount: 1 \ No newline at end of file diff --git a/src/main/resources/contents/omc_items/textures/items/candy/candy_blue.png b/src/main/resources/contents/omc_halloween/textures/candy/candy_blue.png similarity index 100% rename from src/main/resources/contents/omc_items/textures/items/candy/candy_blue.png rename to src/main/resources/contents/omc_halloween/textures/candy/candy_blue.png diff --git a/src/main/resources/contents/omc_items/textures/items/candy/candy_brown.png b/src/main/resources/contents/omc_halloween/textures/candy/candy_brown.png similarity index 100% rename from src/main/resources/contents/omc_items/textures/items/candy/candy_brown.png rename to src/main/resources/contents/omc_halloween/textures/candy/candy_brown.png diff --git a/src/main/resources/contents/omc_items/textures/items/candy/candy_green.png b/src/main/resources/contents/omc_halloween/textures/candy/candy_green.png similarity index 100% rename from src/main/resources/contents/omc_items/textures/items/candy/candy_green.png rename to src/main/resources/contents/omc_halloween/textures/candy/candy_green.png diff --git a/src/main/resources/contents/omc_items/textures/items/candy/candy_red.png b/src/main/resources/contents/omc_halloween/textures/candy/candy_red.png similarity index 100% rename from src/main/resources/contents/omc_items/textures/items/candy/candy_red.png rename to src/main/resources/contents/omc_halloween/textures/candy/candy_red.png diff --git a/src/main/resources/contents/omc_items/textures/items/candy/candy_yellow.png b/src/main/resources/contents/omc_halloween/textures/candy/candy_yellow.png similarity index 100% rename from src/main/resources/contents/omc_items/textures/items/candy/candy_yellow.png rename to src/main/resources/contents/omc_halloween/textures/candy/candy_yellow.png diff --git a/src/main/resources/contents/omc_icons/configs/fonts.yml b/src/main/resources/contents/omc_icons/configs/fonts.yml index 81299e65e..2a214f727 100644 --- a/src/main/resources/contents/omc_icons/configs/fonts.yml +++ b/src/main/resources/contents/omc_icons/configs/fonts.yml @@ -31,33 +31,3 @@ font_images: path: "font/bits.png" scale_ratio: 12 y_position: 9 - candy_red: - permission: candy_red - show_in_gui: true - path: "font/candy/candy_red.png" - scale_ratio: 12 - y_position: 9 - candy_yellow: - permission: candy_yellow - show_in_gui: true - path: "font/candy/candy_yellow.png" - scale_ratio: 12 - y_position: 9 - candy_green: - permission: candy_green - show_in_gui: true - path: "font/candy/candy_green.png" - scale_ratio: 12 - y_position: 9 - candy_blue: - permission: candy_blue - show_in_gui: true - path: "font/candy/candy_blue.png" - scale_ratio: 12 - y_position: 9 - candy_brown: - permission: candy_brown - show_in_gui: true - path: "font/candy/candy_brown.png" - scale_ratio: 12 - y_position: 9 \ No newline at end of file diff --git a/src/main/resources/contents/omc_menus/textures/halloween_event_main_menu.png b/src/main/resources/contents/omc_menus/textures/halloween_event_main_menu.png index 18ce06fbdabe3bb1a83cca69e0da4b1af49bda77..dbf83e2ba8813b03f1533842b3b37645910c99a0 100644 GIT binary patch literal 7203 zcmd^E=Q~_qw4PzY=%Yj@h)(p9=tfCI)DV3{?=5=o45B2G=p~4Vh|v>+5WOTuA0fIZ zBaFf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9Z=Z$ew=y{Wxz^K5wcUXyI=x zo|#&VG$i~F5&!NN%S03&VN{t)8^GPi)%b#zMP6NjRTe*2+gHyVCgu#71WYt-1QOS% z&)Z`j6dEr6Y3ll2t*imuc*XrCp2Z(LYX@NRT*Vaq>LPxA9kPx9QPK!xG~g@lg%Dq;Y2xc{%wM!>=^L+qNWi=P>f`aElpXAnlT z52r2enV5z6`MX|~et=3CK%M!@SFX);z5UvV|Hb@hny`PEgp+0kA)@%=o{6@P{7j_` zAmskP9U#Mk99ib~=OO;T{ny7)*W~YZ)%pP{ zWdLb0t+7`$%gamj=+Xbs;bFh@YZHyu?e{I+on=a|oZCP|w0n3G)m>+!JCObP<=;#H z(!wDfc-Czy88!Jd<37KS${IkGZ=Dd)%!E%A_Rx;3^ZBLt|LcF<3v$$jkY&8M!!L%a ze^*^pq7cD_k(*aK-g~N=I{)!Oy-D+34~3(9Y)1$iZ~y=R07*qoM6N<$f@?J++5i9m From c0195857ae2644ebabaf183b13a0b902b05516fa Mon Sep 17 00:00:00 2001 From: Nocolm Date: Tue, 22 Sep 2026 12:34:43 +0200 Subject: [PATCH 6/6] remove doublon --- .../textures/candy/candy_blue.png | Bin 352 -> 0 bytes .../textures/candy/candy_brown.png | Bin 454 -> 0 bytes .../textures/candy/candy_green.png | Bin 349 -> 0 bytes .../omc_daily_events/textures/candy/candy_red.png | Bin 312 -> 0 bytes .../textures/candy/candy_yellow.png | Bin 335 -> 0 bytes 5 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/main/resources/contents/omc_daily_events/textures/candy/candy_blue.png delete mode 100644 src/main/resources/contents/omc_daily_events/textures/candy/candy_brown.png delete mode 100644 src/main/resources/contents/omc_daily_events/textures/candy/candy_green.png delete mode 100644 src/main/resources/contents/omc_daily_events/textures/candy/candy_red.png delete mode 100644 src/main/resources/contents/omc_daily_events/textures/candy/candy_yellow.png diff --git a/src/main/resources/contents/omc_daily_events/textures/candy/candy_blue.png b/src/main/resources/contents/omc_daily_events/textures/candy/candy_blue.png deleted file mode 100644 index be6fd4e7363c4a12451bd79e7724904683e3d650..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 352 zcmV-m0iXVfP)Px$8c9S!R5*=|Q%i2bFc5t~Ea;Bh0D1)H0H}0R#mC?ZtSX^^dX65Wh)sgHfNucd z1SGq3H(glcU+jvJBH1r~Z=Pp784@8xN$y^$V-`C%O%c_{kB>vre?o>#MATe~@acb5 zO+-W#IvbHWLUMDp|3)GqIds9<-C&Uki|iZVeADax7g**t!D^u~4n79}nGhv$!K!yl zSmwa|1<1dEcB}EW1J>V;^ON+uaH!+OWuaJ1;xN$d>^emTBJZHtX#4$Oh5A9;zuXf} zg($r?b%Wo9_MtKEPE|*`@b>E5d1kW#I{SQP&+XSi4U{@&MIjC7wh8bn4**3W&673` yT#?Itd`}j2$pA1KjN~w#q)FuB$;oPx$fJsC_R5*=wld)^UKorKmgc_8B1SdC3Cnuqqf`c83Q0!tCp@Z}<=-92cATFhU zLc5egTb!~eLZ@~paf#q04yA4qL?lJbouD1`j?0<6>F(qGzI*rHoq~ukjM7@%J5E~( z%iD_rZ_k!g)a%&jvXLsowr$bQ`&|GAfYmrxA#dj;n8M(zxm`6ynHzRKN2l;9P2|bOa zKj%hEe~!g$jOnN^Rk{tsD6QRLmrzOxrIh&Igt)^lv1&zP)r#cL9TDG~5K1X=hg~xG zcqBVh5XYp(ll(Mb(>yhvPx$7fD1xR5*>LlRr+wFcijrsn{x{bjz9xAY=}Jpj#Gh&{MFd>|CN17wFP46$hZL zdV!2|OQg2*#{jls$3aLu$&&s2zVH1{7!YF$b>G|VI*Hl!lomMoSbO^BuK1P6fhB3D zN>kyTg-S_M7+DW&B?RwOxxXGs2o9sL-n(K+MwVpBoIM)=F0^Fi&cO}$Txi|f+5sfS z6tV@IQ93|I&NV4dOn9RP;7H9gk6vM~x~VLAiPpyw#bgxK0xKGK9|8k@1OTs8WaONF za$eDJqUA`Px#@<~KNR5*>Llg(|zFbsu12O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