Cleaned up Initialization for GatewayGenerator
Cleaned up the code for initializing GatewayGenerator. We had some static fields that didn't need to be static and we could just initialize gateways from the class's constructor.
This commit is contained in:
parent
310efb9781
commit
8cb651030a
2 changed files with 11 additions and 15 deletions
|
@ -166,7 +166,6 @@ public class mod_pocketDim
|
|||
EventHookContainer hooks = new EventHookContainer(properties);
|
||||
MinecraftForge.EVENT_BUS.register(hooks);
|
||||
MinecraftForge.TERRAIN_GEN_BUS.register(hooks);
|
||||
gatewayGenerator = new GatewayGenerator(properties);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
|
@ -181,7 +180,7 @@ public class mod_pocketDim
|
|||
spawner = new CustomLimboPopulator(commonTickHandler, properties);
|
||||
new RiftRegenerator(commonTickHandler); //No need to store the reference
|
||||
LimboDecay decay = new LimboDecay(commonTickHandler, properties);
|
||||
this.fastRiftRegenerator = new FastRiftRegenerator(commonTickHandler);
|
||||
fastRiftRegenerator = new FastRiftRegenerator(commonTickHandler);
|
||||
|
||||
transientDoor = new TransientDoor(properties.TransientDoorID, Material.iron, properties).setHardness(1.0F) .setUnlocalizedName("transientDoor");
|
||||
goldenDimensionalDoor = new BlockGoldDimDoor(properties.GoldenDimensionalDoorID, Material.iron, properties).setHardness(1.0F) .setUnlocalizedName("dimDoorGold");
|
||||
|
@ -277,10 +276,9 @@ public class mod_pocketDim
|
|||
EntityList.entityEggs.put(properties.MonolithEntityID, new EntityEggInfo(properties.MonolithEntityID, 0, 0xffffff));
|
||||
LanguageRegistry.instance().addStringLocalization("entity.DimDoors.Obelisk.name", "Monolith");
|
||||
|
||||
|
||||
CraftingManager.registerRecipes(properties);
|
||||
DungeonHelper.initialize();
|
||||
this.gatewayGenerator.initGateways();
|
||||
gatewayGenerator = new GatewayGenerator(properties);
|
||||
|
||||
// Register loot chests
|
||||
DDLoot.registerInfo(properties);
|
||||
|
@ -288,7 +286,6 @@ public class mod_pocketDim
|
|||
proxy.registerRenderers();
|
||||
}
|
||||
|
||||
|
||||
@EventHandler
|
||||
public void onPostInitialization(FMLPostInitializationEvent event)
|
||||
{
|
||||
|
|
|
@ -36,27 +36,26 @@ public class GatewayGenerator implements IWorldGenerator
|
|||
private static final int NETHER_DIMENSION_ID = -1;
|
||||
private static final int END_DIMENSION_ID = 1;
|
||||
|
||||
private static ArrayList<BaseGateway> gateways;
|
||||
private static BaseGateway defaultGateway;
|
||||
private ArrayList<BaseGateway> gateways;
|
||||
private BaseGateway defaultGateway;
|
||||
|
||||
private final DDProperties properties;
|
||||
|
||||
public GatewayGenerator(DDProperties properties)
|
||||
{
|
||||
this.properties = properties;
|
||||
|
||||
this.initialize();
|
||||
}
|
||||
|
||||
public void initGateways()
|
||||
private void initialize()
|
||||
{
|
||||
gateways=new ArrayList<BaseGateway>();
|
||||
this.defaultGateway=new GatewayTwoPillars(this.properties);
|
||||
gateways = new ArrayList<BaseGateway>();
|
||||
defaultGateway = new GatewayTwoPillars(properties);
|
||||
|
||||
//add gateways here
|
||||
gateways.add(new GatewaySandstonePillars(this.properties));
|
||||
// Add gateways here
|
||||
gateways.add(defaultGateway);
|
||||
gateways.add(new GatewayLimbo(this.properties));
|
||||
|
||||
gateways.add(new GatewaySandstonePillars(properties));
|
||||
gateways.add(new GatewayLimbo(properties));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue