Functional tech tree

This commit is contained in:
Anuken
2019-01-19 22:16:28 -05:00
parent 093043750b
commit d34f228d2f
18 changed files with 1217 additions and 1079 deletions

View File

@@ -42,6 +42,7 @@ public class Recipes implements ContentList{
new Recipe(effect, Blocks.container, new ItemStack(Items.titanium, 200));
new Recipe(effect, Blocks.vault, new ItemStack(Items.titanium, 500), new ItemStack(Items.thorium, 250));
new Recipe(effect, Blocks.launchPad, new ItemStack(Items.copper, 500));
new Recipe(effect, Blocks.core, new ItemStack(Items.titanium, 2000)).setHidden(true).setAlwaysUnlocked(true);
//projectors
new Recipe(effect, Blocks.mendProjector, new ItemStack(Items.lead, 200), new ItemStack(Items.titanium, 150), new ItemStack(Items.titanium, 50), new ItemStack(Items.silicon, 180));
@@ -160,9 +161,6 @@ public class Recipes implements ContentList{
new Recipe(units, Blocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.copper, 30), new ItemStack(Items.silicon, 30));
//removed for testing MOBA-style unit production
//new Recipe(units, Blocks.commandCenter, new ItemStack(Items.lead, 100), new ItemStack(Items.densealloy, 100), new ItemStack(Items.silicon, 200));
//LIQUIDS
new Recipe(liquid, Blocks.conduit, new ItemStack(Items.lead, 1));
new Recipe(liquid, Blocks.pulseConduit, new ItemStack(Items.titanium, 1), new ItemStack(Items.lead, 1));

View File

@@ -13,7 +13,7 @@ public class TechTree implements ContentList{
@Override
public void load(){
root = node(null, with(), () -> {
root = node(Blocks.core, with(), () -> {
node(Blocks.conveyor, with(Items.copper, 100), () -> {
node(Blocks.launchPad, with(Items.copper, 100), () -> {
@@ -252,12 +252,8 @@ public class TechTree implements ContentList{
return new TechNode(block, requirements, children);
}
private TechNode node(Block block, ItemStack[] requirements){
return new TechNode(block, requirements, () -> {});
}
private TechNode node(Block block){
return new TechNode(block, with(), () -> {});
private void node(Block block, ItemStack[] requirements){
new TechNode(block, requirements, () -> {});
}
public static class TechNode{
@@ -281,5 +277,9 @@ public class TechTree implements ContentList{
children.run();
context = last;
}
public Recipe recipe(){
return Recipe.getByResult(block);
}
}
}