Added Tainthistle

This commit is contained in:
Jeremy Diamond committed 2014-11-19 04:37:12 -08:00
1 parent 8db3af1159
commit c6e2016f4d
4 files changed
+146 -1

No files matched your search

@@ -6,6 +6,7 @@ import fox.spiteful.forbidden.DarkResearchItem;
import fox.spiteful.forbidden.LogHandler;
import fox.spiteful.forbidden.items.ForbiddenItems;
import fox.spiteful.forbidden.tiles.SubTileEuclidaisy;
import fox.spiteful.forbidden.tiles.SubTileTainthistle;
import fox.spiteful.forbidden.tiles.SubTileWhisperweed;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
@@ -56,9 +57,12 @@ public class ForbiddenBotany {
List<LexiconCategory> cats = BotaniaAPI.getAllCategories();
LexiconCategory functional = null;
LexiconCategory generating = null;
for(LexiconCategory cat : cats){
if(cat.getUnlocalizedName().equals("botania.category.functionalFlowers"))
functional = cat;
else if(cat.getUnlocalizedName().equals("botania.category.generationFlowers"))
generating = cat;
}
SubTileEuclidaisy.lexicon = new ForbiddenLexicon("euclidaisy", functional);
@@ -81,6 +85,16 @@ public class ForbiddenBotany {
InfusionRecipe whispercraft = ThaumcraftApi.addInfusionCraftingRecipe("WHISPERWEED", whisperweed, 4, (new AspectList()).add(Aspect.MIND, 8).add(Aspect.MAGIC, 4).add(Aspect.SENSES, 4), new ItemStack(Blocks.tallgrass, 1, 1), new ItemStack[] { new ItemStack(resource, 1, 2), new ItemStack(resource, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 9), new ItemStack(manaPetal, 1, 7), new ItemStack(manaPetal, 1, 10), new ItemStack(rune, 1, 14), new ItemStack(ConfigItems.itemResource, 1, 6) });
(new DarkResearchItem("WHISPERWEED", "FORBIDDEN", "[B]", (new AspectList()).add(Aspect.PLANT, 8).add(Aspect.MIND, 10).add(Aspect.SENSES, 4), -8, 5, 3, whisperweed)).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.WHISPERWEED.1"), new ResearchPage(whispercraft) }).setParents(new String[] { "INFAUXSION" }).setConcealed().registerResearchItem();
BotaniaAPI.registerSubTile("tainthistle", SubTileTainthistle.class);
BotaniaAPI.registerSubTileSignature(SubTileTainthistle.class, new DarkSignature("tainthistle"));
BotaniaAPI.addSubTileToCreativeMenu("tainthistle");
SubTileTainthistle.lexicon = new ForbiddenLexicon("tainthistle", generating);
SubTileTainthistle.lexicon.addPage(BotaniaAPI.internalHandler.textPage("forbidden.lexicon.tainthistle.0"));
ThaumcraftApi.registerObjectTag(GameRegistry.findItemStack("Botania", "specialFlower", 1), (new AspectList()).add(Aspect.PLANT, 4).add(Aspect.MAGIC, 1));
} catch (Throwable e) {
LogHandler.log(Level.INFO, e, "Forbidden Magic: Botania? Do you wanna build a snowman?");
Compat.botan = false;
@@ -0,0 +1,128 @@
/**
* This class based on a class created by <Pokefenn>.
* It was 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 a
* Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License
* (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB)
*
*/
package fox.spiteful.forbidden.tiles;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.ConfigBlocks;
import vazkii.botania.api.BotaniaAPI;
import vazkii.botania.api.lexicon.LexiconEntry;
import vazkii.botania.api.subtile.SubTileGenerating;
public class SubTileTainthistle extends SubTileGenerating {
private static final String TAG_BURN_TIME = "burnTime";
private static final int range = 4;
public static LexiconEntry lexicon;
int burnTime = 0;
@Override
public void onUpdate() {
super.onUpdate();
boolean didSomething = false;
if(burnTime == 0) {
if(supertile.getWorldObj().getWorldTime() % 80L == 0)
if(mana < getMaxMana() && !supertile.getWorldObj().isRemote) {
for(int ex = supertile.xCoord - range;ex <= supertile.xCoord + range;ex++){
for(int wy = supertile.yCoord - range;wy <= supertile.yCoord + range;wy++){
for(int zee = supertile.zCoord - range;zee <= supertile.zCoord + range;zee++){
if(isFlux(ex, wy, zee)) {
int depth = supertile.getWorldObj().getBlockMetadata(ex, wy, zee);
supertile.getWorldObj().setBlockToAir(ex, wy, zee);
didSomething = true;
burnTime += depth * (1 +supertile.getWorldObj().rand.nextInt(4));
}
}
}
}
if(didSomething){
playSound();
sync();
}
}
} else {
if(supertile.getWorldObj().rand.nextInt(8) == 0)
doBurnParticles();
burnTime--;
}
}
@Override
public boolean isPassiveFlower() {
return true;
}
public void doBurnParticles() {
Thaumcraft.proxy.reservoirBubble(supertile.getWorldObj(), supertile.xCoord, supertile.yCoord, supertile.zCoord, 0x4D00FF);
}
public boolean isFlux(int x, int y, int z){
Block target = supertile.getWorldObj().getBlock(x, y, z);
return target == ConfigBlocks.blockFluxGas || target == ConfigBlocks.blockFluxGoo;
}
public void playSound() {
supertile.getWorldObj().playSoundEffect(supertile.xCoord, supertile.yCoord, supertile.zCoord, "random.drink", 0.05F, 0.5F + (float) Math.random() * 0.5F);
}
@Override
public int getMaxMana() {
return 150;
}
@Override
public int getColor() {
return 0x4D00FF;
}
@Override
public LexiconEntry getEntry() {
return lexicon;
}
@Override
public void writeToPacketNBT(NBTTagCompound cmp) {
super.writeToPacketNBT(cmp);
cmp.setInteger(TAG_BURN_TIME, burnTime);
}
@Override
public void readFromPacketNBT(NBTTagCompound cmp) {
super.readFromPacketNBT(cmp);
burnTime = cmp.getInteger(TAG_BURN_TIME);
}
@Override
public boolean canGeneratePassively() {
return burnTime > 0;
}
@Override
public int getDelayBetweenPassiveGeneration() {
return 3;
}
@Override
public int getValueForPassiveGeneration() {
return 1 + supertile.getWorldObj().rand.nextInt(4);
}
@Override
public IIcon getIcon(){
return BotaniaAPI.getSignatureForName("tainthistle").getIconForStack(null);
}
}
@@ -83,6 +83,7 @@ tile.StarBlock.name=Nether Star Block
tile.blackRoseBush.name=Umbral Rose Bush
darkflower.euclidaisy.name=Euclidaisy
darkflower.whisperweed.name=Whisperweed
darkflower.tainthistle.name=Tainthistle
#
# Enchantments
enchantment.cluster=Fiery Core
@@ -281,4 +282,6 @@ forbidden.research_page.SUBCOLLAR.1=Sometimes, people just want to get hurt. Esp
forbidden.lexicon.euclidaisy=Euclidaisy
forbidden.lexicon.euclidaisy.0=The eerie, pink &1Euclidaisy&0 is an oddity. It uses large amounts of mana to conjure some sort of ethereal substance that only seems useful to thaumaturges.<br>&oIt doesn't combustion bend.&r
forbidden.lexicon.whisperweed=Whisperweed
forbidden.lexicon.whisperweed.0=The &1Whisperweed&0 is an unpleasant plant that whispers secrets into the ears of anyone who'll listen. There doesn't seem to be much point to the plant, since the secrets aren't even relevant to botany.<br>&oMore secrets than Wan Shi Tong&r
forbidden.lexicon.whisperweed.0=The &1Whisperweed&0 is an unpleasant plant that whispers secrets into the ears of anyone who'll listen. There doesn't seem to be much point to the plant, since the secrets aren't even relevant to botany.<br>&oMore secrets than Wan Shi Tong&r
forbidden.lexicon.tainthistle=Tainthistle
forbidden.lexicon.tainthistle.0=The disgusting &1Tainthistle&0 derives sustenance from the tainted runoff of magical experiments. It'll suck up any such substance it can find and try to turn it into mana. Since Botany is an environmentally friendly practice, there doesn't seem to be much point to it.<br>&oMore intrusive than a Spirit Vine&r
Binary file not shown.

After

Width:  |  Height:  |  Size: 350 B