diff --git a/src/main/java/fox/spiteful/forbidden/items/baubles/ItemRingNutrition.java b/src/main/java/fox/spiteful/forbidden/items/baubles/ItemRingNutrition.java index 33d577c..09025be 100644 --- a/src/main/java/fox/spiteful/forbidden/items/baubles/ItemRingNutrition.java +++ b/src/main/java/fox/spiteful/forbidden/items/baubles/ItemRingNutrition.java @@ -2,17 +2,30 @@ package fox.spiteful.forbidden.items.baubles; import baubles.api.BaubleType; import baubles.api.IBauble; +import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fox.spiteful.forbidden.Forbidden; +import fox.spiteful.forbidden.compat.Compat; +import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; +import net.minecraft.util.StatCollector; import thaumcraft.api.IRunicArmor; +import thaumcraft.api.aspects.Aspect; +import vazkii.botania.api.item.ICosmeticAttachable; -public class ItemRingNutrition extends Item implements IRunicArmor, IBauble { +import java.util.Iterator; +import java.util.List; + +@Optional.Interface(iface = "vazkii.botania.api.item.ICosmeticAttachable", modid = "Botania") +public class ItemRingNutrition extends Item implements IRunicArmor, IBauble, ICosmeticAttachable { IIcon icon; public ItemRingNutrition(){ @@ -52,4 +65,37 @@ public class ItemRingNutrition extends Item implements IRunicArmor, IBauble { public int getRunicCharge(ItemStack itemstack){ return 0; } + + @Override + public ItemStack getCosmeticItem(ItemStack stack) { + if(stack == null || stack.getTagCompound() == null) + return null; + if(!stack.getTagCompound().hasKey("cosmeticItem")) + return null; + NBTTagCompound cosmetic = stack.getTagCompound().getCompoundTag("cosmeticItem"); + return ItemStack.loadItemStackFromNBT(cosmetic); + } + + @Override + public void setCosmeticItem(ItemStack stack, ItemStack cosmetic) { + if(cosmetic == null || stack == null) + return; + NBTTagCompound cmp = new NBTTagCompound(); + cosmetic.writeToNBT(cmp); + NBTTagCompound tag = stack.getTagCompound(); + if(tag == null){ + tag = new NBTTagCompound(); + stack.setTagCompound(tag); + } + + tag.setTag("cosmeticItem", cmp); + } + + @Override + public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { + + if(Compat.botan && GuiScreen.isShiftKeyDown() && getCosmeticItem(stack) != null) + list.add(String.format(StatCollector.translateToLocal("botaniamisc.hasCosmetic"), getCosmeticItem(stack).getDisplayName()).replaceAll("&", "\u00a7")); + + } } diff --git a/src/main/java/fox/spiteful/forbidden/items/baubles/ItemSubCollar.java b/src/main/java/fox/spiteful/forbidden/items/baubles/ItemSubCollar.java index b277522..379f271 100644 --- a/src/main/java/fox/spiteful/forbidden/items/baubles/ItemSubCollar.java +++ b/src/main/java/fox/spiteful/forbidden/items/baubles/ItemSubCollar.java @@ -1,9 +1,12 @@ package fox.spiteful.forbidden.items.baubles; import baubles.api.BaublesApi; +import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import fox.spiteful.forbidden.Forbidden; +import fox.spiteful.forbidden.compat.Compat; +import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; @@ -19,12 +22,14 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import thaumcraft.api.aspects.Aspect; import thaumcraft.common.items.baubles.ItemAmuletVis; +import vazkii.botania.api.item.ICosmeticAttachable; import java.text.DecimalFormat; import java.util.Iterator; import java.util.List; -public class ItemSubCollar extends ItemAmuletVis { +@Optional.Interface(iface = "vazkii.botania.api.item.ICosmeticAttachable", modid = "Botania") +public class ItemSubCollar extends ItemAmuletVis implements ICosmeticAttachable { public IIcon icon; DecimalFormat myFormatter = new DecimalFormat("#######.##"); @@ -82,6 +87,10 @@ public class ItemSubCollar extends ItemAmuletVis { } if(stack.stackTagCompound.hasKey("owner")) list.add(StatCollector.translateToLocal("tooltip.collar.owner") + " " + stack.stackTagCompound.getString("owner")); + + if(Compat.botan && GuiScreen.isShiftKeyDown() && getCosmeticItem(stack) != null) + list.add(String.format(StatCollector.translateToLocal("botaniamisc.hasCosmetic"), getCosmeticItem(stack).getDisplayName()).replaceAll("&", "\u00a7")); + } } @@ -124,4 +133,29 @@ public class ItemSubCollar extends ItemAmuletVis { list.add(new ItemStack(item, 1, 0)); } + @Override + public ItemStack getCosmeticItem(ItemStack stack) { + if(stack == null || stack.getTagCompound() == null) + return null; + if(!stack.getTagCompound().hasKey("cosmeticItem")) + return null; + NBTTagCompound cosmetic = stack.getTagCompound().getCompoundTag("cosmeticItem"); + return ItemStack.loadItemStackFromNBT(cosmetic); + } + + @Override + public void setCosmeticItem(ItemStack stack, ItemStack cosmetic) { + if(cosmetic == null || stack == null) + return; + NBTTagCompound cmp = new NBTTagCompound(); + cosmetic.writeToNBT(cmp); + NBTTagCompound tag = stack.getTagCompound(); + if(tag == null){ + tag = new NBTTagCompound(); + stack.setTagCompound(tag); + } + + tag.setTag("cosmeticItem", cmp); + } + } diff --git a/src/main/java/fox/spiteful/forbidden/items/scribes/ItemCrystalwell.java b/src/main/java/fox/spiteful/forbidden/items/scribes/ItemCrystalwell.java index 0bac68d..5aa195b 100644 --- a/src/main/java/fox/spiteful/forbidden/items/scribes/ItemCrystalwell.java +++ b/src/main/java/fox/spiteful/forbidden/items/scribes/ItemCrystalwell.java @@ -6,6 +6,7 @@ import fox.spiteful.forbidden.Forbidden; import fox.spiteful.forbidden.LogHandler; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -33,7 +34,10 @@ public class ItemCrystalwell extends Item implements IScribeTools { public ItemCrystalwell() { maxStackSize = 1; canRepair = false; - setMaxDamage(100); + if(Config.researchDifficulty == -1) + setMaxDamage(50); + else + setMaxDamage(100); setCreativeTab(Forbidden.tab); setHasSubtypes(false); @@ -53,7 +57,7 @@ public class ItemCrystalwell extends Item implements IScribeTools { @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { - if (stack.getItemDamage() >= 100) { + if (Config.researchDifficulty != -1 && stack.getItemDamage() >= 100) { if (!world.isRemote) { Aspect aspect; short amount; @@ -72,7 +76,7 @@ public class ItemCrystalwell extends Item implements IScribeTools { } @Override - public void onUpdate(ItemStack stack, World world, Entity entity, int wat, boolean isSelected) { + public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isSelected) { if(world.isRemote) return; @@ -83,6 +87,9 @@ public class ItemCrystalwell extends Item implements IScribeTools { Thaumcraft.proxy.playerKnowledge.addAspectPool(player.getCommandSenderName(), aspect, amount); PacketHandler.INSTANCE.sendTo(new PacketAspectPool(aspect.getTag(), amount, Short.valueOf(Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(player.getCommandSenderName(), aspect))), (EntityPlayerMP) player); ResearchManager.scheduleSave(player); + stack.setItemDamage(stack.getItemDamage() + 1); + if(stack.getItemDamage() >= stack.getMaxDamage()) + ((EntityPlayer)entity).inventory.setInventorySlotContents(slot, null); } } @@ -92,7 +99,7 @@ public class ItemCrystalwell extends Item implements IScribeTools { @SideOnly(Side.CLIENT) @Override public boolean hasEffect(ItemStack stack, int pass) { - return stack.getItemDamage() >= 100; + return Config.researchDifficulty != -1 && stack.getItemDamage() >= 100; } } \ No newline at end of file diff --git a/src/main/java/fox/spiteful/forbidden/tiles/SubTileTainthistle.java b/src/main/java/fox/spiteful/forbidden/tiles/SubTileTainthistle.java index 32799b1..4fac440 100644 --- a/src/main/java/fox/spiteful/forbidden/tiles/SubTileTainthistle.java +++ b/src/main/java/fox/spiteful/forbidden/tiles/SubTileTainthistle.java @@ -35,7 +35,7 @@ public class SubTileTainthistle extends SubTileGenerating { super.onUpdate(); boolean didSomething = false; if(this.ticksExisted % 80 == 0) { - if (mana < getMaxMana() && !supertile.getWorldObj().isRemote) { + if (!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++) { @@ -43,7 +43,7 @@ public class SubTileTainthistle extends SubTileGenerating { int depth = supertile.getWorldObj().getBlockMetadata(ex, wy, zee); supertile.getWorldObj().setBlockToAir(ex, wy, zee); didSomething = true; - burnTime = Math.min(burnTime + depth * (4 + supertile.getWorldObj().rand.nextInt(4)), 4000); + burnTime = Math.min(burnTime + depth * (20), 4000); } } } @@ -119,7 +119,7 @@ public class SubTileTainthistle extends SubTileGenerating { @Override public int getValueForPassiveGeneration() { - return 2 + supertile.getWorldObj().rand.nextInt(5); + return 3; } @Override diff --git a/src/main/resources/assets/forbidden/lang/en_US.lang b/src/main/resources/assets/forbidden/lang/en_US.lang index 747d8a3..f736dfd 100644 --- a/src/main/resources/assets/forbidden/lang/en_US.lang +++ b/src/main/resources/assets/forbidden/lang/en_US.lang @@ -107,6 +107,10 @@ darkflower.euclidaisy.name=Euclidaisy darkflower.whisperweed.name=Whisperweed darkflower.tainthistle.name=Tainthistle darkflower.bloodthorn.name=Bloodthorn +tile.botania:flower.euclidaisy.name=Euclidaisy +tile.botania:flower.whisperweed.name=Whisperweed +tile.botania:flower.tainthistle.name=Tainthistle +tile.botania:flower.bloodthorn.name=Bloodthorn # # Enchantments enchantment.cluster=Fiery Core @@ -143,6 +147,7 @@ message.collar.youplacecollar=You place the collar around %s's neck. itemGroup.forbidden=Forbidden Magic itemGroup.mobcrystal=Imprinting Crystals tc.research_category.FORBIDDEN=Apocrypha +description.villager.profession.forbidden.heretic=Heretic death.attack.blooderp=%1$s was bled dry death.attack.dragonslayer=%1$s was slain by %2$s death.attack.dragonwrack=%1$s succumbed to a mortal wound @@ -341,7 +346,7 @@ forbidden.research_page.BLOODRAPIER.1=There's nothing more dangerous than a Bloo forbidden.research_name.CRYSTALWELL=Crystal Scribing Tools forbidden.research_text.CRYSTALWELL=Arcane Research Grant forbidden.research_page.CRYSTALWELL.1=Combining elemental shards with your inkwell results in some interesting effects. The Crystal Scribing Tools seem to absorb knowledge as you use them to write. Once the well is empty of ink, you can absorb this knowledge for a small burst of research points by holding the tools in your hand and right clicking. Unfortunately, this burns the tool out and turns it back into a mundane Scribing Tool again. -forbidden.research_page.CRYSTALWELL.1b=Research can get boring and tedious sometimes. There's only so many hours you can spend taking apart bits of cobblestone in the sad hope of finding esoteric insights before you start considering a change in careers.

Thankfully, you've devised a way to expedite the process. The Crystal Scribing Tools will slowly transmit knowledge into your mind while carried around.

It's amazing what you can do with crystals! +forbidden.research_page.CRYSTALWELL.1b=Research can get boring and tedious sometimes. There's only so many hours you can spend taking apart bits of cobblestone in the sad hope of finding esoteric insights before you start considering a change in careers.

Thankfully, you've devised a way to expedite the process. The Crystal Scribing Tools contain a small pool of esoteric knowledge which will slowly be transferred into your mind as you carry them around.

Your chakras are going to be SO aligned! # forbidden.research_name.PRIMEWELL=Primal Scribing Tools forbidden.research_text.PRIMEWELL=Bragging Rights @@ -357,7 +362,7 @@ forbidden.research_page.HELLFIRE.1=Getting stranded in the Nether is the worst. # forbidden.research_name.EUCLIDAISY=Euclidaisy forbidden.research_text.EUCLIDAISY=Mai waifu's power level is over 9000 in the name of the moon! Believe it! -forbidden.research_page.EUCLIDAISY.1=Ethereal Essences are extremely useful sources of essentia and are a very important ingredient in Thaumaturge's Salt. Unfortunately, it can be very difficult to come by. Wisps aren't exactly common, and no self-respecting thaumaturge wants to stoop to smashing open a node.

By combining thaumaturgy and hedge magic, you've created a flower that can use mana to rip open the fabric of reality. The rip isn't stable enough to form a node, but it does stay open long enough to drop a single wispy strand of essence. Applying a redstone signal to the flower causes it to stop. +forbidden.research_page.EUCLIDAISY.1=Ethereal Essences are an extremely useful sources of rare Auram essentia. Unfortunately, they can be very difficult to come by. Wisps aren't exactly common, and no self-respecting thaumaturge wants to stoop to smashing open a node.

By combining thaumaturgy and hedge magic, you've created a flower that can use mana to rip open the fabric of reality. The rip isn't stable enough to form a node, but it does stay open long enough to drop a single wispy strand of essence. Applying a redstone signal to the flower causes it to stop. # forbidden.research_name.WHISPERWEED=Whisperweed forbidden.research_text.WHISPERWEED=Dubbed, not Subbed