Skip to content

Commit

Permalink
Finish up blueprint
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCodedOne committed Aug 2, 2018
1 parent 15190f2 commit ca45b69
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {

@Override
public void performAction(int mouseX, int mouseY, int mouseButton) {
new FabricatorTemplateMessage(fabricator.getPos(), getMouseItem(), templateIndex).sendToServer();

ItemStack mouseItem = getMouseItem();
mouseItem.setCount(1);
new FabricatorTemplateMessage(fabricator.getPos(), mouseItem.copy(), templateIndex).sendToServer();

fabricator.setTemplateSlot(templateIndex, mouseItem);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.elytradev.teckle.common.TeckleObjects;
import com.elytradev.teckle.common.util.BlueprintUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
Expand All @@ -26,15 +27,14 @@ public String getItemStackDisplayName(ItemStack stack) {
ItemStack out = BlueprintUtil.getRecipeFromBlueprint(stack, Minecraft.getMinecraft().world)
.map(IRecipe::getRecipeOutput).orElse(ItemStack.EMPTY);
if (out.isEmpty())
return super.getItemStackDisplayName(stack);
return I18n.format("item.teckle.blueprint.empty.name");
if (out.getItem() == TeckleObjects.itemBlueprint)
return super.getItemStackDisplayName(stack) + "(" + super.getItemStackDisplayName(out) + ")";
return super.getItemStackDisplayName(stack) + "(" + out.getDisplayName() + ")";
return super.getItemStackDisplayName(stack) + " (" + super.getItemStackDisplayName(out) + ")";
return super.getItemStackDisplayName(stack) + " (" + out.getDisplayName() + ")";
}

@Override
public void addInformation(ItemStack stack, @Nullable World worldIn, List<String> tooltip, ITooltipFlag flagIn) {
super.addInformation(stack, worldIn, tooltip, flagIn);
}

}
}
2 changes: 2 additions & 0 deletions src/main/resources/assets/teckle/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ item.teckle.ingot.bluealloy.name=Blue Alloy Ingot
item.teckle.siliconwafer.plain.name=Silicon Wafer
item.teckle.siliconwafer.red.name=Red Doped Wafer
item.teckle.siliconwafer.blue.name=Blue Doped Wafer
item.teckle.blueprint.empty.name=Empty Blueprint
item.teckle.blueprint.name=Blueprint

tooltip.teckle.node.network=Network %s %s Size: %s
tooltip.teckle.traveller.data=Travellers
Expand Down
17 changes: 17 additions & 0 deletions src/main/resources/assets/teckle/recipes/blueprint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"type": "minecraft:crafting_shapeless",
"ingredients": [
{
"type": "forge:ore_dict",
"ore": "paper"
},
{
"type": "forge:ore_dict",
"ore": "dyeBlue"
}
],
"result": {
"item": "teckle:blueprint",
"count": 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ca45b69

Please sign in to comment.