9
0
mirror of https://github.com/Xiao-MoMi/Custom-Fishing.git synced 2025-12-19 15:09:24 +00:00

fix teleport packet

This commit is contained in:
XiaoMoMi
2024-11-29 16:10:49 +08:00
parent 1f744e9a4c
commit 17e0806ad9
4 changed files with 7 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ public class FishingEffectApplyEvent extends Event {
* {@link Stage#LOOT}: The effect at this stage play a crucial role in what loot will appear next, and weighted effects should be applied at this stage.
* {@link Stage#FISHING}: The effects at this stage affect the hook time, game difficulty and other fishing-related attributes
* <p>
* For developers, {@link Stage#CAST} will only be triggered once, while the other two stages will be triggered multiple times
* Please note that {@link Stage#CAST} will only be triggered once, while the other two stages might be triggered multiple times
*
* @return the stage
*/
@@ -62,7 +62,7 @@ public class FishingEffectApplyEvent extends Event {
* Effects at stage {@link Stage#LOOT}/{@link Stage#FISHING} are temporary because the fishhook could move. For example, it flows from the water into the lava or another biome,
* causing some conditional effects changing.
* <p>
* For developers, {@link Stage#CAST} will only be triggered once, while the other two stages will be triggered multiple times
* Please note that {@link Stage#CAST} will only be triggered once, while the other two stages might be triggered multiple times
*
* @return the effect
*/

View File

@@ -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);

View File

@@ -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);

View File

@@ -20,7 +20,7 @@ h2_driver_version=2.3.232
sqlite_driver_version=3.47.0.0
adventure_bundle_version=4.17.0
adventure_platform_version=4.3.4
sparrow_heart_version=0.46
sparrow_heart_version=0.47
cloud_core_version=2.0.0
cloud_services_version=2.0.0
cloud_brigadier_version=2.0.0-beta.10