mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 12:42:22 -04:00
Now /map grass actually saves, and disables auto grass growing when level physics is 0 or 5. (Thanks Joseph)
This commit is contained in:
parent
4bc09e9b1d
commit
9b9cd3535f
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user