Improvements to annotation code generation system, client RMI
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user