mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-20 12:19:46 +00:00
Document the relics in the lexicon.
This commit is contained in:
1 parent
245ebe7847
commit
8c7f5990d2
11 files changed
+155
-55
No files matched your search
@@ -96,7 +96,11 @@ public final class BotaniaAPI {
|
||||
|
||||
public static EnumRarity rarityRelic = EnumHelper.addRarity("RELIC", EnumChatFormatting.GOLD, "Relic");
|
||||
|
||||
public static KnowledgeType basicKnowledge, elvenKnowledge;
|
||||
public static KnowledgeType basicKnowledge;
|
||||
public static KnowledgeType elvenKnowledge;
|
||||
|
||||
// This is here for completeness sake, but you shouldn't use it
|
||||
public static KnowledgeType relicKnowledge;
|
||||
|
||||
// All of these categories are initialized during botania's PreInit stage.
|
||||
public static LexiconCategory categoryBasics;
|
||||
@@ -117,6 +121,7 @@ public final class BotaniaAPI {
|
||||
|
||||
basicKnowledge = registerKnowledgeType("minecraft", EnumChatFormatting.RESET, true);
|
||||
elvenKnowledge = registerKnowledgeType("alfheim", EnumChatFormatting.DARK_GREEN, false);
|
||||
relicKnowledge = registerKnowledgeType("relic", EnumChatFormatting.DARK_PURPLE, false);
|
||||
|
||||
addOreWeight("oreAluminum", 3940); // Tinkers' Construct
|
||||
addOreWeight("oreAmber", 2075); // Thaumcraft
|
||||
|
||||
@@ -17,6 +17,8 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class LexiconEntry implements Comparable<LexiconEntry> {
|
||||
|
||||
@@ -76,6 +78,11 @@ public class LexiconEntry implements Comparable<LexiconEntry> {
|
||||
public String getUnlocalizedName() {
|
||||
return unlocalizedName;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isVisible() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets what pages you want this entry to have.
|
||||
|
||||
@@ -116,7 +116,7 @@ public class GuiLexiconIndex extends GuiLexicon implements IParented {
|
||||
entriesToDisplay.clear();
|
||||
ILexicon lex = (ILexicon) stackUsed.getItem();
|
||||
for(LexiconEntry entry : category == null ? BotaniaAPI.getAllEntries() : category.entries) {
|
||||
if(lex.isKnowledgeUnlocked(stackUsed, entry.getKnowledgeType()) && StatCollector.translateToLocal(entry.getUnlocalizedName()).toLowerCase().contains(searchField.getText().toLowerCase().trim()))
|
||||
if(entry.isVisible() && lex.isKnowledgeUnlocked(stackUsed, entry.getKnowledgeType()) && StatCollector.translateToLocal(entry.getUnlocalizedName()).toLowerCase().contains(searchField.getText().toLowerCase().trim()))
|
||||
entriesToDisplay.add(entry);
|
||||
}
|
||||
Collections.sort(entriesToDisplay);
|
||||
|
||||
@@ -38,6 +38,7 @@ import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
import vazkii.botania.common.core.helper.MathHelper;
|
||||
import vazkii.botania.common.item.relic.ItemDice;
|
||||
import vazkii.botania.common.lib.LibGuiIDs;
|
||||
import vazkii.botania.common.lib.LibItemNames;
|
||||
import vazkii.botania.common.lib.LibMisc;
|
||||
@@ -67,10 +68,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
Botania.proxy.setEntryToOpen(entry);
|
||||
Botania.proxy.setLexiconStack(par1ItemStack);
|
||||
|
||||
par2EntityPlayer.openGui(Botania.instance, LibGuiIDs.LEXICON, par3World, 0, 0, 0);
|
||||
par2EntityPlayer.addStat(ModAchievements.lexiconUse, 1);
|
||||
if(!par3World.isRemote)
|
||||
par3World.playSoundAtEntity(par2EntityPlayer, "botania:lexiconOpen", 0.5F, 1F);
|
||||
openBook(par2EntityPlayer, par1ItemStack, par3World, false);
|
||||
return true;
|
||||
}
|
||||
} else if(par3World.isRemote) {
|
||||
@@ -138,16 +136,29 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
|
||||
setForcedPage(par1ItemStack, "");
|
||||
}
|
||||
|
||||
Botania.proxy.setLexiconStack(par1ItemStack);
|
||||
par3EntityPlayer.addStat(ModAchievements.lexiconUse, 1);
|
||||
par3EntityPlayer.openGui(Botania.instance, LibGuiIDs.LEXICON, par2World, 0, 0, 0);
|
||||
if(!par2World.isRemote && !skipSound)
|
||||
par2World.playSoundAtEntity(par3EntityPlayer, "botania:lexiconOpen", 0.5F, 1F);
|
||||
openBook(par3EntityPlayer, par1ItemStack, par2World, skipSound);
|
||||
skipSound = false;
|
||||
|
||||
return par1ItemStack;
|
||||
}
|
||||
|
||||
public void openBook(EntityPlayer player, ItemStack stack, World world, boolean skipSound) {
|
||||
if(!isKnowledgeUnlocked(stack, BotaniaAPI.relicKnowledge) && isKnowledgeUnlocked(stack, BotaniaAPI.elvenKnowledge))
|
||||
for(ItemStack rstack : ItemDice.relicStacks) {
|
||||
Item item = rstack.getItem();
|
||||
if(player.inventory.hasItem(item)) {
|
||||
unlockKnowledge(stack, BotaniaAPI.relicKnowledge);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Botania.proxy.setLexiconStack(stack);
|
||||
player.addStat(ModAchievements.lexiconUse, 1);
|
||||
player.openGui(Botania.instance, LibGuiIDs.LEXICON, world, 0, 0, 0);
|
||||
if(!world.isRemote && !skipSound)
|
||||
world.playSoundAtEntity(player, "botania:lexiconOpen", 0.5F, 1F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate(ItemStack stack, World world, Entity entity, int idk, boolean something) {
|
||||
int ticks = getQueueTicks(stack);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class ItemDice extends ItemRelic {
|
||||
-1, 0, 1, 2, -1, 2, 3, 4
|
||||
};
|
||||
|
||||
final ItemStack[] relicStacks;
|
||||
public static ItemStack[] relicStacks;
|
||||
|
||||
public ItemDice() {
|
||||
super(LibItemNames.DICE);
|
||||
|
||||
@@ -57,8 +57,8 @@ public class ItemOdinRing extends ItemRelicBauble {
|
||||
|
||||
@Override
|
||||
public void onValidPlayerWornTick(ItemStack stack, EntityPlayer player) {
|
||||
if(player.ticksExisted % 30 == 0)
|
||||
player.heal(1);
|
||||
//if(player.ticksExisted % 30 == 0)
|
||||
//player.heal(1);
|
||||
if(player.isBurning())
|
||||
player.extinguish();
|
||||
}
|
||||
|
||||
@@ -64,10 +64,12 @@ public class ItemRelic extends ItemMod implements IRelic {
|
||||
if(stack.getItem() == ModItems.aesirRing)
|
||||
addStringToTooltip(StatCollector.translateToLocal("botaniamisc.dropIkea"), list);
|
||||
|
||||
addStringToTooltip("", list);
|
||||
String name = stack.getUnlocalizedName() + ".poem";
|
||||
for(int i = 0; i < 4; i++)
|
||||
addStringToTooltip(EnumChatFormatting.ITALIC + StatCollector.translateToLocal(name + i), list);
|
||||
if(stack.getItem() == ModItems.dice) {
|
||||
addStringToTooltip("", list);
|
||||
String name = stack.getUnlocalizedName() + ".poem";
|
||||
for(int i = 0; i < 4; i++)
|
||||
addStringToTooltip(EnumChatFormatting.ITALIC + StatCollector.translateToLocal(name + i), list);
|
||||
}
|
||||
} else addStringToTooltip(StatCollector.translateToLocal("botaniamisc.shiftinfo"), list);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.lexicon.LexiconRecipeMappings;
|
||||
import vazkii.botania.client.lib.LibResources;
|
||||
import vazkii.botania.common.Botania;
|
||||
import vazkii.botania.common.achievement.ModAchievements;
|
||||
import vazkii.botania.common.block.ModBlocks;
|
||||
import vazkii.botania.common.block.ModMultiblocks;
|
||||
import vazkii.botania.common.brew.ModBrews;
|
||||
@@ -244,7 +245,14 @@ public final class LexiconData {
|
||||
public static LexiconEntry gaiaRitualHardmode;
|
||||
public static LexiconEntry elvenLore;
|
||||
public static LexiconEntry relics;
|
||||
|
||||
public static LexiconEntry relicInfo;
|
||||
public static LexiconEntry infiniteFruit;
|
||||
public static LexiconEntry kingKey;
|
||||
public static LexiconEntry flugelEye;
|
||||
public static LexiconEntry thorRing;
|
||||
public static LexiconEntry lokiRing;
|
||||
public static LexiconEntry odinRing;
|
||||
|
||||
public static LexiconEntry unstableBlocks;
|
||||
public static LexiconEntry decorativeBlocks;
|
||||
public static LexiconEntry dispenserTweaks;
|
||||
@@ -903,6 +911,27 @@ public final class LexiconData {
|
||||
if(ConfigHandler.relicsEnabled) {
|
||||
relics = new ALexiconEntry(LibLexicon.ALF_RELICS, categoryAlfhomancy);
|
||||
relics.setLexiconPages(new PageText("0")).setIcon(new ItemStack(ModItems.dice));
|
||||
|
||||
relicInfo = new RLexiconEntry(LibLexicon.ALF_RELIC_INFO, categoryAlfhomancy, null);
|
||||
relicInfo.setLexiconPages(new PageText("0"), new PageText("1")).setIcon(new ItemStack(ModItems.dice));
|
||||
|
||||
infiniteFruit = new RLexiconEntry(LibLexicon.ALF_INFINITE_FRUIT, categoryAlfhomancy, ModAchievements.relicInfiniteFruit);
|
||||
infiniteFruit.setLexiconPages(new PageText("0"));
|
||||
|
||||
kingKey = new RLexiconEntry(LibLexicon.ALF_KING_KEY, categoryAlfhomancy, ModAchievements.relicKingKey);
|
||||
kingKey.setLexiconPages(new PageText("0"));
|
||||
|
||||
flugelEye = new RLexiconEntry(LibLexicon.ALF_FLUGEL_EYE, categoryAlfhomancy, ModAchievements.relicFlugelEye);
|
||||
flugelEye.setLexiconPages(new PageText("0"), new PageText("1"));
|
||||
|
||||
thorRing = new RLexiconEntry(LibLexicon.ALF_THOR_RING, categoryAlfhomancy, ModAchievements.relicThorRing);
|
||||
thorRing.setLexiconPages(new PageText("0"));
|
||||
|
||||
lokiRing = new RLexiconEntry(LibLexicon.ALF_LOKI_RING, categoryAlfhomancy, ModAchievements.relicLokiRing);
|
||||
lokiRing.setLexiconPages(new PageText("0"), new PageText("1"), new PageText("2"), new PageText("3"));
|
||||
|
||||
odinRing = new RLexiconEntry(LibLexicon.ALF_ODIN_RING, categoryAlfhomancy, ModAchievements.relicOdinRing);
|
||||
odinRing.setLexiconPages(new PageText("0"));
|
||||
}
|
||||
|
||||
// MISCLENAEOUS ENTRIES
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* This class was created by <Vazkii>. It's distributed as
|
||||
* part of the Botania Mod. Get the Source Code in github:
|
||||
* https://github.com/Vazkii/Botania
|
||||
*
|
||||
* Botania is Open Source and distributed under the
|
||||
* Botania License: http://botaniamod.net/license.php
|
||||
*
|
||||
* File Created @ [Aug 16, 2015, 10:52:36 PM (GMT)]
|
||||
*/
|
||||
package vazkii.botania.common.lexicon;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.entity.EntityClientPlayerMP;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconCategory;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class RLexiconEntry extends BLexiconEntry {
|
||||
|
||||
Achievement a;
|
||||
|
||||
public RLexiconEntry(String unlocalizedName, LexiconCategory category, Achievement a) {
|
||||
super(unlocalizedName, category);
|
||||
setKnowledgeType(BotaniaAPI.relicKnowledge);
|
||||
this.a = a;
|
||||
if(a != null)
|
||||
setIcon(a.theItemStack.copy());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isVisible() {
|
||||
EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
|
||||
return a == null || player.capabilities.isCreativeMode || player.getStatFileWriter().hasAchievementUnlocked(a);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -214,6 +214,13 @@ public final class LibLexicon {
|
||||
public static final String ALF_GAIA_RITUAL_HARDMODE = "gaiaRitualHardmode";
|
||||
public static final String ALF_LORE = "elvenLore";
|
||||
public static final String ALF_RELICS = "relics";
|
||||
public static final String ALF_RELIC_INFO = "relicInfo";
|
||||
public static final String ALF_INFINITE_FRUIT = "infiniteFruit";
|
||||
public static final String ALF_KING_KEY = "kingKey";
|
||||
public static final String ALF_FLUGEL_EYE = "flugelEye";
|
||||
public static final String ALF_THOR_RING = "thorRing";
|
||||
public static final String ALF_LOKI_RING = "lokiRing";
|
||||
public static final String ALF_ODIN_RING = "odinRing";
|
||||
|
||||
public static final String MISC_UNSTABLE_BLOCKS = "unstableBlocks";
|
||||
public static final String MISC_DECORATIVE_BLOCKS = "decorativeBlocks";
|
||||
|
||||
Reference in new issue
Block a user