Now /map edge floods in actual edge block, instead of being hardcoded to water, fixes #434

This commit is contained in:
UnknownShadow200 2017-06-04 20:53:55 +10:00
parent 3d9f40d94e
commit 4cd5069a77
3 changed files with 10 additions and 6 deletions

View File

@ -31,8 +31,12 @@ namespace MCGalaxy.Blocks.Physics {
//Edge of map water
if (lvl.edgeWater && (y < lvl.EdgeLevel && y >= (lvl.EdgeLevel + lvl.SidesOffset))) {
if (x == 0 || x == lvl.Width - 1 || z == 0 || z == lvl.Length - 1)
lvl.AddUpdate(C.b, Block.water);
if (x == 0 || x == lvl.Width - 1 || z == 0 || z == lvl.Length - 1) {
ExtBlock block = ExtBlock.FromRaw((byte)lvl.HorizonBlock);
PhysicsArgs args = default(PhysicsArgs);
args.ExtBlock = block.BlockID == Block.custom_block;
lvl.AddUpdate(C.b, block.BlockID, false, args);
}
}
if (!C.data.HasWait) C.data.Data = PhysicsArgs.RemoveFromChecks;
}

View File

@ -154,7 +154,7 @@ namespace MCGalaxy.Blocks.Physics {
lvl.AddUpdate(C.b, next);
}
} else {
lvl.AddUpdate(C.b, rand.Next(Block.red, Block.darkpink + 1));
lvl.AddUpdate(C.b, (byte)rand.Next(Block.red, Block.darkpink + 1));
}
}

View File

@ -231,11 +231,11 @@ namespace MCGalaxy {
}
}
internal bool AddUpdate(int b, int type, bool overRide = false) {
internal bool AddUpdate(int b, byte type, bool overRide = false) {
return AddUpdate(b, type, overRide, default(PhysicsArgs));
}
internal bool AddUpdate(int b, int type, bool overRide, PhysicsArgs data) {
internal bool AddUpdate(int b, byte type, bool overRide, PhysicsArgs data) {
try {
int x = b % Width;
int y = (b / Width) / Length;
@ -244,7 +244,7 @@ namespace MCGalaxy {
if (overRide) {
ExtBlock block;
block.BlockID = (byte)type;
block.BlockID = type;
block.ExtID = 0;
// Is the Ext flag just an indicator for the block update?