support for hot-changing radius
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user