Private
Public Access
1
0

try to further decrease allocations

This commit is contained in:
2026-03-22 03:54:48 +01:00
parent e9e4fec229
commit e16ae3f30c
8 changed files with 69 additions and 28 deletions

View File

@@ -6,6 +6,8 @@ namespace OrekiWoofsBees.Common;
public static class PlantRecognitionUtilities
{
private static readonly BlockPos blockPos = new(0);
public static bool IsCrop(Block block)
{
return block is BlockCrop;
@@ -38,8 +40,12 @@ public static class PlantRecognitionUtilities
return false;
}
public static bool IsFlower(Block block, IBlockAccessor accessor, StructVec3i pos) => IsFlower(block, accessor, blockPos.Set(pos.X, pos.Y, pos.Z));
public static bool IsPlant(Block block, IBlockAccessor accessor, BlockPos pos)
{
return IsCrop(block) || IsFlower(block, accessor, pos);
}
public static bool IsPlant(Block block, IBlockAccessor accessor, StructVec3i pos) => IsPlant(block, accessor, blockPos.Set(pos.X, pos.Y, pos.Z));
}