Fix water modified to be a non-full block still always stretching top face of water. (Thanks VenkSociety)

This commit is contained in:
UnknownShadow200 2017-07-22 12:54:16 +10:00
parent d005e0aca9
commit 1d00da8381
5 changed files with 8 additions and 5 deletions

View File

@ -92,7 +92,7 @@ namespace ClassicalSharp.Gui.Screens {
} catch (Exception ex) { } catch (Exception ex) {
ErrorHandler.LogError("loading map", ex); ErrorHandler.LogError("loading map", ex);
string file = Path.GetFileName(path); string file = Path.GetFileName(path);
game.Chat.Add("&e/client loadmap: Failed to load map \"" + file + "\""); game.Chat.Add("&eFailed to load map \"" + file + "\"");
} }
} }
} }

View File

@ -28,8 +28,9 @@ namespace ClassicalSharp {
x++; x++;
chunkIndex++; chunkIndex++;
countIndex += Side.Sides; countIndex += Side.Sides;
bool stretchTile = (info.CanStretch[block] & (1 << Side.Top)) != 0;
while (x < chunkEndX && CanStretch(block, chunkIndex, x, y, z, Side.Top) && !OccludedLiquid(chunkIndex)) { while (x < chunkEndX && stretchTile && CanStretch(block, chunkIndex, x, y, z, Side.Top) && !OccludedLiquid(chunkIndex)) {
counts[countIndex] = 0; counts[countIndex] = 0;
count++; count++;
x++; x++;

View File

@ -22,8 +22,9 @@ namespace ClassicalSharp {
x++; x++;
chunkIndex++; chunkIndex++;
countIndex += Side.Sides; countIndex += Side.Sides;
bool stretchTile = (info.CanStretch[block] & (1 << Side.Top)) != 0;
while (x < chunkEndX && CanStretch(block, chunkIndex, x, y, z, Side.Top) && !OccludedLiquid(chunkIndex)) { while (x < chunkEndX && stretchTile && CanStretch(block, chunkIndex, x, y, z, Side.Top) && !OccludedLiquid(chunkIndex)) {
counts[countIndex] = 0; counts[countIndex] = 0;
count++; count++;
x++; x++;

View File

@ -52,7 +52,7 @@ namespace ClassicalSharp.Network.Protocols {
if (game.World.blocks == null) return; if (game.World.blocks == null) return;
// Need to refresh lighting when a block's light blocking state changes // Need to refresh lighting when a block's light blocking state changes
if (didBlockLight != game.BlockInfo.BlocksLight[block]) { if (game.BlockInfo.BlocksLight[block] != didBlockLight) {
game.Lighting.Refresh(); game.Lighting.Refresh();
} }
} }

View File

@ -20,8 +20,9 @@ Int32 NormalBuilder_StretchXLiquid(Int32 countIndex, Int32 x, Int32 y, Int32 z,
x++; x++;
chunkIndex++; chunkIndex++;
countIndex += Face_Count; countIndex += Face_Count;
bool stretchTile = (Block_CanStretch[block] & (1 << Face_YMax)) != 0;
while (x < Builder_ChunkEndX && NormalBuilder_CanStretch(block, chunkIndex, x, y, z, Face_YMax) && !Builder_OccludedLiquid(chunkIndex)) { while (x < Builder_ChunkEndX && stretchTile && NormalBuilder_CanStretch(block, chunkIndex, x, y, z, Face_YMax) && !Builder_OccludedLiquid(chunkIndex)) {
Builder_Counts[countIndex] = 0; Builder_Counts[countIndex] = 0;
count++; count++;
x++; x++;