e96fc02747
Started implementing our support for dungeon packs. The code is not usable yet and the mod is not functional at this stage. A few additional changes should make it testable. A significant obstacle to implementing dungeon packs easily is that DungeonGenerator doesn't have some necessary information and shouldn't be modified. Even if it is modified, old serialized instances wouldn't have the new fields initialized. I'm having to create workarounds until we implement the new save format. DungeonPack handles all of the logic of selecting a dungeon and verifying whether its type is valid. It relies on DungeonChainRule and OptimizedRule to check which dungeons should be generated next given a list of the dungeons in a chain. DungeonType maps types in packs to ID numbers and provides a reference to the pack that owns the type. DungeonPackConfig will carry config information to be passed to the DungeonPack constructor.
28 lines
No EOL
660 B
Java
28 lines
No EOL
660 B
Java
package StevenDimDoors.mod_pocketDim;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import java.util.Random;
|
|
|
|
import net.minecraft.world.World;
|
|
|
|
public class DungeonGenerator implements Serializable
|
|
{
|
|
public int weight;
|
|
public String schematicPath;
|
|
public ArrayList<HashMap> sideRifts = new ArrayList<HashMap>();
|
|
public LinkData exitLink;
|
|
public boolean isOpen;
|
|
|
|
public int sideDoorsSoFar=0;
|
|
public int exitDoorsSoFar=0;
|
|
public int deadEndsSoFar=0;
|
|
|
|
public DungeonGenerator(int weight, String schematicPath, Boolean isOpen)
|
|
{
|
|
this.weight=weight;
|
|
this.schematicPath=schematicPath;
|
|
this.isOpen=isOpen;
|
|
}
|
|
} |