fuckn road stipes bitches!

This commit is contained in:
boy0001 2014-09-23 21:12:25 +10:00
parent fd823d2910
commit 3c39c6d6e6
3 changed files with 236 additions and 83 deletions

View File

@ -114,14 +114,14 @@ public class PlotWorld {
*/
public static String WALL_FILLING_DEFAULT = "1:0";
// /**
// * Road stripes
// */
// public int ROAD_STRIPES;
// /**
// * Default road stripes: 35
// */
// public static int ROAD_STRIPES_DEFAULT = 35;
/**
* Road stripes
*/
public String ROAD_STRIPES;
/**
* Default road stripes: 35
*/
public static String ROAD_STRIPES_DEFAULT = "98:0";
//
// /**
// * Road stripes data value (byte)

View File

@ -81,7 +81,7 @@ public class WorldGenerator extends ChunkGenerator {
options.put("worlds."+world+".road_width", ROAD_WIDTH_DEFAULT);
options.put("worlds."+world+".road_height", ROAD_HEIGHT_DEFAULT);
options.put("worlds."+world+".road_block", ROAD_BLOCK_DEFAULT);
// options.put("worlds."+world+".road_stripes", ROAD_STRIPES_DEFAULT);
options.put("worlds."+world+".road_stripes", ROAD_STRIPES_DEFAULT);
options.put("worlds."+world+".wall_filling", WALL_FILLING_DEFAULT);
options.put("worlds."+world+".wall_height", WALL_HEIGHT_DEFAULT);
options.put("worlds."+world+".schematic_on_claim", SCHEMATIC_ON_CLAIM_DEFAULT);
@ -107,7 +107,7 @@ public class WorldGenerator extends ChunkGenerator {
plotworld.ROAD_WIDTH = config.getInt("worlds."+world+".road_width");
plotworld.ROAD_HEIGHT = config.getInt("worlds."+world+".road_height");
plotworld.ROAD_BLOCK = config.getString("worlds."+world+".road_block");
// plotworld.ROAD_STRIPES = config.getInt("worlds."+world+".road_stripes");
plotworld.ROAD_STRIPES = config.getString("worlds."+world+".road_stripes");
plotworld.WALL_FILLING = config.getString("worlds."+world+".wall_filling");
plotworld.WALL_HEIGHT = config.getInt("worlds."+world+".wall_height");
plotworld.PLOT_CHAT = config.getBoolean("worlds."+world+".plot_chat");
@ -132,7 +132,7 @@ public class WorldGenerator extends ChunkGenerator {
bottom = (short) Material.BEDROCK.getId();
floor1 = getBlock(plotworld.ROAD_BLOCK);
// floor2 = getBlock(plotworld.ROAD_STRIPES);
floor2 = getBlock(plotworld.ROAD_STRIPES);
wallfilling = getBlock(plotworld.WALL_FILLING);
size = pathsize + plotsize;
wall = getBlock(plotworld.WALL_BLOCK);
@ -229,6 +229,82 @@ public class WorldGenerator extends ChunkGenerator {
setCuboidRegion(Math.max(start,0), Math.min(16,end), 1, roadheight+1, 0, 16, floor1);
}
// FUCK'N ROAD STRIPES
if (pathsize>4) {
if ((plotMinZ+2)%size<=16) {
double value = (plotMinZ+2)%size;
double start,end;
if (plotMinX+2<=16)
start = 16-plotMinX-1;
else
start = 16;
if (roadStartX-1<=16)
end = 16-roadStartX+1;
else
end = 0;
if (!(plotMinX+2<=16||roadStartX-1<=16)) {
start = 0;
}
setCuboidRegion(0, end, 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) {
double value = (plotMinX+2)%size;
double start,end;
if (plotMinZ+2<=16)
start = 16-plotMinZ-1;
else
start = 16;
if (roadStartZ-1<=16)
end = 16-roadStartZ+1;
else
end = 0;
if (!(plotMinZ+2<=16||roadStartZ-1<=16)) {
start = 0;
}
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 (plotMinX+2<=16)
start = 16-plotMinX-1;
else
start = 16;
if (roadStartX-1<=16)
end = 16-roadStartX+1;
else
end = 0;
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); //
}
if (roadStartX<=16&&roadStartX>0) {
double val = roadStartX;
if (val==0)
val+=16-pathsize+2;
double start,end;
if (plotMinZ+2<=16)
start = 16-plotMinZ-1;
else
start = 16;
if (roadStartZ-1<=16)
end = 16-roadStartZ+1;
else
end = 0;
if (!(plotMinZ+2<=16||roadStartZ-1<=16)) {
start = 0;
}
setCuboidRegion(16-val+1, 16-val+2, wallheight, wallheight+1, 0, end, floor2); //
setCuboidRegion(16-val+1, 16-val+2, wallheight, wallheight+1, start, 16, floor2); //
}
}
// Plot filling (28/28 cuboids) (10x2 + 4x2)
if (plotsize>16) {
if (roadStartX<=16) {

View File

@ -56,9 +56,9 @@ public class XPopulator extends BlockPopulator {
int roadheight = plotworld.ROAD_HEIGHT;
int plotheight = plotworld.PLOT_HEIGHT;
int size = pathsize + plotsize;
byte w_v, f1_v, wf_v;
byte w_v, f1_v, wf_v, f2_v;
short w_id, f1_id, wf_id;
short w_id, f1_id, wf_id, f2_id;
// WALL
short[] result_w = getBlock(plotworld.WALL_BLOCK);
@ -77,8 +77,9 @@ public class XPopulator extends BlockPopulator {
//
// Floor 2
// f2_id = (short) Settings.ROAD_STRIPES;
// f2_v = (byte) Settings.ROAD_STRIPES_DATA;
short[] result_f2 = getBlock(plotworld.ROAD_STRIPES);
f2_id = result_f1[0];
f2_v = (byte) result_f1[1];
//
int cx = c.getX(), cz = c.getZ();
@ -117,8 +118,83 @@ public class XPopulator extends BlockPopulator {
setCuboidRegion(Math.max(start,0), Math.min(16,end), 1, roadheight+1, 0, 16, f1_id, f1_v, w);
}
// WALLS
if (pathsize>4) {
if ((plotMinZ+2)%size<=16) {
int value = (plotMinZ+2)%size;
int start,end;
if (plotMinX+2<=16)
start = 16-plotMinX-1;
else
start = 16;
if (roadStartX-1<=16)
end = 16-roadStartX+1;
else
end = 0;
if (!(plotMinX+2<=16||roadStartX-1<=16)) {
start = 0;
}
setCuboidRegion(0, end, wallheight, wallheight+1, 16-value, 16-value+1, f2_id, f2_v, w); //
setCuboidRegion(start, 16, wallheight, wallheight+1, 16-value, 16-value+1, f2_id, f2_v, w); //
}
if ((plotMinX+2)%size<=16) {
int value = (plotMinX+2)%size;
int start,end;
if (plotMinZ+2<=16)
start = 16-plotMinZ-1;
else
start = 16;
if (roadStartZ-1<=16)
end = 16-roadStartZ+1;
else
end = 0;
if (!(plotMinZ+2<=16||roadStartZ-1<=16)) {
start = 0;
}
setCuboidRegion( 16-value, 16-value+1,wallheight, wallheight+1, 0, end, f2_id, f2_v, w); //
setCuboidRegion( 16-value, 16-value+1, wallheight, wallheight+1,start, 16, f2_id, f2_v, w); //
}
if (roadStartZ<=16&&roadStartZ>0) {
int val = roadStartZ;
if (val==0)
val+=16-pathsize+2;
int start,end;
if (plotMinX+2<=16)
start = 16-plotMinX-1;
else
start = 16;
if (roadStartX-1<=16)
end = 16-roadStartX+1;
else
end = 0;
if (!(plotMinX+2<=16||roadStartX-1<=16)) {
start = 0;
}
setCuboidRegion(0, end, wallheight, wallheight+1, 16-val+1, 16-val+2, f2_id, f2_v, w); //
setCuboidRegion(start, 16, wallheight, wallheight+1, 16-val+1, 16-val+2, f2_id, f2_v, w); //
}
if (roadStartX<=16&&roadStartX>0) {
int val = roadStartX;
if (val==0)
val+=16-pathsize+2;
int start,end;
if (plotMinZ+2<=16)
start = 16-plotMinZ-1;
else
start = 16;
if (roadStartZ-1<=16)
end = 16-roadStartZ+1;
else
end = 0;
if (!(plotMinZ+2<=16||roadStartZ-1<=16)) {
start = 0;
}
setCuboidRegion(16-val+1, 16-val+2, wallheight, wallheight+1, 0, end, f2_id, f2_v, w); //
setCuboidRegion(16-val+1, 16-val+2, wallheight, wallheight+1, start, 16, f2_id, f2_v, w); //
}
}
// WALLS
if (pathsize>0) {
if (plotMinZ+1<=16) {
int start,end;
if (plotMinX+2<=16)
@ -191,6 +267,7 @@ public class XPopulator extends BlockPopulator {
setCuboidRegion( 16-roadStartX, 16-roadStartX+1, 1, wallheight+1, start, 16,wf_id, wf_v, w);
setCuboidRegion( 16-roadStartX, 16-roadStartX+1,wallheight+1, wallheight+2, start, 16, w_id, w_v, w);
}
}
// TODO PLOT MAIN - How are we going to do the IDs for the actual plot if we have randomized blocks...
// - possibly on plot claiming, we could regenerate using the xpopulator