Documentation Index Fetch the complete documentation index at: https://mintlify.com/ata4/bspsrc/llms.txt
Use this file to discover all available pages before exploring further.
Lumps are the fundamental data containers in BSP files, organizing different types of map data into discrete sections.
Lump
Default lump type for lumps inside a BSP file.
Constructor
Lump ( int index, LumpType type)
Lump ( LumpType type)
Creates a new lump with the specified index and type. The second constructor uses the type’s default index.
Parameters:
index - Position in the lump table
type - The lump type enum value
Methods
getName Returns the name of the lump type (e.g., “LUMP_ENTITIES”). getIndex Returns the position of this lump in the BSP file’s lump table. getType Returns the lump type enumeration. getParentFile Returns the path to the parent BSP file. setParentFile void setParentFile ( Path parentFile)
Sets the parent BSP file path.
getLength Returns the number of bytes in this lump. If compressed, returns the uncompressed size. getBuffer Returns a view of the buffer for this lump. Changes to it are reflected in the lump’s buffer. setBuffer void setBuffer ( ByteBuffer buf)
Sets the lump data from a ByteBuffer. InputStream getInputStream ()
Returns an InputStream for reading lump data. getOutputStream OutputStream getOutputStream ()
Returns an OutputStream for writing lump data.
isCompressed Checks if the lump data is LZMA compressed. setCompressed void setCompressed ( boolean compressed)
Marks the lump as compressed or uncompressed and updates the FourCC accordingly. compress Compresses the lump data using LZMA compression. uncompress Decompresses the lump data.
getVersion Returns the lump version number. setVersion void setVersion ( int vers)
Sets the lump version. getFourCC Returns the FourCC identifier (used for compressed lumps). setFourCC void setFourCC ( int fourCC)
Sets the FourCC identifier.
LumpType
Enumeration of all lump types used in BSP files across different versions.
Common Lump Types
Type Index Description LUMP_ENTITIES0 Entity definitions LUMP_PLANES1 Plane equations LUMP_TEXDATA2 Texture data LUMP_VERTEXES3 Vertex positions LUMP_VISIBILITY4 Visibility data LUMP_NODES5 BSP tree nodes LUMP_TEXINFO6 Texture information LUMP_FACES7 Face definitions LUMP_LIGHTING8 Lightmap data LUMP_LEAFS10 BSP tree leaves LUMP_EDGES12 Edge definitions LUMP_SURFEDGES13 Surface edge references LUMP_MODELS14 Brush models
Type Index Description LUMP_DISPINFO26 Displacement surface info LUMP_DISP_VERTS33 Displacement vertices LUMP_GAME_LUMP35 Game-specific lumps LUMP_PAKFILE40 Embedded PAK file LUMP_CUBEMAPS42 Cubemap samples LUMP_OVERLAYS45 Overlay decals LUMP_BRUSHES18 Brush definitions LUMP_BRUSHSIDES19 Brush side definitions
These lumps are specific to BSP version 20 and above: Type Index Version Description LUMP_LIGHTING_HDR53 20 HDR lightmap data LUMP_FACES_HDR58 20 HDR face data LUMP_MAP_FLAGS59 20 Map compilation flags LUMP_OVERLAY_FADES60 20 Overlay fade distances LUMP_PHYSLEVEL62 21 Physics level data LUMP_DISP_MULTIBLEND63 21 Displacement multiblend
Static Methods
get (by name)
static LumpType get ( String name, int bspVersion)
static LumpType get ( String name)
Returns the lump type for a given name in a specific BSP version. The version-less variant defaults to BSP v19.
Parameters:
name - Lump name (e.g., “LUMP_ENTITIES”)
bspVersion - BSP version to consider for version-specific lumps
Returns:
The matching LumpType, or LUMP_UNKNOWN if not found
get (by index)
static LumpType get ( int index, int bspVersion)
static LumpType get ( int index)
Returns the lump type for a given index in a specific BSP version.
Parameters:
index - Lump table index (0-63)
bspVersion - BSP version to consider
Returns:
The matching LumpType, or LUMP_UNKNOWN if not found
Instance Methods
getIndex
Returns the position of this lump type in the lump table.
getBspVersion
Returns the first BSP version where this lump type was introduced, or -1 if unknown.
Example Usage
// Get lump type by index
LumpType type = LumpType . get ( 0 ); // LUMP_ENTITIES
// Get lump type by name for specific version
LumpType hdrType = LumpType . get ( "LUMP_LIGHTING_HDR" , 20 );
// Check version
if ( type . getBspVersion () <= bspFile . getVersion ()) {
// This lump type is supported
}
GameLump
Special lump type for game-specific lumps stored inside LUMP_GAME_LUMP.
Methods
getName
Returns the name decoded from the FourCC identifier (e.g., “sprp” for static props).
getFlags
Returns the game lump flags.
setFlags
Sets the game lump flags.
setCompressed
void setCompressed ( boolean compressed)
Marks the game lump as compressed and sets flags to 1 if compressed, 0 otherwise.
Common Game Lumps
FourCC Name Description sprpStatic Props Static prop placement prpsProp Names Static prop model names prplProp Leaves Static prop leaf associations
LumpFile
Utility for loading and saving individual lumps from .lmp files.
Constructor
LumpFile ( BspFile bsp)
LumpFile ( int bspVersion)
Parameters:
bsp - Parent BSP file
bspVersion - BSP version for standalone usage
Methods
load
void load ( Path file, ByteOrder bo) throws IOException
void load ( Path file) throws IOException
Loads a lump from an external .lmp file. The version-less variant uses little-endian byte order.
Parameters:
file - Path to the .lmp file
bo - Byte order for reading
save
void save ( Path file) throws IOException
Saves the lump to an external .lmp file.
Parameters:
file - Path to save the .lmp file
getLump / setLump
Lump getLump ()
void setLump ( Lump lump)
Gets or sets the lump object.
The LMP file header (20 bytes):
static final int HEADER_SIZE = 20 ;
Offset Type Field Description 0 int lumpOffset Offset to lump data (usually 20) 4 int lumpIndex Lump table index 8 int lumpVersion Lump version 12 int lumpSize Size of lump data 16 int mapRevision Map revision number
Example Usage
// Load an external lump file
LumpFile lumpFile = new LumpFile ( 20 ); // BSP version 20
lumpFile . load ( Paths . get ( "maps/mymap_l_0.lmp" ));
Lump entitiesLump = lumpFile . getLump ();
System . out . println ( "Loaded lump: " + entitiesLump . getName ());
System . out . println ( "Size: " + entitiesLump . getLength () + " bytes" );
Entities Entity classes and key-value handling
Structs BSP file structures and data types