Moved rotation to Building
This commit is contained in:
@@ -168,8 +168,8 @@ public abstract class SaveVersion extends SaveFileReader{
|
||||
Tile tile = world.rawTile(i % world.width(), i / world.width());
|
||||
stream.writeShort(tile.blockID());
|
||||
|
||||
boolean saverot = tile.block().saveRotation;
|
||||
byte packed = (byte)((tile.build != null ? 1 : 0) | (saverot ? 2 : 0));
|
||||
boolean savedata = tile.block().saveData;
|
||||
byte packed = (byte)((tile.build != null ? 1 : 0) | (savedata ? 2 : 0));
|
||||
|
||||
//make note of whether there was an entity/rotation here
|
||||
stream.writeByte(packed);
|
||||
@@ -185,8 +185,8 @@ public abstract class SaveVersion extends SaveFileReader{
|
||||
}else{
|
||||
stream.writeBoolean(false);
|
||||
}
|
||||
}else if(saverot){
|
||||
stream.writeByte(tile.rotation());
|
||||
}else if(savedata){
|
||||
stream.writeByte(tile.data);
|
||||
}else{
|
||||
//write consecutive non-entity blocks
|
||||
int consecutives = 0;
|
||||
@@ -244,7 +244,7 @@ public abstract class SaveVersion extends SaveFileReader{
|
||||
boolean isCenter = true;
|
||||
byte packedCheck = stream.readByte();
|
||||
boolean hadEntity = (packedCheck & 1) != 0;
|
||||
boolean hadRotation = (packedCheck & 2) != 0;
|
||||
boolean hadData = (packedCheck & 2) != 0;
|
||||
|
||||
if(hadEntity){
|
||||
isCenter = stream.readBoolean();
|
||||
@@ -271,9 +271,9 @@ public abstract class SaveVersion extends SaveFileReader{
|
||||
skipChunk(stream, true);
|
||||
}
|
||||
}
|
||||
}else if(hadRotation){
|
||||
}else if(hadData){
|
||||
tile.setBlock(block);
|
||||
tile.rotation(stream.readByte());
|
||||
tile.data = stream.readByte();
|
||||
}else{
|
||||
int consecutives = stream.readUnsignedByte();
|
||||
|
||||
|
||||
@@ -72,12 +72,12 @@ public abstract class LegacySaveVersion extends SaveVersion{
|
||||
byte rotation = Pack.rightByte(packedrot);
|
||||
|
||||
tile.setTeam(Team.get(team));
|
||||
tile.rotation(rotation);
|
||||
tile.build.rotation = rotation;
|
||||
|
||||
if(tile.build.items != null) tile.build.items.read(Reads.get(stream));
|
||||
if(tile.build.power != null) tile.build.power.read(Reads.get(stream));
|
||||
if(tile.build.liquids != null) tile.build.liquids.read(Reads.get(stream));
|
||||
if(tile.build.cons() != null) tile.build.cons().read(Reads.get(stream));
|
||||
if(tile.build.cons != null) tile.build.cons.read(Reads.get(stream));
|
||||
|
||||
//read only from subclasses!
|
||||
tile.build.read(Reads.get(in), version);
|
||||
|
||||
Reference in New Issue
Block a user