diff --git a/ClassicalSharp/2D/Widgets/InputWidget.cs b/ClassicalSharp/2D/Widgets/InputWidget.cs index 4e1e18bcb..237cf6570 100644 --- a/ClassicalSharp/2D/Widgets/InputWidget.cs +++ b/ClassicalSharp/2D/Widgets/InputWidget.cs @@ -135,6 +135,7 @@ namespace ClassicalSharp.Gui.Widgets { string line = lines[caretRow]; if (caretCol < line.Length) { args.Text = new String(line[caretCol], 1); + args.UseShadow = true; caretTex.Width = (short)drawer.MeasureSize(ref args).Width; } else { caretTex.Width = (short)caretWidth; diff --git a/ClassicalSharp/Generator/NotchyGenerator.cs b/ClassicalSharp/Generator/NotchyGenerator.cs index 6db6b6e8b..92972dbed 100644 --- a/ClassicalSharp/Generator/NotchyGenerator.cs +++ b/ClassicalSharp/Generator/NotchyGenerator.cs @@ -348,7 +348,11 @@ namespace ClassicalSharp.Generator { int treeY = heightmap[treeZ * Width + treeX] + 1; int treeHeight = 5 + rnd.Next(3); - if (CanGrowTree(treeX, treeY, treeZ, treeHeight)) { + + int index = (treeY * Length + treeZ) * Width + treeX; + BlockID blockUnder = treeY > 0 ? blocks[index - oneY] : Block.Air; + + if (blockUnder == Block.Grass && CanGrowTree(treeX, treeY, treeZ, treeHeight)) { GrowTree(treeX, treeY, treeZ, treeHeight); } } diff --git a/ClassicalSharp/Singleplayer/FoliagePhysics.cs b/ClassicalSharp/Singleplayer/FoliagePhysics.cs index 6e81ffdf0..d1bbcdcd5 100644 --- a/ClassicalSharp/Singleplayer/FoliagePhysics.cs +++ b/ClassicalSharp/Singleplayer/FoliagePhysics.cs @@ -36,7 +36,10 @@ namespace ClassicalSharp.Singleplayer { int x = index % map.Width; int y = (index / map.Width) / map.Length; int z = (index / map.Width) % map.Length; - GrowTree(x, y, z); + + BlockID below = Block.Air; + if (y > 0) below = map.blocks[index - map.Width * map.Length]; + if (below == Block.Grass) GrowTree(x, y, z); } void HandleDirt(int index, BlockID block) {