Fixed world generation crash when IC2 is missing
This commit is contained in:
parent
386bfd704b
commit
ef6583858f
1 changed files with 23 additions and 15 deletions
|
@ -631,16 +631,20 @@ public class WorldGenSmallShip extends WorldGenerator {
|
||||||
while (!isDone) {
|
while (!isDone) {
|
||||||
switch (rand.nextInt(14)) {
|
switch (rand.nextInt(14)) {
|
||||||
case 0: // Mass fabricator
|
case 0: // Mass fabricator
|
||||||
res = WarpDriveConfig.getModItemStack("IC2", "blockMachine", -1);
|
if (WarpDriveConfig.isIndustrialCraft2loaded) {
|
||||||
res.setItemDamage(14);
|
res = WarpDriveConfig.getModItemStack("IC2", "blockMachine", -1);
|
||||||
res.stackSize = 1; // + rand.nextInt(2);
|
res.setItemDamage(14);
|
||||||
isDone = true;
|
res.stackSize = 1; // + rand.nextInt(2);
|
||||||
|
isDone = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
res = WarpDriveConfig.getModItemStack("IC2", "blockNuke", -1);
|
if (WarpDriveConfig.isIndustrialCraft2loaded) {
|
||||||
res.stackSize = 1 + rand.nextInt(2);
|
res = WarpDriveConfig.getModItemStack("IC2", "blockNuke", -1);
|
||||||
isDone = true;
|
res.stackSize = 1 + rand.nextInt(2);
|
||||||
|
isDone = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 2: // Quantum armor bonuses
|
case 2: // Quantum armor bonuses
|
||||||
|
@ -651,17 +655,21 @@ public class WorldGenSmallShip extends WorldGenerator {
|
||||||
break;// skipped
|
break;// skipped
|
||||||
|
|
||||||
case 6:// Glass fiber cable item
|
case 6:// Glass fiber cable item
|
||||||
res = WarpDriveConfig.getModItemStack("IC2", "itemCable", -1);
|
if (WarpDriveConfig.isIndustrialCraft2loaded) {
|
||||||
res.setItemDamage(9);
|
res = WarpDriveConfig.getModItemStack("IC2", "itemCable", -1);
|
||||||
res.stackSize = 2 + rand.nextInt(12);
|
res.setItemDamage(9);
|
||||||
isDone = true;
|
res.stackSize = 2 + rand.nextInt(12);
|
||||||
|
isDone = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 7:// UU matter cell
|
case 7:// UU matter cell
|
||||||
res = WarpDriveConfig.getModItemStack("IC2", "itemCellEmpty", -1);
|
if (WarpDriveConfig.isIndustrialCraft2loaded) {
|
||||||
res.setItemDamage(3);
|
res = WarpDriveConfig.getModItemStack("IC2", "itemCellEmpty", -1);
|
||||||
res.stackSize = 2 + rand.nextInt(14);
|
res.setItemDamage(3);
|
||||||
isDone = true;
|
res.stackSize = 2 + rand.nextInt(14);
|
||||||
|
isDone = true;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 8:
|
case 8:
|
||||||
|
|
Loading…
Add table
Reference in a new issue