From 2c1a64ac8b8e266995ab1b14680ede05126ef202 Mon Sep 17 00:00:00 2001 From: OneWalkDev Date: Tue, 15 Oct 2024 08:27:02 +0900 Subject: [PATCH] add gacha inventory check --- .../subplugins/gacha/core/event/EventGacha.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/space/yurisi/universecorev2/subplugins/gacha/core/event/EventGacha.java b/src/main/java/space/yurisi/universecorev2/subplugins/gacha/core/event/EventGacha.java index 4419002d..df8d6286 100644 --- a/src/main/java/space/yurisi/universecorev2/subplugins/gacha/core/event/EventGacha.java +++ b/src/main/java/space/yurisi/universecorev2/subplugins/gacha/core/event/EventGacha.java @@ -46,6 +46,11 @@ public EventGacha(Player player) { public void turn() { Boolean ticket = UniverseItem.removeItem(player, "gacha_ticket"); + if (player.getInventory().firstEmpty() == -1) { + Message.sendErrorMessage(player, "[ガチャAI]", "インベントリがいっぱいです。(スタックが余ってる場合も一度しまって下さい。)"); + return; + } + if(!ticket){ Message.sendErrorMessage(player, "[ガチャAI]", "チケットが足りません。"); return;