diff --git a/src/main/java/cactusServer/models/CharacterModelManager.java b/src/main/java/cactusServer/models/CharacterModelManager.java index f3b2f24..644c89d 100644 --- a/src/main/java/cactusServer/models/CharacterModelManager.java +++ b/src/main/java/cactusServer/models/CharacterModelManager.java @@ -21,12 +21,7 @@ private void initCharacterModels() { String[] initCharacterModelFileNames = { "pocha.stl", "Head4.obj" }; for (String fileName : initCharacterModelFileNames) { - String path = Instances.class.getResource(fileName).getPath(); - try { - path = URLDecoder.decode(path, "utf-8"); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } + String path = createModelFilePath(fileName); System.out.println((path == null) ? "null����!" : path); // �m�F�p characterModels.put(characterModels.size(), loadModel(path)); } @@ -36,6 +31,16 @@ System.out.println(entry.getKey() + ": " + entry.getValue()); } } + + private String createModelFilePath(String fileName) { + String path = Instances.class.getResource(fileName).getPath(); + try { + path = URLDecoder.decode(path, "utf-8"); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + } + return path; + } private Model3D loadModel(String fileName) { try {