|
@@ -53,7 +53,8 @@ enum RegionState
|
|
REMOVE,
|
|
REMOVE,
|
|
CORE,
|
|
CORE,
|
|
KEEP,
|
|
KEEP,
|
|
- WATERIZE
|
|
|
|
|
|
+ WATERIZE,
|
|
|
|
+ DROPPED
|
|
}
|
|
}
|
|
|
|
|
|
class CoordHolder
|
|
class CoordHolder
|
|
@@ -89,7 +90,12 @@ class CoordHolder
|
|
}
|
|
}
|
|
public class LogBlockHeatmapperRegionTrimmer
|
|
public class LogBlockHeatmapperRegionTrimmer
|
|
{
|
|
{
|
|
- static List<String> blocktypes = Arrays.asList(
|
|
|
|
|
|
+ static final int treshold = 100;
|
|
|
|
+
|
|
|
|
+ static final int buffer = 30;
|
|
|
|
+ static final int workbenchbuffer = 50;
|
|
|
|
+
|
|
|
|
+ static final List<String> blocktypes = Arrays.asList(
|
|
"minecraft:crafting_table",
|
|
"minecraft:crafting_table",
|
|
"minecraft:furnace",
|
|
"minecraft:furnace",
|
|
"minecraft:barrel",
|
|
"minecraft:barrel",
|
|
@@ -116,23 +122,16 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
);
|
|
);
|
|
|
|
|
|
//x y
|
|
//x y
|
|
- static int[ ][ ] dataField ;
|
|
|
|
-
|
|
|
|
- static Map<String,Integer> keepRegionsIn = new TreeMap<>();
|
|
|
|
|
|
|
|
- static Map<String,RegionState> keepRegions = new TreeMap<>();
|
|
|
|
-
|
|
|
|
- static int radius=0;
|
|
|
|
-
|
|
|
|
- static int coreRadius=0;
|
|
|
|
-
|
|
|
|
- static int regionRedius = 0;
|
|
|
|
|
|
|
|
- static final int treshold = 100;
|
|
|
|
|
|
+
|
|
|
|
|
|
static final Color removeA = new Color(255, 127, 39);
|
|
static final Color removeA = new Color(255, 127, 39);
|
|
static final Color removeB = new Color(251, 100, 0);
|
|
static final Color removeB = new Color(251, 100, 0);
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ static final Color removeA_Dropped = new Color(255, 13, 90);
|
|
|
|
+ static final Color removeB_Dropped = new Color(255, 13, 120);
|
|
|
|
+
|
|
static final Color keepA = new Color(128, 255, 0);
|
|
static final Color keepA = new Color(128, 255, 0);
|
|
static final Color keepB = new Color(0, 255, 64);
|
|
static final Color keepB = new Color(0, 255, 64);
|
|
|
|
|
|
@@ -154,6 +153,26 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
static final Color coreEdge = new Color(255, 0, 0);
|
|
static final Color coreEdge = new Color(255, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ static int[ ][ ] dataField ;
|
|
|
|
+
|
|
|
|
+ static Map<String,Integer> keepRegionsIn = new TreeMap<>();
|
|
|
|
+
|
|
|
|
+ static Map<String,RegionState> keepRegions = new TreeMap<>();
|
|
|
|
+
|
|
|
|
+ static Map<CoordHolder,Integer> workbenchCalculations = new HashMap<>();
|
|
|
|
+
|
|
|
|
+ static int radius=0;
|
|
|
|
+
|
|
|
|
+ static int coreRadius=0;
|
|
|
|
+
|
|
|
|
+ static int regionRedius = 0;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
static int fuckyou = 0;
|
|
static int fuckyou = 0;
|
|
|
|
|
|
private static void setRegion(int x,int y, int s)
|
|
private static void setRegion(int x,int y, int s)
|
|
@@ -171,7 +190,7 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
keepRegions.put(("r."+rx+"."+ry+".mca"),s);
|
|
keepRegions.put(("r."+rx+"."+ry+".mca"),s);
|
|
}
|
|
}
|
|
|
|
|
|
- static Map<CoordHolder,Integer> workbenchCalculations = new HashMap<>();
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -300,11 +319,11 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
//-y=up
|
|
//-y=up
|
|
if(x<radius*2&&x>=0&&y<radius*2&&y>=0)
|
|
if(x<radius*2&&x>=0&&y<radius*2&&y>=0)
|
|
{
|
|
{
|
|
- for(int i=-30;i<31;i++)
|
|
|
|
|
|
+ for(int i=-buffer;i<buffer+1;i++)
|
|
{
|
|
{
|
|
if((x+i)<(radius*2)&&(x+i)>0)
|
|
if((x+i)<(radius*2)&&(x+i)>0)
|
|
{
|
|
{
|
|
- for(int j=-30;j<31;j++)
|
|
|
|
|
|
+ for(int j=-buffer;j<+1;j++)
|
|
{
|
|
{
|
|
if((y+j)<(radius*2)&&(y+j)>0)
|
|
if((y+j)<(radius*2)&&(y+j)>0)
|
|
{
|
|
{
|
|
@@ -364,9 +383,12 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
System.out.println("Processing r."+(i)+"."+(j)+".mca; ("+i+"/"+regionBase+"|"+j+"/"+regionBase);
|
|
System.out.println("Processing r."+(i)+"."+(j)+".mca; ("+i+"/"+regionBase+"|"+j+"/"+regionBase);
|
|
if(current<treshold)
|
|
if(current<treshold)
|
|
{
|
|
{
|
|
- if(!(keepRegions.getOrDefault(("r."+(i)+"."+(j)+".mca"),RegionState.REMOVE)==RegionState.CORE))
|
|
|
|
|
|
+ RegionState old = keepRegions.getOrDefault(("r."+(i)+"."+(j)+".mca"),RegionState.REMOVE);
|
|
|
|
+ System.out.println("Processing r."+(i)+"."+(j)+".mca; Is: "+old);
|
|
|
|
+ if(((old)!=RegionState.CORE)&&(old!=RegionState.KEEP))
|
|
{
|
|
{
|
|
- keepRegions.put(("r."+(i)+"."+(j)+".mca"),RegionState.REMOVE);
|
|
|
|
|
|
+ System.out.println("Dropping r."+(i)+"."+(j)+".mca; Is: "+old);
|
|
|
|
+ keepRegions.put(("r."+(i)+"."+(j)+".mca"),RegionState.DROPPED);
|
|
}
|
|
}
|
|
|
|
|
|
if(current>0) // no activity inside so no need to search for activity spots
|
|
if(current>0) // no activity inside so no need to search for activity spots
|
|
@@ -409,19 +431,19 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
|
|
|
|
if(k==BlockState.ACTIVITY)
|
|
if(k==BlockState.ACTIVITY)
|
|
{
|
|
{
|
|
- if(pi<30&&pj<31)
|
|
|
|
|
|
+ if(pi<buffer&&pj<buffer)
|
|
{
|
|
{
|
|
keepRegions.put(("r."+(i-1)+"."+(j-1)+".mca"),RegionState.KEEP);
|
|
keepRegions.put(("r."+(i-1)+"."+(j-1)+".mca"),RegionState.KEEP);
|
|
}
|
|
}
|
|
- if(pi<30)
|
|
|
|
|
|
+ if(pi<buffer)
|
|
{
|
|
{
|
|
keepRegions.put(("r."+(i-1)+"."+(j)+".mca"),RegionState.KEEP);
|
|
keepRegions.put(("r."+(i-1)+"."+(j)+".mca"),RegionState.KEEP);
|
|
}
|
|
}
|
|
- if (pj<30)
|
|
|
|
|
|
+ if (pj<buffer)
|
|
{
|
|
{
|
|
keepRegions.put(("r."+(i)+"."+(j-1)+".mca"),RegionState.KEEP);
|
|
keepRegions.put(("r."+(i)+"."+(j-1)+".mca"),RegionState.KEEP);
|
|
}
|
|
}
|
|
- int max = 512-31;
|
|
|
|
|
|
+ int max = 512-(buffer+1);
|
|
|
|
|
|
if(pi>max&&pj>max)
|
|
if(pi>max&&pj>max)
|
|
{
|
|
{
|
|
@@ -437,11 +459,11 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
}
|
|
}
|
|
|
|
|
|
//propagating buffers
|
|
//propagating buffers
|
|
- int kxmin = Math.max(0,kx-31);
|
|
|
|
- int kymin = Math.max(0,ky-31);
|
|
|
|
|
|
+ int kxmin = Math.max(0,kx-(buffer+1));
|
|
|
|
+ int kymin = Math.max(0,ky-(buffer+1));
|
|
|
|
|
|
- int kxmax = Math.min(dataField.length,kx+31);
|
|
|
|
- int kymax = Math.min(dataField.length,ky+31);
|
|
|
|
|
|
+ int kxmax = Math.min(dataField.length,kx+buffer+1);
|
|
|
|
+ int kymax = Math.min(dataField.length,ky+buffer+1);
|
|
|
|
|
|
for(int ki = kxmin;ki<kxmax;ki++)
|
|
for(int ki = kxmin;ki<kxmax;ki++)
|
|
{
|
|
{
|
|
@@ -458,19 +480,19 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
|
|
|
|
if(k==BlockState.WORKBENCH_FORCED)
|
|
if(k==BlockState.WORKBENCH_FORCED)
|
|
{
|
|
{
|
|
- if(pi<50&&pj<51)
|
|
|
|
|
|
+ if(pi<workbenchbuffer&&pj<workbenchbuffer)
|
|
{
|
|
{
|
|
keepRegions.put(("r."+(i-1)+"."+(j-1)+".mca"),RegionState.KEEP);
|
|
keepRegions.put(("r."+(i-1)+"."+(j-1)+".mca"),RegionState.KEEP);
|
|
}
|
|
}
|
|
- if(pi<51)
|
|
|
|
|
|
+ if(pi<workbenchbuffer+1)
|
|
{
|
|
{
|
|
keepRegions.put(("r."+(i-1)+"."+(j)+".mca"),RegionState.KEEP);
|
|
keepRegions.put(("r."+(i-1)+"."+(j)+".mca"),RegionState.KEEP);
|
|
}
|
|
}
|
|
- if (pj<51)
|
|
|
|
|
|
+ if (pj<workbenchbuffer+1)
|
|
{
|
|
{
|
|
keepRegions.put(("r."+(i)+"."+(j-1)+".mca"),RegionState.KEEP);
|
|
keepRegions.put(("r."+(i)+"."+(j-1)+".mca"),RegionState.KEEP);
|
|
}
|
|
}
|
|
- int max = 512-51;
|
|
|
|
|
|
+ int max = 512-(workbenchbuffer+1);
|
|
|
|
|
|
if(pi>max&&pj>max)
|
|
if(pi>max&&pj>max)
|
|
{
|
|
{
|
|
@@ -486,11 +508,11 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
}
|
|
}
|
|
|
|
|
|
//propagating buffers
|
|
//propagating buffers
|
|
- int kxmin = Math.max(0,kx-51);
|
|
|
|
- int kymin = Math.max(0,ky-51);
|
|
|
|
|
|
+ int kxmin = Math.max(0,kx-(workbenchbuffer+1));
|
|
|
|
+ int kymin = Math.max(0,ky-(workbenchbuffer+1));
|
|
|
|
|
|
- int kxmax = Math.min(dataField.length,kx+51);
|
|
|
|
- int kymax = Math.min(dataField.length,ky+51);
|
|
|
|
|
|
+ int kxmax = Math.min(dataField.length,kx+(workbenchbuffer+1));
|
|
|
|
+ int kymax = Math.min(dataField.length,ky+(workbenchbuffer+1));
|
|
|
|
|
|
for(int ki = kxmin;ki<kxmax;ki++)
|
|
for(int ki = kxmin;ki<kxmax;ki++)
|
|
{
|
|
{
|
|
@@ -576,6 +598,9 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
case WATERIZE:
|
|
case WATERIZE:
|
|
color = (grid ? waterA : waterB).getRGB();
|
|
color = (grid ? waterA : waterB).getRGB();
|
|
break;
|
|
break;
|
|
|
|
+ case DROPPED:
|
|
|
|
+ color = (grid ? removeA_Dropped : removeB_Dropped).getRGB();
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -621,6 +646,7 @@ public class LogBlockHeatmapperRegionTrimmer
|
|
{
|
|
{
|
|
|
|
|
|
case REMOVE:
|
|
case REMOVE:
|
|
|
|
+ case DROPPED:
|
|
fileActions.println("mv "+k+" oldChunks/");
|
|
fileActions.println("mv "+k+" oldChunks/");
|
|
System.out.println("mv "+k+" oldChunks/");
|
|
System.out.println("mv "+k+" oldChunks/");
|
|
break;
|
|
break;
|