Integrated Filler NBT and ship generation
This commit is contained in:
parent
6e7aafabcd
commit
90ee55cc81
5 changed files with 280 additions and 311 deletions
|
@ -84,14 +84,29 @@ public class Filler implements IXmlRepresentableUnit {
|
|||
|
||||
public void setBlock(World world, int x, int y, int z) {
|
||||
JumpBlock.setBlockNoLight(world, x, y, z, block, metadata, 2);
|
||||
|
||||
if (nbtTagCompound != null) {
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
if (tileEntity == null) {
|
||||
WarpDrive.logger.error("No TileEntity found for Filler %s at (%d %d %d)", getName(), x, y, z);
|
||||
return;
|
||||
}
|
||||
tileEntity.readFromNBT(nbtTagCompound);
|
||||
|
||||
NBTTagCompound nbtTagCompoundTileEntity = new NBTTagCompound();
|
||||
tileEntity.writeToNBT(nbtTagCompoundTileEntity);
|
||||
|
||||
for (Object key : nbtTagCompound.func_150296_c()) {
|
||||
if (key instanceof String) {
|
||||
nbtTagCompoundTileEntity.setTag((String) key, nbtTagCompound.getTag((String) key));
|
||||
}
|
||||
}
|
||||
|
||||
tileEntity.onChunkUnload();
|
||||
tileEntity.readFromNBT(nbtTagCompoundTileEntity);
|
||||
tileEntity.validate();
|
||||
tileEntity.markDirty();
|
||||
|
||||
JumpBlock.refreshBlockStateOnClient(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -310,7 +310,7 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullGlass(world, i + 10, j + 5, k + 12);
|
||||
genStructure.setHullPlain(world, i + 10, j + 6, k + 3);
|
||||
genStructure.setHullPlain(world, i + 10, j + 6, k + 6);
|
||||
genStructure.setCable(world, i + 10, j + 6, k + 7);
|
||||
genStructure.setWiring(world, i + 10, j + 6, k + 7);
|
||||
genStructure.setHullPlain(world, i + 10, j + 6, k + 8);
|
||||
genStructure.setHullPlain(world, i + 10, j + 6, k + 11);
|
||||
genStructure.setHullPlain(world, i + 10, j + 7, k + 4);
|
||||
|
@ -356,9 +356,9 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullGlass(world, i + 11, j + 5, k + 12);
|
||||
genStructure.setHullPlain(world, i + 11, j + 6, k + 3);
|
||||
genStructure.setHullPlain(world, i + 11, j + 6, k + 5);
|
||||
genStructure.setCable(world, i + 11, j + 6, k + 6);
|
||||
genStructure.setCable(world, i + 11, j + 6, k + 7);
|
||||
genStructure.setCable(world, i + 11, j + 6, k + 8);
|
||||
genStructure.setWiring(world, i + 11, j + 6, k + 6);
|
||||
genStructure.setWiring(world, i + 11, j + 6, k + 7);
|
||||
genStructure.setWiring(world, i + 11, j + 6, k + 8);
|
||||
genStructure.setHullPlain(world, i + 11, j + 6, k + 9);
|
||||
genStructure.setHullPlain(world, i + 11, j + 6, k + 11);
|
||||
genStructure.setHullPlain(world, i + 11, j + 7, k + 4);
|
||||
|
@ -387,8 +387,8 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullPlain(world, i + 12, j + 2, k + 4);
|
||||
genStructure.setHullPlain(world, i + 12, j + 2, k + 5);
|
||||
genStructure.setHullPlain(world, i + 12, j + 2, k + 6);
|
||||
genStructure.setCable(world, i + 12, j + 2, k + 7);
|
||||
genStructure.setCable(world, i + 12, j + 2, k + 8);
|
||||
genStructure.setWiring(world, i + 12, j + 2, k + 7);
|
||||
genStructure.setWiring(world, i + 12, j + 2, k + 8);
|
||||
if (!isCorrupted || rand.nextBoolean()) {
|
||||
world.setBlock(i + 12, j + 2, k + 9, WarpDrive.blockLift);
|
||||
if (isCreative) {// fill with energy
|
||||
|
@ -402,7 +402,7 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullPlain(world, i + 12, j + 2, k + 11);
|
||||
genStructure.setHullPlain(world, i + 12, j + 3, k + 2);
|
||||
genStructure.setHullPlain(world, i + 12, j + 3, k + 6);
|
||||
genStructure.setCable(world, i + 12, j + 3, k + 7);
|
||||
genStructure.setWiring(world, i + 12, j + 3, k + 7);
|
||||
genStructure.setHullPlain(world, i + 12, j + 3, k + 8);
|
||||
genStructure.setHullPlain(world, i + 12, j + 3, k + 12);
|
||||
genStructure.setHullGlass(world, i + 12, j + 4, k + 2);
|
||||
|
@ -426,7 +426,7 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullPlain(world, i + 12, j + 6, k + 3);
|
||||
genStructure.setHullPlain(world, i + 12, j + 6, k + 4);
|
||||
genStructure.setHullPlain(world, i + 12, j + 6, k + 5);
|
||||
genStructure.setCable(world, i + 12, j + 6, k + 7);
|
||||
genStructure.setWiring(world, i + 12, j + 6, k + 7);
|
||||
genStructure.setHullPlain(world, i + 12, j + 6, k + 9);
|
||||
genStructure.setHullPlain(world, i + 12, j + 6, k + 10);
|
||||
genStructure.setHullPlain(world, i + 12, j + 6, k + 11);
|
||||
|
@ -452,33 +452,43 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullPlain(world, i + 13, j + 2, k + 10);
|
||||
genStructure.setHullPlain(world, i + 13, j + 2, k + 11);
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 2);
|
||||
if (rand.nextBoolean()) {
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 3);
|
||||
genStructure.setHullGlass(world, i + 13, j + 4, k + 3);
|
||||
} else if (!isCorrupted || rand.nextBoolean()) {
|
||||
world.setBlock(i + 13, j + 3, k + 3, WarpDrive.blockAirShield);
|
||||
world.setBlock(i + 13, j + 4, k + 3, WarpDrive.blockAirShield);
|
||||
}
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 4);
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 5);
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 6);
|
||||
genStructure.setCable(world, i + 13, j + 3, k + 7);
|
||||
genStructure.setWiring(world, i + 13, j + 3, k + 7);
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 8);
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 9);
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 10);
|
||||
if (rand.nextBoolean()) {
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 11);
|
||||
genStructure.setHullGlass(world, i + 13, j + 4, k + 11);
|
||||
} else if (!isCorrupted || rand.nextBoolean()) {
|
||||
world.setBlock(i + 13, j + 3, k + 11, WarpDrive.blockAirShield);
|
||||
world.setBlock(i + 13, j + 4, k + 11, WarpDrive.blockAirShield);
|
||||
}
|
||||
genStructure.setHullPlain(world, i + 13, j + 3, k + 12);
|
||||
genStructure.setHullPlain(world, i + 13, j + 4, k + 2);
|
||||
genStructure.setHullGlass(world, i + 13, j + 4, k + 3);
|
||||
genStructure.setHullPlain(world, i + 13, j + 4, k + 4);
|
||||
genStructure.setHullPlain(world, i + 13, j + 4, k + 5);
|
||||
genStructure.setHullPlain(world, i + 13, j + 4, k + 6);
|
||||
genStructure.setCable(world, i + 13, j + 4, k + 7);
|
||||
genStructure.setWiring(world, i + 13, j + 4, k + 7);
|
||||
genStructure.setHullPlain(world, i + 13, j + 4, k + 8);
|
||||
genStructure.setHullPlain(world, i + 13, j + 4, k + 9);
|
||||
genStructure.setHullPlain(world, i + 13, j + 4, k + 10);
|
||||
world.setBlock(i + 13, j + 4, k + 11, WarpDrive.blockAirShield);
|
||||
genStructure.setHullPlain(world, i + 13, j + 4, k + 12);
|
||||
genStructure.setHullPlain(world, i + 13, j + 5, k + 2);
|
||||
genStructure.setHullPlain(world, i + 13, j + 5, k + 3);
|
||||
world.setBlock(i + 13, j + 5, k + 4, Blocks.glowstone);
|
||||
genStructure.setHullPlain(world, i + 13, j + 5, k + 5);
|
||||
genStructure.setHullPlain(world, i + 13, j + 5, k + 6);
|
||||
genStructure.setCable(world, i + 13, j + 5, k + 7);
|
||||
genStructure.setWiring(world, i + 13, j + 5, k + 7);
|
||||
genStructure.setHullPlain(world, i + 13, j + 5, k + 8);
|
||||
genStructure.setHullPlain(world, i + 13, j + 5, k + 9);
|
||||
world.setBlock(i + 13, j + 5, k + 10, Blocks.glowstone);
|
||||
|
@ -488,7 +498,7 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullPlain(world, i + 13, j + 6, k + 4);
|
||||
genStructure.setHullPlain(world, i + 13, j + 6, k + 5);
|
||||
genStructure.setHullPlain(world, i + 13, j + 6, k + 6);
|
||||
genStructure.setCable(world, i + 13, j + 6, k + 7);
|
||||
genStructure.setWiring(world, i + 13, j + 6, k + 7);
|
||||
genStructure.setHullPlain(world, i + 13, j + 6, k + 8);
|
||||
genStructure.setHullPlain(world, i + 13, j + 6, k + 9);
|
||||
genStructure.setHullPlain(world, i + 13, j + 6, k + 10);
|
||||
|
@ -508,18 +518,18 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullPlain(world, i + 14, j + 3, k + 9);
|
||||
genStructure.setHullPlain(world, i + 14, j + 3, k + 10);
|
||||
genStructure.setHullPlain(world, i + 14, j + 4, k + 4);
|
||||
genStructure.setResource(world, i + 14, j + 4, k + 5);
|
||||
genStructure.setResource(world, i + 14, j + 4, k + 6);
|
||||
genStructure.setPropulsion(world, i + 14, j + 4, k + 5);
|
||||
genStructure.setPropulsion(world, i + 14, j + 4, k + 6);
|
||||
genStructure.setHullPlain(world, i + 14, j + 4, k + 7);
|
||||
genStructure.setResource(world, i + 14, j + 4, k + 8);
|
||||
genStructure.setResource(world, i + 14, j + 4, k + 9);
|
||||
genStructure.setPropulsion(world, i + 14, j + 4, k + 8);
|
||||
genStructure.setPropulsion(world, i + 14, j + 4, k + 9);
|
||||
genStructure.setHullPlain(world, i + 14, j + 4, k + 10);
|
||||
genStructure.setHullPlain(world, i + 14, j + 5, k + 4);
|
||||
genStructure.setResource(world, i + 14, j + 5, k + 5);
|
||||
genStructure.setResource(world, i + 14, j + 5, k + 6);
|
||||
genStructure.setPropulsion(world, i + 14, j + 5, k + 5);
|
||||
genStructure.setPropulsion(world, i + 14, j + 5, k + 6);
|
||||
genStructure.setHullPlain(world, i + 14, j + 5, k + 7);
|
||||
genStructure.setResource(world, i + 14, j + 5, k + 8);
|
||||
genStructure.setResource(world, i + 14, j + 5, k + 9);
|
||||
genStructure.setPropulsion(world, i + 14, j + 5, k + 8);
|
||||
genStructure.setPropulsion(world, i + 14, j + 5, k + 9);
|
||||
genStructure.setHullPlain(world, i + 14, j + 5, k + 10);
|
||||
genStructure.setHullPlain(world, i + 14, j + 6, k + 4);
|
||||
genStructure.setHullPlain(world, i + 14, j + 6, k + 5);
|
||||
|
@ -535,12 +545,12 @@ public class WorldGenSmallShip extends WorldGenerator {
|
|||
genStructure.setHullPlain(world, i + 15, j + 3, k + 4);
|
||||
genStructure.setHullPlain(world, i + 15, j + 3, k + 10);
|
||||
genStructure.setHullPlain(world, i + 15, j + 4, k + 7);
|
||||
genStructure.setResource(world, i + 15, j + 5, k + 7);
|
||||
genStructure.setPropulsion(world, i + 15, j + 5, k + 7);
|
||||
genStructure.setHullPlain(world, i + 15, j + 6, k + 4);
|
||||
genStructure.setHullPlain(world, i + 15, j + 6, k + 7);
|
||||
genStructure.setHullPlain(world, i + 15, j + 6, k + 10);
|
||||
genStructure.setHullPlain(world, i + 16, j + 4, k + 7);
|
||||
genStructure.setResource(world, i + 16, j + 5, k + 7);
|
||||
genStructure.setPropulsion(world, i + 16, j + 5, k + 7);
|
||||
genStructure.setHullPlain(world, i + 16, j + 6, k + 7);
|
||||
genStructure.setHullPlain(world, i + 17, j + 5, k + 7);
|
||||
spawnNPC(world, i + 9, j + 3, k + 5);
|
||||
|
|
|
@ -2,6 +2,7 @@ package cr0s.warpdrive.world;
|
|||
|
||||
import cr0s.warpdrive.WarpDrive;
|
||||
import cr0s.warpdrive.config.Dictionary;
|
||||
import cr0s.warpdrive.config.Filler;
|
||||
import cr0s.warpdrive.config.GenericSet;
|
||||
import cr0s.warpdrive.config.Loot;
|
||||
import cr0s.warpdrive.config.WarpDriveConfig;
|
||||
|
@ -21,171 +22,114 @@ import net.minecraft.world.World;
|
|||
|
||||
public class WorldGenStructure {
|
||||
|
||||
private Block hullPlain_block;
|
||||
private int hullPlain_metadata;
|
||||
private Block hullGlass_block;
|
||||
private int hullGlass_metadata;
|
||||
private Block solarPanel_block;
|
||||
private int solarPanel_metadata;
|
||||
private Block cable_block;
|
||||
private int cable_metadata;
|
||||
private Block resource_block;
|
||||
private int resource_metadata;
|
||||
private final boolean corrupted;
|
||||
private final Random rand;
|
||||
private final Filler fillerHullPlain;
|
||||
private final Filler fillerHullGlass;
|
||||
private final Filler fillerSolarPanel;
|
||||
private final Filler fillerWiring;
|
||||
private final Filler fillerPropulsion;
|
||||
|
||||
public WorldGenStructure(final boolean corrupted, Random rand) {
|
||||
public WorldGenStructure(final boolean corrupted, final Random rand) {
|
||||
this.corrupted = corrupted;
|
||||
this.rand = rand;
|
||||
|
||||
// choose a hull block
|
||||
switch (rand.nextInt(7)) {
|
||||
default:
|
||||
case 0:
|
||||
case 1:
|
||||
hullPlain_block = Blocks.stained_hardened_clay;
|
||||
hullPlain_metadata = rand.nextInt(16);
|
||||
hullGlass_block = Blocks.stained_glass;
|
||||
hullGlass_metadata = hullPlain_metadata;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
hullPlain_block = WarpDrive.blockHulls_plain[0][0];
|
||||
hullPlain_metadata = rand.nextInt(16);
|
||||
hullGlass_block = WarpDrive.blockHulls_glass[0];
|
||||
hullGlass_metadata = hullPlain_metadata;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
hullPlain_block = WarpDrive.blockHulls_plain[1][0];
|
||||
hullPlain_metadata = rand.nextInt(16);
|
||||
hullGlass_block = WarpDrive.blockHulls_glass[1];
|
||||
hullGlass_metadata = hullPlain_metadata;
|
||||
break;
|
||||
|
||||
case 10: // disabled since it's tier3
|
||||
if (WarpDriveConfig.isIndustrialCraft2Loaded) {
|
||||
hullPlain_block = WarpDriveConfig.getModBlock("IC2", "blockAlloy");
|
||||
hullPlain_metadata = 0;
|
||||
hullGlass_block = WarpDriveConfig.getModBlock("IC2", "blockAlloyGlass");
|
||||
hullGlass_metadata = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// choose a solar panel
|
||||
if (WarpDriveConfig.isIndustrialCraft2Loaded) {
|
||||
if (WarpDriveConfig.isAdvancedSolarPanelLoaded) {
|
||||
solarPanel_block = WarpDriveConfig.getModBlock("AdvancedSolarPanel", "BlockAdvSolarPanel");
|
||||
solarPanel_metadata = rand.nextInt(2);
|
||||
// hull plain and glass are linked by same name
|
||||
final GenericSet<Filler> fillerSetHull_plain = WarpDriveConfig.FillerManager.getRandomSetFromGroup(rand, "hull_plain");
|
||||
if (fillerSetHull_plain == null) {
|
||||
WarpDrive.logger.warn(String.format("No FillerSet found with group %s during world generation: check your configuration",
|
||||
"hull_plain"));
|
||||
fillerHullPlain = new Filler();
|
||||
fillerHullPlain.block = Blocks.stone;
|
||||
fillerHullGlass = new Filler();
|
||||
fillerHullGlass.block = Blocks.glass;
|
||||
} else {
|
||||
solarPanel_block = WarpDriveConfig.getModBlock("IC2", "blockGenerator");
|
||||
solarPanel_metadata = 3;
|
||||
}
|
||||
} else if (WarpDriveConfig.isEnderIOLoaded) {
|
||||
solarPanel_block = WarpDriveConfig.getModBlock("EnderIO", "blockSolarPanel");
|
||||
solarPanel_metadata = 0;
|
||||
fillerHullPlain = fillerSetHull_plain.getRandomUnit(rand);
|
||||
|
||||
final String nameFillerGlass = "hull_glass:" + fillerSetHull_plain.getName();
|
||||
final GenericSet<Filler> fillerSetHull_glass = WarpDriveConfig.FillerManager.getGenericSet(nameFillerGlass);
|
||||
if (fillerSetHull_glass == null) {
|
||||
WarpDrive.logger.warn(String.format("No FillerSet found with group %s during world generation: check your configuration",
|
||||
nameFillerGlass));
|
||||
fillerHullGlass = new Filler();
|
||||
fillerHullGlass.block = Blocks.glass;
|
||||
} else {
|
||||
solarPanel_block = Blocks.air;
|
||||
solarPanel_metadata = 0;
|
||||
}
|
||||
|
||||
// choose a wiring
|
||||
cable_block = Blocks.air;
|
||||
cable_metadata = 0;
|
||||
if (WarpDriveConfig.isIndustrialCraft2Loaded) {
|
||||
cable_block = WarpDriveConfig.getModBlock("IC2", "blockCable");
|
||||
cable_metadata = 0;
|
||||
|
||||
switch (rand.nextInt(4)) {
|
||||
case 0:
|
||||
cable_metadata = 0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
cable_metadata = 3;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
cable_metadata = 6;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
cable_metadata = 9;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
fillerHullGlass = fillerSetHull_glass.getRandomUnit(rand);
|
||||
}
|
||||
}
|
||||
|
||||
// choose a resource block
|
||||
resource_block = Blocks.redstone_block;
|
||||
resource_metadata = 0;
|
||||
switch (rand.nextInt(10)) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
resource_block = Blocks.redstone_block;
|
||||
break;
|
||||
// solarPanel and wiring are linked by same name
|
||||
final GenericSet<Filler> fillerSetSolarPanel = WarpDriveConfig.FillerManager.getRandomSetFromGroup(rand, "ship_solarPanel");
|
||||
if (fillerSetSolarPanel == null) {
|
||||
WarpDrive.logger.warn(String.format("No FillerSet found with group %s during world generation: check your configuration",
|
||||
"ship_solarPanel"));
|
||||
fillerSolarPanel = new Filler();
|
||||
fillerSolarPanel.block = Blocks.sandstone;
|
||||
fillerWiring = new Filler();
|
||||
fillerWiring.block = Blocks.fence;
|
||||
} else {
|
||||
fillerSolarPanel = fillerSetSolarPanel.getRandomUnit(rand);
|
||||
|
||||
case 6:
|
||||
case 7:
|
||||
resource_block = Blocks.lapis_block;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 9:
|
||||
resource_block = Blocks.coal_block;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
final String nameFillerWiring = "ship_wiring:" + fillerSetSolarPanel.getName();
|
||||
final GenericSet<Filler> fillerSetWiring = WarpDriveConfig.FillerManager.getGenericSet(nameFillerWiring);
|
||||
if (fillerSetWiring == null) {
|
||||
WarpDrive.logger.warn(String.format("No FillerSet found with group %s during world generation: check your configuration",
|
||||
nameFillerWiring));
|
||||
fillerWiring = new Filler();
|
||||
fillerWiring.block = Blocks.fence;
|
||||
} else {
|
||||
fillerWiring = fillerSetWiring.getRandomUnit(rand);
|
||||
}
|
||||
}
|
||||
|
||||
public void setHullPlain(World world, final int x, final int y, final int z) {
|
||||
// propulsion is on it's own
|
||||
final GenericSet<Filler> fillerSetPropulsion = WarpDriveConfig.FillerManager.getRandomSetFromGroup(rand, "ship_propulsion");
|
||||
if (fillerSetPropulsion == null) {
|
||||
WarpDrive.logger.warn(String.format("No FillerSet found with group %s during world generation: check your configuration",
|
||||
"ship_propulsion"));
|
||||
fillerPropulsion = new Filler();
|
||||
fillerPropulsion.block = Blocks.log;
|
||||
} else {
|
||||
fillerPropulsion = fillerSetPropulsion.getRandomUnit(rand);
|
||||
}
|
||||
}
|
||||
|
||||
public void setHullPlain(final World world, final int x, final int y, final int z) {
|
||||
if (corrupted && (rand.nextInt(400) == 1)) {
|
||||
world.newExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, 17, false, true);
|
||||
} else if (corrupted && (rand.nextInt(10) == 1)) {
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
} else {
|
||||
world.setBlock(x, y, z, hullPlain_block, hullPlain_metadata, 2);
|
||||
fillerHullPlain.setBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void setHullGlass(World world, final int x, final int y, final int z) {
|
||||
public void setHullGlass(final World world, final int x, final int y, final int z) {
|
||||
if (corrupted && (rand.nextInt(5) == 1)) {
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
} else {
|
||||
world.setBlock(x, y, z, hullGlass_block, hullGlass_metadata, 2);
|
||||
fillerHullGlass.setBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void setSolarPanel(World world, final int x, final int y, final int z) {
|
||||
public void setSolarPanel(final World world, final int x, final int y, final int z) {
|
||||
if (corrupted && (rand.nextInt(3) == 1)) {
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
} else {
|
||||
world.setBlock(x, y, z, solarPanel_block, solarPanel_metadata, 2);
|
||||
fillerSolarPanel.setBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void setCable(World world, final int x, final int y, final int z) {
|
||||
public void setWiring(final World world, final int x, final int y, final int z) {
|
||||
if (corrupted && (rand.nextInt(3) == 1)) {
|
||||
world.setBlock(x, y, z, Blocks.air, 0, 2);
|
||||
} else {
|
||||
world.setBlock(x, y, z, cable_block, cable_metadata, 2);
|
||||
fillerWiring.setBlock(world, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
public void setResource(World world, final int x, final int y, final int z) {
|
||||
world.setBlock(x, y, z, resource_block, resource_metadata, 2);
|
||||
public void setPropulsion(final World world, final int x, final int y, final int z) {
|
||||
fillerPropulsion.setBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
public void fillInventoryWithLoot(final World worldObj, final Random rand, final int x, final int y, final int z, final String group) {
|
||||
|
@ -193,7 +137,7 @@ public class WorldGenStructure {
|
|||
if (tileEntity instanceof IInventory) {
|
||||
final IInventory inventory = (IInventory) tileEntity;
|
||||
final int size = inventory.getSizeInventory();
|
||||
final int countLoots = Math.min(3 + rand.nextInt(3), size);
|
||||
final int countLoots = Math.min(rand.nextInt(3) + rand.nextInt(4), size);
|
||||
|
||||
final GenericSet<Loot> lootSet = WarpDriveConfig.LootManager.getRandomSetFromGroup(rand, group);
|
||||
if (lootSet == null) {
|
||||
|
|
|
@ -109,7 +109,6 @@
|
|||
</fillerSet>
|
||||
|
||||
|
||||
|
||||
<!-- nether ores with simple base block -->
|
||||
<fillerSet group="nether" name="stone" weight="10">
|
||||
<import group="nether_ores" name="netherrack" />
|
||||
|
@ -126,7 +125,6 @@
|
|||
</fillerSet>
|
||||
|
||||
|
||||
|
||||
<!-- end ores with simple base block -->
|
||||
<fillerSet group="end" name="end" weight="10">
|
||||
<import group="end_ores" name="endstone" />
|
||||
|
@ -141,7 +139,6 @@
|
|||
</fillerSet>
|
||||
|
||||
|
||||
|
||||
<!-- assorted overworld surface blocks -->
|
||||
<fillerSet group="overworld_surface" name="stone" weight="75">
|
||||
<filler block="minecraft:stone" weight="100" />
|
||||
|
@ -170,7 +167,6 @@
|
|||
</fillerSet>
|
||||
|
||||
|
||||
|
||||
<!-- assorted nether surface blocks -->
|
||||
<fillerSet group="nether_surface" name="netherrack" weight="50">
|
||||
<filler block="minecraft:netherrack" weight="100" />
|
||||
|
@ -189,7 +185,6 @@
|
|||
</fillerSet>
|
||||
|
||||
|
||||
|
||||
<!-- assorted end surface blocks -->
|
||||
<fillerSet group="end_surface" name="endstone" weight="50">
|
||||
<filler block="minecraft:end_stone" weight="100" />
|
||||
|
@ -211,7 +206,6 @@
|
|||
</fillerSet>
|
||||
|
||||
|
||||
|
||||
<!-- WarpDrive gases -->
|
||||
<for variable="gasMetadata" in="0,1,2,3,4,5,6,7,8,9,10,11">
|
||||
<fillerSet group="gas" name="wd_%gasMetadata%" weight="1">
|
||||
|
@ -250,41 +244,48 @@
|
|||
|
||||
|
||||
<!-- ship solar panel -->
|
||||
<fillerSet group="solar" name="advancedSolarPanel" weight="20" mods="AdvancedSolarPanel">
|
||||
<filler block="AdvancedSolarPanel:BlockAdvSolarPanel" metadata="0" weight="100" />
|
||||
<fillerSet group="ship_solarPanel" name="advancedSolarPanel" weight="20" mods="AdvancedSolarPanel">
|
||||
<filler block="AdvancedSolarPanel:BlockAdvSolarPanel" nbt="{facing:5}" metadata="0" weight="200" />
|
||||
<filler block="AdvancedSolarPanel:BlockAdvSolarPanel" nbt="{facing:5}" metadata="1" weight="100" />
|
||||
</fillerSet>
|
||||
<fillerSet group="solar" name="advancedSolarPanel" weight="10" mods="AdvancedSolarPanel">
|
||||
<filler block="AdvancedSolarPanel:BlockAdvSolarPanel" metadata="1" weight="100" />
|
||||
<fillerSet group="ship_solarPanel" name="ic2" weight="10" mods="IC2">
|
||||
<filler block="IC2:blockGenerator" metadata="3" nbt="{facing:5}" weight="100" />
|
||||
</fillerSet>
|
||||
<fillerSet group="solar" name="ic2" weight="10" mods="IC2">
|
||||
<filler block="IC2:blockGenerator" metadata="3" weight="100" />
|
||||
</fillerSet>
|
||||
<fillerSet group="solar" name="enderIO" weight="10" mods="EnderIO">
|
||||
<fillerSet group="ship_solarPanel" name="enderIO" weight="10" mods="EnderIO,ThermalDynamics">
|
||||
<filler block="EnderIO:blockSolarPanel" metadata="0" weight="100" />
|
||||
</fillerSet>
|
||||
<fillerSet group="solar" name="vanilla" weight="1">
|
||||
<filler block="minecraft:air" weight="100" />
|
||||
<fillerSet group="ship_solarPanel" name="vanilla" weight="1" mods="!IC2,!EnderIO,!ThermalDynamics">
|
||||
<filler block="minecraft:daylight_detector" weight="100" />
|
||||
</fillerSet>
|
||||
|
||||
|
||||
<!-- ship wiring -->
|
||||
<fillerSet group="cable" name="ic2" weight="10" mods="IC2">
|
||||
<filler block="IC2:blockCable" metadata="0" weight="100" />
|
||||
<fillerSet group="ship_wiring" name="advancedSolarPanel" weight="10" mods="AdvancedSolarPanel">
|
||||
<import group="ship_wiring" name="ic2" />
|
||||
</fillerSet>
|
||||
<fillerSet group="cable" name="ic2" weight="10" mods="IC2">
|
||||
<filler block="IC2:blockCable" metadata="3" weight="100" />
|
||||
<fillerSet group="ship_wiring" name="ic2" weight="10" mods="IC2">
|
||||
<filler block="IC2:blockCable" metadata="0" weight="100" /><!-- Insulated copper cable -->
|
||||
<filler block="IC2:blockCable" metadata="3" weight="100" /><!-- Insulated gold cable -->
|
||||
<filler block="IC2:blockCable" metadata="6" weight="100" /><!-- Glass fiber cable -->
|
||||
<filler block="IC2:blockCable" metadata="9" weight="100" /><!-- Insulated tin cable -->
|
||||
</fillerSet>
|
||||
<fillerSet group="cable" name="ic2" weight="10" mods="IC2">
|
||||
<filler block="IC2:blockCable" metadata="6" weight="100" />
|
||||
<fillerSet group="ship_wiring" name="enderIO" weight="5" mods="EnderIO,ThermalDynamics">
|
||||
<filler block="ThermalDynamics:ThermalDynamics_0" metadata="0" weight="100" /><!-- Leadstone Fluxduct -->
|
||||
<filler block="ThermalDynamics:ThermalDynamics_0" metadata="1" weight="40" /><!-- Hardened Fluxduct -->
|
||||
<filler block="ThermalDynamics:ThermalDynamics_0" metadata="2" weight="10" /><!-- Readstone Energy Fluxduct -->
|
||||
</fillerSet>
|
||||
<fillerSet group="cable" name="ic2" weight="10" mods="IC2">
|
||||
<filler block="IC2:blockCable" metadata="9" weight="100" />
|
||||
</fillerSet>
|
||||
<fillerSet group="cable" name="vanilla" weight="5">
|
||||
<filler block="minecraft:air" weight="100" />
|
||||
<fillerSet group="ship_wiring" name="vanilla" weight="5" mods="!IC2,!EnderIO,!ThermalDynamics">
|
||||
<filler block="minecraft:fence" weight="100" />
|
||||
</fillerSet>
|
||||
|
||||
|
||||
<!-- ship propulsion -->
|
||||
<fillerSet group="ship_propulsion" name="vanilla" weight="5">
|
||||
<filler block="minecraft:redstone_block" weight="100" />
|
||||
<filler block="minecraft:lapis_block" ratio="0.2" />
|
||||
<filler block="minecraft:coal_block" ratio="0.2" />
|
||||
</fillerSet>
|
||||
|
||||
|
||||
<!-- flow variation for moons -->
|
||||
<fillerSet group="moon.flow" name="lava" weight="5">
|
||||
|
@ -310,7 +311,6 @@
|
|||
</fillerSet>
|
||||
|
||||
|
||||
|
||||
<!-- core variation for moons -->
|
||||
<fillerSet group="moon.core" name="lava" weight="6">
|
||||
<filler block="minecraft:lava" weight="100" />
|
||||
|
@ -348,5 +348,4 @@
|
|||
<!-- TODO: add GT granite cores -->
|
||||
<!-- TODO: add TE/EIO block of sort -->
|
||||
|
||||
|
||||
</worldGeneration>
|
||||
|
|
|
@ -54,6 +54,7 @@
|
|||
<loot item="IC2:itemCable" damage="9" minQuantity="1" maxQuantity="18" weight="8" /><!-- Glass fiber cable -->
|
||||
<loot item="IC2:itemCable" damage="10" minQuantity="1" maxQuantity="18" weight="15" /><!-- Tin cable -->
|
||||
<loot item="IC2:itemCable" damage="13" minQuantity="1" maxQuantity="18" weight="15" /><!-- Insulated tin cable -->
|
||||
<loot item="minecraft:stick" minQuantity="1" maxQuantity="18" weight="1" />
|
||||
|
||||
<!-- nano armor? -->
|
||||
<!-- ICBM rocket launcher platform minQuantity="1" maxQuantity="2" -->
|
||||
|
|
Loading…
Add table
Reference in a new issue