9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-30 04:19:27 +00:00

修正一些问题

This commit is contained in:
XiaoMoMi
2025-08-23 18:28:07 +08:00
parent 05e3dd545f
commit c8a6b3b8d5
11 changed files with 22 additions and 20 deletions

View File

@@ -8,9 +8,17 @@ import org.jetbrains.annotations.NotNull;
public class CraftEngineReloadEvent extends Event {
private static final HandlerList HANDLER_LIST = new HandlerList();
private final BukkitCraftEngine plugin;
private static boolean firstFlag = true;
private final boolean isFirstReload;
public CraftEngineReloadEvent(BukkitCraftEngine plugin) {
this.plugin = plugin;
this.isFirstReload = firstFlag;
firstFlag = false;
}
public boolean isFirstReload() {
return this.isFirstReload;
}
public BukkitCraftEngine plugin() {

View File

@@ -1,6 +1,6 @@
package net.momirealms.craftengine.bukkit.entity;
import net.momirealms.craftengine.bukkit.util.KeyUtils;
import net.momirealms.craftengine.bukkit.util.EntityUtils;
import net.momirealms.craftengine.bukkit.world.BukkitWorld;
import net.momirealms.craftengine.core.entity.AbstractEntity;
import net.momirealms.craftengine.core.util.Direction;
@@ -68,7 +68,7 @@ public class BukkitEntity extends AbstractEntity {
@Override
public Key type() {
return KeyUtils.namespacedKey2Key(literalObject().getType().getKey());
return EntityUtils.getEntityType(literalObject());
}
@Override

View File

@@ -6,7 +6,6 @@ import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.CoreReflect
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MBlocks;
import net.momirealms.craftengine.bukkit.plugin.reflection.minecraft.MFluids;
import net.momirealms.craftengine.bukkit.util.BlockStateUtils;
import net.momirealms.craftengine.bukkit.util.KeyUtils;
import net.momirealms.craftengine.bukkit.util.LocationUtils;
import net.momirealms.craftengine.core.block.CustomBlock;
import net.momirealms.craftengine.core.block.ImmutableBlockState;
@@ -63,7 +62,11 @@ public class BukkitBlockInWorld implements BlockInWorld {
@Override
public Key type() {
return KeyUtils.namespacedKey2Key(this.block.getType().getKey());
CustomBlock customBlock = customBlock();
if (customBlock == null) {
return BlockStateUtils.getBlockOwnerIdFromData(this.block.getBlockData());
}
return customBlock.id();
}
@Override