diff --git a/Blocks/Behaviour/PlaceBehaviour.cs b/Blocks/Behaviour/PlaceBehaviour.cs index 06933b6d1..a5cf44f43 100644 --- a/Blocks/Behaviour/PlaceBehaviour.cs +++ b/Blocks/Behaviour/PlaceBehaviour.cs @@ -24,7 +24,7 @@ namespace MCGalaxy.BlockBehaviour { internal static bool Grass(Player p, byte block, ushort x, ushort y, ushort z) { Level lvl = p.level; - if (!(lvl.physics == 0 || lvl.physics == 5)) { + if (!lvl.GrassGrow || !(lvl.physics == 0 || lvl.physics == 5)) { p.ChangeBlock(x, y, z, block, 0); return false; } diff --git a/Levels/Level.Fields.cs b/Levels/Level.Fields.cs index b2eb5f30d..d7e7b19bd 100644 --- a/Levels/Level.Fields.cs +++ b/Levels/Level.Fields.cs @@ -166,8 +166,6 @@ namespace MCGalaxy { } } int Physicsint; - public bool GrassDestroy = true; - public bool GrassGrow = true; public bool physicschanged { get { return ListCheck.Count > 0; } } public int currentUndo; @@ -185,6 +183,8 @@ namespace MCGalaxy { public bool growTrees; [ConfigBool("Animal AI", "Physics", null, true)] public bool ai = true; + [ConfigBool("GrassGrowth", "Physics", null, true)] + public bool GrassGrow = true; public int lastCheck, lastUpdate; internal FastList ListCheck = new FastList(); //A list of blocks that need to be updated diff --git a/Player/Player.Handlers.cs b/Player/Player.Handlers.cs index 83db6c476..022b860ff 100644 --- a/Player/Player.Handlers.cs +++ b/Player/Player.Handlers.cs @@ -140,7 +140,8 @@ namespace MCGalaxy { changed = ChangeBlock(x, y, z, Block.air, 0); } - if ((level.physics == 0 || level.physics == 5) && level.GetTile(x, (ushort)(y - 1), z) == Block.dirt) + bool autoDelete = level.GrassGrow && (level.physics == 0 || level.physics == 5); + if (autoDelete && level.GetTile(x, (ushort)(y - 1), z) == Block.dirt) ChangeBlock(x, (ushort)(y - 1), z, Block.grass, 0); return changed; } @@ -166,7 +167,7 @@ namespace MCGalaxy { if (!level.DoBlockchange(this, x, y, z, block, extBlock)) return false; Player.GlobalBlockchange(level, x, y, z, block, extBlock); - if (level.GetTile(x, (ushort)(y - 1), z) == Block.grass && level.GrassDestroy + if (level.GrassGrow && level.GetTile(x, (ushort)(y - 1), z) == Block.grass && !Block.LightPass(block, extBlock, level.CustomBlockDefs)) { level.Blockchange(this, x, (ushort)(y - 1), z, Block.dirt); } diff --git a/Player/Player.Timers.cs b/Player/Player.Timers.cs index be68f1fe5..84a7ccf4d 100644 --- a/Player/Player.Timers.cs +++ b/Player/Player.Timers.cs @@ -95,7 +95,6 @@ namespace MCGalaxy { void CheckTimerElapsed(object sender, ElapsedEventArgs e) { if (name == "") return; SendRaw(Opcode.Ping); - Server.s.Log("CALLBACK"); if (Server.afkminutes <= 0) return; if (IsAfk) {