diff --git a/src/main/java/com/sosnitzka/taiga/TAIGA.java b/src/main/java/com/sosnitzka/taiga/TAIGA.java index 4c69679..b7ae9ea 100644 --- a/src/main/java/com/sosnitzka/taiga/TAIGA.java +++ b/src/main/java/com/sosnitzka/taiga/TAIGA.java @@ -1,6 +1,7 @@ package com.sosnitzka.taiga; import com.google.common.collect.Lists; +import com.sosnitzka.taiga.book.ContentOre; import com.sosnitzka.taiga.proxy.CommonProxy; import com.sosnitzka.taiga.recipes.CraftingRegistry; import com.sosnitzka.taiga.recipes.SmeltingRegistry; @@ -23,6 +24,7 @@ import static com.sosnitzka.taiga.Fluids.*; import static com.sosnitzka.taiga.MaterialTraits.*; import static com.sosnitzka.taiga.util.Utils.integrateMaterial; import static com.sosnitzka.taiga.util.Utils.integrateOre; +import static slimeknights.mantle.client.book.BookLoader.registerPageType; import static slimeknights.tconstruct.library.utils.HarvestLevels.*; @Mod(modid = TAIGA.MODID, version = TAIGA.VERSION, guiFactory = TAIGA.GUIFACTORY, dependencies = "required-after:tconstruct@[1.10.2-2.5.0,);" + "required-after:mantle@[1.10.2-1.0.0,)") @@ -66,6 +68,8 @@ public class TAIGA { for (MaterialIntegration m : integrateList) { m.integrateRecipes(); } + + registerPageType("taigaore", ContentOre.class); } @EventHandler diff --git a/src/main/java/com/sosnitzka/taiga/book/ContentOre.java b/src/main/java/com/sosnitzka/taiga/book/ContentOre.java new file mode 100644 index 0000000..fd18e28 --- /dev/null +++ b/src/main/java/com/sosnitzka/taiga/book/ContentOre.java @@ -0,0 +1,64 @@ +package com.sosnitzka.taiga.book; + +import com.google.common.collect.Lists; +import slimeknights.mantle.client.book.data.BookData; +import slimeknights.mantle.client.book.data.element.ItemStackData; +import slimeknights.mantle.client.book.data.element.TextData; +import slimeknights.mantle.client.gui.book.GuiBook; +import slimeknights.mantle.client.gui.book.element.BookElement; +import slimeknights.mantle.client.gui.book.element.ElementItem; +import slimeknights.mantle.client.gui.book.element.ElementText; +import slimeknights.tconstruct.library.book.TinkerPage; +import slimeknights.tconstruct.library.client.CustomFontColor; + +import java.util.ArrayList; +import java.util.List; + + +public class ContentOre extends TinkerPage { + + public static final transient int INPUT_X = 100; + public static final transient int INPUT_Y = 80; + + public static final transient float ITEM_SCALE = 1.75F; + + public String title = "Ore"; + public ItemStackData input; + public TextData[] description; + public String[] informations; + + @Override + public void build(BookData book, ArrayList list, boolean rightSide) { + + + TextData tdTitle = new TextData(title); + tdTitle.underlined = true; + //list.add(new ElementText(GuiBook.PAGE_WIDTH/2, 0, GuiBook.PAGE_WIDTH, 9, new TextData[]{tdTitle})); + + addTitle(list, CustomFontColor.encodeColor(0xcccccc) + title, true); + + if (input != null && !input.id.equals("")) { + list.add(new ElementItem(INPUT_X, INPUT_Y, ITEM_SCALE * 2.5f, input.getItems(), input.action)); + } + + if (description != null && description.length > 0) { + list.add(new ElementText(0, 15, GuiBook.PAGE_WIDTH, GuiBook.PAGE_HEIGHT - 15, description)); + } + + int h = GuiBook.PAGE_WIDTH / 3 - 10; + if (informations.length > 0) { + TextData head = new TextData(parent.translate("modifier.informations")); + head.underlined = true; + list.add(new ElementText(10, 20 + h, GuiBook.PAGE_WIDTH / 2 - 5, GuiBook.PAGE_HEIGHT - h - 20, head)); + + List effectData = Lists.newArrayList(); + for (String e : informations) { + effectData.add(new TextData("\u25CF ")); + effectData.add(new TextData(e)); + effectData.add(new TextData("\n")); + } + + list.add(new ElementText(10, 30 + h, GuiBook.PAGE_WIDTH / 2 + 5, GuiBook.PAGE_HEIGHT - h - 20, effectData)); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/sosnitzka/taiga/book/ContentSmelting.java b/src/main/java/com/sosnitzka/taiga/book/ContentSmelting.java deleted file mode 100644 index 835483e..0000000 --- a/src/main/java/com/sosnitzka/taiga/book/ContentSmelting.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.sosnitzka.taiga.book; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import slimeknights.mantle.client.book.data.BookData; -import slimeknights.mantle.client.book.data.content.PageContent; -import slimeknights.mantle.client.book.data.element.ImageData; -import slimeknights.mantle.client.book.data.element.ItemStackData; -import slimeknights.mantle.client.book.data.element.TextData; -import slimeknights.mantle.client.gui.book.GuiBook; -import slimeknights.mantle.client.gui.book.element.BookElement; -import slimeknights.mantle.client.gui.book.element.ElementImage; -import slimeknights.mantle.client.gui.book.element.ElementItem; -import slimeknights.mantle.client.gui.book.element.ElementText; - -import java.util.ArrayList; - -import static slimeknights.mantle.client.gui.book.Textures.TEX_SMELTING; - -public class ContentSmelting extends PageContent { - - public static final transient int TEX_SIZE = 128; - public static final transient ImageData IMG_SMELTING = new ImageData(TEX_SMELTING, 0, 0, 110, 114, TEX_SIZE, TEX_SIZE); - - public static final transient int INPUT_X = 5; - public static final transient int INPUT_Y = 5; - public static final transient int RESULT_X = 74; - public static final transient int RESULT_Y = 41; - public static final transient int FUEL_X = 5; - public static final transient int FUEL_Y = 77; - - public static final transient float ITEM_SCALE = 2.0F; - - public String title = "Smelting"; - public ItemStackData input; - public ItemStackData result; - public TextData[] description; - - @Override - public void build(BookData book, ArrayList list, boolean rightSide) { - int x = GuiBook.PAGE_WIDTH / 2 - IMG_SMELTING.width / 2; - int y = TITLE_HEIGHT; - - TextData tdTitle = new TextData(title); - tdTitle.underlined = true; - list.add(new ElementText(0, 0, GuiBook.PAGE_WIDTH, 9, new TextData[]{tdTitle})); - list.add(new ElementImage(x, y, IMG_SMELTING.width, IMG_SMELTING.height, IMG_SMELTING, book.appearance.slotColor)); - - if (input != null && !input.id.equals("")) { - list.add(new ElementItem(x + INPUT_X, y + INPUT_Y, ITEM_SCALE, input.getItems(), input.action)); - } - - if (result != null && !result.id.equals("")) { - list.add(new ElementItem(x + RESULT_X, y + RESULT_Y, ITEM_SCALE, result.getItems(), result.action)); - } - - list.add(new ElementItem(x + FUEL_X, y + FUEL_Y, ITEM_SCALE, getFuelsList())); - - if (description != null && description.length > 0) { - list.add(new ElementText(0, IMG_SMELTING.height + y + 5, GuiBook.PAGE_WIDTH, GuiBook.PAGE_HEIGHT - y - 5, description)); - } - } - - public ItemStack[] getFuelsList() { - //TODO ask JEI for fuel list if it is present - - ItemStack[] fuels = new ItemStack[13]; - fuels[0] = new ItemStack(Blocks.WOODEN_SLAB); - fuels[1] = new ItemStack(Blocks.PLANKS); - fuels[2] = new ItemStack(Blocks.COAL_BLOCK); - fuels[3] = new ItemStack(Items.WOODEN_PICKAXE); - fuels[4] = new ItemStack(Items.WOODEN_SWORD); - fuels[5] = new ItemStack(Items.WOODEN_HOE); - fuels[6] = new ItemStack(Items.STICK); - fuels[7] = new ItemStack(Items.COAL); - fuels[8] = new ItemStack(Items.LAVA_BUCKET); - fuels[9] = new ItemStack(Blocks.SAPLING); - fuels[10] = new ItemStack(Items.BLAZE_ROD); - fuels[11] = new ItemStack(Items.WOODEN_SHOVEL); - fuels[12] = new ItemStack(Items.WOODEN_AXE); - - return fuels; - } -} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/bsp/pageblkinteraction.json b/src/main/resources/assets/taiga/book/en_US/bsp/pageblkinteraction.json deleted file mode 100644 index c4ff182..0000000 --- a/src/main/resources/assets/taiga/book/en_US/bsp/pageblkinteraction.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "title": "Interacting with Blocks", - "input": { - "itemList": "items/records.json" - }, - "block": { - "id": "minecraft:jukebox" - }, - "description": [ - { - "text": "That's my jam!" - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/bsp/pagecrafting.json b/src/main/resources/assets/taiga/book/en_US/bsp/pagecrafting.json deleted file mode 100644 index e3fc391..0000000 --- a/src/main/resources/assets/taiga/book/en_US/bsp/pagecrafting.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "title": "Crafting a Thing", - "grid_size": "large", - "grid": [ - [ - {}, - { - "id": "minecraft:redstone_torch" - } - ], - [ - { - "id": "minecraft:redstone_torch" - }, - { - "id": "minecraft:quartz" - }, - { - "id": "minecraft:redstone_torch" - } - ], - [ - { - "id": "minecraft:stone" - }, - { - "id": "minecraft:stone" - }, - { - "id": "minecraft:stone" - } - ] - ], - "result": { - "id": "minecraft:comparator" - }, - "description": [ - { - "text": "This item does stuff and, of course, " - }, - { - "text": "things.", - "underlined": true - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/bsp/pagecraftingsmall.json b/src/main/resources/assets/taiga/book/en_US/bsp/pagecraftingsmall.json deleted file mode 100644 index 648a90c..0000000 --- a/src/main/resources/assets/taiga/book/en_US/bsp/pagecraftingsmall.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "title": "Crafting a Thing", - "grid_size": "small", - "grid": [ - [ - { - "id": "minecraft:stick" - }, - { - "id": "minecraft:planks" - } - ], - [ - { - "id": "minecraft:planks" - }, - { - "id": "minecraft:stick" - } - ] - ], - "result": { - "id": "tconstruct:stencil" - }, - "description": [ - { - "text": "This item does stuff and, of course, " - }, - { - "text": "things.", - "underlined": true - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/bsp/pagesmelting.json b/src/main/resources/assets/taiga/book/en_US/bsp/pagesmelting.json deleted file mode 100644 index c8b7d86..0000000 --- a/src/main/resources/assets/taiga/book/en_US/bsp/pagesmelting.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "title": "Smelting a Thing", - "input": { - "id": "minecraft:iron_ore" - }, - "result": { - "id": "minecraft:iron_ingot" - }, - "description": [ - { - "text": "Very delicious iron." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/bsp/pagesmithing.json b/src/main/resources/assets/taiga/book/en_US/bsp/pagesmithing.json deleted file mode 100644 index a6795a0..0000000 --- a/src/main/resources/assets/taiga/book/en_US/bsp/pagesmithing.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "title": "Smithing a Thing", - "input": { - "id": "minecraft:diamond_sword" - }, - "modifier": { - "id": "minecraft:enchanted_book", - "nbt": { - "ench": [ - { - "id": 16, - "lvl": 5 - } - ] - } - }, - "result": { - "id": "minecraft:diamond_sword", - "nbt": { - "ench": [ - { - "id": 16, - "lvl": 5 - } - ] - } - }, - "description": [ - { - "text": "Ow, that's sharp." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/language.lang b/src/main/resources/assets/taiga/book/en_US/language.lang index 6a632b8..8bb6c6a 100644 --- a/src/main/resources/assets/taiga/book/en_US/language.lang +++ b/src/main/resources/assets/taiga/book/en_US/language.lang @@ -1 +1,2 @@ -index_title=TAIGA \ No newline at end of file +index_title=TAIGA +modifier.informations=Informations \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/ore/basalt.json1 b/src/main/resources/assets/taiga/book/en_US/ore/basalt.json1 new file mode 100644 index 0000000..81f713e --- /dev/null +++ b/src/main/resources/assets/taiga/book/en_US/ore/basalt.json1 @@ -0,0 +1,11 @@ +{ + "title": "Basalt", + "input": { + "id": "taiga:basalt_block" + }, + "description": [ + { + "text": "This is basalt. Basalt is a block, which can be found in the overworld at the top of lava lakes. If you don't want to fall into the lava you have to mine it carefully. Try to build some blocks underneath to be on the safe side." + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/ore/meteorite.json b/src/main/resources/assets/taiga/book/en_US/ore/meteorite.json new file mode 100644 index 0000000..220e8ea --- /dev/null +++ b/src/main/resources/assets/taiga/book/en_US/ore/meteorite.json @@ -0,0 +1,15 @@ +{ + "title": "Meteorite", + "input": { + "id": "taiga:meteorite_block" + }, + "description": [ + { + "text": "You have to be patient, to find meteorite in your surroundings. Many hundrets of thounsands years ago they fell from the sky. Most of them are buried under dirt and grass and you have to dig a lot." + } + ], + "informations": [ + "Deals massive damage to spiders and silverfish", + "Multiple levels" + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/en_US/ore/obsidiorite.json1 b/src/main/resources/assets/taiga/book/en_US/ore/obsidiorite.json1 new file mode 100644 index 0000000..940e558 --- /dev/null +++ b/src/main/resources/assets/taiga/book/en_US/ore/obsidiorite.json1 @@ -0,0 +1,11 @@ +{ + "title": "Obsidiorite", + "input": { + "id": "taiga:obsidiorite_block" + }, + "description": [ + { + "text": "They are flying in the end!" + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/taiga/book/sections/intro.json b/src/main/resources/assets/taiga/book/sections/intro.json index f65f254..db66dfd 100644 --- a/src/main/resources/assets/taiga/book/sections/intro.json +++ b/src/main/resources/assets/taiga/book/sections/intro.json @@ -10,36 +10,8 @@ "data": "ores/firstwords.json" }, { - "name": "basalt", - "type": "text with right image etch", - "data": "ores/basalt.json" - }, - { - "type": "blank" - }, - { - "name": "PageCrafter", - "type": "crafting", - "data": "bsp/pagecrafting.json" - }, - { - "name": "PageSmallCrafter", - "type": "crafting", - "data": "bsp/pagecraftingsmall.json" - }, - { - "name": "PageSmelting", - "type": "smelting", - "data": "bsp/pagesmelting.json" - }, - { - "name": "PageSmithing", - "type": "smithing", - "data": "bsp/pagesmithing.json" - }, - { - "name": "PageBlockInteraction", - "type": "block interaction", - "data": "bsp/pageblkinteraction.json" + "name": "meteorite", + "type": "taigaore", + "data": "ore/meteorite.json" } ] \ No newline at end of file diff --git a/src/main/resources/assets/taiga/lang/en_US.lang b/src/main/resources/assets/taiga/lang/en_US.lang index 7b322ba..25a1805 100644 --- a/src/main/resources/assets/taiga/lang/en_US.lang +++ b/src/main/resources/assets/taiga/lang/en_US.lang @@ -1,3 +1,5 @@ +modifier.informations=Informations + material.basalt.name=Basalt material.dilithium.name=Dilithium material.tiberium.name=Tiberium diff --git a/src/main/resources/smeltery.png b/src/main/resources/smeltery.png new file mode 100644 index 0000000..19f96f8 Binary files /dev/null and b/src/main/resources/smeltery.png differ diff --git a/src/tinker_tank.png b/src/tinker_tank.png new file mode 100644 index 0000000..80504e1 Binary files /dev/null and b/src/tinker_tank.png differ