use of net.glowstone.entity.meta.profile.PlayerProfile in project Glowstone by GlowstoneMC.
the class GlowClient method start.
public void start() {
GLFWErrorCallback.createPrint(System.err).set();
entity = new GlowClientEntity(server.getWorlds().get(0).getSpawnLocation(), new PlayerProfile("GlowClient", UUID.randomUUID()));
if (!GLFW.glfwInit()) {
throw new IllegalStateException("Unable to initialize GLFW");
}
GLFW.glfwWindowHint(GLFW.GLFW_RESIZABLE, GLFW.GLFW_TRUE);
window = GLFW.glfwCreateWindow(1280, 720, "GlowClient", MemoryUtil.NULL, MemoryUtil.NULL);
if (window == MemoryUtil.NULL) {
throw new RuntimeException("Failed to create window");
}
GLFW.glfwSetKeyCallback(window, this::onInput);
try (MemoryStack stack = MemoryStack.stackPush()) {
IntBuffer pWidth = stack.mallocInt(1);
IntBuffer pHeight = stack.mallocInt(1);
GLFW.glfwGetWindowSize(window, pWidth, pHeight);
GLFWVidMode vidmode = GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor());
GLFW.glfwSetWindowPos(window, (vidmode.width() - pWidth.get(0)) / 2, (vidmode.height() - pHeight.get(0)) / 2);
}
GLFW.glfwMakeContextCurrent(window);
GLFW.glfwSwapInterval(1);
}
use of net.glowstone.entity.meta.profile.PlayerProfile in project Glowstone by GlowstoneMC.
the class UuidListFile method getProfiles.
public List<PlayerProfile> getProfiles() {
List<PlayerProfile> result = new ArrayList<>(entries.size());
for (BaseEntry baseEntry : entries) {
Entry entry = (Entry) baseEntry;
PlayerProfile profile = ProfileCache.getProfile(entry.uuid);
if (profile == null) {
profile = new PlayerProfile(entry.fallbackName, entry.uuid);
}
result.add(profile);
}
return result;
}
Aggregations