mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-21 20:56:45 +01:00
Whatever... WorldGeneration sucks.
This commit is contained in:
parent
6f1572e5d2
commit
c07634acc6
13
.classpath
Normal file
13
.classpath
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="PlotSquared/src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/BarAPI.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/bukkit-1.7.9-R0.2.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/CameraAPI.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/PlotMe.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/simple-5.1.6.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/simple-xml.jar"/>
|
||||
<classpathentry kind="lib" path="C:/Users/Jesse Boyd/Desktop/plugins/plot_lib/lib/WorldEdit.jar"/>
|
||||
<classpathentry kind="output" path="bin"/>
|
||||
</classpath>
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,4 +9,5 @@
|
||||
*.ear
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
hs_err_pid*
|
||||
/bin
|
||||
|
17
.project
Normal file
17
.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>plot_new</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -23,14 +23,14 @@ import static com.intellectualcrafters.plot.PlotWorld.*;
|
||||
*/
|
||||
public class WorldGenerator extends ChunkGenerator {
|
||||
short[][] result;
|
||||
double plotsize;
|
||||
double pathsize;
|
||||
int plotsize;
|
||||
int pathsize;
|
||||
short bottom;
|
||||
short wall;
|
||||
short wallfilling;
|
||||
short floor1;
|
||||
short floor2;
|
||||
double size;
|
||||
int size;
|
||||
Biome biome;
|
||||
int roadheight;
|
||||
int wallheight;
|
||||
@ -164,9 +164,9 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
return new Location(world, 0, PlotMain.getWorldSettings(world).ROAD_HEIGHT + 2, 0);
|
||||
}
|
||||
|
||||
public void setCuboidRegion(double x1,double x2, int y1, int y2, double z1, double z2, short id) {
|
||||
for (double x = x1; x < x2; x++) {
|
||||
for (double z = z1; z < z2; z++) {
|
||||
public void setCuboidRegion(int x1,int x2, int y1, int y2, int z1, int z2, short id) {
|
||||
for (int x = x1; x < x2; x++) {
|
||||
for (int z = z1; z < z2; z++) {
|
||||
for (int y = y1; y < y2; y++) {
|
||||
setBlock(result, (int) x, y, (int) z, id);
|
||||
}
|
||||
@ -188,12 +188,12 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
cx+=((-cx)*(size));
|
||||
if (cz<0)
|
||||
cz+=((-cz)*(size));
|
||||
double absX = (cx*16+16-pathWidthLower-1+8*size);
|
||||
double absZ = (cz*16+16-pathWidthLower-1+8*size);
|
||||
double plotMinX = (((absX)%size));
|
||||
double plotMinZ = (((absZ)%size));
|
||||
double roadStartX = (plotMinX + pathsize);
|
||||
double roadStartZ = (plotMinZ + pathsize);
|
||||
int absX = (int) (cx*16+16-pathWidthLower-1+8*size);
|
||||
int absZ = (int) (cz*16+16-pathWidthLower-1+8*size);
|
||||
int plotMinX = (((absX)%size));
|
||||
int plotMinZ = (((absZ)%size));
|
||||
int roadStartX = (plotMinX + pathsize);
|
||||
int roadStartZ = (plotMinZ + pathsize);
|
||||
if (roadStartX>=size)
|
||||
roadStartX-=size;
|
||||
if (roadStartZ>=size)
|
||||
@ -223,11 +223,11 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
setCuboidRegion(Math.max(start,0), Math.min(16,end), 1, roadheight+1, 0, 16, floor1);
|
||||
}
|
||||
|
||||
// FUCK'N ROAD STRIPES
|
||||
// ROAD STRIPES
|
||||
if (pathsize>4) {
|
||||
if ((plotMinZ+2)%size<=16) {
|
||||
double value = (plotMinZ+2)%size;
|
||||
double start,end;
|
||||
if ((plotMinZ+2)<=16) {
|
||||
int value = (plotMinZ+2);
|
||||
int start,end;
|
||||
if (plotMinX+2<=16)
|
||||
start = 16-plotMinX-1;
|
||||
else
|
||||
@ -243,8 +243,8 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
setCuboidRegion(start, 16, wallheight, wallheight+1, 16-value, 16-value+1, floor2); //
|
||||
}
|
||||
if ((plotMinX+2)%size<=16) {
|
||||
double value = (plotMinX+2)%size;
|
||||
double start,end;
|
||||
int value = (plotMinX+2)%size;
|
||||
int start,end;
|
||||
if (plotMinZ+2<=16)
|
||||
start = 16-plotMinZ-1;
|
||||
else
|
||||
@ -259,11 +259,11 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
setCuboidRegion( 16-value, 16-value+1,wallheight, wallheight+1, 0, end, floor2); //
|
||||
setCuboidRegion( 16-value, 16-value+1, wallheight, wallheight+1,start, 16, floor2); //
|
||||
}
|
||||
if (roadStartZ<=16&&roadStartZ>0) {
|
||||
double val = roadStartZ;
|
||||
if (val==0)
|
||||
val+=16-pathsize+2;
|
||||
double start,end;
|
||||
if (roadStartZ<=16&&roadStartZ>1) {
|
||||
int val = roadStartZ;
|
||||
// if (val==0)
|
||||
// val+=16-pathsize+2;
|
||||
int start,end;
|
||||
if (plotMinX+2<=16)
|
||||
start = 16-plotMinX-1;
|
||||
else
|
||||
@ -275,14 +275,14 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
if (!(plotMinX+2<=16||roadStartX-1<=16)) {
|
||||
start = 0;
|
||||
}
|
||||
setCuboidRegion(0, end, wallheight, wallheight+1, 16-val+1, 16-val+2, floor2); //
|
||||
setCuboidRegion(start, 16, wallheight, wallheight+1, 16-val+1, 16-val+2, floor2); //
|
||||
setCuboidRegion(0, end, wallheight, wallheight+1, 16-val+1, 16-val+2, floor2);
|
||||
setCuboidRegion(start, 16, wallheight, wallheight+1, 16-val+1, 16-val+2, floor2);
|
||||
}
|
||||
if (roadStartX<=16&&roadStartX>0) {
|
||||
double val = roadStartX;
|
||||
int val = roadStartX;
|
||||
if (val==0)
|
||||
val+=16-pathsize+2;
|
||||
double start,end;
|
||||
int start,end;
|
||||
if (plotMinZ+2<=16)
|
||||
start = 16-plotMinZ-1;
|
||||
else
|
||||
@ -403,7 +403,7 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
// WALLS (16/16 cuboids)
|
||||
if (pathsize>0) {
|
||||
if (plotMinZ+1<=16) {
|
||||
double start,end;
|
||||
int start,end;
|
||||
if (plotMinX+2<=16)
|
||||
start = 16-plotMinX-1;
|
||||
else
|
||||
@ -421,7 +421,7 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
setCuboidRegion(start, 16, wallheight+1, wallheight+2, 16-plotMinZ-1, 16-plotMinZ, wall);
|
||||
}
|
||||
if (plotMinX+1<=16) {
|
||||
double start,end;
|
||||
int start,end;
|
||||
if (plotMinZ+2<=16)
|
||||
start = 16-plotMinZ-1;
|
||||
else
|
||||
@ -439,7 +439,7 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
setCuboidRegion( 16-plotMinX-1, 16-plotMinX, wallheight+1, wallheight+2,start, 16, wall);
|
||||
}
|
||||
if (roadStartZ<=16&&roadStartZ>0) {
|
||||
double start,end;
|
||||
int start,end;
|
||||
if (plotMinX+1<=16)
|
||||
start = 16-plotMinX;
|
||||
else
|
||||
@ -457,7 +457,7 @@ public class WorldGenerator extends ChunkGenerator {
|
||||
setCuboidRegion(start, 16, wallheight+1, wallheight+2, 16-roadStartZ, 16-roadStartZ+1, wall);
|
||||
}
|
||||
if (roadStartX<=16&&roadStartX>0) {
|
||||
double start,end;
|
||||
int start,end;
|
||||
if (plotMinZ+1<=16)
|
||||
start = 16-plotMinZ;
|
||||
else
|
||||
|
@ -54,7 +54,7 @@ public class XPopulator extends BlockPopulator {
|
||||
int pathsize = plotworld.ROAD_WIDTH;
|
||||
int wallheight = plotworld.WALL_HEIGHT;
|
||||
int roadheight = plotworld.ROAD_HEIGHT;
|
||||
int plotheight = plotworld.PLOT_HEIGHT;
|
||||
// int plotheight = plotworld.PLOT_HEIGHT;
|
||||
int size = pathsize + plotsize;
|
||||
byte w_v, f1_v, wf_v, f2_v;
|
||||
|
||||
@ -78,7 +78,7 @@ public class XPopulator extends BlockPopulator {
|
||||
|
||||
// Floor 2
|
||||
short[] result_f2 = getBlock(plotworld.ROAD_STRIPES);
|
||||
f2_id = result_f1[0];
|
||||
f2_id = result_f2[0];
|
||||
f2_v = (byte) result_f1[1];
|
||||
//
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user