會長:chenjinsheng / 此間半開一盞茶開設日:2015-05-17 23:58:58
近期編輯:chenjinsheng ...看更多 |
@Override public boolean onCommand(CommandSender cs, Command c, String s, String[] ss) { if (ss.length == 0 && cs instanceof Player) { Player p = (Player) cs; MinecraftServer ms = ((CraftServer) Bukkit.getServer()).getServer(); WorldServer ws = ((CraftWorld)Bukkit.getWorlds().get(0)).getHandle(); GameProfile gp = new GameProfile(p.getUniqueId(), p.getName()); PlayerInteractManager pim = new PlayerInteractManager(ws); EntityPlayer ep = new EntityPlayer(ms, ws, gp, pim); Location l = p.getLocation(); ep.setLocation(l.getX(), l.getY(), l.getZ(), l.getYaw(), l.getPitch()); PlayerConnection pc = ((CraftPlayer) p).getHandle().playerConnection; pc.sendPacket(new PacketPlayOutPlayerInfo(PacketPlayOutPlayerInfo .EnumPlayerInfoAction.ADD_PLAYER,ep)); pc.sendPacket(new PacketPlayOutNamedEntitySpawn(ep)); } return false; } |
目前沒有資料連到「製作假的實體玩家」。