mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
you're not bricked up right now while you read this,
you have serious issue, you're on social media, bro, every 10 seconds you swipe, you see the baddest girl on the planet, and you're sitting here soft, oh lazy, but it would be weird if i was bricked while watching you talk, how was that weird, is it weird to have high testosterone levels? you need savor before it's too late bro, it might be your only shot.
This commit is contained in:
parent
fb8e3b522f
commit
c6cd707894
@ -1,5 +1,6 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -15,7 +16,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockSkeletonHolder extends BlockContainer {
|
||||
public class BlockSkeletonHolder extends BlockContainer implements INBTTransformable {
|
||||
|
||||
public BlockSkeletonHolder() {
|
||||
super(Material.rock);
|
||||
@ -43,9 +44,9 @@ public class BlockSkeletonHolder extends BlockContainer {
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
if(world.isRemote) return true;
|
||||
if(player.isSneaking()) return false;
|
||||
|
||||
|
||||
TileEntitySkeletonHolder pedestal = (TileEntitySkeletonHolder) world.getTileEntity(x, y, z);
|
||||
|
||||
|
||||
if(pedestal.item == null && player.getHeldItem() != null) {
|
||||
pedestal.item = player.getHeldItem().copy();
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = null;
|
||||
@ -59,13 +60,13 @@ public class BlockSkeletonHolder extends BlockContainer {
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
|
||||
|
||||
if(!world.isRemote) {
|
||||
TileEntitySkeletonHolder entity = (TileEntitySkeletonHolder) world.getTileEntity(x, y, z);
|
||||
if(entity != null && entity.item != null) {
|
||||
@ -73,14 +74,19 @@ public class BlockSkeletonHolder extends BlockContainer {
|
||||
world.spawnEntityInWorld(item);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
super.breakBlock(world, x, y, z, block, meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDirectional(meta, coordBaseMode);
|
||||
}
|
||||
|
||||
public static class TileEntitySkeletonHolder extends TileEntity {
|
||||
|
||||
public ItemStack item;
|
||||
|
||||
|
||||
@Override public boolean canUpdate() { return false; }
|
||||
|
||||
@Override
|
||||
@ -89,7 +95,7 @@ public class BlockSkeletonHolder extends BlockContainer {
|
||||
this.writeToNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
this.readFromNBT(pkt.func_148857_g());
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@ -27,7 +28,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class Floodlight extends BlockContainer implements IToolable {
|
||||
public class Floodlight extends BlockContainer implements IToolable, INBTTransformable {
|
||||
|
||||
public Floodlight(Material mat) {
|
||||
super(mat);
|
||||
@ -47,7 +48,7 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float fX, float fY, float fZ, int meta) {
|
||||
return side;
|
||||
}
|
||||
|
||||
|
||||
//only method with player param, called second for variable rotation
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
@ -60,18 +61,18 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
setAngle(world, x, y, z, player, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public void setAngle(World world, int x, int y, int z, EntityLivingBase player, boolean updateMeta) {
|
||||
|
||||
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
float rotation = player.rotationPitch;
|
||||
|
||||
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
|
||||
|
||||
if(tile instanceof TileEntityFloodlight) {
|
||||
int meta = world.getBlockMetadata(x, y, z) % 6;
|
||||
TileEntityFloodlight floodlight = (TileEntityFloodlight) tile;
|
||||
|
||||
|
||||
if(meta == 0 || meta == 1) {
|
||||
if(i == 0 || i == 2) if(updateMeta) world.setBlockMetadataWithNotify(x, y, z, meta + 6, 3);
|
||||
if(meta == 1) if(i == 0 || i == 1) rotation = 180F - rotation;
|
||||
@ -83,48 +84,92 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
tile.markDirty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
if(meta < 6) {
|
||||
switch(coordBaseMode) {
|
||||
case 1: // West
|
||||
switch(meta) {
|
||||
case 2: return 5;
|
||||
case 3: return 4;
|
||||
case 4: return 2;
|
||||
case 5: return 3;
|
||||
}
|
||||
break;
|
||||
case 2: // North
|
||||
switch(meta) {
|
||||
case 2: return 3;
|
||||
case 3: return 2;
|
||||
case 4: return 5;
|
||||
case 5: return 4;
|
||||
}
|
||||
break;
|
||||
case 3: // East
|
||||
switch(meta) {
|
||||
case 2: return 4;
|
||||
case 3: return 5;
|
||||
case 4: return 3;
|
||||
case 5: return 2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Also rotate the upper bits that store additional state (6-11)
|
||||
if(meta >= 6) {
|
||||
return transformMeta(meta - 6, coordBaseMode) + 6;
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block transformBlock(Block block) {
|
||||
return block; // No block transformation needed
|
||||
}
|
||||
|
||||
public static class TileEntityFloodlight extends TileEntity implements IEnergyReceiverMK2 {
|
||||
|
||||
|
||||
public float rotation;
|
||||
protected BlockPos[] lightPos = new BlockPos[15];
|
||||
public static final long maxPower = 5_000;
|
||||
public long power;
|
||||
|
||||
|
||||
public int delay;
|
||||
public boolean isOn;
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
|
||||
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() % 6).getOpposite();
|
||||
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||
|
||||
|
||||
if(delay > 0) {
|
||||
delay --;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if(power >= 100) {
|
||||
power -= 100;
|
||||
|
||||
|
||||
if(!isOn) {
|
||||
this.isOn = true;
|
||||
this.castLights();
|
||||
this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
|
||||
this.worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
long timer = worldObj.getTotalWorldTime();
|
||||
if(timer % 5 == 0) {
|
||||
timer = timer / 5;
|
||||
this.castLight((int) Math.abs(timer % this.lightPos.length));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
if(isOn) {
|
||||
this.isOn = false;
|
||||
@ -136,12 +181,12 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void castLight(int index) {
|
||||
BlockPos newPos = this.getRayEndpoint(index);
|
||||
BlockPos oldPos = this.lightPos[index];
|
||||
this.lightPos[index] = null;
|
||||
|
||||
|
||||
if(newPos == null || !newPos.equals(oldPos)) { //if the new end point is null or not equal to the previous, delete the previous spot
|
||||
if(oldPos != null) {
|
||||
TileEntity tile = Compat.getTileStandard(worldObj, oldPos.getX(), oldPos.getY(), oldPos.getZ());
|
||||
@ -153,9 +198,9 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(newPos == null) return;
|
||||
|
||||
|
||||
if(worldObj.getBlock(newPos.getX(), newPos.getY(), newPos.getZ()) == Blocks.air) {
|
||||
worldObj.setBlock(newPos.getX(), newPos.getY(), newPos.getZ(), ModBlocks.floodlight_beam, 0, 2);
|
||||
TileEntity tile = Compat.getTileStandard(worldObj, newPos.getX(), newPos.getY(), newPos.getZ());
|
||||
@ -167,16 +212,16 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
this.lightPos[index] = newPos;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public BlockPos getRayEndpoint(int index) {
|
||||
|
||||
|
||||
if(index < 0 || index >= lightPos.length) return null;
|
||||
|
||||
int meta = this.getBlockMetadata();
|
||||
Vec3 dir = Vec3.createVectorHelper(1, 0, 0);
|
||||
|
||||
|
||||
float[] angles = getVariation(index);
|
||||
|
||||
|
||||
float rotation = this.rotation;
|
||||
if(meta == 1 || meta == 7) rotation = 180 - rotation;
|
||||
if(meta == 6) rotation = 180 - rotation;
|
||||
@ -188,31 +233,31 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
if(meta == 3) dir.rotateAroundY((float) -(Math.PI / 2D));
|
||||
if(meta == 4) dir.rotateAroundY((float) (Math.PI));
|
||||
dir.rotateAroundY(angles[1]);
|
||||
|
||||
|
||||
for(int i = 1; i < 64; i++) {
|
||||
int iX = (int) Math.floor(xCoord + 0.5 + dir.xCoord * i);
|
||||
int iY = (int) Math.floor(yCoord + 0.5 + dir.yCoord * i);
|
||||
int iZ = (int) Math.floor(zCoord + 0.5 + dir.zCoord * i);
|
||||
|
||||
|
||||
if(iX == xCoord && iY == yCoord && iZ == zCoord) continue;
|
||||
|
||||
|
||||
Block block = worldObj.getBlock(iX, iY, iZ);
|
||||
if(block.getLightOpacity(worldObj, iX, iY, iZ) < 127) continue;
|
||||
|
||||
|
||||
int fX = (int) Math.floor(xCoord + 0.5 + dir.xCoord * (i - 1));
|
||||
int fY = (int) Math.floor(yCoord + 0.5 + dir.yCoord * (i - 1));
|
||||
int fZ = (int) Math.floor(zCoord + 0.5 + dir.zCoord * (i - 1));
|
||||
|
||||
if(i > 1) return new BlockPos(fX, fY, fZ);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
private void castLights() {
|
||||
for(int i = 0; i < this.lightPos.length; i++) this.castLight(i);
|
||||
}
|
||||
|
||||
|
||||
private void destroyLight(int index) {
|
||||
BlockPos pos = lightPos[index];
|
||||
if(pos != null) {
|
||||
@ -221,11 +266,11 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void destroyLights() {
|
||||
for(int i = 0; i < this.lightPos.length; i++) destroyLight(i);
|
||||
}
|
||||
|
||||
|
||||
private float[] getVariation(int index) {
|
||||
return new float[] {
|
||||
(((index / 3) - 2) * 7.5F) / 180F * (float) Math.PI,
|
||||
@ -239,7 +284,7 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
this.writeToNBT(nbt);
|
||||
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
this.readFromNBT(pkt.func_148857_g());
|
||||
@ -268,12 +313,12 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
private boolean isLoaded = true;
|
||||
@Override public boolean isLoaded() { return isLoaded; }
|
||||
@Override public void onChunkUnload() { this.isLoaded = false; }
|
||||
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 1,
|
||||
@ -284,10 +329,10 @@ public class Floodlight extends BlockContainer implements IToolable {
|
||||
zCoord + 2
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return bb;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.items.ItemEnums.EnumCokeType;
|
||||
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemRTGPelletDepleted;
|
||||
import com.hbm.items.tool.ItemBlowtorch;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
@ -25,6 +26,7 @@ public class ItemPoolsComponent {
|
||||
public static final String POOL_VAULT_LOCKERS = "POOL_VAULT_LOCKERS";
|
||||
public static final String POOL_METEOR_SAFE = "POOL_METEOR_SAFE";
|
||||
public static final String POOL_OIL_RIG = "POOL_OIL_RIG";
|
||||
public static final String POOL_RTG = "POOL_RTG";
|
||||
|
||||
public static void init() {
|
||||
|
||||
@ -210,5 +212,12 @@ public class ItemPoolsComponent {
|
||||
weighted(ModItems.circuit, EnumCircuitType.CAPACITOR.ordinal(), 1, 1, 3),
|
||||
};
|
||||
}};
|
||||
|
||||
new ItemPool(POOL_RTG) {{
|
||||
this.pool = new WeightedRandomChestContent[] {
|
||||
weighted(ModItems.pellet_rtg_depleted, ItemRTGPelletDepleted.DepletedRTGMaterial.LEAD.ordinal(), 1, 1, 40),
|
||||
weighted(ModItems.pellet_rtg_weak,0, 0, 1, 1),
|
||||
};
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,6 +59,7 @@ public class StructureManager {
|
||||
public static final NBTStructure aircraft_carrier = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/aircraft_carrier.nbt"));
|
||||
public static final NBTStructure oil_rig = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/oil_rig.nbt"));
|
||||
public static final NBTStructure beached_patrol = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/beached_patrol.nbt"));
|
||||
public static final NBTStructure lighthouse = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/lighthouse.nbt"));
|
||||
|
||||
// public static final NBTStructure test_rot = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-rot.nbt"));
|
||||
// public static final NBTStructure test_jigsaw = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/test-jigsaw.nbt"));
|
||||
|
||||
@ -79,9 +79,10 @@ public interface INBTTransformable {
|
||||
}
|
||||
|
||||
public static int transformMetaPillar(int meta, int coordBaseMode) {
|
||||
if(coordBaseMode == 2) return meta;
|
||||
int type = meta & 3;
|
||||
int rot = meta & 12;
|
||||
if(coordBaseMode == 2) return meta; // 180° rotation: X and Z flip, result same
|
||||
|
||||
int type = meta & 3; // lower 2 bits
|
||||
int rot = meta & 12; // upper 2 bits (4 or 8)
|
||||
|
||||
if(rot == 4) return type | 8;
|
||||
if(rot == 8) return type | 4;
|
||||
@ -158,4 +159,46 @@ public interface INBTTransformable {
|
||||
return meta;
|
||||
}
|
||||
|
||||
}
|
||||
public static int transformMetaVine(int meta, int coordBaseMode) { //Sloppppp coddee aa
|
||||
int result = 0;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int bit = 1 << i;
|
||||
if ((meta & bit) != 0) {
|
||||
result |= rotateVineBit(bit, coordBaseMode);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static int rotateVineBit(int bit, int coordBaseMode) {
|
||||
int index = -1;
|
||||
|
||||
switch (bit) {
|
||||
case 1: index = 0; break; // south
|
||||
case 2: index = 1; break; // west
|
||||
case 4: index = 2; break; // north
|
||||
case 8: index = 3; break; // east
|
||||
default: return 0;
|
||||
}
|
||||
|
||||
int rotated = index;
|
||||
|
||||
switch (coordBaseMode) {
|
||||
case 1: rotated = (index + 1) % 4; break; // 90°
|
||||
case 2: rotated = (index + 2) % 4; break; // 180°
|
||||
case 3: rotated = (index + 3) % 4; break; // 270°
|
||||
// case 0: vines work ughhggh (im dragging it)
|
||||
}
|
||||
|
||||
switch (rotated) {
|
||||
case 0: return 1; // south
|
||||
case 1: return 2; // west
|
||||
case 2: return 4; // north
|
||||
case 3: return 8; // east
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,6 @@ import com.hbm.world.gen.component.CivilianFeatures.NTMHouse1;
|
||||
import com.hbm.world.gen.component.CivilianFeatures.NTMHouse2;
|
||||
import com.hbm.world.gen.component.CivilianFeatures.NTMLab1;
|
||||
import com.hbm.world.gen.component.CivilianFeatures.NTMLab2;
|
||||
import com.hbm.world.gen.component.CivilianFeatures.NTMWorkshop1;
|
||||
import com.hbm.world.gen.component.CivilianFeatures.RuralHouse1;
|
||||
import com.hbm.world.gen.component.OfficeFeatures.LargeOffice;
|
||||
import com.hbm.world.gen.component.OfficeFeatures.LargeOfficeCorner;
|
||||
@ -31,40 +30,40 @@ import net.minecraft.world.gen.structure.StructureComponent;
|
||||
import net.minecraft.world.gen.structure.StructureStart;
|
||||
|
||||
public class MapGenNTMFeatures extends MapGenStructure {
|
||||
|
||||
|
||||
//BiomeDictionary could be /very/ useful, since it automatically sorts *all* biomes into predefined categories
|
||||
private static List biomelist;
|
||||
/** Maximum distance between structures */
|
||||
private int maxDistanceBetweenScatteredFeatures;
|
||||
/** Minimum distance between structures */
|
||||
private int minDistanceBetweenScatteredFeatures;
|
||||
|
||||
|
||||
public MapGenNTMFeatures() {
|
||||
this.maxDistanceBetweenScatteredFeatures = StructureConfig.structureMaxChunks;
|
||||
this.minDistanceBetweenScatteredFeatures = StructureConfig.structureMinChunks;
|
||||
}
|
||||
|
||||
|
||||
/** String ID for this MapGen */
|
||||
@Override
|
||||
public String func_143025_a() {
|
||||
return "NTMFeatures";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Checks if a structure can be spawned at coords, based off of chance and biome
|
||||
* (Good approach would probably be to only exclude ocean biomes through biomelist and rely on temperature and rainfall instead of biomegenbase, would allow for biomes o' plenty compat)
|
||||
*/
|
||||
@Override
|
||||
protected boolean canSpawnStructureAtCoords(int chunkX, int chunkZ) {
|
||||
|
||||
|
||||
int k = chunkX;
|
||||
int l = chunkZ;
|
||||
|
||||
|
||||
if(chunkX < 0)
|
||||
chunkX -= this.maxDistanceBetweenScatteredFeatures - 1;
|
||||
if(chunkZ < 0)
|
||||
chunkZ -= this.maxDistanceBetweenScatteredFeatures - 1;
|
||||
|
||||
|
||||
int i1 = chunkX / this.maxDistanceBetweenScatteredFeatures;
|
||||
int j1 = chunkZ / this.maxDistanceBetweenScatteredFeatures;
|
||||
Random random = this.worldObj.setRandomSeed(i1, j1, 14357617);
|
||||
@ -72,31 +71,31 @@ public class MapGenNTMFeatures extends MapGenStructure {
|
||||
j1 *= this.maxDistanceBetweenScatteredFeatures;
|
||||
i1 += random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures);
|
||||
j1 += random.nextInt(this.maxDistanceBetweenScatteredFeatures - this.minDistanceBetweenScatteredFeatures);
|
||||
|
||||
|
||||
if(k == i1 && l == j1) {
|
||||
BiomeGenBase biomegenbase = this.worldObj.getWorldChunkManager().getBiomeGenAt(k * 16 + 8, l * 16 + 8);
|
||||
|
||||
|
||||
if(biomelist == null) {
|
||||
biomelist = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean});
|
||||
}
|
||||
|
||||
|
||||
Iterator iterator = biomelist.iterator();
|
||||
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
BiomeGenBase biomegenbase1 = (BiomeGenBase)iterator.next();
|
||||
|
||||
|
||||
if(biomegenbase == biomegenbase1)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//StructureStart Methods Class
|
||||
|
||||
|
||||
/** Returns new StructureStart if structure can be spawned at coords */
|
||||
@Override
|
||||
protected StructureStart getStructureStart(int chunkX, int chunkZ) {
|
||||
@ -105,26 +104,26 @@ public class MapGenNTMFeatures extends MapGenStructure {
|
||||
}
|
||||
return new MapGenNTMFeatures.Start(this.worldObj, this.rand, chunkX, chunkZ);
|
||||
}
|
||||
|
||||
|
||||
public static class Start extends StructureStart {
|
||||
|
||||
|
||||
public Start() {}
|
||||
|
||||
|
||||
public Start(World world, Random rand, int chunkX, int chunkZ) {
|
||||
super(chunkX, chunkZ);
|
||||
|
||||
|
||||
int i = (chunkX << 4) + 8;
|
||||
int j = (chunkZ << 4) + 8;
|
||||
|
||||
|
||||
BiomeGenBase biome = world.getBiomeGenForCoords(i, j); //Only gets the biome in the corner of the chunk.
|
||||
|
||||
|
||||
/*
|
||||
* Probably want to use nextInt() to increase the structures of rarity here. As a fallback, you could have generic stone brick/useless block ruins that will always be chosen if the
|
||||
* chance/location fails for all other structures. Might not even be necessary, but whatever.
|
||||
* Rainfall & Temperature Check
|
||||
*/
|
||||
//TODO: Do something about this so it's nice-looking and easily readable. Plus, test compatibility against mods like BoP
|
||||
|
||||
|
||||
if(rand.nextInt(3) == 0) { //Empty Ruin Structures
|
||||
switch(rand.nextInt(4)) {
|
||||
case 0:
|
||||
@ -143,7 +142,7 @@ public class MapGenNTMFeatures extends MapGenStructure {
|
||||
NTMRuin4 ruin4 = new NTMRuin4(rand, i, j);
|
||||
this.components.add(ruin4);
|
||||
}
|
||||
|
||||
|
||||
} else if(biome.heightVariation <= 0.25F && rand.nextInt(10) == 0) { //for now our only restriction is kinda-flat biomes. that and chance might change idk
|
||||
SiloComponent silo = new SiloComponent(rand, i, j);
|
||||
this.components.add(silo);
|
||||
@ -155,10 +154,6 @@ public class MapGenNTMFeatures extends MapGenStructure {
|
||||
NTMHouse2 house2 = new NTMHouse2(rand, i, j);
|
||||
this.components.add(house2);
|
||||
}
|
||||
|
||||
} else if(biome.temperature >= 0.25 && biome.temperature <= 0.3 && biome.rainfall >= 0.6 && biome.rainfall <= 0.9 && rand.nextBoolean()) { //Taiga & Mega Taiga
|
||||
NTMWorkshop1 workshop1 = new NTMWorkshop1(rand, i, j); //TODO replace this
|
||||
this.components.add(workshop1);
|
||||
} else { //Everything else
|
||||
switch(rand.nextInt(6)) {
|
||||
case 0:
|
||||
@ -179,16 +174,16 @@ public class MapGenNTMFeatures extends MapGenStructure {
|
||||
this.components.add(ruralHouse); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(GeneralConfig.enableDebugMode) {
|
||||
System.out.print("[Debug] StructureStart at " + i + ", 64, " + j + "\n[Debug] Components: ");
|
||||
this.components.forEach((component) -> {
|
||||
System.out.print(MapGenStructureIO.func_143036_a((StructureComponent) component) + " ");
|
||||
});
|
||||
|
||||
|
||||
System.out.print("\n");
|
||||
}
|
||||
|
||||
|
||||
this.updateBoundingBox();
|
||||
}
|
||||
}
|
||||
|
||||
@ -578,7 +578,7 @@ public class NBTStructure {
|
||||
if(definition.block instanceof BlockSign) return INBTTransformable.transformMetaDeco(definition.meta, coordBaseMode);
|
||||
if(definition.block instanceof BlockLadder) return INBTTransformable.transformMetaDeco(definition.meta, coordBaseMode);
|
||||
if(definition.block instanceof BlockTripWireHook) return INBTTransformable.transformMetaDirectional(definition.meta, coordBaseMode);
|
||||
|
||||
if(definition.block == Blocks.vine) return INBTTransformable.transformMetaVine(definition.meta, coordBaseMode);
|
||||
return definition.meta;
|
||||
}
|
||||
|
||||
|
||||
@ -38,7 +38,7 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
final List<BiomeGenBase> invalidBiomes = Arrays.asList(new BiomeGenBase[] {BiomeGenBase.ocean, BiomeGenBase.river, BiomeGenBase.frozenOcean, BiomeGenBase.frozenRiver, BiomeGenBase.deepOcean});
|
||||
final List<BiomeGenBase> oceanBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.deepOcean });
|
||||
final List<BiomeGenBase> beachBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.beach, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach });
|
||||
|
||||
final List<BiomeGenBase> lighthouseBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.deepOcean, BiomeGenBase.beach, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach });
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome);
|
||||
@ -79,6 +79,14 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = 2;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = lighthouseBiomes::contains;
|
||||
structure = new JigsawPiece("lighthouse", StructureManager.lighthouse, -40);
|
||||
maxHeight = 29;
|
||||
minHeight = 28;
|
||||
spawnWeight = 2;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = beachBiomes::contains;
|
||||
structure = new JigsawPiece("beached_patrol", StructureManager.beached_patrol, -5);
|
||||
@ -87,7 +95,7 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = 8;
|
||||
}});
|
||||
|
||||
NBTStructure.registerNullWeight(0, 2, beachBiomes::contains);
|
||||
NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains); //why the fuck did this change
|
||||
|
||||
Map<Block, BlockSelector> bricks = new HashMap<Block, BlockSelector>() {{
|
||||
put(ModBlocks.meteor_brick, new MeteorBricks());
|
||||
|
||||
@ -21,49 +21,48 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||
import net.minecraft.world.gen.structure.StructureBoundingBox;
|
||||
|
||||
/* Described as "Civilian", as that's the overarching connection between all of these structures. Unlike the ruins, there's not enough to
|
||||
/* Described as "Civilian", as that's the overarching connection between all of these structures. Unlike the ruins, there's not enough to
|
||||
* compartmentalize even further. Just in general many of the structures I consider lower-quality (except for the sandstone houses; those are actually pretty nice).
|
||||
*/
|
||||
public class CivilianFeatures {
|
||||
|
||||
|
||||
public static void registerComponents() {
|
||||
MapGenStructureIO.func_143031_a(NTMHouse1.class, "NTMHouse1");
|
||||
MapGenStructureIO.func_143031_a(NTMHouse2.class, "NTMHouse2");
|
||||
MapGenStructureIO.func_143031_a(NTMHouse1.class, "NTMHouse1");
|
||||
MapGenStructureIO.func_143031_a(NTMHouse2.class, "NTMHouse2");
|
||||
MapGenStructureIO.func_143031_a(NTMLab1.class, "NTMLab1"); //i'll replace these shitty structures one day trust
|
||||
MapGenStructureIO.func_143031_a(NTMLab2.class, "NTMLab2");
|
||||
MapGenStructureIO.func_143031_a(NTMWorkshop1.class, "NTMWorkshop1");
|
||||
MapGenStructureIO.func_143031_a(NTMLab2.class, "NTMLab2");
|
||||
MapGenStructureIO.func_143031_a(RuralHouse1.class, "NTMRuralHouse1");
|
||||
}
|
||||
|
||||
|
||||
/** Sandstone Ruin 1 */
|
||||
public static class NTMHouse1 extends Component {
|
||||
|
||||
|
||||
private boolean hasPlacedChest;
|
||||
|
||||
|
||||
private static Sandstone RandomSandstone = new Sandstone();
|
||||
|
||||
|
||||
public NTMHouse1() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
/** Constructor for this feature; takes coordinates for bounding box */
|
||||
public NTMHouse1(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 9, 4, 6);
|
||||
this.hasPlacedChest = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void func_143012_a(NBTTagCompound nbt) {
|
||||
super.func_143012_a(nbt);
|
||||
nbt.setBoolean("hasChest", this.hasPlacedChest);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void func_143011_b(NBTTagCompound nbt) {
|
||||
super.func_143011_b(nbt);
|
||||
this.hasPlacedChest = nbt.getBoolean("hasChest");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generates structures.
|
||||
*/
|
||||
@ -86,15 +85,15 @@ public class CivilianFeatures {
|
||||
* Fills an area with blocks randomly - look into randLimit?
|
||||
* this.randomlyFillWithBlocks(world, box, rand, randLimit, minX, minY, minZ, maxX, maxY, maxZ, blockToPlace, blockToReplace, alwaysReplace);
|
||||
*/
|
||||
|
||||
|
||||
//System.out.println(this.coordBaseMode);
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.sandstone, 0, 0, 0, 9, 6, -1, box);
|
||||
|
||||
|
||||
//Walls
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 9, 0, 0, false, rand, RandomSandstone); //Back Wall
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 1, 0, 1, 1, 0, false, rand, RandomSandstone);
|
||||
@ -114,10 +113,10 @@ public class CivilianFeatures {
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 9 - 2, 2, 6, box);
|
||||
this.fillWithRandomizedBlocks(world, box, 9, 0, 0, 9, 0, 6, false, rand, RandomSandstone); //Right Wall
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.65F, 9, 1, 1, 9, 1, 6 - 1, Blocks.sand, Blocks.air, false);
|
||||
|
||||
|
||||
this.fillWithRandomizedBlocks(world, box, 4, 0, 1, 4, 1, 3, false, rand, RandomSandstone);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.reinforced_sand, 0, 4, 0, 4, box);
|
||||
|
||||
|
||||
//Loot/Sand
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 1, 0, 1, box);
|
||||
if(!this.hasPlacedChest)
|
||||
@ -128,35 +127,35 @@ public class CivilianFeatures {
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.crate_metal, 0, 9 - 1, 0, 1, box);
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 2, 3, 0, 6 - 1, Blocks.sand, Blocks.air, false);
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.25F, 5, 0, 2, 9 - 1, 0, 6 - 1, Blocks.sand, Blocks.air, false);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static class NTMHouse2 extends Component {
|
||||
|
||||
|
||||
private static Sandstone RandomSandstone = new Sandstone();
|
||||
|
||||
|
||||
private boolean[] hasPlacedLoot = new boolean[2];
|
||||
|
||||
|
||||
public NTMHouse2() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public NTMHouse2(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 15, 5, 9);
|
||||
this.hasPlacedLoot[0] = false;
|
||||
this.hasPlacedLoot[1] = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void func_143012_a(NBTTagCompound nbt) {
|
||||
super.func_143012_a(nbt);
|
||||
nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]);
|
||||
nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void func_143011_b(NBTTagCompound nbt) {
|
||||
super.func_143011_b(nbt);
|
||||
@ -166,18 +165,18 @@ public class CivilianFeatures {
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
|
||||
//System.out.print(this.coordBaseMode);
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.sandstone, 0, 0, 0, 6, 15, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.sandstone, 0, 9, 0, 15, 9, -1, box);
|
||||
|
||||
|
||||
this.fillWithAir(world, box, 1, 0, 1, 5, 5, 9 - 1);
|
||||
|
||||
|
||||
//House 1
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 0, 0, 6, 1, 0, false, rand, RandomSandstone); //Back Wall
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 2, 0, 1, 2, 0, false, rand, RandomSandstone);
|
||||
@ -196,7 +195,7 @@ public class CivilianFeatures {
|
||||
this.fillWithRandomizedBlocks(world, box, 6, 0, 9 - 2, 6, 0, 9 - 2, false, rand, RandomSandstone);
|
||||
this.fillWithRandomizedBlocks(world, box, 6, 3, 9 - 2, 6, 3, 9 - 2, false, rand, RandomSandstone);
|
||||
this.fillWithRandomizedBlocks(world, box, 6, 0, 1, 6, 3, 9 - 3, false, rand, RandomSandstone);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 1, 0, 1, 5, 0, 9 - 1, Blocks.sandstone, Blocks.air, false); //Floor
|
||||
//this.fillWithRandomizedBlocks(world, box, 1, 5 - 1, 0, 5, 5 - 1, 9, false, rand, RandomSandstone); //Ceiling
|
||||
this.fillWithBlocks(world, box, 1, 5 - 1, 0, 5, 5 - 1, 9, Blocks.sandstone, Blocks.air, false);
|
||||
@ -207,7 +206,7 @@ public class CivilianFeatures {
|
||||
this.fillWithMetadataBlocks(world, box, 3, 5, 4, 3, 5, 6, Blocks.stone_slab, 1, Blocks.air, 0, false);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 3, 5, 9 - 1, box);
|
||||
this.fillWithMetadataBlocks(world, box, 2, 5, 9, 4, 5, 9, Blocks.stone_slab, 1, Blocks.air, 0, false);
|
||||
|
||||
|
||||
//House 2
|
||||
this.fillWithRandomizedBlocks(world, box, 15 - 6, 0, 0, 15, 0, 0, false, rand, RandomSandstone); //Back Wall
|
||||
this.fillWithRandomizedBlocks(world, box, 15 - 6, 1, 0, 15 - 2, 1, 0, false, rand, RandomSandstone);
|
||||
@ -234,9 +233,9 @@ public class CivilianFeatures {
|
||||
this.fillWithMetadataBlocks(world, box, 15, 1, 4, 15, 1, 5, Blocks.stone_slab, 1, Blocks.air, 0, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 15, 1, 9 - 1, 15, 1, 9 - 3, false, rand, RandomSandstone);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.stone_slab, 1, 15, 1, 9 - 1, box);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 15 - 5, 0, 1, 15 - 1, 0, 9 - 1, Blocks.sandstone, Blocks.air, false); //Floor
|
||||
|
||||
|
||||
//Loot & Decorations
|
||||
//House 1
|
||||
int eastMeta = this.getDecoMeta(4);
|
||||
@ -247,7 +246,7 @@ public class CivilianFeatures {
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 1, 1, 9 - 4, box);
|
||||
if(!hasPlacedLoot[0]) {
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), 1, 1, 9 - 2, box);
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsComponent.POOL_MACHINE_PARTS), (TileEntityChest)world.getTileEntity(this.getXWithOffset(1, 9 - 2),
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsComponent.POOL_MACHINE_PARTS), (TileEntityChest)world.getTileEntity(this.getXWithOffset(1, 9 - 2),
|
||||
this.getYWithOffset(1), this.getZWithOffset(1, 9 - 2)), 10);
|
||||
this.hasPlacedLoot[0] = true;
|
||||
}
|
||||
@ -256,53 +255,53 @@ public class CivilianFeatures {
|
||||
this.fillWithMetadataBlocks(world, box, 5, 1, 6, 5, 3, 6, ModBlocks.steel_scaffold, eastMeta < 4 ? 0 : 8, Blocks.air, 0, false);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.steel_grate, 7, 5, 1, 5, box);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.crate_weapon, 0, 5, 2, 5, box);
|
||||
|
||||
|
||||
//House 2
|
||||
if(!hasPlacedLoot[1]) {
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.chest, this.getMetadataWithOffset(Blocks.chest, 3), 15 - 5, 1, 1, box);
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsLegacy.POOL_ANTENNA), (TileEntityChest)world.getTileEntity(this.getXWithOffset(15 - 5, 1),
|
||||
WeightedRandomChestContent.generateChestContents(rand, ItemPool.getPool(ItemPoolsLegacy.POOL_ANTENNA), (TileEntityChest)world.getTileEntity(this.getXWithOffset(15 - 5, 1),
|
||||
this.getYWithOffset(1), this.getZWithOffset(15 - 5, 1)), 10);
|
||||
this.hasPlacedLoot[1] = true;
|
||||
}
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), 15 - 5, 1, 4, box);
|
||||
TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(15 - 5, 4), this.getYWithOffset(1), this.getZWithOffset(15 - 5, 4));
|
||||
|
||||
|
||||
if(bobble != null) {
|
||||
bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1];
|
||||
bobble.markDirty();
|
||||
}
|
||||
|
||||
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.25F, 15 - 4, 1, 1, 15 - 1, 1, 9 - 1, Blocks.sand, Blocks.air, false);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class NTMLab1 extends Component {
|
||||
|
||||
|
||||
private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks();
|
||||
private static LabTiles RandomLabTiles = new LabTiles();
|
||||
|
||||
|
||||
private boolean[] hasPlacedLoot = new boolean[2];
|
||||
|
||||
|
||||
public NTMLab1() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
/** Constructor for this feature; takes coordinates for bounding box */
|
||||
public NTMLab1(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 9, 4, 7);
|
||||
this.hasPlacedLoot[0] = false;
|
||||
this.hasPlacedLoot[1] = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void func_143012_a(NBTTagCompound nbt) {
|
||||
super.func_143012_a(nbt);
|
||||
nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]);
|
||||
nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void func_143011_b(NBTTagCompound nbt) {
|
||||
super.func_143011_b(nbt);
|
||||
@ -312,28 +311,28 @@ public class CivilianFeatures {
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
|
||||
//System.out.println(this.coordBaseMode);
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 9, 7 - 2, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 3, 6, 9, 7, -1, box);
|
||||
|
||||
if(this.getBlockAtCurrentPosition(world, 2, 0, 7 - 1, box).getMaterial().isReplaceable()
|
||||
|
||||
if(this.getBlockAtCurrentPosition(world, 2, 0, 7 - 1, box).getMaterial().isReplaceable()
|
||||
|| this.getBlockAtCurrentPosition(world, 2, 0, 7 - 1, box) == Blocks.air) {
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 2, 7 - 1, 2, 7 - 1, -1, box);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, getStairMeta(0), 2, 0, 7 - 1, box);
|
||||
}
|
||||
|
||||
|
||||
this.fillWithAir(world, box, 1, 0, 1, 9 - 1, 4, 4);
|
||||
this.fillWithAir(world, box, 4, 0, 4, 9 - 1, 4, 7 - 1);
|
||||
this.fillWithAir(world, box, 3, 1, 7 - 1, 3, 2, 7 - 1);
|
||||
|
||||
|
||||
int pillarMeta = this.getPillarMeta(8);
|
||||
|
||||
|
||||
//Pillars
|
||||
this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 9, 0, 0, 9, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
@ -343,7 +342,7 @@ public class CivilianFeatures {
|
||||
this.fillWithBlocks(world, box, 3, 0, 7 - 2, 3, 3, 7 - 2, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 3, 0, 7, 3, 3, 7, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 9, 0, 7, 9, 3, 7, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
|
||||
|
||||
//Walls
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 9 - 1, 4 - 1, 0, false, rand, RandomConcreteBricks); //Back Wall
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 4, 0, 9, 4, 0, false, rand, RandomConcreteBricks);
|
||||
@ -358,16 +357,16 @@ public class CivilianFeatures {
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.75F, 5, 2, 7, 9 - 2, 3, 7, Blocks.glass_pane, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 3, 4, 7, 9, 4, 7, false, rand, RandomConcreteBricks);
|
||||
this.fillWithRandomizedBlocks(world, box, 9, 1, 1, 9, 4, 7 - 1, false, rand, RandomConcreteBricks); //Right Wall
|
||||
|
||||
|
||||
//Floor & Ceiling
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 0, 1, 9 - 1, 0, 4, false, rand, RandomLabTiles); //Floor
|
||||
this.fillWithRandomizedBlocks(world, box, 4, 0, 7 - 2, 9 - 1, 0, 7 - 1, false, rand, RandomLabTiles);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 3, 0, 7 - 1, box);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 1, 4 - 1, 1, 1, 4, 4, ModBlocks.reinforced_glass, Blocks.air, false); //Ceiling
|
||||
this.fillWithBlocks(world, box, 2, 4, 1, 9 - 1, 4, 4, ModBlocks.brick_light, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 4, 4, 7 - 2, 9 - 1, 4, 7 - 1, ModBlocks.brick_light, Blocks.air, false);
|
||||
|
||||
|
||||
//Decorations & Loot
|
||||
this.fillWithMetadataBlocks(world, box, 1, 1, 1, 1, 1, 4, Blocks.dirt, 2, Blocks.air, 0, false);
|
||||
int westDecoMeta = this.getDecoMeta(5);
|
||||
@ -376,11 +375,11 @@ public class CivilianFeatures {
|
||||
for(byte i = 0; i < 4; i++) {
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.plant_flower, i, 1, 2, 1 + i, box);
|
||||
}
|
||||
|
||||
|
||||
int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 2);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 3, 1, 7 - 1, box);
|
||||
ItemDoor.placeDoorBlock(world, this.getXWithOffset(3, 7 - 1), this.getYWithOffset(1), this.getZWithOffset(3, 7 - 1), doorMeta, ModBlocks.door_office);
|
||||
|
||||
|
||||
int northDecoMeta = this.getDecoMeta(3);
|
||||
this.fillWithMetadataBlocks(world, box, 5, 4 - 1, 1, 9 - 1, 4 - 1, 1, ModBlocks.steel_scaffold, westDecoMeta < 4 ? 0 : 8, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 5, 4 - 1, 2, 9 - 1, 4 - 1, 2, ModBlocks.steel_wall, northDecoMeta, Blocks.air, 0, false);
|
||||
@ -395,24 +394,24 @@ public class CivilianFeatures {
|
||||
LootGenerator.lootMedicine(world, this.getXWithOffset(6, 3), this.getYWithOffset(2), this.getZWithOffset(6, 3));
|
||||
this.hasPlacedLoot[0] = true;
|
||||
}
|
||||
|
||||
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 9 - 1, 1, 7 - 2, box);
|
||||
if(!hasPlacedLoot[1]) {
|
||||
this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 9 - 1, 1, 7 - 1, ItemPool.getPool(ItemPoolsLegacy.POOL_GENERIC), 8);
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class NTMLab2 extends Component {
|
||||
|
||||
|
||||
private static SuperConcrete RandomSuperConcrete = new SuperConcrete();
|
||||
private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks();
|
||||
private static LabTiles RandomLabTiles = new LabTiles();
|
||||
|
||||
|
||||
private boolean[] hasPlacedLoot = new boolean[2];
|
||||
|
||||
|
||||
public NTMLab2() {
|
||||
super();
|
||||
}
|
||||
@ -422,48 +421,48 @@ public class CivilianFeatures {
|
||||
this.hasPlacedLoot[0] = false;
|
||||
this.hasPlacedLoot[1] = false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void func_143012_a(NBTTagCompound nbt) {
|
||||
super.func_143012_a(nbt);
|
||||
nbt.setBoolean("hasLoot1", this.hasPlacedLoot[0]);
|
||||
nbt.setBoolean("hasLoot2", this.hasPlacedLoot[1]);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void func_143011_b(NBTTagCompound nbt) {
|
||||
super.func_143011_b(nbt);
|
||||
this.hasPlacedLoot[0] = nbt.getBoolean("hasLoot1");
|
||||
this.hasPlacedLoot[1] = nbt.getBoolean("hasLoot2");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
|
||||
//System.out.println(this.coordBaseMode);
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
this.boundingBox.offset(0, -7, 0);
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 12, 8 - 2, 6, box);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 7, 6, 8, 6, box);
|
||||
|
||||
if(this.getBlockAtCurrentPosition(world, 12 - 3, 11 - 4, 7, box).getMaterial().isReplaceable()
|
||||
|
||||
if(this.getBlockAtCurrentPosition(world, 12 - 3, 11 - 4, 7, box).getMaterial().isReplaceable()
|
||||
|| this.getBlockAtCurrentPosition(world, 12 - 3, 11 - 4, 7, box) == Blocks.air) {
|
||||
int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 2);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 12 - 3, 7, 12 - 2, 7, 11 - 4, box);
|
||||
this.fillWithMetadataBlocks(world, box, 12 - 3, 11 - 4, 7, 12 - 2, 11 - 4, 7, Blocks.stone_brick_stairs, stairMeta, Blocks.air, 0, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
this.fillWithAir(world, box, 1, 11 - 4, 1, 12 - 1, 11, 8 - 3);
|
||||
this.fillWithAir(world, box, 1, 11 - 4, 8 - 2, 5, 11, 8 - 1);
|
||||
this.fillWithAir(world, box, 12 - 3, 11 - 3, 8 - 2, 12 - 2, 11 - 2, 8 - 2);
|
||||
this.fillWithAir(world, box, 5, 5, 1, 6, 6, 2);
|
||||
this.fillWithAir(world, box, 2, 0, 2, 12 - 2, 3, 8 - 2);
|
||||
|
||||
this.fillWithAir(world, box, 2, 0, 2, 12 - 2, 3, 8 - 2);
|
||||
|
||||
//Walls
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 11 - 4, 0, 12, 11, 0, false, rand, RandomSuperConcrete); //Back Wall
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 11 - 4, 0, 0, 11, 8, false, rand, RandomSuperConcrete); //Left Wall
|
||||
@ -488,13 +487,13 @@ public class CivilianFeatures {
|
||||
this.fillWithRandomizedBlocks(world, box, 12, 11 - 3, 2, 12, 11 - 1, 2, false, rand, RandomSuperConcrete);
|
||||
this.fillWithBlocks(world, box, 12, 11 - 3, 1, 12, 11 - 1, 1, ModBlocks.reinforced_glass, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 12, 11, 1, 12, 11, 8 - 3, false, rand, RandomSuperConcrete);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 1, 0, 1, 12 - 1, 3, 1, ModBlocks.reinforced_stone, Blocks.air, false); //Back Wall
|
||||
this.fillWithBlocks(world, box, 1, 0, 2, 1, 3, 8 - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Left Wall
|
||||
this.fillWithBlocks(world, box, 1, 0, 8 - 1, 12 - 1, 3, 8 - 1, ModBlocks.reinforced_stone, Blocks.air, false); //Front Wall
|
||||
this.fillWithBlocks(world, box, 1, 0, 8 - 1, 12 - 1, 3, 8 - 1, ModBlocks.reinforced_stone, Blocks.air, false); //Front Wall
|
||||
this.fillWithBlocks(world, box, 12 - 1, 0, 2, 12 - 1, 3, 8 - 2, ModBlocks.reinforced_stone, Blocks.air, false); // Right Wall
|
||||
this.fillWithBlocks(world, box, 6, 0, 3, 6, 3, 8 - 2, ModBlocks.reinforced_stone, Blocks.air, false); //Internal Wall
|
||||
|
||||
|
||||
//Floors & Ceiling
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 11 - 4, 1, 3, 11 - 4, 8 - 1, false, rand, RandomLabTiles); //Left Floor
|
||||
this.fillWithRandomizedBlocks(world, box, 4, 11 - 4, 8 - 2, 5, 11 - 4, 8 - 1, false, rand, RandomLabTiles);
|
||||
@ -509,7 +508,7 @@ public class CivilianFeatures {
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.tile_lab_cracked, 0, 6, 11 - 4, 5, box);
|
||||
this.fillWithBlocks(world, box, 7, 11 - 4, 2, 7, 11 - 4, 3, ModBlocks.tile_lab_broken, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 7, 11 - 4, 4, 7, 11 - 4, 5, ModBlocks.tile_lab_cracked, Blocks.air, false);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 1, 11, 1, 2, 11, 8 - 1, ModBlocks.brick_light, Blocks.air, false); //Left Ceiling
|
||||
this.fillWithBlocks(world, box, 3, 11, 8 - 2, 4, 11, 8 - 1, ModBlocks.brick_light, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 12 - 3, 11, 1, 12 - 1, 11, 8 - 3, ModBlocks.brick_light, Blocks.air, false); //Right Ceiling
|
||||
@ -520,40 +519,40 @@ public class CivilianFeatures {
|
||||
this.fillWithBlocks(world, box, 4, 11, 4, 4, 11, 5, ModBlocks.waste_planks, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 5, 11, 6, 5, 11, 8 - 1, ModBlocks.waste_planks, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 8, 11, 3, 8, 11, 5, ModBlocks.waste_planks, Blocks.air, false);
|
||||
|
||||
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 0, 2, 5, 0, 8 - 2, false, rand, RandomLabTiles); //Floor
|
||||
this.fillWithRandomizedBlocks(world, box, 6, 0, 2, 6, 0, 3, false, rand, RandomLabTiles);
|
||||
this.fillWithRandomizedBlocks(world, box, 7, 0, 2, 12 - 2, 0, 8 - 2, false, rand, RandomLabTiles);
|
||||
|
||||
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 4, 1, 12 - 1, 4, 8 - 1, false, rand, RandomConcreteBricks); //Ceiling
|
||||
|
||||
|
||||
//Decorations & Loot
|
||||
int eastMeta = this.getDecoMeta(4);
|
||||
int westMeta = this.getDecoMeta(5);
|
||||
int northMeta = this.getDecoMeta(3);
|
||||
int southMeta = this.getDecoMeta(2);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.crashed_balefire, southMeta, 6, 11 - 2, 3, box);
|
||||
|
||||
|
||||
int doorMeta = this.getMetadataWithOffset(Blocks.wooden_door, 1);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 12 - 3, 11 - 3, 8 - 2, box);
|
||||
ItemDoor.placeDoorBlock(world, this.getXWithOffset(12 - 3, 8 - 2), this.getYWithOffset(11 - 3), this.getZWithOffset(12 - 3, 8 - 2),
|
||||
ItemDoor.placeDoorBlock(world, this.getXWithOffset(12 - 3, 8 - 2), this.getYWithOffset(11 - 3), this.getZWithOffset(12 - 3, 8 - 2),
|
||||
doorMeta, ModBlocks.door_office);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.door_office, doorMeta, 12 - 2, 11 - 3, 8 - 2, box);
|
||||
ItemDoor.placeDoorBlock(world, this.getXWithOffset(12 - 2, 8 - 2), this.getYWithOffset(11 - 3), this.getZWithOffset(12 - 2, 8 - 2),
|
||||
ItemDoor.placeDoorBlock(world, this.getXWithOffset(12 - 2, 8 - 2), this.getYWithOffset(11 - 3), this.getZWithOffset(12 - 2, 8 - 2),
|
||||
doorMeta, ModBlocks.door_office);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 1, 11 - 3, 1, 1, 11 - 1, 1, ModBlocks.deco_steel, Blocks.air, false);
|
||||
this.fillWithMetadataBlocks(world, box, 1, 11 - 3, 2, 1, 11 - 2, 3, ModBlocks.steel_grate, 7, Blocks.air, 0, false);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, westMeta, 1, 11 - 1, 2, box);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.steel_beam, 0, 1, 11 - 1, 3, box);
|
||||
this.fillWithBlocks(world, box, 1, 11 - 3, 6, 1, 11 - 1, 6, ModBlocks.deco_pipe_framed_rusted, Blocks.air, false);
|
||||
|
||||
|
||||
this.fillWithMetadataBlocks(world, box, 12 - 4, 11 - 3, 1, 12 - 4, 11 - 1, 1, ModBlocks.steel_wall, eastMeta, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 12 - 3, 11 - 1, 1, 12 - 2, 11 - 1, 1, ModBlocks.steel_grate, 0, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 12 - 3, 11 - 2, 1, 12 - 2, 11 - 2, 1, ModBlocks.tape_recorder, northMeta, Blocks.air, 0, false);
|
||||
this.fillWithBlocks(world, box, 12 - 3, 11 - 3, 1, 12 - 2, 11 - 3, 1, ModBlocks.deco_steel, Blocks.air, false);
|
||||
this.fillWithMetadataBlocks(world, box, 12 - 1, 11 - 3, 1, 12 - 1, 11 - 1, 1, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false);
|
||||
|
||||
|
||||
this.fillWithMetadataBlocks(world, box, 2, 1, 2, 2, 1, 8 - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.vitrified_barrel, 0, 2, 2, 2, box);
|
||||
this.fillWithMetadataBlocks(world, box, 3, 1, 2, 3, 3, 2, ModBlocks.steel_wall, westMeta, Blocks.air, 0, false);
|
||||
@ -565,7 +564,7 @@ public class CivilianFeatures {
|
||||
this.hasPlacedLoot[0] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 5, 1, 8 - 2, ItemPool.getPool(ItemPoolsComponent.POOL_NUKE_FUEL), 10);
|
||||
}
|
||||
this.fillWithBlocks(world, box, 4, 1, 8 - 3, 5, 1, 8 - 3, ModBlocks.crate_lead, Blocks.air, false);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 12 - 5, 1, 8 - 2, 12 - 5, 3, 8 - 2, ModBlocks.deco_steel, Blocks.air, false);;
|
||||
this.fillWithMetadataBlocks(world, box, 12 - 4, 1, 8 - 2, 12 - 2, 1, 8 - 2, ModBlocks.steel_grate, 7, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 12 - 4, 2, 8 - 2, 12 - 3, 2, 8 - 2, ModBlocks.tape_recorder, southMeta, Blocks.air, 0, false);
|
||||
@ -576,184 +575,34 @@ public class CivilianFeatures {
|
||||
if(rand.nextInt(2) == 0)
|
||||
generateLoreBook(world, box, 12 - 2, 1, 3, 1, HbmChestContents.generateOfficeBook(rand));
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public static class NTMWorkshop1 extends Component {
|
||||
|
||||
private static SuperConcrete RandomSuperConcrete = new SuperConcrete();
|
||||
|
||||
private boolean hasPlacedLoot;
|
||||
|
||||
public NTMWorkshop1() {
|
||||
|
||||
public static class RuralHouse1 extends Component {
|
||||
|
||||
public RuralHouse1() {
|
||||
super();
|
||||
}
|
||||
|
||||
public NTMWorkshop1(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 10, 6, 8);
|
||||
this.hasPlacedLoot = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_143012_a(NBTTagCompound nbt) {
|
||||
super.func_143012_a(nbt);
|
||||
nbt.setBoolean("hasLoot", this.hasPlacedLoot);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_143011_b(NBTTagCompound nbt) {
|
||||
super.func_143011_b(nbt);
|
||||
this.hasPlacedLoot = nbt.getBoolean("hasLoot");
|
||||
|
||||
public RuralHouse1(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 14, 8, 14);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
////System.out.println(this.coordBaseMode);
|
||||
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 0, 8 - 3, 11, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.dirt, 0, 8, 1, 10, 6, -1, box);
|
||||
|
||||
this.fillWithAir(world, box, 1, 0, 0, 10 - 3, 6 - 2, 8);
|
||||
this.fillWithAir(world, box, 10 - 2, 0, 2, 10 - 1, 2, 5);
|
||||
|
||||
if(this.getBlockAtCurrentPosition(world, 0, 0, 5, box).getMaterial().isReplaceable()
|
||||
|| this.getBlockAtCurrentPosition(world, 0, 0, 5, box) == Blocks.air) {
|
||||
int stairMeta = this.getMetadataWithOffset(Blocks.stone_brick_stairs, 1);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.stone_brick_stairs, stairMeta, 0, 0, 5, box);
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 1, 0, 8 - 1, -1, box);
|
||||
|
||||
this.fillWithMetadataBlocks(world, box, 0, 0, 1, 0, 0, 8 - 1, Blocks.stone_slab, 5, Blocks.air, 0, false);
|
||||
}
|
||||
|
||||
//Walls
|
||||
int pillarMetaWE = this.getPillarMeta(4);
|
||||
int pillarMetaNS = this.getPillarMeta(8);
|
||||
this.fillWithBlocks(world, box, 1, 0, 0, 1, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, 0, box);
|
||||
this.fillWithMetadataBlocks(world, box, 2, 4, 0, 10 - 4, 4, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 10 - 3, 4, 0, box);
|
||||
this.fillWithBlocks(world, box, 10 - 3, 0, 0, 10 - 3, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 0, 0, 10 - 4, 1, 0, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 2, 0, 2, 2, 0, false, rand, RandomSuperConcrete);
|
||||
this.fillWithBlocks(world, box, 3, 2, 0, 5, 2, 0, ModBlocks.reinforced_glass, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 10 - 4, 2, 0, 10 - 4, 2, 0, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 3, 0, 10 - 4, 3, 0, false, rand, RandomSuperConcrete);
|
||||
this.fillWithMetadataBlocks(world, box, 1, 4, 1, 1, 4, 8 - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Left Wall
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 1, 4, 8, box);
|
||||
this.fillWithBlocks(world, box, 1, 0, 8, 1, 3, 8, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 0, 1, 1, 1, 4, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 2, 1, 1, 2, 1, false, rand, RandomSuperConcrete);
|
||||
this.fillWithBlocks(world, box, 1, 2, 2, 1, 2, 3, ModBlocks.reinforced_glass, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 2, 4, 1, 2, 4, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 3, 1, 1, 3, 8 - 1, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 0, 8 - 2, 1, 3, 8 - 1, false, rand, RandomSuperConcrete);
|
||||
this.fillWithMetadataBlocks(world, box, 2, 4, 8, 10 - 4, 4, 8, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false); //Front Wall
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.concrete, 0, 10 - 3, 4, 8, box);
|
||||
this.fillWithBlocks(world, box, 10 - 3, 0, 8, 10 - 3, 3, 8, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 0, 8, 10 - 4, 1, 8, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 2, 8, 2, 2, 8, false, rand, RandomSuperConcrete);
|
||||
this.fillWithBlocks(world, box, 3, 2, 8, 5, 2, 8, ModBlocks.reinforced_glass, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 10 - 4, 2, 8, 10 - 4, 2, 8, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 3, 8, 10 - 4, 3, 8, false, rand, RandomSuperConcrete);
|
||||
this.fillWithMetadataBlocks(world, box, 10 - 3, 4, 1, 10 - 3, 4, 8 - 1, ModBlocks.concrete_pillar, pillarMetaNS, Blocks.air, 0, false); //Right Wall
|
||||
this.fillWithRandomizedBlocks(world, box, 10 - 3, 0, 1, 10 - 3, 3, 8 - 1, false, rand, RandomSuperConcrete);
|
||||
|
||||
pillarMetaWE = this.getPillarMeta(5);
|
||||
pillarMetaNS = this.getPillarMeta(9);
|
||||
this.fillWithMetadataBlocks(world, box, 10 - 2, 2, 1, 10 - 1, 2, 1, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Back Wall
|
||||
this.fillWithMetadataBlocks(world, box, 10, 0, 1, 10, 2, 1, Blocks.log, 1, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 10 - 2, 0, 1, 10 - 1, 1, 1, Blocks.planks, 1, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 10, 2, 2, 10, 2, 5, Blocks.log, pillarMetaNS, Blocks.air, 0, false); //Right Wall
|
||||
this.fillWithMetadataBlocks(world, box, 10, 0, 6, 10, 2, 6, Blocks.log, 1, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 10, 0, 3, 10, 1, 5, Blocks.planks, 1, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 10 - 2, 2, 6, 10 - 1, 2, 6, Blocks.log, pillarMetaWE, Blocks.air, 0, false); //Front Wall
|
||||
this.fillWithMetadataBlocks(world, box, 10 - 2, 0, 6, 10 - 1, 1, 6, Blocks.planks, 1, Blocks.air, 0, false);
|
||||
|
||||
//Floor & Ceiling
|
||||
this.fillWithBlocks(world, box, 2, 0, 1, 6, 0, 8 - 1, ModBlocks.brick_light, Blocks.air, false); //Floor
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.brick_light, 0, 1, 0, 5, box);
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 4, 1, 6, 4, 3, false, rand, RandomSuperConcrete); //Ceiling
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 4, 4, 2, 4, 4, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 5, 4, 4, 6, 4, 4, false, rand, RandomSuperConcrete);
|
||||
this.fillWithRandomizedBlocks(world, box, 2, 4, 8 - 3, 6, 4, 8 - 1, false, rand, RandomSuperConcrete);
|
||||
|
||||
this.fillWithBlocks(world, box, 10 - 2, 2, 2, 10 - 1, 2, 5, ModBlocks.deco_steel, Blocks.air, false);
|
||||
|
||||
//Loot & Decorations
|
||||
int southMeta = this.getDecoMeta(2);
|
||||
int eastMeta = this.getDecoMeta(5);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.pole_satellite_receiver, eastMeta, 2, 6 - 1, 1, box);
|
||||
this.fillWithBlocks(world, box, 3, 6 - 1, 1, 4, 6 - 1, 1, ModBlocks.deco_steel, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 2, 6 - 1, 2, 4, 6 - 1, 2, ModBlocks.deco_steel, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 2, 6, 1, 4, 6, 2, ModBlocks.steel_roof, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 2, 1, 1, 2, 3, 1, ModBlocks.deco_red_copper, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 3, 1, 1, 3, 1, 2, ModBlocks.deco_beryllium, Blocks.air, false);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.machine_amgen, 0, 4, 1, 1, box);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.machine_detector, 0, 4, 1, 2, box);
|
||||
this.fillWithBlocks(world, box, 5, 1, 1, 5, 1, 2, ModBlocks.deco_beryllium, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 6, 1, 1, 6, 3, 1, ModBlocks.deco_red_copper, Blocks.air, false);
|
||||
this.fillWithBlocks(world, box, 3, 1, 4, 4, 1, 4, ModBlocks.concrete_super_broken, Blocks.air, false);
|
||||
this.fillWithMetadataBlocks(world, box, 6, 1, 4, 6, 3, 4, ModBlocks.steel_scaffold, eastMeta < 4 ? 0 : 8, Blocks.air, 0, false);
|
||||
this.fillWithMetadataBlocks(world, box, 6, 1, 5, 6, 1, 7, ModBlocks.steel_grate, 7, Blocks.air, 0, false);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.radiorec, eastMeta, 6, 2, 8 - 1, box);
|
||||
this.fillWithMetadataBlocks(world, box, 2, 1, 8 - 1, 3, 1, 8 - 1, ModBlocks.machine_electric_furnace_off, southMeta, Blocks.air, 0, false);
|
||||
if(!hasPlacedLoot) {
|
||||
this.hasPlacedLoot = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, 4, 1, 8 - 1, ItemPool.getPool(ItemPoolsComponent.POOL_MACHINE_PARTS), 11);
|
||||
}
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 5, 3, 1, box);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 2, 1, 2, box);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 6, 1, 2, box);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 6, 2, 5, box);
|
||||
|
||||
this.fillWithMetadataBlocks(world, box, 10 - 2, 0, 5, 10 - 1, 0, 5, ModBlocks.steel_grate, 7, Blocks.air, 0, false);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.tape_recorder, southMeta, 10 - 2, 1, 5, box);
|
||||
this.placeBlockAtCurrentPosition(world, ModBlocks.bobblehead, rand.nextInt(16), 10 - 1, 1, 5, box);
|
||||
TileEntityBobble bobble = (TileEntityBobble) world.getTileEntity(this.getXWithOffset(10 - 1, 5), this.getYWithOffset(1), this.getZWithOffset(10 - 1, 5));
|
||||
|
||||
if(bobble != null) {
|
||||
bobble.type = BobbleType.values()[rand.nextInt(BobbleType.values().length - 1) + 1];
|
||||
bobble.markDirty();
|
||||
}
|
||||
this.fillWithMetadataBlocks(world, box, 10 - 2, 0, 2, 10 - 2, 0, 3, Blocks.log, pillarMetaWE, Blocks.air, 0, false);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.log, pillarMetaWE, 10 - 2, 1, 2, box);
|
||||
this.placeBlockAtCurrentPosition(world, Blocks.web, 0, 10 - 2, 1, 3, box);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class RuralHouse1 extends Component {
|
||||
|
||||
public RuralHouse1() {
|
||||
super();
|
||||
}
|
||||
|
||||
public RuralHouse1(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 14, 8, 14);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//FillWithAir
|
||||
fillWithAir(world, box, 9, 1, 3, 12, 4, 8);
|
||||
fillWithAir(world, box, 5, 1, 2, 8, 3, 8);
|
||||
fillWithAir(world, box, 2, 1, 5, 4, 3, 8);
|
||||
fillWithAir(world, box, 2, 1, 10, 7, 3, 12);
|
||||
|
||||
|
||||
//Foundations
|
||||
fillWithBlocks(world, box, 1, 0, 4, 4, 0, 4, ModBlocks.concrete_colored_ext);
|
||||
fillWithBlocks(world, box, 4, 0, 2, 4, 0, 3, ModBlocks.concrete_colored_ext);
|
||||
@ -770,7 +619,7 @@ public class CivilianFeatures {
|
||||
placeFoundationUnderneath(world, ModBlocks.concrete_colored_ext, 0, 1, 10, 8, 13, -1, box);
|
||||
placeFoundationUnderneath(world, ModBlocks.concrete_colored_ext, 0, 1, 4, 3, 9, -1, box);
|
||||
placeFoundationUnderneath(world, ModBlocks.concrete_colored_ext, 0, 4, 1, 13, 9, -1, box);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.log, 0, 2, 3, 2, 3, 0, box);
|
||||
placeFoundationUnderneath(world, Blocks.log, 0, 3, 2, 3, 2, 0, box);
|
||||
placeFoundationUnderneath(world, Blocks.log, 0, 3, 0, 3, 0, -1, box);
|
||||
@ -793,7 +642,7 @@ public class CivilianFeatures {
|
||||
placeFoundationUnderneath(world, Blocks.log, 0, 0, 6, 0, 7, 0, box);
|
||||
placeFoundationUnderneath(world, Blocks.log, 0, 0, 4, 0, 4, 0, box);
|
||||
placeFoundationUnderneath(world, Blocks.log, 0, 0, 3, 0, 4, -1, box);
|
||||
|
||||
|
||||
//Walls
|
||||
//North/Front
|
||||
fillWithBlocks(world, box, 1, 1, 4, 4, 4, 4, Blocks.brick_block);
|
||||
@ -856,7 +705,7 @@ public class CivilianFeatures {
|
||||
//North/Front
|
||||
int logW = this.getPillarMeta(4);
|
||||
int logN = this.getPillarMeta(8);
|
||||
|
||||
|
||||
fillWithBlocks(world, box, 0, 0, 3, 0, 3, 3, Blocks.log);
|
||||
fillWithMetadataBlocks(world, box, 1, 4, 3, 3, 4, 3, Blocks.log, logW);
|
||||
fillWithMetadataBlocks(world, box, 3, 4, 1, 3, 4, 2, Blocks.log, logN);
|
||||
@ -903,12 +752,12 @@ public class CivilianFeatures {
|
||||
placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 0, 3, 10, box);
|
||||
placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 0, 3, 8, box);
|
||||
placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 9, 0, 3, 4, box);
|
||||
|
||||
|
||||
int stairW = this.getStairMeta(0);
|
||||
int stairE = this.getStairMeta(1);
|
||||
int stairN = this.getStairMeta(2);
|
||||
int stairS = this.getStairMeta(3);
|
||||
|
||||
|
||||
//Floor
|
||||
placeBlockAtCurrentPosition(world, Blocks.planks, 1, 11, 0, 2, box);
|
||||
fillWithMetadataBlocks(world, box, 9, 0, 3, 12, 0, 8, Blocks.planks, 1);
|
||||
@ -930,7 +779,7 @@ public class CivilianFeatures {
|
||||
fillWithMetadataBlocks(world, box, 10 + i, 0, 13 - i, 11 + i, 0, 13 - i, Blocks.planks, 1);
|
||||
fillWithBlocks(world, box, 10 + i, 1, 13 - i, 11 + i, 1, 13 - i, Blocks.fence);
|
||||
}
|
||||
|
||||
|
||||
//Ceiling
|
||||
fillWithMetadataBlocks(world, box, 12, 4, 3, 12, 4, 8, Blocks.oak_stairs, stairW | 4);
|
||||
fillWithBlocks(world, box, 12, 5, 3, 12, 5, 8, Blocks.planks);
|
||||
@ -940,7 +789,7 @@ public class CivilianFeatures {
|
||||
fillWithBlocks(world, box, 8, 4, 5, 8, 4, 8, Blocks.planks);
|
||||
fillWithBlocks(world, box, 5, 4, 2, 8, 4, 4, Blocks.planks);
|
||||
fillWithBlocks(world, box, 1, 4, 5, 7, 4, 12, Blocks.planks);
|
||||
|
||||
|
||||
//Roofing
|
||||
//Framing
|
||||
placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW, 1, 5, 3, box);
|
||||
@ -998,11 +847,11 @@ public class CivilianFeatures {
|
||||
placeBlockAtCurrentPosition(world, Blocks.spruce_stairs, stairW | 4, 7 - i, 5 + i, z, box);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Main (LEFT)
|
||||
BrokenStairs roofStairs = new BrokenStairs();
|
||||
BrokenBlocks roofBlocks = new BrokenBlocks();
|
||||
|
||||
|
||||
roofStairs.setMetadata(stairW);
|
||||
fillWithBlocks(world, box, 4, 5, 1, 7, 5, 1, Blocks.wooden_slab);
|
||||
fillWithRandomizedBlocks(world, box, 4, 5, 2, 7, 5, 3, rand, roofBlocks); //TODO separate into stair/slab/block block selectors
|
||||
@ -1026,11 +875,11 @@ public class CivilianFeatures {
|
||||
fillWithRandomizedBlocks(world, box, 3, 7, 10, 3, 7, 13, rand, roofStairs);
|
||||
fillWithRandomizedBlocks(world, box, 2, 6, 4, 2, 6, 13, rand, roofStairs);
|
||||
fillWithRandomizedBlocks(world, box, 1, 5, 4, 1, 5, 13, rand, roofStairs);
|
||||
|
||||
|
||||
//Deco
|
||||
int metaN = getDecoMeta(3);
|
||||
int metaE = getDecoMeta(4);
|
||||
|
||||
|
||||
//Webs
|
||||
randomlyFillWithBlocks(world, box, rand, 0.05F, 12, 3, 3, 12, 3, 8, Blocks.web);
|
||||
randomlyFillWithBlocks(world, box, rand, 0.05F, 10, 4, 3, 11, 4, 8, Blocks.web);
|
||||
@ -1085,7 +934,7 @@ public class CivilianFeatures {
|
||||
placeBlockAtCurrentPosition(world, ModBlocks.steel_wall, metaN, 3, 3, 6, box);
|
||||
placeBlockAtCurrentPosition(world, ModBlocks.radiorec, getDecoMeta(2), 8, 2, 2, box);
|
||||
placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 7, 2, 4, box);
|
||||
|
||||
|
||||
fillWithBlocks(world, box, 2, 1, 12, 3, 1, 12, Blocks.bookshelf); //bookshelf/desk
|
||||
placeBlockAtCurrentPosition(world, Blocks.oak_stairs, stairE | 4, 4, 1, 12, box);
|
||||
placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 8, 5, 1, 12, box);
|
||||
@ -1095,7 +944,7 @@ public class CivilianFeatures {
|
||||
placeBed(world, box, 1, 3, 1, 10);
|
||||
placeBlockAtCurrentPosition(world, Blocks.flower_pot, 0, 4, 2, 12, box);
|
||||
placeBlockAtCurrentPosition(world, ModBlocks.deco_computer, getDecoModelMeta(0), 5, 2, 12, box);
|
||||
|
||||
|
||||
fillWithMetadataBlocks(world, box, 4, 5, 5, 5, 5, 5, Blocks.dark_oak_stairs, stairS | 4); //seat and desk
|
||||
placeBlockAtCurrentPosition(world, Blocks.wooden_slab, 1, 4, 5, 6, box);
|
||||
placeBlockAtCurrentPosition(world, ModBlocks.crate_can, 0, 7, 5, 7, box); //conserve crates
|
||||
@ -1104,7 +953,7 @@ public class CivilianFeatures {
|
||||
if(rand.nextBoolean())
|
||||
placeBlockAtCurrentPosition(world, ModBlocks.machine_diesel, metaE, 7, 5, 9, box);
|
||||
placeBlockAtCurrentPosition(world, rand.nextBoolean() ? ModBlocks.crate_weapon : ModBlocks.crate, 0, 6, 5, 12, box);
|
||||
|
||||
|
||||
//inventories
|
||||
generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(2), 7, 1, 10, ItemPool.getPool(ItemPoolsComponent.POOL_OFFICE_TRASH), 4);
|
||||
generateInvContents(world, box, rand, Blocks.chest, metaE, 7, 5, 5, ItemPool.getPool(ItemPoolsLegacy.POOL_GENERIC), 8);
|
||||
@ -1114,10 +963,10 @@ public class CivilianFeatures {
|
||||
placeBlockAtCurrentPosition(world, ModBlocks.deco_loot, 0, 5, 6, 5, box);
|
||||
LootGenerator.lootMakeshiftGun(world, getXWithOffset(5, 5), getYWithOffset(6), getZWithOffset(5, 5));
|
||||
placeRandomBobble(world, box, rand, 5, 5, 12);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//i don't like this class
|
||||
public static class BrokenStairs extends BlockSelector {
|
||||
//man.
|
||||
@ -1129,11 +978,11 @@ public class CivilianFeatures {
|
||||
public int getSelectedBlockMetaData() {
|
||||
return this.field_151562_a instanceof BlockStairs ? this.selectedBlockMetaData : 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) {
|
||||
float chance = rand.nextFloat();
|
||||
|
||||
|
||||
if(chance < 0.7)
|
||||
this.field_151562_a = Blocks.oak_stairs;
|
||||
else if(chance < 0.97)
|
||||
@ -1142,14 +991,14 @@ public class CivilianFeatures {
|
||||
this.field_151562_a = Blocks.air;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//this fucking sucks. i am racist against the blockselector class
|
||||
public static class BrokenBlocks extends BlockSelector {
|
||||
|
||||
|
||||
@Override
|
||||
public void selectBlocks(Random rand, int posX, int posY, int posZ, boolean notInterior) {
|
||||
float chance = rand.nextFloat();
|
||||
|
||||
|
||||
if(chance < 0.6) {
|
||||
this.field_151562_a = Blocks.planks;
|
||||
this.selectedBlockMetaData = 0;
|
||||
|
||||
BIN
src/main/resources/assets/hbm/structures/lighthouse.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/lighthouse.nbt
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user