mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 20:22:33 +00:00
Starting work on the message.
This commit is contained in:
1 parent
b0159b45d2
commit
f64637a097
7 files changed
+31
-3
No files matched your search
@@ -49,6 +49,7 @@ public final class LibResources {
|
||||
public static final String ENTRY_PORTAL2 = PREFIX_ENTRIES + "portal2.png";
|
||||
public static final String ENTRY_PORTAL3 = PREFIX_ENTRIES + "portal3.png";
|
||||
public static final String ENTRY_PORTAL4 = PREFIX_ENTRIES + "portal4.png";
|
||||
public static final String ENTRY_ELVEN_GARDE = PREFIX_ENTRIES + "elvenGarde.png";
|
||||
|
||||
public static final String MODEL_ALTAR = PREFIX_MODEL + "altar.png";
|
||||
public static final String MODEL_SPREADER = PREFIX_MODEL + "spreader.png";
|
||||
|
||||
@@ -28,6 +28,7 @@ import vazkii.botania.api.recipe.RecipeElvenTrade;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.tile.mana.TilePool;
|
||||
import vazkii.botania.common.item.ItemLexicon;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
|
||||
@@ -179,6 +180,7 @@ public class TileAlfPortal extends TileMod {
|
||||
for(ItemStack stack : stacksIn) {
|
||||
if(stack.getItem() instanceof ILexicon) {
|
||||
((ILexicon) stack.getItem()).unlockKnowledge(stack, BotaniaAPI.elvenKnowledge);
|
||||
ItemLexicon.forceMessage(stack, true);
|
||||
spawnItem(stack);
|
||||
stacksIn.remove(i);
|
||||
return;
|
||||
|
||||
@@ -38,6 +38,7 @@ import vazkii.botania.api.recipe.IElvenItem;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.lexicon.LexiconData;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -45,7 +46,8 @@ import vazkii.botania.common.lib.LibMisc;
|
||||
public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
|
||||
private static final String TAG_KNOWLEDGE_PREFIX = "knowledge.";
|
||||
|
||||
private static final String TAG_FORCED_MESSAGE = "forcedMessage";
|
||||
|
||||
public ItemLexicon() {
|
||||
super();
|
||||
setMaxStackSize(1);
|
||||
@@ -116,6 +118,10 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) {
|
||||
if(isMessageForced(par1ItemStack)) {
|
||||
Botania.proxy.setEntryToOpen(LexiconData.elvenMessage);
|
||||
forceMessage(par1ItemStack, false);
|
||||
}
|
||||
par3EntityPlayer.openGui(Botania.instance, LibGuiIDs.LEXICON, par2World, 0, 0, 0);
|
||||
return par1ItemStack;
|
||||
}
|
||||
@@ -134,6 +140,14 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
public void unlockKnowledge(ItemStack stack, KnowledgeType knowledge) {
|
||||
ItemNBTHelper.setBoolean(stack, TAG_KNOWLEDGE_PREFIX + knowledge.id, true);
|
||||
}
|
||||
|
||||
public static void forceMessage(ItemStack stack, boolean forced) {
|
||||
ItemNBTHelper.setBoolean(stack, TAG_FORCED_MESSAGE, forced);
|
||||
}
|
||||
|
||||
public static boolean isMessageForced(ItemStack stack) {
|
||||
return ItemNBTHelper.getBoolean(stack, TAG_FORCED_MESSAGE, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isElvenItem(ItemStack stack) {
|
||||
|
||||
@@ -142,6 +142,7 @@ public final class LexiconData {
|
||||
public static LexiconEntry flightTiara;
|
||||
|
||||
public static LexiconEntry alfhomancyIntro;
|
||||
public static LexiconEntry elvenMessage;
|
||||
public static LexiconEntry elvenResources;
|
||||
|
||||
public static LexiconEntry unstableBlocks;
|
||||
@@ -453,12 +454,15 @@ public final class LexiconData {
|
||||
|
||||
// ALFHOMANCY ENTRIES
|
||||
alfhomancyIntro = new BLexiconEntry(LibLexicon.ALF_INTRO, categoryAlfhomancy);
|
||||
alfhomancyIntro.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeAlfPortal), new PageCraftingRecipe("3", ModCrafingRecipes.recipeNaturaPylon),
|
||||
alfhomancyIntro.setPriority().setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeAlfPortal), new PageCraftingRecipe("3", ModCrafingRecipes.recipeNaturaPylon),
|
||||
new PageImage("4", LibResources.ENTRY_PORTAL0), new PageImage("5", LibResources.ENTRY_PORTAL1), new PageImage("6", LibResources.ENTRY_PORTAL2), new PageImage("7", LibResources.ENTRY_PORTAL3),
|
||||
new PageImage("8", LibResources.ENTRY_PORTAL4), new PageText("9"), new PageText("10"), new PageText("11"));
|
||||
|
||||
elvenMessage = new ALexiconEntry(LibLexicon.ALF_MESSAGE, categoryAlfhomancy);
|
||||
elvenMessage.setPriority().setLexiconPages(new PageImage("0", LibResources.ENTRY_ELVEN_GARDE), new PageText("1"));
|
||||
|
||||
elvenResources = new ALexiconEntry(LibLexicon.ALF_RESOURCES, categoryAlfhomancy);
|
||||
elvenResources.setLexiconPages(new PageText("0"));
|
||||
elvenResources.setPriority().setLexiconPages(new PageText("0"));
|
||||
|
||||
// MISCLENAEOUS ENTRIES
|
||||
unstableBlocks = new BLexiconEntry(LibLexicon.MISC_UNSTABLE_BLOCKS, categoryMisc);
|
||||
|
||||
@@ -122,6 +122,7 @@ public final class LibLexicon {
|
||||
public static final String BAUBLE_FLIGHT_TIARA = "flightTiara";
|
||||
|
||||
public static final String ALF_INTRO = "aIntro";
|
||||
public static final String ALF_MESSAGE = "elfMessage";
|
||||
public static final String ALF_RESOURCES = "elfResources";
|
||||
|
||||
public static final String MISC_UNSTABLE_BLOCKS = "unstableBlocks";
|
||||
|
||||
@@ -1065,6 +1065,12 @@ botania.page.aIntro9=To open up the portal, simply right click the core with a &
|
||||
botania.page.aIntro10=The amount of &4Mana&0 required to open up the portal is orders of magnitude higher than that to keep it maintained, thus closing the portal to prevent &4Mana&0 loss is a poor strategy.<br>Furthermore, the link isn't strong enough to allow living beings to go through it, but it seems that &4items&0 can.
|
||||
botania.page.aIntro11=The amount of information about &1Alfheim&0 stored in this lexicon is resumed to this entry alone, perhaps &4letting the Elves have a look at it&0 might prove beneficial.
|
||||
|
||||
# -- A MESSAGE FROM ELVEN GARDE
|
||||
botania.entry.elfMessage=A Message from Elven Garde
|
||||
botania.page.elfMessage0=
|
||||
# ^ This is blank on purpose
|
||||
botania.page.elfMessage1=WIP
|
||||
|
||||
# -- THE RESOURCES OF ALFHEIM
|
||||
botania.entry.elfResources=The Resources of Alfheim
|
||||
botania.page.elfResources0=WIP
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
Reference in new issue
Block a user