mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-19 15:09:15 +00:00
修复重复行为处理
This commit is contained in:
@@ -13,7 +13,6 @@ import net.momirealms.craftengine.bukkit.util.LocationUtils;
|
||||
import net.momirealms.craftengine.core.entity.furniture.*;
|
||||
import net.momirealms.craftengine.core.entity.furniture.hitbox.FurnitureHitBoxConfig;
|
||||
import net.momirealms.craftengine.core.entity.furniture.tick.FurnitureTicker;
|
||||
import net.momirealms.craftengine.core.entity.furniture.tick.TickingFurniture;
|
||||
import net.momirealms.craftengine.core.entity.furniture.tick.TickingFurnitureImpl;
|
||||
import net.momirealms.craftengine.core.plugin.config.Config;
|
||||
import net.momirealms.craftengine.core.sound.SoundData;
|
||||
|
||||
@@ -3813,12 +3813,14 @@ public class BukkitNetworkManager implements NetworkManager, Listener, PluginMes
|
||||
if (cancellable.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 不处理调试棒
|
||||
if (itemInHand.vanillaId().equals(ItemKeys.DEBUG_STICK)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 已经有过交互了
|
||||
if (serverPlayer.lastSuccessfulInteractionTick() == serverPlayer.gameTicks()) {
|
||||
return;
|
||||
}
|
||||
// 必须从网络包层面处理,否则无法获取交互的具体实体
|
||||
if (serverPlayer.isSecondaryUseActive() && !itemInHand.isEmpty() && hitBox.config().canUseItemOn()) {
|
||||
Optional<CustomItem<ItemStack>> optionalCustomItem = itemInHand.getCustomItem();
|
||||
|
||||
@@ -21,7 +21,9 @@ templates:
|
||||
conditions:
|
||||
- type: expression
|
||||
expression: <arg:player.is_sneaking>
|
||||
- type: "!has_item"
|
||||
functions:
|
||||
- type: update_interaction_tick
|
||||
- type: rotate_furniture
|
||||
degree: 90
|
||||
on-success:
|
||||
@@ -47,9 +49,11 @@ templates:
|
||||
conditions:
|
||||
- type: expression
|
||||
expression: <arg:player.is_sneaking>
|
||||
- type: "!has_item"
|
||||
- type: "!match_furniture_variant"
|
||||
variants: ${blacklist_variants:-null}
|
||||
functions:
|
||||
- type: update_interaction_tick
|
||||
- type: rotate_furniture
|
||||
degree: 45
|
||||
on-success:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.momirealms.craftengine.core.entity.furniture;
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||
import net.momirealms.craftengine.core.block.entity.tick.TickingBlockEntity;
|
||||
import net.momirealms.craftengine.core.entity.furniture.behavior.FurnitureBehaviorTypes;
|
||||
import net.momirealms.craftengine.core.entity.furniture.element.FurnitureElementConfig;
|
||||
import net.momirealms.craftengine.core.entity.furniture.element.FurnitureElementConfigs;
|
||||
|
||||
@@ -11,7 +11,6 @@ import net.momirealms.craftengine.core.util.Key;
|
||||
import net.momirealms.craftengine.core.util.MiscUtils;
|
||||
import net.momirealms.craftengine.core.util.ResourceConfigUtils;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
Reference in New Issue
Block a user