Private
Public Access
1
0

support for hot-changing radius

This commit is contained in:
2026-05-25 05:51:16 +02:00
parent b3b262b208
commit 0f1bcece53
5 changed files with 80 additions and 5 deletions

View File

@@ -28,6 +28,8 @@ public interface IPlantPositionRegistry
void RegisterBeehive(BlockPos pos, int radius);
void UpdateBeehiveRadius(BlockPos pos, int radius);
void RemovePlantPosition(BlockPos pos, Block block);
void UnregisterBeehive(BlockPos pos);

View File

@@ -77,6 +77,15 @@ public class PlantPositionRegistryModSystem2 : ModSystem, IPlantPositionRegistry
beehives[key] = new BeehiveScanCursor(pos, radius);
}
public void UpdateBeehiveRadius(BlockPos pos, int radius)
{
if (!offsetTables.ContainsKey(radius))
offsetTables[radius] = new ScanOffsetTable(radius);
var key = StructVec3i.FromBlockPos(pos);
beehives[key] = new BeehiveScanCursor(pos, radius);
}
public void UnregisterBeehive(BlockPos pos)
{
var key = StructVec3i.FromBlockPos(pos);