mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-27 02:49:15 +00:00
修复worldedit实体复制
This commit is contained in:
@@ -323,8 +323,9 @@ public class BukkitFurnitureManager extends AbstractFurnitureManager {
|
||||
if (FastNMS.INSTANCE.method$CraftEntity$getHandle(shulker) instanceof CollisionEntity) {
|
||||
return;
|
||||
}
|
||||
// not a collision entity
|
||||
Byte flag = shulker.getPersistentDataContainer().get(FURNITURE_COLLISION, PersistentDataType.BYTE);
|
||||
if (flag != null && flag == 1) {
|
||||
if (flag == null || flag != 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class FurnitureEventListener implements Listener {
|
||||
if (entity instanceof ItemDisplay itemDisplay) {
|
||||
this.manager.handleBaseEntityLoadLate(itemDisplay, 0);
|
||||
} else if (entity instanceof Shulker shulker) {
|
||||
//this.manager.handleCollisionEntityLoadLate(shulker, 0);
|
||||
this.manager.handleCollisionEntityLoadLate(shulker, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package net.momirealms.craftengine.bukkit.plugin.command.feature;
|
||||
|
||||
import net.momirealms.craftengine.bukkit.nms.CollisionEntity;
|
||||
import net.momirealms.craftengine.bukkit.nms.FastNMS;
|
||||
import net.momirealms.craftengine.bukkit.entity.furniture.BukkitFurnitureManager;
|
||||
import net.momirealms.craftengine.bukkit.plugin.command.BukkitCommandFeature;
|
||||
import net.momirealms.craftengine.core.plugin.CraftEngine;
|
||||
import net.momirealms.craftengine.core.plugin.command.CraftEngineCommandManager;
|
||||
@@ -9,6 +8,8 @@ import org.bukkit.Location;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Shulker;
|
||||
import org.bukkit.persistence.PersistentDataType;
|
||||
import org.incendo.cloud.Command;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -29,7 +30,7 @@ public class TestCommand extends BukkitCommandFeature<CommandSender> {
|
||||
try {
|
||||
Collection<Entity> entities = player.getLocation().getNearbyEntities(2,2,2);
|
||||
for (Entity entity : entities) {
|
||||
if (FastNMS.INSTANCE.method$CraftEntity$getHandle(entity) instanceof CollisionEntity) {
|
||||
if (entity instanceof Shulker) {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user