Heart of the Machine

Heart of the Machine

26.6k Downloads

Disperate functionality crammed into utility objects

Kneelawk opened this issue ยท 0 comments

commented

HotMDimensions and NecterePortalGen are two examples of monolithic utility objects that contain poorly described functions for very different tasks. Furthermore, some of these functions appear similar but should never be called in place of each other and are only designed for very specific contexts. These and any other monolithic utility objects need to be broken up.

HotMDimensions primarily contains:

  • Nectere-dimension initialization code (chunk generators, dimension types, world keys, etc.)
  • Entity-teleportaion code.
  • Nectere-portal initialization (generation and pre-generation) code specifically for teleportaion.
  • Nectere portalable-biome-data management.
  • Nectere <-> Non-Nectere teleport location calculation.
  • Non-Nectere portal generation location calculation.
  • Non-Nectere portal location calculation for biome checking in Nectere-side portal generator.
  • Command integration:
    • Non-Nectere portal location calculation for /locate command.
    • Retro-gen-portal command logic.

NecterePortalGen primarily contains:

  • Portal structure portal pos <-> origin pos calculation functions.
  • Portal structure placement (based on terrain) calculation functions.
  • Portal placement within Nectere-side chunk calculation functions.
  • Portal generation function for entire Non-Nectere chunks, called by the portal spawner block entity.
  • General-purpose portal block-placement generation function.

NecterePortalStructureFeature primarily contains:

  • Non-Nectere-side biome-checking mechanism for structure generation.
  • Non-Nectere portal structure location scanning and calculation for /locate command.
  • Structure components: Start and Piece.