From 2e31bbc2b5489b3fcfc90f69e131856b24cb2aac Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 14 Jun 2019 21:16:06 +0200 Subject: [PATCH] Fix another creative mode exploit --- .../de/epiceric/shopchest/command/ShopCommandExecutor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/command/ShopCommandExecutor.java b/src/main/java/de/epiceric/shopchest/command/ShopCommandExecutor.java index cca1ea7..97746e0 100644 --- a/src/main/java/de/epiceric/shopchest/command/ShopCommandExecutor.java +++ b/src/main/java/de/epiceric/shopchest/command/ShopCommandExecutor.java @@ -274,8 +274,11 @@ class ShopCommandExecutor implements CommandExecutor { return; } - ClickType.setPlayerClickType(p, new SelectClickType(p.getGameMode(), amount, buyPrice, sellPrice, shopType)); - p.setGameMode(GameMode.CREATIVE); + if (!(ClickType.getPlayerClickType(p) instanceof SelectClickType)) { + // Don't set previous game mode to creative if player already has select click type + ClickType.setPlayerClickType(p, new SelectClickType(p.getGameMode(), amount, buyPrice, sellPrice, shopType)); + p.setGameMode(GameMode.CREATIVE); + } p.sendMessage(LanguageUtils.getMessage(Message.SELECT_ITEM)); } else {