Merge from master

This commit is contained in:
BruceChen 2022-09-30 08:44:11 +08:00
commit 993771dc5d
8 changed files with 366 additions and 21 deletions

View file

@ -752,6 +752,7 @@ namespace MinecraftClient.Mapping
return false;
}
}
/// <summary>
/// Check if the provided material is a liquid a player can swim into
/// </summary>
@ -768,5 +769,36 @@ namespace MinecraftClient.Mapping
return false;
}
}
/// <summary>
/// Check if the provided material is a bed
/// </summary>
/// <param name="m">Material to test</param>
/// <returns>True if the material is a bed</returns>
public static bool IsBed(this Material m)
{
switch (m)
{
case Material.BlackBed:
case Material.BlueBed:
case Material.BrownBed:
case Material.CyanBed:
case Material.GrayBed:
case Material.GreenBed:
case Material.LightBlueBed:
case Material.LightGrayBed:
case Material.LimeBed:
case Material.MagentaBed:
case Material.OrangeBed:
case Material.PinkBed:
case Material.PurpleBed:
case Material.RedBed:
case Material.WhiteBed:
case Material.YellowBed:
return true;
default:
return false;
}
}
}
}