mirror of
https://github.com/darksaid98/SiegeEngines.git
synced 2026-12-01 14:38:55 +00:00
fix: creative mode inv taking
This commit is contained in:
1 parent
b8472be343
commit
09a2ce6c53
2 files changed
+5
-5
No files matched your search
@@ -10,16 +10,12 @@ import dev.jorel.commandapi.arguments.PlayerArgument;
|
||||
import dev.jorel.commandapi.arguments.StringArgument;
|
||||
import dev.jorel.commandapi.exceptions.WrapperCommandSyntaxException;
|
||||
import dev.jorel.commandapi.executors.CommandArguments;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static com.github.alathra.siegeengines.SiegeEngines.*;
|
||||
|
||||
public class SiegeEnginesCommand {
|
||||
|
||||
@@ -20,6 +20,7 @@ import com.github.alathra.siegeengines.projectile.FireworkProjectile;
|
||||
import com.github.alathra.siegeengines.projectile.PotionProjectile;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.NamespacedKey;
|
||||
@@ -1213,7 +1214,10 @@ public class ClickHandler implements Listener {
|
||||
return;
|
||||
}
|
||||
if (siegeEngine.place(player, entity.getLocation(),entity)) {
|
||||
item.setAmount(item.getAmount() - 1);
|
||||
// If player is in creative mode, don't remove the item from their inventory
|
||||
if (player.getGameMode() != GameMode.CREATIVE) {
|
||||
item.setAmount(item.getAmount() - 1);
|
||||
}
|
||||
player.getInventory().setItemInMainHand(item);
|
||||
player.sendMessage("§eSiege Engine mounted to the "+entity.getType().toString().toLowerCase()+"!");
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user