diff --git a/core/src/se/cookery/world/Block.java b/core/src/se/cookery/world/Block.java index cf4df43..ff99aa6 100644 --- a/core/src/se/cookery/world/Block.java +++ b/core/src/se/cookery/world/Block.java @@ -17,8 +17,8 @@ public class Block { private long offset_x = 0; private long offset_y = 0; - private int[][] height = new int[BLOCK_SIZE][BLOCK_SIZE]; - private int[][] groundType = new int[BLOCK_SIZE][BLOCK_SIZE]; + private byte[][] height = new byte[BLOCK_SIZE][BLOCK_SIZE]; + private short[][] groundType = new short[BLOCK_SIZE][BLOCK_SIZE]; public Block(long x, long y) { offset_x = x; @@ -46,7 +46,7 @@ public class Block { } - public void setHeight(long x, long y, int height) { + public void setHeight(long x, long y, byte height) { this.height[getLocalX(x)][getLocalY(y)] = height; } public int getHeight(long x, long y) { @@ -57,10 +57,10 @@ public class Block { public void setGroundType(long x, long y, GroundType groundType) { setGroundType(x, y, groundType.getId()); } - public void setGroundType(long x, long y, int groundTypeId) { + public void setGroundType(long x, long y, short groundTypeId) { this.groundType[getLocalX(x)][getLocalY(y)] = groundTypeId; } - public int getGroundType(long x, long y) { + public short getGroundType(long x, long y) { return groundType[getLocalX(x)][getLocalY(y)]; } } diff --git a/core/src/se/cookery/world/GroundType.java b/core/src/se/cookery/world/GroundType.java index b0896f5..85bfb63 100644 --- a/core/src/se/cookery/world/GroundType.java +++ b/core/src/se/cookery/world/GroundType.java @@ -6,16 +6,16 @@ package se.cookery.world; public final class GroundType { // Variables - private final int id; + private final short id; private final String name; - protected GroundType(int id, String name) { + protected GroundType(short id, String name) { this.id = id; this.name = name; } - public int getId() { + public short getId() { return id; }