mirror of
https://github.com/GTNewHorizons/ForbiddenMagic.git
synced 2026-11-19 03:39:08 +00:00
Goshdurn hippy flower mod
This commit is contained in:
1 parent
360c59d13b
commit
4554d55a48
11 files changed
+198
-15
No files matched your search
@@ -2,6 +2,7 @@ package fox.spiteful.forbidden.compat;
|
||||
|
||||
import fox.spiteful.forbidden.*;
|
||||
import fox.spiteful.forbidden.tiles.SubTileEuclidaisy;
|
||||
import fox.spiteful.forbidden.tiles.SubTileWhisperweed;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -32,6 +33,7 @@ import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import vazkii.botania.api.lexicon.LexiconCategory;
|
||||
import vazkii.botania.api.lexicon.LexiconPage;
|
||||
import vazkii.botania.api.recipe.RecipePetals;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.util.List;
|
||||
@@ -266,9 +268,24 @@ public class Compat {
|
||||
tag.setString("type", "euclidaisy");
|
||||
euclidaisy.setTagCompound(tag);
|
||||
|
||||
InfusionRecipe euclid = ThaumcraftApi.addInfusionCraftingRecipe("EUCLIDAISY", euclidaisy, 8, (new AspectList()).add(Aspect.AURA, 8).add(Aspect.ELDRITCH, 10).add(Aspect.MAGIC, 8), new ItemStack(flower, 1, 6), new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(resource, 1, 8), new ItemStack(resource, 1, 6), new ItemStack(manaPetal, 1, 6), new ItemStack(manaPetal, 1, 6), new ItemStack(rune, 1, 12), new ItemStack(rune, 1, 11) });
|
||||
InfusionRecipe euclid = ThaumcraftApi.addInfusionCraftingRecipe("EUCLIDAISY", euclidaisy, 8, (new AspectList()).add(Aspect.AURA, 8).add(Aspect.ELDRITCH, 10).add(Aspect.MAGIC, 8), new ItemStack(flower, 1, 6), new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(resource, 1, 1), new ItemStack(resource, 1, 6), new ItemStack(manaPetal, 1, 6), new ItemStack(manaPetal, 1, 6), new ItemStack(rune, 1, 12), new ItemStack(rune, 1, 11) });
|
||||
(new DarkResearchItem("EUCLIDAISY", "FORBIDDEN", "[B]", (new AspectList()).add(Aspect.PLANT, 8).add(Aspect.MAGIC, 4).add(Aspect.AURA, 12), -7, 5, 3, euclidaisy)).setPages(new ResearchPage[] { new ResearchPage("forbidden.research_page.EUCLIDAISY.1"), new ResearchPage(euclid) }).setParents(new String[] { "INFAUXSION" }).setConcealed().registerResearchItem();
|
||||
|
||||
BotaniaAPI.registerSubTile("whisperweed", SubTileWhisperweed.class);
|
||||
BotaniaAPI.registerSubTileSignature(SubTileWhisperweed.class, new DarkSignature("whisperweed"));
|
||||
BotaniaAPI.addSubTileToCreativeMenu("whisperweed");
|
||||
|
||||
SubTileWhisperweed.lexicon = new ForbiddenLexicon("whisperweed", functional);
|
||||
|
||||
SubTileWhisperweed.lexicon.addPage(BotaniaAPI.internalHandler.textPage("forbidden.lexicon.whisperweed.0"));
|
||||
|
||||
ItemStack whisperweed = new ItemStack(specialFlower, 1, 0);
|
||||
NBTTagCompound wtag = new NBTTagCompound();
|
||||
wtag.setString("type", "whisperweed");
|
||||
whisperweed.setTagCompound(wtag);
|
||||
RecipePetals whispercraft = BotaniaAPI.registerPetalRecipe(whisperweed, 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));
|
||||
SubTileWhisperweed.lexicon.addPage(BotaniaAPI.internalHandler.petalRecipePage("forbidden.lexicon.whisperweed.1", whispercraft));
|
||||
|
||||
} catch (Throwable e) {
|
||||
LogHandler.log(Level.INFO, e, "Forbidden Magic: Botania? Do you wanna build a snowman?");
|
||||
botan = false;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package fox.spiteful.forbidden.compat;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import vazkii.botania.api.subtile.signature.SubTileSignature;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import vazkii.botania.api.subtile.signature.SubTileSignature;
|
||||
|
||||
public class DarkSignature extends SubTileSignature {
|
||||
String name;
|
||||
@@ -25,11 +25,11 @@ public class DarkSignature extends SubTileSignature {
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedNameForStack(ItemStack item){
|
||||
return "tile.darkflower." + name + ".name";
|
||||
return "darkflower." + name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedLoreTextForStack(ItemStack item){
|
||||
return "tile.darkflower." + name + ".lore";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package fox.spiteful.forbidden.tiles;
|
||||
|
||||
import fox.spiteful.forbidden.compat.DarkSignature;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
@@ -9,6 +10,7 @@ import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.items.ItemWispEssence;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
|
||||
@@ -69,4 +71,9 @@ public class SubTileEuclidaisy extends SubTileFunctional {
|
||||
public LexiconEntry getEntry(){
|
||||
return lexicon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(){
|
||||
return ((DarkSignature)(BotaniaAPI.getSignatureForName("euclidaisy"))).getIconForStack(null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package fox.spiteful.forbidden.tiles;
|
||||
|
||||
import fox.spiteful.forbidden.compat.DarkSignature;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.lib.network.PacketHandler;
|
||||
import thaumcraft.common.lib.network.playerdata.PacketAspectPool;
|
||||
import thaumcraft.common.lib.network.playerdata.PacketSyncWarp;
|
||||
import thaumcraft.common.lib.network.playerdata.PacketWarpMessage;
|
||||
import vazkii.botania.api.BotaniaAPI;
|
||||
import vazkii.botania.api.lexicon.LexiconEntry;
|
||||
import vazkii.botania.api.subtile.SubTileFunctional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class SubTileWhisperweed extends SubTileFunctional {
|
||||
private static final int cost = 1500;
|
||||
private final static int range = 3;
|
||||
public static LexiconEntry lexicon;
|
||||
|
||||
@Override
|
||||
public void onUpdate(){
|
||||
super.onUpdate();
|
||||
|
||||
if(redstoneSignal > 0)
|
||||
return;
|
||||
|
||||
if(!supertile.getWorldObj().isRemote && mana >= cost && supertile.getWorldObj().getTotalWorldTime() % 300 == 0) {
|
||||
List<EntityPlayer> players = supertile.getWorldObj().getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - range, supertile.yCoord - range, supertile.zCoord - range, supertile.xCoord + range + 1, supertile.yCoord + range + 1, supertile.zCoord + range + 1));
|
||||
if(players.size() > 0) {
|
||||
EntityPlayer player = players.get(supertile.getWorldObj().rand.nextInt(players.size()));
|
||||
int amt = 1 + player.worldObj.rand.nextInt(3);
|
||||
if(player.worldObj.rand.nextInt(10) < 2){
|
||||
amt += 1 + player.worldObj.rand.nextInt(3);
|
||||
Thaumcraft.addWarpToPlayer(player, 1 + player.worldObj.rand.nextInt(5), true);
|
||||
}
|
||||
|
||||
for(int a = 0; a < amt; ++a) {
|
||||
Aspect aspect;
|
||||
if(player.worldObj.rand.nextInt(25) > 2)
|
||||
aspect = (Aspect)Aspect.getPrimalAspects().get(player.worldObj.rand.nextInt(6));
|
||||
else
|
||||
aspect = (Aspect)Aspect.getCompoundAspects().get(player.worldObj.rand.nextInt(Aspect.getCompoundAspects().size()));
|
||||
Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspect, (short)1);
|
||||
PacketHandler.INSTANCE.sendTo(new PacketAspectPool(aspect.getTag(), (short)1, Short.valueOf(Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspect))), (EntityPlayerMP)player);
|
||||
}
|
||||
mana -= cost;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColor(){
|
||||
return 0x745380;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxMana() {
|
||||
return cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean acceptsRedstone() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LexiconEntry getEntry(){
|
||||
return lexicon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(){
|
||||
return ((DarkSignature)(BotaniaAPI.getSignatureForName("whisperweed"))).getIconForStack(null);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user