diff --git a/src/main/java/galaxyoyo/unknown/api/editor/EditorAPI.java b/src/main/java/galaxyoyo/unknown/api/editor/EditorAPI.java index 078f97d..afc4b91 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/EditorAPI.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/EditorAPI.java @@ -25,7 +25,10 @@ public class EditorAPI for (int x = 1; x < width; x += 16) { bytes.add((byte) 0); + bytes.add((byte) 0); + bytes.add((byte) (Byte.MIN_VALUE / 2)); } + bytes.remove(bytes.lastIndexOf((byte) (Byte.MIN_VALUE / 2))); bytes.add(Byte.MIN_VALUE); } diff --git a/src/main/java/galaxyoyo/unknown/api/editor/sprites/SpriteRegister.java b/src/main/java/galaxyoyo/unknown/api/editor/sprites/SpriteRegister.java index ad2c44a..e1bd922 100644 --- a/src/main/java/galaxyoyo/unknown/api/editor/sprites/SpriteRegister.java +++ b/src/main/java/galaxyoyo/unknown/api/editor/sprites/SpriteRegister.java @@ -24,6 +24,11 @@ public class SpriteRegister @SuppressWarnings("unchecked") public static void refreshAllSprites() { + if (nameToCoords != null && !nameToCoords.isEmpty() && !sprites.isEmpty()) + { + return; + } + try { BufferedReader br = new BufferedReader(new InputStreamReader(SpriteRegister.class.getResourceAsStream("/assets/unknown/textures/sprites/sprites.json"))); @@ -43,9 +48,7 @@ public class SpriteRegister { int x = list.get(0).intValue(); int y = list.get(1).intValue(); - int width = list.get(2).intValue() * 16; - int height = list.get(3).intValue() * 16; - BufferedImage child = img.getSubimage(x, y, width, height); + BufferedImage child = img.getSubimage(x, y, 16, 16); Sprite sprite = new Sprite(child); lSprites.add(sprite); } diff --git a/src/main/resources/assets/unknown/textures/sprites/gazon.png b/src/main/resources/assets/unknown/textures/sprites/gazon.png index a5b3c1d..6de3e60 100644 Binary files a/src/main/resources/assets/unknown/textures/sprites/gazon.png and b/src/main/resources/assets/unknown/textures/sprites/gazon.png differ diff --git a/src/main/resources/assets/unknown/textures/sprites/sprites.json b/src/main/resources/assets/unknown/textures/sprites/sprites.json index ea92c86..b450de6 100644 --- a/src/main/resources/assets/unknown/textures/sprites/sprites.json +++ b/src/main/resources/assets/unknown/textures/sprites/sprites.json @@ -1,11 +1,82 @@ { "gazon": [ - [0,15,1,5], - [0,144,1,3], - [16,144,2,2], - [32,208,6,2], - [128,144,1,2], - [160,156,3,2], - [160,32,1,3] + [0,0], + [0,16], + [0,32], + [0,48], + [0,64], + [0,144], + [0,160], + [0,176], + [16,144], + [32,144], + [16,160], + [32,160], + [32,224], + [48,224], + [64,224], + [80,224], + [96,224], + [112,224], + [112,208], + [159,48], + [160,166], + [176,166], + [128,144], + [128,160], + [144,80], + [48,36], + [64,36], + [54,53], + [70,53], + [48,70], + [16,28], + [16,16], + [16,32], + [16,48], + [16,64], + [16,80], + [32,16], + [32,32], + [32,48], + [32,64], + [32,80], + [48,64], + [48,80], + [64,64], + [64,80], + [80,64], + [80,80], + [96,64], + [96,80], + [112,64], + [112,80], + [128,80], + [128,64], + [112,48], + [128,48], + [112,32], + [128,32], + [112,16], + [128,16], + [64,128], + [80,128], + [96,128], + [48,144], + [64,144], + [80,144], + [96,144], + [48,160], + [96,160], + [48,176], + [96,176], + [32,176], + [112,176], + [64,160], + [80,160], + [64,176], + [80,176], + [64,192], + [80,192] ] }