diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 6aef02f339..ecdb253ea1 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -457,7 +457,7 @@ public class DesktopInput extends InputHandler{ cursorType = cursor.build.getCursor(); } - if(cursor.build != null && player.team() != Team.derelict && cursor.build.team == Team.derelict && Build.validPlace(cursor.block(), player.team(), cursor.build.tileX(), cursor.build.tileY(), cursor.build.rotation)){ + if(cursor.build != null && player.team() != Team.derelict && cursor.build.team == Team.derelict && cursor.build.block.unlockedNow() && Build.validPlace(cursor.block(), player.team(), cursor.build.tileX(), cursor.build.tileY(), cursor.build.rotation)){ cursorType = ui.repairCursor; } diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index 1d9b895049..b41c2b733b 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -380,13 +380,20 @@ public class Conveyor extends Block implements Autotiler{ } } + @Override + public byte version(){ + return 1; + } + @Override public void write(Writes write){ super.write(write); write.i(len); for(int i = 0; i < len; i++){ - write.i(Pack.intBytes((byte)ids[i].id, (byte)(xs[i] * 127), (byte)(ys[i] * 255 - 128), (byte)0)); + write.s(ids[i].id); + write.b((byte)(xs[i] * 127)); + write.b((byte)(ys[i] * 255 - 128)); } } @@ -397,10 +404,20 @@ public class Conveyor extends Block implements Autotiler{ len = Math.min(amount, capacity); for(int i = 0; i < amount; i++){ - int val = read.i(); - short id = (short)(((byte)(val >> 24)) & 0xff); - float x = (float)((byte)(val >> 16)) / 127f; - float y = ((float)((byte)(val >> 8)) + 128f) / 255f; + short id; + float x, y; + + if(revision == 0){ + int val = read.i(); + id = (short)(((byte)(val >> 24)) & 0xff); + x = (float)((byte)(val >> 16)) / 127f; + y = ((float)((byte)(val >> 8)) + 128f) / 255f; + }else{ + id = read.s(); + x = (float)read.b() / 127f; + y = ((float)read.b() + 128f) / 255f; + } + if(i < capacity){ ids[i] = content.item(id); xs[i] = x;