Whatever... WorldGeneration sucks.

This commit is contained in:
boy0001 2014-09-23 23:01:10 +10:00
parent 6f1572e5d2
commit c07634acc6
5 changed files with 65 additions and 34 deletions

13
.classpath Normal file
View 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
View File

@ -9,4 +9,5 @@
*.ear *.ear
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml # 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
View 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>

View File

@ -23,14 +23,14 @@ import static com.intellectualcrafters.plot.PlotWorld.*;
*/ */
public class WorldGenerator extends ChunkGenerator { public class WorldGenerator extends ChunkGenerator {
short[][] result; short[][] result;
double plotsize; int plotsize;
double pathsize; int pathsize;
short bottom; short bottom;
short wall; short wall;
short wallfilling; short wallfilling;
short floor1; short floor1;
short floor2; short floor2;
double size; int size;
Biome biome; Biome biome;
int roadheight; int roadheight;
int wallheight; int wallheight;
@ -164,9 +164,9 @@ public class WorldGenerator extends ChunkGenerator {
return new Location(world, 0, PlotMain.getWorldSettings(world).ROAD_HEIGHT + 2, 0); 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) { public void setCuboidRegion(int x1,int x2, int y1, int y2, int z1, int z2, short id) {
for (double x = x1; x < x2; x++) { for (int x = x1; x < x2; x++) {
for (double z = z1; z < z2; z++) { for (int z = z1; z < z2; z++) {
for (int y = y1; y < y2; y++) { for (int y = y1; y < y2; y++) {
setBlock(result, (int) x, y, (int) z, id); setBlock(result, (int) x, y, (int) z, id);
} }
@ -188,12 +188,12 @@ public class WorldGenerator extends ChunkGenerator {
cx+=((-cx)*(size)); cx+=((-cx)*(size));
if (cz<0) if (cz<0)
cz+=((-cz)*(size)); cz+=((-cz)*(size));
double absX = (cx*16+16-pathWidthLower-1+8*size); int absX = (int) (cx*16+16-pathWidthLower-1+8*size);
double absZ = (cz*16+16-pathWidthLower-1+8*size); int absZ = (int) (cz*16+16-pathWidthLower-1+8*size);
double plotMinX = (((absX)%size)); int plotMinX = (((absX)%size));
double plotMinZ = (((absZ)%size)); int plotMinZ = (((absZ)%size));
double roadStartX = (plotMinX + pathsize); int roadStartX = (plotMinX + pathsize);
double roadStartZ = (plotMinZ + pathsize); int roadStartZ = (plotMinZ + pathsize);
if (roadStartX>=size) if (roadStartX>=size)
roadStartX-=size; roadStartX-=size;
if (roadStartZ>=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); 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 (pathsize>4) {
if ((plotMinZ+2)%size<=16) { if ((plotMinZ+2)<=16) {
double value = (plotMinZ+2)%size; int value = (plotMinZ+2);
double start,end; int start,end;
if (plotMinX+2<=16) if (plotMinX+2<=16)
start = 16-plotMinX-1; start = 16-plotMinX-1;
else else
@ -243,8 +243,8 @@ public class WorldGenerator extends ChunkGenerator {
setCuboidRegion(start, 16, wallheight, wallheight+1, 16-value, 16-value+1, floor2); // setCuboidRegion(start, 16, wallheight, wallheight+1, 16-value, 16-value+1, floor2); //
} }
if ((plotMinX+2)%size<=16) { if ((plotMinX+2)%size<=16) {
double value = (plotMinX+2)%size; int value = (plotMinX+2)%size;
double start,end; int start,end;
if (plotMinZ+2<=16) if (plotMinZ+2<=16)
start = 16-plotMinZ-1; start = 16-plotMinZ-1;
else 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, 0, end, floor2); //
setCuboidRegion( 16-value, 16-value+1, wallheight, wallheight+1,start, 16, floor2); // setCuboidRegion( 16-value, 16-value+1, wallheight, wallheight+1,start, 16, floor2); //
} }
if (roadStartZ<=16&&roadStartZ>0) { if (roadStartZ<=16&&roadStartZ>1) {
double val = roadStartZ; int val = roadStartZ;
if (val==0) // if (val==0)
val+=16-pathsize+2; // val+=16-pathsize+2;
double start,end; int start,end;
if (plotMinX+2<=16) if (plotMinX+2<=16)
start = 16-plotMinX-1; start = 16-plotMinX-1;
else else
@ -275,14 +275,14 @@ public class WorldGenerator extends ChunkGenerator {
if (!(plotMinX+2<=16||roadStartX-1<=16)) { if (!(plotMinX+2<=16||roadStartX-1<=16)) {
start = 0; start = 0;
} }
setCuboidRegion(0, end, 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); // setCuboidRegion(start, 16, wallheight, wallheight+1, 16-val+1, 16-val+2, floor2);
} }
if (roadStartX<=16&&roadStartX>0) { if (roadStartX<=16&&roadStartX>0) {
double val = roadStartX; int val = roadStartX;
if (val==0) if (val==0)
val+=16-pathsize+2; val+=16-pathsize+2;
double start,end; int start,end;
if (plotMinZ+2<=16) if (plotMinZ+2<=16)
start = 16-plotMinZ-1; start = 16-plotMinZ-1;
else else
@ -403,7 +403,7 @@ public class WorldGenerator extends ChunkGenerator {
// WALLS (16/16 cuboids) // WALLS (16/16 cuboids)
if (pathsize>0) { if (pathsize>0) {
if (plotMinZ+1<=16) { if (plotMinZ+1<=16) {
double start,end; int start,end;
if (plotMinX+2<=16) if (plotMinX+2<=16)
start = 16-plotMinX-1; start = 16-plotMinX-1;
else else
@ -421,7 +421,7 @@ public class WorldGenerator extends ChunkGenerator {
setCuboidRegion(start, 16, wallheight+1, wallheight+2, 16-plotMinZ-1, 16-plotMinZ, wall); setCuboidRegion(start, 16, wallheight+1, wallheight+2, 16-plotMinZ-1, 16-plotMinZ, wall);
} }
if (plotMinX+1<=16) { if (plotMinX+1<=16) {
double start,end; int start,end;
if (plotMinZ+2<=16) if (plotMinZ+2<=16)
start = 16-plotMinZ-1; start = 16-plotMinZ-1;
else else
@ -439,7 +439,7 @@ public class WorldGenerator extends ChunkGenerator {
setCuboidRegion( 16-plotMinX-1, 16-plotMinX, wallheight+1, wallheight+2,start, 16, wall); setCuboidRegion( 16-plotMinX-1, 16-plotMinX, wallheight+1, wallheight+2,start, 16, wall);
} }
if (roadStartZ<=16&&roadStartZ>0) { if (roadStartZ<=16&&roadStartZ>0) {
double start,end; int start,end;
if (plotMinX+1<=16) if (plotMinX+1<=16)
start = 16-plotMinX; start = 16-plotMinX;
else else
@ -457,7 +457,7 @@ public class WorldGenerator extends ChunkGenerator {
setCuboidRegion(start, 16, wallheight+1, wallheight+2, 16-roadStartZ, 16-roadStartZ+1, wall); setCuboidRegion(start, 16, wallheight+1, wallheight+2, 16-roadStartZ, 16-roadStartZ+1, wall);
} }
if (roadStartX<=16&&roadStartX>0) { if (roadStartX<=16&&roadStartX>0) {
double start,end; int start,end;
if (plotMinZ+1<=16) if (plotMinZ+1<=16)
start = 16-plotMinZ; start = 16-plotMinZ;
else else

View File

@ -54,7 +54,7 @@ public class XPopulator extends BlockPopulator {
int pathsize = plotworld.ROAD_WIDTH; int pathsize = plotworld.ROAD_WIDTH;
int wallheight = plotworld.WALL_HEIGHT; int wallheight = plotworld.WALL_HEIGHT;
int roadheight = plotworld.ROAD_HEIGHT; int roadheight = plotworld.ROAD_HEIGHT;
int plotheight = plotworld.PLOT_HEIGHT; // int plotheight = plotworld.PLOT_HEIGHT;
int size = pathsize + plotsize; int size = pathsize + plotsize;
byte w_v, f1_v, wf_v, f2_v; byte w_v, f1_v, wf_v, f2_v;
@ -78,7 +78,7 @@ public class XPopulator extends BlockPopulator {
// Floor 2 // Floor 2
short[] result_f2 = getBlock(plotworld.ROAD_STRIPES); short[] result_f2 = getBlock(plotworld.ROAD_STRIPES);
f2_id = result_f1[0]; f2_id = result_f2[0];
f2_v = (byte) result_f1[1]; f2_v = (byte) result_f1[1];
// //