mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2025-12-30 04:19:27 +00:00
修正一些问题
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user