mirror of
https://github.com/chylex/Hardcore-Ender-Expansion.git
synced 2025-04-14 05:15:42 +02:00
Work on lab, removed some unnecessary files
This commit is contained in:
parent
1b82932666
commit
423bd6b29d
src
_
main/java/chylex/hee/world/structure/island/biome/feature
BIN
src/_/_10.png
BIN
src/_/_10.png
Binary file not shown.
Before ![]() (image error) Size: 3.3 KiB |
BIN
src/_/_5.png
BIN
src/_/_5.png
Binary file not shown.
Before ![]() (image error) Size: 3.3 KiB |
BIN
src/_/_6.png
BIN
src/_/_6.png
Binary file not shown.
Before ![]() (image error) Size: 3.3 KiB |
BIN
src/_/_7.png
BIN
src/_/_7.png
Binary file not shown.
Before ![]() (image error) Size: 3.3 KiB |
BIN
src/_/_8.png
BIN
src/_/_8.png
Binary file not shown.
Before ![]() (image error) Size: 3.3 KiB |
BIN
src/_/_9.png
BIN
src/_/_9.png
Binary file not shown.
Before ![]() (image error) Size: 3.3 KiB |
Binary file not shown.
Before ![]() (image error) Size: 3.3 KiB |
Binary file not shown.
Before ![]() (image error) Size: 419 B |
@ -42,6 +42,7 @@ public final class RavagedDungeonPlacer implements ITileEntityGenerator{
|
||||
|
||||
public void generateEntrance(LargeStructureWorld world, Random rand, int x, int y, int z, int maxEntranceHeight, DungeonElement entrance){
|
||||
int surfaceY = y-maxEntranceHeight-1;
|
||||
|
||||
while(++surfaceY <= y){
|
||||
if (world.getBlock(x,surfaceY,z) == IslandBiomeBase.getTopBlock())break;
|
||||
}
|
||||
|
@ -7,7 +7,7 @@ import chylex.hee.world.structure.island.biome.feature.island.laboratory.Laborat
|
||||
public class StructureLaboratory extends AbstractIslandStructure{
|
||||
@Override
|
||||
protected boolean generate(Random rand){
|
||||
LaboratoryTerrainMap map = new LaboratoryTerrainAnalyser(world).generateBestMap(rand,100);
|
||||
LaboratoryTerrainMap map = new LaboratoryTerrainAnalyser(world).generateBestMap(rand,169);
|
||||
|
||||
|
||||
return false;
|
||||
|
@ -0,0 +1,5 @@
|
||||
package chylex.hee.world.structure.island.biome.feature.island.laboratory;
|
||||
|
||||
public final class LaboratoryGenerator{
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package chylex.hee.world.structure.island.biome.feature.island.laboratory;
|
||||
import java.util.Random;
|
||||
import net.minecraft.init.Blocks;
|
||||
import chylex.hee.block.BlockList;
|
||||
import chylex.hee.world.structure.util.pregen.LargeStructureWorld;
|
||||
|
||||
public class LaboratoryPlacer{
|
||||
public void generateSmallRoom(LargeStructureWorld world, Random rand, int x, int y, int z){
|
||||
// floor and ceiling
|
||||
|
||||
for(int a = 0; a < 5; a++){
|
||||
for(int px = 0; px < 7; px++){
|
||||
world.setBlock(x-3+px,y,z-2+a,BlockList.obsidian_special);
|
||||
world.setBlock(x-3+px,y+4,z-2+a,Blocks.obsidian);
|
||||
}
|
||||
|
||||
for(int pz = 0; pz < 2; pz++){
|
||||
world.setBlock(x-2+a,y,z-3+pz*2,BlockList.obsidian_special);
|
||||
world.setBlock(x-2+a,y+4,z-3+pz*2,Blocks.obsidian);
|
||||
}
|
||||
}
|
||||
|
||||
// walls
|
||||
|
||||
for(int py = 0; py < 4; py++){
|
||||
for(int px = 0; px < 2; px++){
|
||||
for(int pz = 0; pz < 2; pz++){
|
||||
world.setBlock(x-3+px*6,y+py,z-3+pz*6,Blocks.obsidian);
|
||||
}
|
||||
}
|
||||
|
||||
for(int a = 0; a < 5; a++){
|
||||
for(int b = 0; b < 2; b++){
|
||||
world.setBlock(x-3+b*6,y+py,z-2+a,py == 1 && a >= 1 && a <= 3 ? BlockList.laboratory_glass : Blocks.obsidian);
|
||||
world.setBlock(x-2+a,y+py,z-3+b*6,py == 1 && a >= 1 && a <= 3 ? BlockList.laboratory_glass : Blocks.obsidian);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// fill in the bottom
|
||||
|
||||
for(int px = 0; px < 7; px++){
|
||||
for(int pz = 0; pz < 7; pz++){
|
||||
for(int py = -1; py > -5; py--){
|
||||
if (world.isAir(x-3+px,y+py,z-3+pz) && !world.isAir(x-3+px,y+py+1,z-3+pz)){
|
||||
world.setBlock(x-3+px,y+py,z-3+pz,Blocks.obsidian);
|
||||
}
|
||||
else break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO fill the inside with air
|
||||
}
|
||||
|
||||
public void generateLargeRoom(LargeStructureWorld world, Random rand, int x, int y, int z){
|
||||
|
||||
}
|
||||
}
|
@ -13,8 +13,8 @@ public final class LaboratoryTerrainAnalyser{
|
||||
LaboratoryTerrainMap bestMap = new LaboratoryTerrainMap(world,rand,0,0);
|
||||
if (bestMap.getScore() >= scoreThreshold)return bestMap;
|
||||
|
||||
for(int x = 0; x < 16; x += 2){
|
||||
for(int z = 0; z < 16; z += 2){
|
||||
for(int x = 0; x < 16; x += 4){
|
||||
for(int z = 0; z < 16; z += 4){
|
||||
LaboratoryTerrainMap map = new LaboratoryTerrainMap(world,rand,x,z);
|
||||
if (map.getScore() > bestMap.getScore() && (bestMap = map).getScore() >= scoreThreshold)return bestMap;
|
||||
}
|
||||
|
@ -151,10 +151,9 @@ public class LaboratoryTerrainMap{
|
||||
}
|
||||
|
||||
if ((float)mostFrequentYAmount/(blockSize*blockSize) < 0.4D)return node.setUnusable();
|
||||
if (maxY-mostFrequentY > 3)return node.setUnusable();
|
||||
if (maxY-mostFrequentY > 2)return node.setUnusable();
|
||||
|
||||
node.setMostFrequentY(mostFrequentY);
|
||||
return node;
|
||||
return node.setMostFrequentY(mostFrequentY);
|
||||
}
|
||||
|
||||
public int getScore(){
|
||||
|
@ -36,12 +36,24 @@ public final class LaboratoryTerrainNode{
|
||||
return mostFrequentY;
|
||||
}
|
||||
|
||||
public void tryConnect(LaboratoryTerrainNode node, int direction){
|
||||
if (!node.unusable && Math.abs(mostFrequentY-node.mostFrequentY) < 4)connections[direction] = true;
|
||||
}
|
||||
|
||||
public LaboratoryTerrainNode setConnectionAvailable(int direction, boolean available){
|
||||
connections[direction] = available;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean checkConnection(int direction){
|
||||
return connections[direction];
|
||||
}
|
||||
|
||||
public boolean hasNoAvailableConnections(){
|
||||
return !connections[0] && !connections[1] && !connections[2] && !connections[3];
|
||||
}
|
||||
|
||||
public int getConnectionAmount(){
|
||||
return (connections[0] ? 1 : 0)+(connections[1] ? 1 : 0)+(connections[2] ? 1 : 0)+(connections[3] ? 1 : 0);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user