Free plugin for symmetric construction

dont use grokeAI its not the best for code

so i had chatpgt go over it and here is the reply 

 

What I think (code review, practical)

The good

  • Clear structure (regions, helpers, state object)

  • UI is straightforward and readable

  • Auto-detect logic is decent for quick “guess symmetry from foundations”

  • Supports more than just blocks (doors + bars) and also mirrors upgrades

  • Resource charging is implemented (prevents “free duplication”)

Watch-outs / improvements

  1. Potential double-trigger / recursion risk

  • Clones are spawned via CreateEntity inside OnEntityBuilt.
    Depending on how Oxide fires OnEntityBuilt, there’s a chance cloned entities might also trigger the hook (often they don’t because it’s not a “player built” action, but this varies).
    Best practice: tag spawned clones (e.g., via entity.SetFlag/custom tracking) or temporarily ignore during spawn.

  1. Performance: lots of UI rebuilding

  • UpdateUI() calls CreateUI() which destroys and recreates the whole UI panel.
    That’s OK for occasional clicks, but if you later update frequently, it can get heavy.
    Better: update specific elements or only rebuild on state change (minor).

  1. Resource charging timing

  • You delay cloning by timer.Once(0.1f), then you take resources.
    If the player drops items / changes inventory in that 0.1s, results can feel inconsistent.
    Consider taking resources immediately (or re-checking is fine, but user experience can be odd).

  1. Upgrade symmetry search might miss

  • It searches within 0.5f and then requires < 0.1f distance.
    That’s quite strict, and floating errors / building placement can cause misses.
    Consider slightly relaxing tolerance or matching by building ID adjacency.

  1. Auto-detect foundation filtering

  • PrefabName.Contains("foundation") can catch more than intended, but is usually fine.
    You also require OwnerID == player.userID which is good.

  1. Mirror rotation math is clever but fragile

  • Reflecting rotation by refMatrix * rotMatrix * refMatrix can behave oddly for some prefabs.
    Doors get a special 180 correction which hints you’ve already seen issues.
    Expect edge cases with non-symmetric prefabs.

Translation of the Russian player-facing messages (English)

  • “У вас нет прав на использование симметрии.” → “You don’t have permission to use symmetry.”

  • “UI включён/выключен.” → “UI enabled/disabled.”

  • “Симметрия включена/выключена.” → “Symmetry enabled/disabled.”

  • “Центр симметрии установлен.” → “Symmetry center set.”

  • “Не удалось найти поверхность.” → “Couldn’t find a surface.”

  • “Сначала установите центр: /sym set” → “Set the center first: /sym set”

  • “Центр симметрии удалён.” → “Symmetry center deleted.”

  • “Мало фундаментов для детекта → n4s по умолчанию.” → “Too few foundations to detect → defaulting to n4s.”

  • “Недостаточно углов для вычисления → n4s по умолчанию.” → “Not enough angles to compute → defaulting to n4s.”

  • “Определён тип: …” → “Detected type: …”

  • “Недостаточно ресурсов для симметричной копии.” → “Not enough resources for the symmetric copy.”

  • “Доступные типы: …” → “Available types: …”

  • “Тип симметрии: …” → “Symmetry type: …”