mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-11-18 03:15:24 +00:00
Added Tainthistle
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user