Skip to content

Commit

Permalink
Fixed rotating beds
Browse files Browse the repository at this point in the history
  • Loading branch information
JBurlison committed Jul 19, 2019
1 parent d623f0b commit 0c3b58a
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Pandaros.Settlers/Pandaros.Settlers/GameLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static class GameLoader
public static string SAVE_LOC = "";
public static string Schematic_SAVE_LOC = "";
public static string Schematic_DEFAULT_LOC = "";
public static readonly Version MOD_VER = new Version(0, 8, 2, 60);
public static readonly Version MOD_VER = new Version(0, 8, 2, 61);
public static bool RUNNING { get; private set; }
public static bool WorldLoaded { get; private set; }
public static Colony StubColony { get; private set; }
Expand Down
49 changes: 23 additions & 26 deletions Pandaros.Settlers/Pandaros.Settlers/NBT/Schematic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,34 +65,31 @@ public void Rotate()

for (int y = 0; y < YMax; y++)
{
for (int x = 0; x < ZMax; x++)
for (int z = 0; z < ZMax; z++)
{
for (int z = 0; z < XMax; z++)
for (int x = 0; x < XMax; x++)
{
int newX = z;
int newZ = ZMax - (x + 1);

if (Blocks[z, y, x].CSBlock)
if (Blocks[z, y, x].ItemID.Contains("z+"))
{
Blocks[z, y, x].BlockID.Replace("z+", "x+");
}
else if (Blocks[z, y, x].ItemID.Contains("z-"))
{
Blocks[z, y, x].BlockID.Replace("z-", "x-");
}
else if (Blocks[z, y, x].ItemID.Contains("x+"))
{
Blocks[z, y, x].BlockID.Replace("x+", "z-");
}
else if (Blocks[z, y, x].ItemID.Contains("x-"))
{
Blocks[z, y, x].BlockID.Replace("x-", "z+");
}

newBlocks[newZ, y, newX] = Blocks[z, y, x];


int newX = x;
int newZ = ZMax - (z + 1);

if (Blocks[x, y, z].ItemID.Contains("z+"))
{
Blocks[x, y, z].BlockID = Blocks[x, y, z].BlockID.Replace("z+", "x-");
}
else if (Blocks[x, y, z].ItemID.Contains("z-"))
{
Blocks[x, y, z].BlockID = Blocks[x, y, z].BlockID.Replace("z-", "x+");
}
else if (Blocks[x, y, z].ItemID.Contains("x+"))
{
Blocks[x, y, z].BlockID = Blocks[x, y, z].BlockID.Replace("x+", "z+");
}
else if (Blocks[x, y, z].ItemID.Contains("x-"))
{
Blocks[x, y, z].BlockID = Blocks[x, y, z].BlockID.Replace("x-", "z-");
}

newBlocks[newZ, y, newX] = Blocks[x, y, z];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Pandaros.Settlers/Pandaros.Settlers/modInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"dllpath": "Pandaros.Settlers.dll",
"name": "Pandaros.Settlers",
"namepretty": "Pandaros' Settlers!",
"version": "0.8.2.60",
"version": "0.8.2.62",
"enabled": true,
"marksgamemodded": true,
"compatibleversions": [
Expand Down

0 comments on commit 0c3b58a

Please sign in to comment.