try to further decrease allocations
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user