Files
Gadomancy/src/main/java/makeo/gadomancy/common/research/IfAnyParentResearchItem.java
T
HellFirePvP 0dac2eeee9 - Added aura effect blacklist
- Added more future familiar rework stuff
- Rewrote all ResearchItems to mod-internal SimpleResearchItems
- Fix for issue with non-intended merging golem core stacks
2016-01-10 15:56:59 +01:00

53 lines
1.7 KiB
Java

package makeo.gadomancy.common.research;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.research.ResearchCategories;
import thaumcraft.api.research.ResearchItem;
import thaumcraft.client.gui.GuiResearchBrowser;
/**
* This class is part of the Gadomancy Mod
* Gadomancy is Open Source and distributed under the
* GNU LESSER GENERAL PUBLIC LICENSE
* for more read the LICENSE file
*
* Created by HellFirePvP @ 03.01.2016 14:35
*/
public class IfAnyParentResearchItem extends SimpleResearchItem {
private String[] anyParents = null;
public IfAnyParentResearchItem(String key, int col, int row, int complex, ItemStack icon, AspectList tags) {
super(key, col, row, complex, icon, tags);
}
public IfAnyParentResearchItem(String key, int col, int row, int complex, ResourceLocation icon, AspectList tags) {
super(key, col, row, complex, icon, tags);
}
@Override
public boolean isConcealed() {
if(anyParents != null) {
for(String res : anyParents) {
ResearchItem ri = ResearchCategories.getResearch(res);
if(ri != null) {
if(GuiResearchBrowser.completedResearch.get(Minecraft.getMinecraft().thePlayer.getCommandSenderName()).contains(ri.key)) {
return super.isConcealed();
}
}
}
return true;
}
return super.isConcealed();
}
public IfAnyParentResearchItem setAnyParents(String... parents) {
this.anyParents = parents;
return this;
}
}