Make manual craftable.
This commit is contained in:
@@ -7,17 +7,9 @@ import li.cil.manual.api.prefab.item.AbstractManualItem;
|
||||
import li.cil.oc2.client.manual.Manuals;
|
||||
import li.cil.oc2.client.manual.ModManualScreenStyle;
|
||||
import li.cil.oc2.client.manual.ModManualStyle;
|
||||
import li.cil.oc2.common.util.TooltipUtils;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public final class ManualItem extends AbstractManualItem {
|
||||
public ManualItem() {
|
||||
super(new Properties().tab(ItemGroup.COMMON));
|
||||
@@ -25,15 +17,6 @@ public final class ManualItem extends AbstractManualItem {
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
@Override
|
||||
public void appendHoverText(final ItemStack stack, @Nullable final World world, final List<ITextComponent> tooltip, final ITooltipFlag flag) {
|
||||
super.appendHoverText(stack, world, tooltip, flag);
|
||||
TooltipUtils.tryAddDescription(stack, tooltip);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
|
||||
@Override
|
||||
protected ManualModel getManualModel() {
|
||||
return Manuals.MANUAL.get();
|
||||
|
||||
@@ -119,6 +119,13 @@ public final class ModRecipesProvider extends RecipeProvider {
|
||||
.unlockedBy("has_transistor", inventoryChange(Items.TRANSISTOR.get()))
|
||||
.save(consumer);
|
||||
|
||||
WrenchRecipeBuilder
|
||||
.wrenchRecipe(Items.MANUAL.get())
|
||||
.requires(net.minecraft.item.Items.BOOK)
|
||||
.unlockedBy("has_book", inventoryChange(net.minecraft.item.Items.BOOK))
|
||||
.unlockedBy("has_wrench", inventoryChange(Items.WRENCH.get()))
|
||||
.save(consumer);
|
||||
|
||||
|
||||
ShapedRecipeBuilder
|
||||
.shaped(Items.NETWORK_CABLE.get(), 8)
|
||||
|
||||
@@ -18,9 +18,7 @@
|
||||
"item.oc2.wrench": "Scrench",
|
||||
"item.oc2.wrench.desc": "Used to configure devices and to dismantle them (while sneaking).",
|
||||
"item.oc2.manual": "Manual",
|
||||
"item.oc2.manual.desc": "Obtain by using a book on a computer casing in the world.",
|
||||
"item.oc2.bus_interface": "Bus Interface",
|
||||
"item.oc2.bus_interface.desc": "Used to attach Bus Cables to external devices.",
|
||||
"item.oc2.network_cable": "Network Cable",
|
||||
"item.oc2.memory": "Memory",
|
||||
"item.oc2.hard_drive": "Hard Drive",
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"parent": "minecraft:recipes/root",
|
||||
"rewards": {
|
||||
"recipes": [
|
||||
"oc2:manual"
|
||||
]
|
||||
},
|
||||
"criteria": {
|
||||
"has_book": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "minecraft:book"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"has_wrench": {
|
||||
"trigger": "minecraft:inventory_changed",
|
||||
"conditions": {
|
||||
"items": [
|
||||
{
|
||||
"item": "oc2:wrench"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"has_the_recipe": {
|
||||
"trigger": "minecraft:recipe_unlocked",
|
||||
"conditions": {
|
||||
"recipe": "oc2:manual"
|
||||
}
|
||||
}
|
||||
},
|
||||
"requirements": [
|
||||
[
|
||||
"has_book",
|
||||
"has_wrench",
|
||||
"has_the_recipe"
|
||||
]
|
||||
]
|
||||
}
|
||||
14
src/main/resources/data/oc2/recipes/manual.json
Normal file
14
src/main/resources/data/oc2/recipes/manual.json
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"type": "oc2:wrench",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "oc2:wrench"
|
||||
},
|
||||
{
|
||||
"item": "minecraft:book"
|
||||
}
|
||||
],
|
||||
"result": {
|
||||
"item": "oc2:manual"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user