mirror of
https://github.com/Xiao-MoMi/Custom-Fishing.git
synced 2025-12-30 12:29:19 +00:00
fix teleport packet
This commit is contained in:
@@ -25,6 +25,7 @@ import net.momirealms.customfishing.api.util.PlayerUtils;
|
||||
import net.momirealms.customfishing.bukkit.command.BukkitCommandFeature;
|
||||
import net.momirealms.customfishing.common.command.CustomFishingCommandManager;
|
||||
import net.momirealms.customfishing.common.locale.MessageConstants;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -77,7 +78,7 @@ public class GetItemCommand extends BukkitCommandFeature<CommandSender> {
|
||||
amountToGive -= perStackSize;
|
||||
ItemStack more = itemStack.clone();
|
||||
more.setAmount(perStackSize);
|
||||
if (toInv) {
|
||||
if (toInv || player.getGameMode() == GameMode.SPECTATOR) {
|
||||
PlayerUtils.putItemsToInventory(player.getInventory(), more, more.getAmount());
|
||||
} else {
|
||||
PlayerUtils.dropItem(player, more, false, true, false);
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.momirealms.customfishing.api.util.PlayerUtils;
|
||||
import net.momirealms.customfishing.bukkit.command.BukkitCommandFeature;
|
||||
import net.momirealms.customfishing.common.command.CustomFishingCommandManager;
|
||||
import net.momirealms.customfishing.common.locale.MessageConstants;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
@@ -78,7 +79,7 @@ public class GiveItemCommand extends BukkitCommandFeature<CommandSender> {
|
||||
amountToGive -= perStackSize;
|
||||
ItemStack more = itemStack.clone();
|
||||
more.setAmount(perStackSize);
|
||||
if (toInv) {
|
||||
if (toInv || player.getGameMode() == GameMode.SPECTATOR) {
|
||||
PlayerUtils.putItemsToInventory(player.getInventory(), more, more.getAmount());
|
||||
} else {
|
||||
PlayerUtils.dropItem(player, more, false, true, false);
|
||||
|
||||
Reference in New Issue
Block a user