Placement config code cleanup

This commit is contained in:
Anuken
2020-09-05 20:41:50 -04:00
parent c483ae2c23
commit f87bd78674
14 changed files with 67 additions and 92 deletions

View File

@@ -16,8 +16,6 @@ public class BuildPlan{
public @Nullable Block block;
/** Whether this is a break request.*/
public boolean breaking;
/** Whether this request comes with a config int. If yes, any blocks placed with this request will not call playerPlaced.*/
public boolean hasConfig;
/** Config int. Not used unless hasConfig is true.*/
public Object config;
/** Original position, only used in schematics.*/
@@ -40,6 +38,16 @@ public class BuildPlan{
this.breaking = false;
}
/** This creates a build request with a config. */
public BuildPlan(int x, int y, int rotation, Block block, Object config){
this.x = x;
this.y = y;
this.rotation = rotation;
this.block = block;
this.breaking = false;
this.config = config;
}
/** This creates a remove request. */
public BuildPlan(int x, int y){
this.x = x;
@@ -84,7 +92,6 @@ public class BuildPlan{
copy.rotation = rotation;
copy.block = block;
copy.breaking = breaking;
copy.hasConfig = hasConfig;
copy.config = config;
copy.originalX = originalX;
copy.originalY = originalY;
@@ -127,12 +134,6 @@ public class BuildPlan{
return y*tilesize + block.offset;
}
public BuildPlan configure(Object config){
this.config = config;
this.hasConfig = true;
return this;
}
public @Nullable Tile tile(){
return world.tile(x, y);
}