Now /map grass actually saves, and disables auto grass growing when level physics is 0 or 5. (Thanks Joseph)

This commit is contained in:
UnknownShadow200 2016-08-05 19:53:09 +10:00
parent 4bc09e9b1d
commit 9b9cd3535f
4 changed files with 6 additions and 6 deletions

View File

@ -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;
}

View File

@ -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<Check> ListCheck = new FastList<Check>(); //A list of blocks that need to be updated

View File

@ -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);
}

View File

@ -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) {