Improvements to annotation code generation system, client RMI

This commit is contained in:
Anuken
2018-05-18 17:21:18 -07:00
parent ae3bcac3b7
commit b3e188a5f4
12 changed files with 130 additions and 53 deletions

View File

@@ -28,6 +28,9 @@ public class Item implements Comparable<Item>{
public int hardness = 0;
/**the burning color of this item*/
public Color flameColor = Palette.darkFlame.cpy();
/**base material cost of this item, used for calculating place times
* 1 cost = 1 tick added to build time*/
public float cost = 1f;
public Item(String name, Color color) {
this.id = items.size;

View File

@@ -13,6 +13,7 @@ public class Recipe {
public final Block result;
public final ItemStack[] requirements;
public final Section section;
public final float cost;
public boolean desktopOnly = false, debugOnly = false;
@@ -22,6 +23,13 @@ public class Recipe {
this.requirements = requirements;
this.section = section;
float timeToPlace = 0f;
for(ItemStack stack : requirements){
timeToPlace += stack.amount * stack.item.cost;
}
this.cost = timeToPlace;
allRecipes.add(this);
recipeMap.put(result, this);
}