Skip to content

Better names for some world.gen.structure classes and methods #492

@Hornwitser

Description

@Hornwitser

I've looked through the world.gen.structure classes and found a few of the classes and methods to have misleading or inconsistent names. It may not be desirable to do all of these renames, but the descriptions I've made can be added at the very least.

Descriptions

  • MapGenStructure.setStructureStart
    Sets the StructureStart located at the provided chunk coordinates.

  • MapGenStructure.getStructureStart
    Gets the StructureStart located at the provided chunk coordinates

Misleading names

  • StructureStart.isSizeableStructure -> *.isValid
    Returns true if the generated structure is valid.

  • MapGenStructureIO StructureIO -> StructureLoader
    Doesn't actually do any IO. Provides functions for loading StructureStart and StructureComponent from an NBTCompound based on a hard coded list of start and component types.

    This class is interesting as the complete mapping between structure ids and the classes they correspond to is in it.

  • MapGenStructureIO.getStructureStart -> *.readStructureStartFromNBT
    Reads a StructureStart from an NBTCompound passed as a parameter.

  • MapGenStructureIO.getStructureComponent -> *.readStructureComponentFromNBT
    Reads a StructureComponent from an NBTCompound passed as a parameter.

Inconsistent names

  • StructureOceanMonument.StartMonument -> *.Start
    For consistency with structure start classes. The classes for the other structure types are named MapGenVillage.Start, MapGenNetherBridge.Start, MapGenStronghold.Start, MapGenScatteredFeature.Start, MapGenEndCity.Start and WoodlandMansion.Start

  • ComponentScatteredFeaturePieces -> StructureScatteredFeaturePieces
    WoodLandMansionPieces -> StructureWoodlandMansionPieces
    For consistency with structure pieces classes. The classes for the other structure types are named StructureMineshaftPieces, StructureVillagePieces, StructureNetherBridgePieces, StructureOceanMonumentPieces, StructureEndCityPieces.

    Structure*Pieces -> *Pieces has been done.

  • StructureMineshaftPieces.registerStructurePieces -> *.registerMineshaftPieces
    StructureEndCityPieces.registerPieces -> *.registerEndCityPieces
    StructureNetherBridge.registerNetherFortressPieces -> *.registerNetherBridgePieces *
    For consistency with registerXPieces methods. The methods for the other structure types are name registerVillagePieces, registerStrongHoldPieces, registerScatteredFeaturePieces, registerOceanMonumentPieces, and registerWoodlandMansionPieces

    * An alternative is to rename MapGenNetherBridge and StructureNetherBridgePieces to use NetherFortress instead of NetherBridge. was done in NetherBridge -> NetherFortress #438

  • StructureOceanMonument -> MapGenOceanMonument
    WoodlandMansion -> MapGenWoodlandMansion
    For consistency with the other MapGen classes. The classes for the other structure types are named MapGenVillage, MapGenNetherBridge, MapGenStronghold, MapGenScatteredFeature and MapGenEndCity

    MapGen* was renamed to *Structure in MapGenX -> StructureX #448

There is an odd one out: StructureMineshaftStart. Had it followed the same pattern as the other classes it would have been a nested class of MapGenMineshaft called Start. Maybe rename it to MapGenMineshaftStart?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions