Merge from master.

This commit is contained in:
MysteriousAges committed 2013-03-04 13:04:21 -08:00
1 parent 1bee56adf3
commit e92d9c131e
59 files changed
+1756 -411

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@
<property name="mc.version" value="1.4.7"/>
<property name="forge.version" value="6.6.0.507"/>
<property name="thaumicbees.version" value="1.3.0"/>
<property name="thaumicbees.version" value="1.4.2"/>
<!-- for local deployment only, not used by main -->
<property name="deploy.type" value="previews" />
+52
View File
@@ -1,3 +1,55 @@
1.4.2
Added Void Capsules - hold up to 8 buckets of liquid with one! It's a waterproof bag of holding!
Fix: Added Greatwood & Silverwood slabs to the ore dictionary so they should work as normal.
1.4.1
Added Greatwood and Silverwood planks. Since Greatwood and Silverwood are tougher than other trees, you'll need some extra machinery. To obtain these, jam a log of the appropriate tree into a Forestry carpenter and provide a half bucket of water.
Added slabs for the new planks also.
1.4.0a
Fixed some issues with the Node bee's effect.
1.4.0
New branch of bees containing 3 new species. A new type of frame!
Thaumaturge's Backpack now require Amber rather than Gold Nuggets.
Due to popular complaint, the Bees & Magic node now requires Unified Thaumic Field Theory to unlock.
Moving all kinds of string contstants out of code into Localization files.
Also fixed crazy aspects showing up on things that shouldn't have those aspects.
1.3.0d
Fixed an issue with mutations requiring a non-specific type of node to fail.
1.3.0c
Discovered a function call that will crash dedicated servers. If you are running ThuamicBees on a server, please update to this revision.
1.3.0b
Fixed a problem with capsules not being registered with the Forge Liquid Dictionary. You should be able to use them just about everywhere, now.
Fixed the issue with certain items appearing twice in Creative Mode tabs.
1.3.0a
Some bug fixes, including uncommenting some mutation-related code, research tweaking.
Added the last bee for a long while, probably. Good luck getting it.
Common TB crashes stemming from Forestry issues should now be reported a little better, especially the backpack registration & item texture file related things. Errors should appear in your log, so make sure you read the log before you report the error here. It could be something silly on your end that is causing the crash.
1.3.0
3 new species of bee: Vis, Pure, and Flux! Each requires an aura node nearby, and may have some side-effects...
New Thaumcraft research! Open up your Thaumanomicon to see it.
New Apiary Frames! They run off magic, confers bees with bonuses, and may have an impact outside of your apiary...
1.2.705B - Replaced 1.2.705
Fixed issue with bad Mutation class, allowing pure bees to turn into any bee that involves them in a mutation.
Also ACTUALLY fixed issue with Extra Bees loading after ThaumicBees on *nix-based systems.
1.2.705
*Stealth update: Fixed an issue with TB loading before Extra Bees, resulting in some Null Pointers getting passed and choked on. If you get this issue, please re-download 1.2.705. No other changes were made in this version.
*8 new species of bees, including "Praecantatio", which, like the other Elemental bees, may contain Vis shards in its propolis. Some of the new species may also have extra evil involved, so be ready for anything.
*Extra integration with Extra Bees! Mutations for some of the new bees. If Extra Bees is present, their mutations will require EB species rather than the base Forestry species.
*Changed the "Charmed" mutation to avoid conflicting with Extra Bees. (Binnie already had one there, so mine got moved.)
*New bee branch, similar to Extra Bees's mob spawning bees.
*One new bee from a new branch, the rest of which will come once Azanor releases the Thaumcraft API.
1.1.702-67 - Replaced 1.1.702-62
Additional Magic Capsules, featuring ExtraBees liquids, and RailCraft Creosote & Steam. (Yes, steam capsules. It's magic. That's how. :P)
Tagged additional Forestry items with Thaumcraft aspects.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 53 KiB

@@ -1 +0,0 @@
storage.backpack.Thaumaturge=Thaumaturge's Backpack
+192
View File
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties version="1.0">
<!-- Item names -->
<entry key="item.jellyBabies.name">Handful of Jelly Babies</entry>
<entry key="item.tb.thaumiumScoop.name">Thaumium Scoop</entry>
<entry key="item.tb.thaumiumGrafter.name">Thaumium Grafter</entry>
<!-- Block names -->
<entry key="tile.tb.planks.greatwood.name">Greatwood Planks</entry>
<entry key="tile.tb.slab.wood.greatwood.name">Greatwood Slab</entry>
<entry key="tile.tb.planks.silverwood.name">Silverwood Planks</entry>
<entry key="tile.tb.slab.wood.silverwood.name">Silverwood Slab</entry>
<entry key="tile.tb.magicApiary.name">Magic Apiary</entry>
<!-- Comb names -->
<entry key="tb.comb.occult">Occult Comb</entry>
<entry key="tb.comb.otherworldly">Otherworldy Comb</entry>
<entry key="tb.comb.paper">Papery Comb</entry>
<entry key="tb.comb.stark">Stark Comb</entry>
<entry key="tb.comb.air">Airy Comb</entry>
<entry key="tb.comb.fire">Firey Comb</entry>
<entry key="tb.comb.water">Watery Comb</entry>
<entry key="tb.comb.earth">Earthy Comb</entry>
<entry key="tb.comb.magic">Infused Comb</entry>
<entry key="tb.comb.aware">Memory Comb</entry>
<entry key="tb.comb.furtive">Furtive Comb</entry>
<!-- Wax names -->
<entry key="tb.wax.magic">Magic Wax</entry>
<!-- Drop names -->
<entry key="tb.drop.enchanting">Enchanting Drop</entry>
<entry key="tb.drop.intellect">Intellect Drop</entry>
<!-- Pollen names -->
<entry key="tb.pollen.unusual">Unusual Pollen</entry>
<entry key="tb.pollen.phased">Phased Pollen</entry>
<!-- Propolis names -->
<entry key="tb.propolis.dull">Dull Propolis</entry>
<entry key="tb.propolis.air">Breezey Propolis</entry>
<entry key="tb.propolis.fire">Burning Propolis</entry>
<entry key="tb.propolis.water">Flowing Propolis</entry>
<entry key="tb.propolis.earth">Stony Propolis</entry>
<entry key="tb.propolis.magic">Infused Propolis</entry>
<!-- Misc Resources -->
<entry key="tb.resource.fragment">Lore Fragment</entry>
<entry key="tb.resource.lump">Aromatic Lump</entry>
<entry key="tb.resource.fertilizer">Concentrated Compound</entry>
<entry key="tb.resource.crystalFlux">Crystalized %s Aspect</entry>
<!-- Frames -->
<entry key="tb.frame.magic">Magic Frame</entry>
<entry key="tb.frame.resillient">Resilient Frame</entry>
<entry key="tb.frame.gentle">Gentle Frame</entry>
<entry key="tb.frame.metabolic">Metabolic Frame</entry>
<entry key="tb.frame.necrotic">Necrotic Frame</entry>
<entry key="tb.frame.temporal">Temporal Frame</entry>
<!-- Capsule names -->
<entry key="tb.capsule.magic">Magic Capsule</entry>
<entry key="tb.capsule.void">Void Capsule</entry>
<!-- Liquids -->
<entry key="tb.liquid.">Empty</entry>
<entry key="tb.liquid.water">Water</entry>
<entry key="tb.liquid.lava">Lava</entry>
<entry key="tb.liquid.biomass">Biomass</entry>
<entry key="tb.liquid.biofuel">Empty</entry>
<entry key="tb.liquid.Oil">Oil</entry>
<entry key="tb.liquid.Fuel">Fuel</entry>
<entry key="tb.liquid.seedoil">Seed Oil</entry>
<entry key="tb.liquid.honey">Honey</entry>
<entry key="tb.liquid.juice">Juice</entry>
<entry key="tb.liquid.ice">Ice</entry>
<entry key="tb.liquid.milk">Milk</entry>
<entry key="tb.liquid.acid">Acid</entry>
<entry key="tb.liquid.poison">Poison</entry>
<entry key="tb.liquid.liquidNitrogen">Liquid Nitrogen</entry>
<entry key="tb.liquid.liquidDNA">Liquid DNA</entry>
<entry key="tb.liquid.Creosote Oil">Creosote Oil</entry>
<entry key="tb.liquid.Steam">Steam</entry>
<!-- Moon Phases -->
<entry key="tb.moon.full">Full Moon</entry>
<entry key="tb.moon.gibbousWaning">Waning Gibbous</entry>
<entry key="tb.moon.gibousWaxing">Waxing Gibbous</entry>
<entry key="tb.moon.halfWaning">Waning Half</entry>
<entry key="tb.moon.halfWaxing">Waxing Half</entry>
<entry key="tb.moon.crescentWaning">Waning Crescent</entry>
<entry key="tb.moon.crescentWaxing">Waxing Crescent</entry>
<entry key="tb.moon.new">New Moon</entry>
<!-- Miscellaneous names -->
<entry key="tb.backpack.thaumaturge">Thaumaturge's Backpack</entry>
<!-- Species names -->
<entry key="thaumicbees.speciesEsoteric">Esoteric</entry>
<entry key="thaumicbees.speciesEsoteric.description">An unusual crossbreed which seems to have magical properties.|Apinomicon</entry>
<entry key="thaumicbees.speciesMysterious">Mysterious</entry>
<entry key="thaumicbees.speciesMysterious.description">These bees have been to the end of the world and back, and their power has grown.|Apinomicon</entry>
<entry key="thaumicbees.speciesArcane">Arcane</entry>
<entry key="thaumicbees.speciesArcane.description">"Their produce is charged with magic."|Azanor, Master Thaumaturge</entry>
<entry key="thaumicbees.speciesCharmed">Charmed</entry>
<entry key="thaumicbees.speciesCharmed.description">Your first experiments in Thaumaturgical Apiculture have yielded fruit. Buzzing fruit.|Apinomicon</entry>
<entry key="thaumicbees.speciesEnchanted">Enchanted</entry>
<entry key="thaumicbees.speciesEnchanted.description">Successive generations of Charmed bees have reinforced their connection to the unknown.|Apinomicon</entry>
<entry key="thaumicbees.speciesSupernatural">Supernatural</entry>
<entry key="thaumicbees.speciesSupernatural.description">These bees walk the line between this world and the unseen.|Apinomicon</entry>
<entry key="thaumicbees.speciesPupil">Pupil</entry>
<entry key="thaumicbees.speciesPupil.description">"What does that bee want with my paper?!|Yorae, Librarian</entry>
<entry key="thaumicbees.speciesScholarly">Scholarly</entry>
<entry key="thaumicbees.speciesScholarly.description">"I can't be sure, but I think they might be smarter than me..."|Yorae, Librarian</entry>
<entry key="thaumicbees.speciesSavant">Savant</entry>
<entry key="thaumicbees.speciesSavant.description">lim(x^(i / pi)/ log(e * 7 - ln(32/x^-pi))). Solve for honey.|Note found on Yorae's desk</entry>
<entry key="thaumicbees.speciesStark">Stark</entry>
<entry key="thaumicbees.speciesStark.description">"These are unusually attracted to shards. This warrents further investigation."|Azanor, Master Thaumaturge</entry>
<entry key="thaumicbees.speciesAura">Aura</entry>
<entry key="thaumicbees.speciesAura.description">"They work so fast it's breathtaking."|Sengir, Mad Apiarist</entry>
<entry key="thaumicbees.speciesIgnis">Ignis</entry>
<entry key="thaumicbees.speciesIgnis.description">Caution: Contents of hive extremely hot.|Warning label on Azanor's apiary</entry>
<entry key="thaumicbees.speciesAqua">Aqua</entry>
<entry key="thaumicbees.speciesAqua.description">"I tried to breed them once, but that was a wash."|MysteriousAges, Apprentice Thaumaturge</entry>
<entry key="thaumicbees.speciesSolum">Solum</entry>
<entry key="thaumicbees.speciesSolum.description">"You're really gonna dig these bees, but watch out - they bore quite easily."|MysteriousAges, Apprentice Comedian</entry>
<entry key="thaumicbees.speciesPraecantatio">Praecantatio</entry>
<entry key="thaumicbees.speciesPraecantatio.description">Beekeeping is magic!|Apinomicon, Preface</entry>
<entry key="thaumicbees.speciesAware">Aware</entry>
<entry key="thaumicbees.speciesAware.description">"They can see into your soul!"|Florastar, Expert Beekeeper</entry>
<entry key="thaumicbees.speciesVis">Vis</entry>
<entry key="thaumicbees.speciesVis.description">"They can feel changes in the aura, but are not yet able to affect it."|Azanor, research notes</entry>
<entry key="thaumicbees.speciesPure">Pure</entry>
<entry key="thaumicbees.speciesPure.description">"It's like a bee janitor!"|MysteriousAges, Thaumaturge</entry>
<entry key="thaumicbees.speciesFlux">Flux</entry>
<entry key="thaumicbees.speciesFlux.description">"I thought they would help clean up, but it only makes things worse!"|Kreicus, Apprentice Thaumaturge</entry>
<entry key="thaumicbees.speciesNode">Node</entry>
<entry key="thaumicbees.speciesNode.description">Having undergone a freak mutation, these bees now attract magic to them.|Apinomicon</entry>
<entry key="thaumicbees.speciesSkulking">Skulking</entry>
<entry key="thaumicbees.speciesSkulking.description">These bees have become xenophobic and bad-tempered. Use caution.|Apinomicon</entry>
<entry key="thaumicbees.speciesBrainy">Brainy</entry>
<entry key="thaumicbees.speciesBrainy.description">Their combs may be fetid and foul-smelling, but their intelligence is well-developed.|Apinomicon</entry>
<entry key="thaumicbees.speciesGossamer">Gossamer</entry>
<entry key="thaumicbees.speciesGossamer.description">As they work, they seem to fade out from light for brief moments.|Apinomicon</entry>
<entry key="thaumicbees.speciesWispy">Wispy</entry>
<entry key="thaumicbees.speciesWispy.description">Their language is garbled and unintelligible. It is probable they are speaking to unnatural beings.|Apinomicon</entry>
<entry key="thaumicbees.speciesBatty">Batty</entry>
<entry key="thaumicbees.speciesBatty.description">They tend to attract bats to their hives through means unknown.|Apinomicon</entry>
<entry key="thaumicbees.speciesGhastly">Ghastly</entry>
<entry key="thaumicbees.speciesGhastly.description">"*sigh*... Really, Myst?"|Taveria</entry>
<entry key="thaumicbees.speciesTimely">Timely</entry>
<entry key="thaumicbees.speciesTimely.description">"An apiarist is never late. He arrives precicely when he means to!"|Sengir, Mad Apiarist</entry>
<entry key="thaumicbees.speciesLordly">Lordly</entry>
<entry key="thaumicbees.speciesLordly.description">They live in peace, within the sight of the Eye of Harmony|Tattered Remains of ancient Apinomicon</entry>
<entry key="thaumicbees.speciesDoctoral">Doctoral</entry>
<entry key="thaumicbees.speciesDoctoral.description">"Would you like a Jelly Baby?"|Passing stranger with a great scarf and a blue box</entry>
<!-- Bee Alleles -->
<entry key="thaumicbees.effectCurative">Cleansing</entry>
<entry key="thaumicbees.effecteffectDigSpeed">Mining</entry>
<entry key="thaumicbees.effecteffectMoveSpeed">Swiftness</entry>
<entry key="thaumicbees.effecteffectSlowSpeed">Time Warp</entry>
<entry key="thaumicbees.effectNodeGeneration">Aura Attract</entry>
<entry key="thaumicbees.effectBrainy">Brainy</entry>
<entry key="thaumicbees.effectBatty">Batty</entry>
<entry key="thaumicbees.effectWispy">Wispy</entry>
<entry key="thaumicbees.Ghast">Ghastly</entry>
<entry key="tb.bees.flower.book">Books</entry>
<entry key="tb.bees.flower.magic">Magic Flowers</entry>
<entry key="tb.bees.flower.node">Node</entry>
<entry key="tb.bees.flower.nodePure">Purify Node</entry>
<entry key="tb.bees.flower.nodeFlux">Fluxify Node</entry>
<!-- Classifications -->
<entry key="classification.arcane">Arcane</entry>
<entry key="classification.arcane.description"></entry>
<entry key="classification.supernatural">Supernatural</entry>
<entry key="classification.supernatural.description"></entry>
<entry key="classification.scholarly">Scholarly</entry>
<entry key="classification.scholarly.description"></entry>
<entry key="classification.thaumic">Thaumic</entry>
<entry key="classification.thaumic.description"></entry>
<entry key="classification.skulking">Skulking</entry>
<entry key="classification.skulking.description"></entry>
<entry key="classification.vis">Vis</entry>
<entry key="classification.vis.description"></entry>
<entry key="classification.time">Time</entry>
<entry key="classification.time.description"></entry>
</properties>
@@ -99,8 +99,38 @@ Like the Magic Frame, this frame consumes aura to maintain its enchantments. Thi
<longText>You have been seeking a way to significantly extend bee life. It should be possible by adding a frame enchanted with the essence of time to the hive.</longText>
<page type="text">Keeping bees has been frustrating, as the insects' short lives requires you to manually intervene far too often.
A new variation of your frame design, this version involving some Time magic, should help extend their lives significantly.</page>
A new variation of your frame design, this version involving some Time magic, should help extend their lives significantly. Like the Magic frame, this one too requires aura to run, and will produce flux now and again.</page>
<page type="infusioncrafting">FRAMETIME</page>
</project>
<project id="VOIDCAPSULE">
<name>Void Capsule</name>
<popupText>Another Dimension of Liquid Storage</popupText>
<longText>It seems reasonable that if you can shift blocks and other matter into an alternate dimension temporarily, you should be able to do something similar with liquids.</longText>
<page type="text">These new capsules can hold the equivalent of 8 buckets' worth of liquid by syphoning off a large quantity into a pocket dimension temporarily.
Like other capsules, they are fragile and are typically single-use. They have proven popular for long-term storage.</page>
<page type="infusioncrafting">VOIDCAPSULE</page>
</project>
<project id="THAUMIUMSCOOP">
<name>Thaumium Scoop</name>
<popupText>Stronger, Faster, Bee-ter</popupText>
<longText>It is possible to improve the durability of the scoop by creating them out of sterner materials. While you're at it, it may be helpful to enable them to be enchanted with restorative magics.</longText>
<page type="text">This improved scoop is more durable than the plain one your non-magical beekeeping friends are liable to use. It is good for three times as long as the average scoop at the cost of using some thaumium instead.
Because the thaumium present in its construction, it is possible to enchant the scoop with a Repairing spell in the usual manner.</page>
<page type="arcanecrafting">THAUMIUMSCOOP</page>
</project>
<project id="THAUMIUMGRAFTER">
<name>Thaumium Grafter</name>
<popupText>The Treesnipper</popupText>
<longText>This improved grafter is more durable than the plain one your non-magical arborist acquaintances tend to use in their exploits. It should be possible to allow them to be enchanted with repairing magic to make them last indefinitely.</longText>
<page type="text">Adding Thaumium to your grafter design has increased its durability significantly - up to two times longer than regular grafters.
It is also possible to enchant them with the Repair enchant, given sufficient experience.</page>
<page type="arcanecrafting">THAUMIUMGRAFTER</page>
</project>
</research>
@@ -0,0 +1,199 @@
package net.mysteriousages.utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
/**
* Provides some common functionality for Inventory clusters. Performs bounds-checking on slot args.
*
* @author MysteriousAges
*
*/
public class GenericInventory implements IInventory
{
private ItemStack[] inventory;
private String name;
private int stackLimit;
public GenericInventory(String inventoryName, int slotCount)
{
this(inventoryName, slotCount, 64);
}
public GenericInventory(String inventoryName, int slotCount, int maxStackSize)
{
this.inventory = new ItemStack[slotCount];
this.name = inventoryName;
this.stackLimit = maxStackSize;
}
@Override
public int getSizeInventory()
{
return this.inventory.length;
}
@Override
public ItemStack getStackInSlot(int slot)
{
ItemStack result = null;
if (this.slotNumberValid(slot))
{
result = this.inventory[slot];
}
return result;
}
@Override
public ItemStack decrStackSize(int slot, int count)
{
ItemStack result = null;
if (this.slotNumberValid(slot))
{
if (this.inventory[slot] != null)
{
result = this.inventory[slot].splitStack(Math.min(count, this.inventory[slot].stackSize));
if (this.inventory[slot].stackSize <= 0)
{
this.inventory[slot] = null;
}
}
}
return result;
}
@Override
public ItemStack getStackInSlotOnClosing(int slot)
{
return this.getStackInSlot(slot);
}
@Override
public void setInventorySlotContents(int slot, ItemStack itemStack)
{
if (this.slotNumberValid(slot))
{
this.inventory[slot] = itemStack;
}
}
@Override
public String getInvName()
{
return this.name;
}
@Override
public int getInventoryStackLimit()
{
return this.stackLimit;
}
public ItemStack[] getInventory()
{
return this.inventory;
}
@Override
public void onInventoryChanged() { }
@Override
public boolean isUseableByPlayer(EntityPlayer player)
{
return true;
}
/**
* Accepts an ItemStack and attempts to merge it with a similar item stack or an empty slot.
* @param stack
* @return Any leftover items, or null if the merge completed successfully.
*/
public ItemStack attemptStackMerge(ItemStack stack)
{
for (int i = 0; i < this.inventory.length; ++i)
{
if (this.inventory[i] == null)
{
this.inventory[i] = stack;
stack = null;
break;
}
else if (this.inventory[i].isItemEqual(stack))
{
int freeSlots = stack.getItem().getItemStackLimit() - this.inventory[i].stackSize;
this.inventory[i].stackSize += freeSlots;
stack.stackSize -= freeSlots;
}
if (stack.stackSize <= 0)
{
stack = null;
break;
}
}
return stack;
}
public void writeToNBT(NBTTagCompound tag)
{
tag.setString("Name", this.name);
tag.setInteger("Size", this.inventory.length);
NBTTagList itemList = new NBTTagList();
for (int i = 0; i < this.inventory.length; ++i)
{
NBTTagCompound itemTag = new NBTTagCompound();
itemTag.setByte("Slot", (byte)i);
this.inventory[i].writeToNBT(itemTag);
itemList.appendTag(itemTag);
}
tag.setTag("Items", itemList);
}
public void readFromNBT(NBTTagCompound tag)
{
this.name = tag.getString("Name");
NBTTagList itemList = tag.getTagList("Items");
int length = tag.getInteger("Size");
this.inventory = new ItemStack[length];
for (int i = 0; i < itemList.tagCount(); ++i)
{
NBTTagCompound item = (NBTTagCompound)itemList.tagAt(i);
int slotId = item.getByte("Slot");
if (slotId >= 0 && slotId < this.inventory.length)
{
this.inventory[slotId] = ItemStack.loadItemStackFromNBT(item);
}
}
}
/**
* Checks to see if the given slot number is valid with the inventory size
* @param slot
* @return True, if slot in [0, inventory size)
*/
protected boolean slotNumberValid(int slot)
{
return slot >= 0 && slot < this.inventory.length;
}
@Override
public void openChest() { }
@Override
public void closeChest() { }
}
@@ -0,0 +1,71 @@
package net.mysteriousages.utils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.nbt.NBTTagCompound;
/**
* Provides basic functionality for an owned inventory.
* @author MysteriousAges
*
*/
public class GenericOwnedInventory extends GenericInventory
{
private String ownerName;
private boolean isPublic;
public GenericOwnedInventory(EntityPlayer player, String inventoryName, int slotCount)
{
super(inventoryName, slotCount);
this.setInfo(player);
}
public GenericOwnedInventory(EntityPlayer player, String inventoryName, int slotCount, int maxStackSize)
{
super(inventoryName, slotCount, maxStackSize);
this.setInfo(player);
}
private void setInfo(EntityPlayer player)
{
this.ownerName = player.username;
}
public void setPubliclyAccessible(boolean flag)
{
this.isPublic = flag;
}
public String getOwnerName()
{
return this.ownerName;
}
public boolean isPubliclyAccessible()
{
return this.isPublic;
}
@Override
public boolean isUseableByPlayer(EntityPlayer player)
{
return this.isPublic || this.ownerName.equalsIgnoreCase(player.username);
}
@Override
public void writeToNBT(NBTTagCompound tag)
{
super.writeToNBT(tag);
tag.setString("Owner", this.ownerName);
tag.setBoolean("PublicFlag", this.isPublic);
}
@Override
public void readFromNBT(NBTTagCompound tag)
{
super.readFromNBT(tag);
this.ownerName = tag.getString("Owner");
this.isPublic = tag.getBoolean("PublicFlag");
}
}
+9 -9
View File
@@ -1,7 +1,7 @@
package thaumicbees.bees;
import net.minecraft.potion.Potion;
import thaumicbees.compat.ThaumcraftHelper;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele;
@@ -37,22 +37,22 @@ public class Allele implements IAllele
Allele.flowerNodeFluxify = new AlleleFlower("flowerAuraNodeFlux", new FlowerProviderAuraNodeFlux(), false);
Allele.cleansingEffect = new AlleleEffectCure("effectCurative", false);
Allele.digSpeed = new AlleleEffectPotion("effectDigSpeed", "Mining", Potion.digSpeed, 7, false);
Allele.moveSpeed = new AlleleEffectPotion("effectMoveSpeed", "Swiftness", Potion.moveSpeed, 5, false);
Allele.slowSpeed = new AlleleEffectPotion("effectSlowSpeed", "Time Warp", Potion.moveSlowdown, 3, false);
Allele.digSpeed = new AlleleEffectPotion("effectDigSpeed", Potion.digSpeed, 7, false);
Allele.moveSpeed = new AlleleEffectPotion("effectMoveSpeed", Potion.moveSpeed, 5, false);
Allele.slowSpeed = new AlleleEffectPotion("effectSlowSpeed", Potion.moveSlowdown, 3, false);
Allele.nodeGen = new AlleleEffectAuraNodeGrow("effectNodeGeneration", "Nodeify", false, 400);
Allele.nodeGen = new AlleleEffectAuraNodeGrow("effectNodeGeneration", false, 400);
Allele.spawnBrainyZombie = new AlleleEffectSpawnMob("effectBrainy", false, "Brainy", ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID);
Allele.spawnBrainyZombie = new AlleleEffectSpawnMob("effectBrainy", false, ThaumcraftHelper.Entity.BRAINY_ZOMBIE.entityID);
Allele.spawnBrainyZombie.setAggrosPlayerOnSpawn().setThrottle(800).setSpawnsOnPlayerNear(null).setMaxMobsInSpawnZone(2);
Allele.spawnBats = new AlleleEffectSpawnMob("effectBatty", false, "Batty", ThaumcraftHelper.Entity.FIREBAT.entityID);
Allele.spawnBats = new AlleleEffectSpawnMob("effectBatty", false, ThaumcraftHelper.Entity.FIREBAT.entityID);
Allele.spawnBats.setThrottle(300).setSpawnsOnPlayerNear("Bat");
Allele.spawnWisp = new AlleleEffectSpawnWisp("effectWispy", false, "Wispy", ThaumcraftHelper.Entity.WISP.entityID);
Allele.spawnWisp = new AlleleEffectSpawnWisp("effectWispy", false, ThaumcraftHelper.Entity.WISP.entityID);
Allele.spawnWisp.setThrottle(1800);
Allele.spawnGhast = new AlleleEffectSpawnMob("Ghast", false, "Ghastly", "Ghast");
Allele.spawnGhast = new AlleleEffectSpawnMob("Ghast", false, "Ghast");
Allele.spawnGhast.setThrottle(2000).setChanceToSpawn(20).setMaxMobsInSpawnZone(1);
}
@@ -2,11 +2,14 @@ package thaumicbees.bees;
import java.util.List;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.World;
import thaumicbees.main.ThaumicBees;
import thaumicbees.main.utils.LocalizationManager;
import forestry.api.apiculture.IAlleleBeeEffect;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
@@ -14,12 +17,10 @@ import forestry.api.genetics.IEffectData;
public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
{
protected String readableName;
public AlleleEffect(String id, boolean isDominant, String identifier)
public AlleleEffect(String id, boolean isDominant)
{
super(id, isDominant);
this.readableName = identifier;
}
@Override
@@ -34,7 +35,7 @@ public abstract class AlleleEffect extends Allele implements IAlleleBeeEffect
@Override
public String getIdentifier()
{
return this.readableName;
return LocalizationManager.getLocalizedString(getUID());
}
@Override
@@ -16,9 +16,9 @@ public class AlleleEffectAuraNodeGrow extends AlleleEffect
private int throttle;
public AlleleEffectAuraNodeGrow(String id, String identifier, boolean isDominant, int timeout)
public AlleleEffectAuraNodeGrow(String id, boolean isDominant, int timeout)
{
super(id, isDominant, identifier);
super(id, isDominant);
this.throttle = timeout;
}
@@ -39,7 +39,7 @@ public class AlleleEffectAuraNodeGrow extends AlleleEffect
if (value >= throttle)
{
World w = housing.getWorld();
if (w.rand.nextInt(15) < 1)
if (w.rand.nextInt(10) < 1)
{
float x = housing.getXCoord();
float y = housing.getYCoord();
@@ -48,7 +48,7 @@ public class AlleleEffectAuraNodeGrow extends AlleleEffect
if (nodeId != -1)
{
AuraNode node = ThaumcraftApi.getNodeCopy(nodeId);
if (node.level >= node.baseLevel * 3 / 4)
if (node.level >= node.baseLevel * 4 / 5)
{
x = (float)(x - node.xPos);
y = (float)(y - node.yPos);
@@ -59,11 +59,11 @@ public class AlleleEffectAuraNodeGrow extends AlleleEffect
y = y / distance;
z = z / distance;
x *= 0.0125f;
y *= 0.0125f;
z *= 0.0125f;
x *= 0.05f;
y *= 0.05f;
z *= 0.05f;
ThaumcraftApi.queueNodeChanges(nodeId, node.baseLevel * -3 / 10, w.rand.nextInt(1), false, null, x, y, z);
ThaumcraftApi.queueNodeChanges(nodeId, node.baseLevel * -1 / 13, w.rand.nextInt(2), false, null, x, y, z);
}
}
}
@@ -21,7 +21,7 @@ public class AlleleEffectCure extends AlleleEffect
public AlleleEffectCure(String id, boolean isDominant)
{
super(id, isDominant, "Cleansing");
super(id, isDominant);
}
@Override
@@ -18,9 +18,9 @@ public class AlleleEffectPotion extends AlleleEffect
private int potionId;
private int duration;
public AlleleEffectPotion(String name, String readableName, Potion potionApplied, int effectDuration, boolean isDominant)
public AlleleEffectPotion(String name, Potion potionApplied, int effectDuration, boolean isDominant)
{
super("effect" + name, isDominant, readableName);
super("effect" + name, isDominant);
this.potionId = potionApplied.id;
this.duration = 20 * effectDuration;
}
@@ -25,9 +25,9 @@ public class AlleleEffectSpawnMob extends AlleleEffect
protected int chanceToSpawn;
protected int maxMobsInArea;
public AlleleEffectSpawnMob(String id, boolean isDominant, String identifier, String mobToSpawn)
public AlleleEffectSpawnMob(String id, boolean isDominant, String mobToSpawn)
{
super(id, isDominant, identifier);
super(id, isDominant);
this.aggosOnPlayer = false;
this.mobName = mobToSpawn;
this.throttle = 200;
@@ -3,8 +3,8 @@ package thaumicbees.bees;
import java.lang.reflect.Field;
import cpw.mods.fml.common.FMLLog;
import thaumicbees.compat.ThaumcraftHelper;
import thaumicbees.item.ItemArmorApiarist;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import net.minecraft.entity.EntityList;
@@ -18,9 +18,9 @@ public class AlleleEffectSpawnWisp extends AlleleEffectSpawnMob
private byte[] wispTypes = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 };
public AlleleEffectSpawnWisp(String id, boolean isDominant, String identifier, String mobToSpawn)
public AlleleEffectSpawnWisp(String id, boolean isDominant, String mobToSpawn)
{
super(id, isDominant, identifier, mobToSpawn);
super(id, isDominant, mobToSpawn);
}
@Override
@@ -2,36 +2,36 @@ package thaumicbees.bees;
import java.util.ArrayList;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAlleleSpecies;
import forestry.api.genetics.IClassification;
public enum BeeClassification implements IClassification
{
ARCANE("Arcane", "Arcanus", ""),
SUPERNATURAL("Supernatural", "Coeleste", ""),
SCHOLARLY("Scholarly", "Docto", ""),
THAUMIC("Thaumic", "Thaumis", ""),
SKULKING("Skulking", "Malevolens", ""),
VIS("Vis", "Patabilis", ""),
TIME("Time", "Sempiternus", ""),
ARCANE("Arcane", "Arcanus"),
SUPERNATURAL("Supernatural", ""),
SCHOLARLY("Scholarly", ""),
THAUMIC("Thaumic", ""),
SKULKING("Skulking", ""),
VIS("Vis", ""),
TIME("Time", ""),
;
private String uID;
private String name;
private String scientific;
private String description;
private String latin;
private ArrayList<IAlleleSpecies> species;
private IClassification parent;
private EnumClassLevel level;
private BeeClassification(String name, String latin, String desc)
private BeeClassification(String name, String scientific)
{
this.uID = "classification." + name.toLowerCase();
this.name = name;
this.scientific = latin;
this.latin = scientific;
this.level = EnumClassLevel.GENUS;
this.description = desc;
this.species = new ArrayList();
this.parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
AlleleManager.alleleRegistry.registerClassification(this);
@@ -52,19 +52,19 @@ public enum BeeClassification implements IClassification
@Override
public String getName()
{
return this.name;
return LocalizationManager.getLocalizedString(getUID());
}
@Override
public String getScientific()
{
return this.scientific;
return this.latin;
}
@Override
public String getDescription()
{
return this.description;
return LocalizationManager.getLocalizedString(getUID() + ".description");
}
@Override
@@ -9,13 +9,16 @@ import forestry.api.genetics.IClassification.EnumClassLevel;
import java.util.HashMap;
import thaumicbees.compat.ForestryHelper;
import thaumicbees.compat.ThaumcraftHelper;
import cpw.mods.fml.common.registry.LanguageRegistry;
import thaumicbees.item.types.CombType;
import thaumicbees.item.types.DropType;
import thaumicbees.item.types.PollenType;
import thaumicbees.item.types.ResourceType;
import thaumicbees.main.Config;
import thaumicbees.main.utils.LocalizationManager;
import thaumicbees.main.utils.compat.ForestryHelper;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
@@ -25,63 +28,63 @@ import net.minecraft.world.World;
public enum BeeSpecies implements IAlleleBeeSpecies
{
ESOTERIC("Esoteric", "An unusual crossbreed which seems to have magical properties.|Apinomicon", "secretiore",
ESOTERIC("Esoteric", "secretiore",
BeeClassification.ARCANE, 0x001099, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
MYSTERIOUS("Mysterious", "These bees have been to the end of the world and back, and their power has grown.|Apinomicon", "mysticus",
MYSTERIOUS("Mysterious", "mysticus",
BeeClassification.ARCANE, 0x762bc2, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
ARCANE("Arcane", "\"Their produce is charged with magic.\"|Azanor, Master Thaumaturge", "arcanus",
ARCANE("Arcane", "arcanus",
BeeClassification.ARCANE, 0xd242df, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
CHARMED("Charmed", "Your first experiments in Thaumaturgical Apiculture have yielded fruit. Buzzing fruit.|Apinomicon", "larvatus",
CHARMED("Charmed", "larvatus",
BeeClassification.SUPERNATURAL, 0x48EEEC, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
ENCHANTED("Enchanted", "Successive generations of Charmed bees have reinforced their connection to the unknown.|Apinomicon", "cantatus",
ENCHANTED("Enchanted", "cantatus",
BeeClassification.SUPERNATURAL, 0x18e726, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
SUPERNATURAL("Supernatural", "These bees walk the line between this world and the unseen.|Apinomicon", "coeleste",
SUPERNATURAL("Supernatural", "coeleste",
BeeClassification.SUPERNATURAL, 0x005614, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
PUPIL("Pupil", "\"What does that bee want with my paper?!|Yorae, Librarian", "disciplina",
PUPIL("Pupil", "disciplina",
BeeClassification.SCHOLARLY, 0xFFFF00, EnumTemperature.NORMAL, EnumHumidity.ARID, false, true),
SCHOLARLY("Scholarly", "\"I can't be sure, but I think they might be smarter than me...\"|Yorae, Librarian", "studiosis",
SCHOLARLY("Scholarly", "studiosis",
BeeClassification.SCHOLARLY, 0x6E0000, EnumTemperature.NORMAL, EnumHumidity.ARID, false, false),
SAVANT("Savant", "lim(x^(i / pi)/ log(e * 7 - ln(32/x^-pi))). Solve for honey.|Note found on Yorae's desk", "philologus",
SAVANT("Savant", "philologus",
BeeClassification.SCHOLARLY, 0x6E1C6D, EnumTemperature.NORMAL, EnumHumidity.ARID, true, false),
STARK("Stark", "\"These are unusually attracted to shards. This warrents further investigation.\"|Azanor, Master Thaumaturge", "torridae",
STARK("Stark", "torridae",
BeeClassification.THAUMIC, 0xCCCCCC, 0x999999, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
AIR("Aura", "\"They work so fast it's breathtaking.\"|Sengir, Mad Apiarist", "ventosa",
AIR("Aura", "ventosa",
BeeClassification.THAUMIC, 0xD9D636, 0xA19E10, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
FIRE("Ignis", "Caution: Contents of hive extremely hot.|Warning label on Azanor's apiary", "praefervidus",
FIRE("Ignis", "praefervidus",
BeeClassification.THAUMIC, 0xE50B0B, 0x95132F, EnumTemperature.HOT, EnumHumidity.ARID, true, true),
WATER("Aqua", "\"I tried to breed them once, but that was a wash.\"|MysteriousAges, Apprentice Thaumaturge", "umidus",
WATER("Aqua", "umidus",
BeeClassification.THAUMIC, 0x36CFD9, 0x1054A1, EnumTemperature.NORMAL, EnumHumidity.DAMP, true, true),
EARTH("Solum", "\"You're really gonna dig these bees, but watch out - they bore quite easily.\"|MysteriousAges, Apprentice Comedian", "sordida",
EARTH("Solum", "sordida",
BeeClassification.THAUMIC, 0x005100, 0x00a000, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
INFUSED("Praecantatio", "Beekeeping is magic!|Apinomicon, Preface", "azanorius",
INFUSED("Praecantatio", "azanorius",
BeeClassification.THAUMIC, 0xaa32fc, 0x7A489E, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, true),
AWARE("Aware", "\"They can see into your soul!\"|Florastar, Expert Beekeeper", "sensibilis",
AWARE("Aware", "sensibilis",
BeeClassification.VIS, 0xb0092e9, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
VIS("Vis", "\"They can feel changes in the aura, but are not yet able to affect it.\"|Azanor, research notes", "arcanus saecula",
VIS("Vis", "arcanus saecula",
BeeClassification.VIS, 0x004c99, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
PURE("Pure", "\"It's like a bee janitor!\"|MysteriousAges, Thaumaturge", "arcanus puritatem",
PURE("Pure", "arcanus puritatem",
BeeClassification.VIS, 0xb0092e9, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
FLUX("Flux", "\"I thought they would help clean up, but it only makes things worse!\"|Kreicus, Apprentice Thaumaturge", "arcanus labe",
FLUX("Flux", "arcanus labe",
BeeClassification.VIS, 0x004c99, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
NODE("Node", "Having undergone a freak mutation, these bees now attract magic to them.|Apinomicon", "conficiens",
NODE("Node", "conficiens",
BeeClassification.VIS, 0xFFF266, 0xFF8CE9, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
SKULKING("Skulking", "These bees have become xenophobic and bad-tempered. Use caution.|Apinomicon", "malevolens",
SKULKING("Skulking", "malevolens",
BeeClassification.SKULKING, 0x524827, 0xe15236, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
BRAINY("Brainy", "Their combs may be fetid and foul-smelling, but their intelligence is well-developed.|Apinomicon", "cerebrum",
BRAINY("Brainy", "cerebrum",
BeeClassification.SKULKING, 0x83FF70, 0xe15236, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
GOSSAMER("Gossamer", "As they work, they seem to fade out from light for brief moments.|Apinomicon", "perlucidus",
GOSSAMER("Gossamer", "perlucidus",
BeeClassification.SKULKING, 0x183f66, 0xe15236, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
WISPY("Wispy", "Their language is garbled and unintelligible. It is probable they are speaking to unnatural beings.|Apinomicon", "umbrabilis",
WISPY("Wispy", "umbrabilis",
BeeClassification.SKULKING, 0x9cb8d5, 0xe15236, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
BATTY("Batty", "They tend to attract bats to their hives through means unknown.|Apinomicon", "chiroptera",
BATTY("Batty", "chiroptera",
BeeClassification.SKULKING, 0x27350d, 0xe15236, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false,true),
GHASTLY("Ghastly", "\"*sigh*... Really, Myst?\"|Taveria", "pallens",
GHASTLY("Ghastly", "pallens",
BeeClassification.SKULKING, 0xccccee, 0xbf877c, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
TIMELY("Timely", "\"An apiarist is never late. He arrives precicely when he means to!\"|Sengir, Mad Apiarist", "gallifreis",
TIMELY("Timely", "gallifreis",
BeeClassification.TIME, 0xC6AF86, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, true),
LORDLY("Lordly", "", "rassilonis",
LORDLY("Lordly", "rassilonis",
BeeClassification.TIME, 0xC6AF86, 0x8E0213, EnumTemperature.NORMAL, EnumHumidity.NORMAL, false, false),
DOCTORAL("Doctoral", "\"Would you like a Jelly Baby?\"", "medicus qui",
DOCTORAL("Doctoral", "medicus qui",
BeeClassification.TIME, 0xDDE5FC, 0x4B6E8C, EnumTemperature.NORMAL, EnumHumidity.NORMAL, true, false),
;
@@ -180,19 +183,22 @@ public enum BeeSpecies implements IAlleleBeeSpecies
.setGenome(BeeGenomeManager.getTemplateGhastly())
.register();
TIMELY.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.DRIPPING.ordinal()), 25)
.addProduct(Config.pollen.getStackForType(PollenType.PHASED), 10)
.setGenome(BeeGenomeManager.getTemplateTimely())
.register();
LORDLY.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 30)
LORDLY.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 5)
.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.DRIPPING.ordinal()), 25)
.addProduct(Config.pollen.getStackForType(PollenType.PHASED), 15)
.setGenome(BeeGenomeManager.getTemplateLordly())
.register();
DOCTORAL.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 35)
.addSpecialty(new ItemStack(Config.jellyBaby), 5)
DOCTORAL.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.MYSTERIOUS.ordinal()), 10)
.addProduct(new ItemStack(Config.fBeeComb, 1, ForestryHelper.Comb.DRIPPING.ordinal()), 25)
.addProduct(Config.pollen.getStackForType(PollenType.PHASED), 19)
.addSpecialty(new ItemStack(Config.jellyBaby), 7)
.setGenome(BeeGenomeManager.getTemplateDoctoral())
.register();
}
private String name;
private String descripton;
private String binomial;
private String authority;
private int bodyType;
@@ -210,23 +216,21 @@ public enum BeeSpecies implements IAlleleBeeSpecies
private String uid;
private boolean dominant;
private BeeSpecies(String speciesName, String speciesDescription, String genusName, IClassification classification, int firstColour, EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesDominant)
private BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesDominant)
{
this(speciesName, speciesDescription, genusName, classification, 0, firstColour, 0xFF6E0D, preferredTemp, preferredHumidity, hasGlowEffect, true, true, isSpeciesDominant);
this(speciesName, genusName, classification, 0, firstColour, 0xFF6E0D, preferredTemp, preferredHumidity, hasGlowEffect, true, true, isSpeciesDominant);
}
private BeeSpecies(String speciesName, String speciesDescription, String genusName, IClassification classification, int firstColour, int secondColour, EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesDominant)
private BeeSpecies(String speciesName, String genusName, IClassification classification, int firstColour, int secondColour, EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesDominant)
{
this(speciesName, speciesDescription, genusName, classification, 0, firstColour, secondColour, preferredTemp, preferredHumidity, hasGlowEffect, true, true, isSpeciesDominant);
this(speciesName, genusName, classification, 0, firstColour, secondColour, preferredTemp, preferredHumidity, hasGlowEffect, true, true, isSpeciesDominant);
}
private BeeSpecies(String speciesName, String speciesDescription, String genusName, IClassification classification, int body, int firstColour, int secondColour, EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesSecret, boolean isSpeciesCounted, boolean isSpeciesDominant)
private BeeSpecies(String speciesName, String genusName, IClassification classification, int body, int firstColour, int secondColour, EnumTemperature preferredTemp, EnumHumidity preferredHumidity, boolean hasGlowEffect, boolean isSpeciesSecret, boolean isSpeciesCounted, boolean isSpeciesDominant)
{
this.uid = "thaumicbees.species" + speciesName;
this.dominant = isSpeciesDominant;
AlleleManager.alleleRegistry.registerAllele(this);
name = speciesName;
descripton = speciesDescription;
binomial = genusName;
authority = "MysteriousAges";
bodyType = body;
@@ -273,12 +277,12 @@ public enum BeeSpecies implements IAlleleBeeSpecies
public String getName()
{
return name;
return LocalizationManager.getLocalizedString(getUID());
}
public String getDescription()
{
return descripton;
return LocalizationManager.getLocalizedString(getUID() + ".description");
}
public int getBodyType()
@@ -1,8 +1,10 @@
package thaumicbees.bees;
import cpw.mods.fml.common.registry.LanguageRegistry;
import thaumcraft.api.AuraNode;
import thaumcraft.api.ThaumcraftApi;
import thaumicbees.main.Config;
import thaumicbees.main.utils.LocalizationManager;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -44,7 +46,7 @@ public class FlowerProviderAuraNode implements IFlowerProvider
@Override
public String getDescription()
{
return "Node";
return LocalizationManager.getLocalizedString("tb.bees.flower.node");
}
@Override
@@ -1,8 +1,10 @@
package thaumicbees.bees;
import cpw.mods.fml.common.registry.LanguageRegistry;
import thaumcraft.api.EnumTag;
import thaumcraft.api.ObjectTags;
import thaumcraft.api.ThaumcraftApi;
import thaumicbees.main.utils.LocalizationManager;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import forestry.api.apiculture.IBeeGenome;
@@ -14,7 +16,7 @@ public class FlowerProviderAuraNodeFlux extends FlowerProviderAuraNode
@Override
public ItemStack[] affectProducts(World world, IBeeGenome genome, int x, int y, int z, ItemStack[] products)
{
if (world.rand.nextInt(10) < 1)
if (world.rand.nextInt(20) < 1)
{
EnumTag tag;
do
@@ -37,6 +39,6 @@ public class FlowerProviderAuraNodeFlux extends FlowerProviderAuraNode
@Override
public String getDescription()
{
return "Node Flux";
return LocalizationManager.getLocalizedString("tb.bees.flower.nodeFlux");
}
}
@@ -1,5 +1,6 @@
package thaumicbees.bees;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -8,6 +9,7 @@ import thaumcraft.api.EnumTag;
import thaumcraft.api.ObjectTags;
import thaumcraft.api.ThaumcraftApi;
import thaumicbees.main.Config;
import thaumicbees.main.utils.LocalizationManager;
import forestry.api.apiculture.IBeeGenome;
public class FlowerProviderAuraNodePurify extends FlowerProviderAuraNode
@@ -21,16 +23,16 @@ public class FlowerProviderAuraNodePurify extends FlowerProviderAuraNode
@Override
public String getDescription()
{
return "Node Purify";
return LocalizationManager.getLocalizedString("tb.bees.flower.nodePure");
}
@Override
public ItemStack[] affectProducts(World world, IBeeGenome genome, int x, int y, int z, ItemStack[] products)
{
if (world.rand.nextInt(10) < 1)
if (world.rand.nextInt(25) < 1)
{
AuraNode node = this.getNodeWithinRange(world, x, y, z);
if (node != null)
if (node != null && (1.0 * node.level) / node.baseLevel > 0.75)
{
int aspectCount = node.flux.tags.size();
if (aspectCount > 0)
@@ -39,7 +41,7 @@ public class FlowerProviderAuraNodePurify extends FlowerProviderAuraNode
if (selectedTag != null)
{
node.flux.remove(selectedTag, 1);
ThaumcraftApi.queueNodeChanges(node.key, 0, 0, false, new ObjectTags().add(selectedTag, -1), 0, 0, 0);
ThaumcraftApi.queueNodeChanges(node.key, node.baseLevel / -16, 0, false, new ObjectTags().add(selectedTag, -1), 0, 0, 0);
products = addItemToProducts(products, new ItemStack(Config.solidFlux, 1, selectedTag.id));
}
}
@@ -1,5 +1,7 @@
package thaumicbees.bees;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -46,6 +48,6 @@ public class FlowerProviderBookshelf implements IFlowerProvider
public String getDescription()
{
return "Books";
return LocalizationManager.getLocalizedString("tb.bees.flower.book");
}
}
@@ -1,6 +1,9 @@
package thaumicbees.bees;
import cpw.mods.fml.common.registry.LanguageRegistry;
import thaumicbees.main.Config;
import thaumicbees.main.utils.LocalizationManager;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
@@ -32,12 +35,18 @@ public class FlowerProviderThaumcraftFlower implements IFlowerProvider
{
boolean flag = false;
int blockDown = world.getBlockId(x, y - 1, z);
if (world.isAirBlock(x, y, z) && (blockDown == Block.dirt.blockID || blockDown == Block.grass.blockID))
if (world.isAirBlock(x, y, z))
{
int rand = world.rand.nextInt(10);
world.setBlockAndMetadataWithNotify(x, y, z, Config.tcPlant.blockID, (rand >= 5) ? 2 : 3);
System.out.println(x + ", " + y + ", " + ", " + z + " set to flower.");
flag = true;
if (blockDown == Block.dirt.blockID || blockDown == Block.grass.blockID)
{
world.setBlockAndMetadataWithNotify(x, y, z, Config.tcPlant.blockID, ThaumcraftHelper.BlockPlant.SHIMMERLEAF.ordinal());
flag = true;
}
else if (blockDown == Block.sand.blockID)
{
world.setBlockAndMetadataWithNotify(x, y, z, Config.tcPlant.blockID, ThaumcraftHelper.BlockPlant.CINDERPEARL.ordinal());
flag = true;
}
}
return flag;
}
@@ -45,7 +54,7 @@ public class FlowerProviderThaumcraftFlower implements IFlowerProvider
@Override
public String getDescription()
{
return "Magic Flowers";
return LocalizationManager.getLocalizedString("tb.bees.flower.magic");
}
@Override
@@ -3,9 +3,10 @@ package thaumicbees.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumicbees.main.CommonProxy;
import thaumicbees.tile.TileEntityMagicApiary;
import net.minecraft.block.BlockContainer;
import thaumicbees.block.TileEntityMagicApiary;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.IBlockAccess;
@@ -16,41 +17,57 @@ import forestry.api.apiculture.IBeeHousing;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
public class BlockMagicApiary extends BlockContainer
public class BlockMagicApiary extends Block
{
public BlockMagicApiary(int par1)
{
super(par1, Material.wood);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
this.setBlockName("Magic Apiary");
this.blockIndexInTexture = 48;
this.blockIndexInTexture = 50;
this.setHardness(2f);
this.setResistance(5f);
}
@Override
@SideOnly(Side.CLIENT)
public int getBlockTexture(IBlockAccess worldAccess, int x, int y, int z, int side)
{
int texture = 48;
if (side == 0 || side == 1)
int texture = 50;
if (side == 0)
{
texture = 50;
texture = 51;
}
else if (side == 1)
{
TileEntityMagicApiary tileInfo = (TileEntityMagicApiary)worldAccess.getBlockTileEntity(x, y, z);
if (tileInfo != null && tileInfo.isMaster())
{
texture = 52;
}
else
{
texture = 51;
}
}
return texture;
}
public int getBlockTextureFromSideAndMetadata(int side, int meta)
{
int texture = 48;
int texture = 50;
if (side == 0 || side == 1)
{
texture = 50;
texture = 51;
}
return texture;
}
@Override
public TileEntity createNewTileEntity(World var1)
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entity)
{
return new TileEntityMagicApiary();
super.onBlockPlacedBy(world, x, y, z, entity);
// Validate block arrangement
}
}
@@ -0,0 +1,54 @@
package thaumicbees.block;
import java.util.List;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import thaumicbees.item.types.PlankType;
import thaumicbees.main.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.block.BlockWood;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class BlockPlanks extends Block
{
public BlockPlanks(int id)
{
super(id, Material.wood);
this.setHardness(2.5f);
this.setResistance(6.0f);
this.setBlockName("tb.planks");
this.setCreativeTab(CreativeTabs.tabBlock);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
Block.setBurnProperties(id, 5, 20);
}
@Override
public int getBlockTextureFromSideAndMetadata(int side, int meta)
{
int tx = 256;
if (PlankType.getType(meta) != null)
{
tx = PlankType.getType(meta).textureIdx;
}
return tx;
}
@Override
public int damageDropped(int meta)
{
return meta;
}
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(int id, CreativeTabs tab, List itemsList)
{
for (PlankType type : PlankType.values())
{
itemsList.add(new ItemStack(this, 1, type.ordinal()));
}
}
}
@@ -0,0 +1,68 @@
package thaumicbees.block;
import java.util.List;
import java.util.Random;
import thaumicbees.item.types.PlankType;
import thaumicbees.main.CommonProxy;
import thaumicbees.main.Config;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockHalfSlab;
import net.minecraft.block.material.Material;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
public class BlockWoodSlab extends BlockHalfSlab
{
public BlockWoodSlab(int id, boolean doubleSlab)
{
super(id, doubleSlab, Material.wood);
this.setHardness(2.5f);
this.setResistance(6.0f);
this.setBlockName("tb.slab.wood");
this.setCreativeTab(CreativeTabs.tabBlock);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
this.setLightOpacity(doubleSlab ? 255 : 0);
Block.setBurnProperties(id, 5, 20);
}
@Override
public int getBlockTextureFromSideAndMetadata(int side, int meta)
{
int tx = 256;
if (PlankType.getType(meta & 7) != null)
{
tx = PlankType.getType(meta & 7).textureIdx;
}
return tx;
}
public int idDropped(int id, Random rand, int par3)
{
return Config.slabWoodHalf.blockID;
}
protected ItemStack createStackedBlock(int meta)
{
return new ItemStack(Config.slabWoodHalf.blockID, 2, meta & 7);
}
@Override
public String getFullSlabName(int meta)
{
return this.getBlockName() + "." + PlankType.getType(meta).name;
}
@SideOnly(Side.CLIENT)
@Override
public void getSubBlocks(int id, CreativeTabs tab, List itemsList)
{
for (PlankType type : PlankType.values())
{
itemsList.add(new ItemStack(this, 1, type.ordinal()));
}
}
}
@@ -1,140 +1,140 @@
package thaumicbees.tile;
package thaumicbees.block;
import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.mysteriousages.utils.GenericInventory;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.apiculture.IBeekeepingLogic;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import thaumicbees.main.utils.compat.ForestryHelper;
public class TileEntityMagicApiary extends TileEntity implements IInventory, IBeeHousing
public class LogicMagicApiary implements IBeeHousing
{
@Override
public int getSizeInventory()
private TileEntityMagicApiary parent;
private String ownerName;
private BiomeGenBase biome;
private IBeekeepingLogic beeLogic;
private GenericInventory tileInventory;
private ArrayList<ItemStack> inventoryOverflow;
private static final int SLOT_ID_QUEEN = 0;
private static final int SLOT_ID_DRONE = 1;
private static final int SLOT_ID_FRAME = 2;
private static final int SLOT_LENGTH_FRAME = 2;
private static final int SLOT_ID_PRODUCE = 4;
private static final int SLOT_LENGTH_PRODUCE = 6;
public LogicMagicApiary(TileEntityMagicApiary master)
{
// TODO Auto-generated method stub
return 0;
this.parent = master;
this.beeLogic = BeeManager.breedingManager.createBeekeepingLogic(this);
this.tileInventory = new GenericInventory("MagicApiary", 11);
}
@Override
public ItemStack getStackInSlot(int var1)
public TileEntityMagicApiary getParent()
{
// TODO Auto-generated method stub
return null;
return parent;
}
@Override
public ItemStack decrStackSize(int var1, int var2)
public void setOwner(EntityPlayer player)
{
// TODO Auto-generated method stub
return null;
this.ownerName = player.username;
}
@Override
public ItemStack getStackInSlotOnClosing(int var1)
public String getOwner()
{
// TODO Auto-generated method stub
return null;
return this.ownerName;
}
@Override
public void setInventorySlotContents(int var1, ItemStack var2)
public void writeToNBT(NBTTagCompound tag)
{
NBTTagCompound beeTag = new NBTTagCompound();
this.beeLogic.writeToNBT(beeTag);
tag.setTag("BeeLogic", beeTag);
tag.setString("Owner", this.ownerName);
NBTTagCompound inventory = new NBTTagCompound();
this.tileInventory.writeToNBT(inventory);
tag.setTag("Inventory", inventory);
if (this.inventoryOverflow.size() > 0)
{
NBTTagList overflow = new NBTTagList();
for (int i = 0; i < this.inventoryOverflow.size(); ++i)
{
NBTTagCompound itemTag = new NBTTagCompound();
this.inventoryOverflow.get(i).writeToNBT(itemTag);
overflow.appendTag(itemTag);
}
}
}
public void readFromNBT(NBTTagCompound tag)
{
// TODO Auto-generated method stub
}
@Override
public String getInvName()
{
return "thaumicbees.magicApiary";
}
@Override
public int getInventoryStackLimit()
{
// TODO Auto-generated method stub
return 0;
}
@Override
public boolean isUseableByPlayer(EntityPlayer var1)
{
return true;
}
@Override
public void openChest() { }
@Override
public void closeChest() { }
@Override
public float getTerritoryModifier(IBeeGenome genome)
{
// TODO Auto-generated method stub
return 0;
return 1f;
}
@Override
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate)
{
// TODO Auto-generated method stub
return 0;
return 1f;
}
@Override
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate)
{
// TODO Auto-generated method stub
return 0;
return 1f;
}
@Override
public float getProductionModifier(IBeeGenome genome)
{
// TODO Auto-generated method stub
return 0;
return 2f;
}
@Override
public float getFloweringModifier(IBeeGenome genome)
{
// TODO Auto-generated method stub
return 0;
return 1f;
}
@Override
public boolean isSealed()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isSelfLighted()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isSunlightSimulated()
{
// TODO Auto-generated method stub
return false;
}
@Override
public boolean isHellish()
{
// TODO Auto-generated method stub
return false;
}
@@ -142,49 +142,46 @@ public class TileEntityMagicApiary extends TileEntity implements IInventory, IBe
public void onQueenChange(ItemStack queen)
{
// TODO Auto-generated method stub
}
@Override
public void wearOutEquipment(int amount)
{
// TODO Auto-generated method stub
}
@Override
public void onQueenDeath(IBee queen)
{
// TODO Auto-generated method stub
}
@Override
public void onPostQueenDeath(IBee queen)
{
// TODO Auto-generated method stub
}
@Override
public int getXCoord()
{
// TODO Auto-generated method stub
return 0;
return parent.xCoord;
}
@Override
public int getYCoord()
{
// TODO Auto-generated method stub
return 0;
return parent.yCoord;
}
@Override
public int getZCoord()
{
// TODO Auto-generated method stub
return 0;
return parent.zCoord;
}
@Override
@@ -205,56 +202,51 @@ public class TileEntityMagicApiary extends TileEntity implements IInventory, IBe
public void setQueen(ItemStack itemstack)
{
// TODO Auto-generated method stub
}
@Override
public void setDrone(ItemStack itemstack)
{
// TODO Auto-generated method stub
}
@Override
public int getBiomeId()
{
// TODO Auto-generated method stub
return 0;
return this.biome.biomeID;
}
@Override
public EnumTemperature getTemperature()
{
// TODO Auto-generated method stub
return null;
return ForestryHelper.getEnumTemperatureFromValue(this.biome.temperature);
}
@Override
public EnumHumidity getHumidity()
{
// TODO Auto-generated method stub
return null;
return ForestryHelper.getEnumHumidityFromValue(this.biome.rainfall);
}
@Override
public World getWorld()
{
// TODO Auto-generated method stub
return null;
return this.getWorld();
}
@Override
public String getOwnerName()
{
// TODO Auto-generated method stub
return null;
return parent.getOwner();
}
@Override
public void setErrorState(int state)
{
// TODO Auto-generated method stub
}
@Override
@@ -277,4 +269,5 @@ public class TileEntityMagicApiary extends TileEntity implements IInventory, IBe
// TODO Auto-generated method stub
return false;
}
}
@@ -0,0 +1,97 @@
package thaumicbees.block;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
import forestry.api.apiculture.IBeeHousing;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
public class TileEntityMagicApiary extends TileEntity
{
private String owner;
private LogicMagicApiary logic;
private int masterX;
private int masterY;
private int masterZ;
public TileEntityMagicApiary(World w)
{
this.setWorldObj(w);
}
public void setValid(TileEntityMagicApiary masterEntity)
{
this.logic = masterEntity.logic;
this.masterX = masterEntity.xCoord;
this.masterY = masterEntity.yCoord;
this.masterZ = masterEntity.zCoord;
}
public String getOwner()
{
return this.owner;
}
public boolean isValidStructure()
{
return false;
}
public boolean isMaster()
{
boolean flag = false;
if (this.logic != null)
{
flag = this.logic.getParent() == this;
}
return flag;
}
public LogicMagicApiary getLogic()
{
return this.logic;
}
@Override
public void readFromNBT(NBTTagCompound tagRoot)
{
super.readFromNBT(tagRoot);
this.owner = tagRoot.getString("Owner");
if (tagRoot.hasKey("Logic"))
{
this.logic = new LogicMagicApiary(this);
this.logic.readFromNBT(tagRoot.getCompoundTag("Logic"));
}
else
{
this.masterX = tagRoot.getInteger("MasterX");
this.masterY = tagRoot.getInteger("MasterY");
this.masterZ = tagRoot.getInteger("MasterZ");
}
}
@Override
public void writeToNBT(NBTTagCompound tagRoot)
{
super.writeToNBT(tagRoot);
tagRoot.setString("Owner", this.owner);
if (this.isMaster())
{
NBTTagCompound logicTag = new NBTTagCompound();
this.logic.writeToNBT(logicTag);
tagRoot.setTag("Logic", logicTag);
}
else
{
tagRoot.setInteger("MasterX", this.masterX);
tagRoot.setInteger("MasterY", this.masterY);
tagRoot.setInteger("MasterZ", this.masterZ);
}
}
}
@@ -26,13 +26,14 @@ public class ItemCapsule extends Item
{
private CapsuleType capsuleType;
public ItemCapsule(CapsuleType type, int itemId)
public ItemCapsule(CapsuleType type, int itemId, int maxStackSize)
{
super(itemId);
this.capsuleType = type;
this.setTextureFile(CommonProxy.TCBEES_LIQUIDS_IMAGE);
this.setCreativeTab(Tabs.tabApiculture);
this.setHasSubtypes(true);
this.setMaxStackSize(maxStackSize);
}
public CapsuleType getType()
@@ -43,7 +44,7 @@ public class ItemCapsule extends Item
@Override
public String getItemDisplayName(ItemStack itemStack)
{
return LiquidType.values()[itemStack.getItemDamage()].displayName + " " + this.capsuleType.name;
return LiquidType.values()[itemStack.getItemDamage()].getDisplayName() + " " + this.capsuleType.getName();
}
public ItemStack getCapsuleForLiquid(LiquidType l)
@@ -89,13 +89,7 @@ public class ItemComb extends Item
@Override
public String getItemDisplayName(ItemStack stack)
{
String result = "";
int meta = stack.getItemDamage();
if (meta >= 0 && meta < CombType.values().length)
{
result = CombType.values()[meta].name;
}
return result;
return CombType.values()[stack.getItemDamage()].getName();
}
}
@@ -3,8 +3,10 @@ package thaumicbees.item;
import java.util.List;
import thaumicbees.item.types.DropType;
import thaumicbees.item.types.PropolisType;
import thaumicbees.main.CommonProxy;
import thaumicbees.main.ThaumicBees;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs;
@@ -85,13 +87,7 @@ public class ItemDrop extends Item
@Override
public String getItemDisplayName(ItemStack stack)
{
String result = "";
int meta = stack.getItemDamage();
if (meta >= 0 && meta < DropType.values().length)
{
result = DropType.values()[meta].name;
}
return result;
return DropType.values()[stack.getItemDamage()].getName();
}
}
@@ -12,6 +12,7 @@ import thaumicbees.main.CommonProxy;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import forestry.api.apiculture.IBee;
import forestry.api.apiculture.IBeeGenome;
@@ -35,7 +36,7 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame
@Override
public String getItemDisplayName(ItemStack itemStack)
{
return this.type.frameName;
return this.type.getName();
}
// --------- IHiveFrame functions -----------------------------------------
@@ -43,10 +44,7 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame
@Override
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear)
{
this.doFluxEffect(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord());
frame = this.doWear(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(), frame, wear);
return frame;
return this.doWear(housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(), frame, wear);
}
private void doFluxEffect(World w, int x, int y, int z)
@@ -60,22 +58,50 @@ public class ItemMagicHiveFrame extends Item implements IHiveFrame
private ItemStack doWear(World w, int x, int y, int z, ItemStack frame, int wear)
{
int damage = wear;
int fluxMod = 1;
// This throttles back the amount of aura consumed by the frame by storing a smidge of data on the item stack.
if (this.type.auraPerUse > 0)
{
// Attempt to use aura for the frame.
if (!ThaumcraftApi.decreaseClosestAura(w, x, y, z, this.type.auraPerUse, true))
NBTTagCompound tag;
if (frame.hasTagCompound())
{
// Insufficient aura, or no nearby node.
damage = wear + this.type.auraPerUse;
tag = frame.getTagCompound();
}
else
{
tag = new NBTTagCompound();
tag.setByte("wearTicks", (byte)0);
frame.setTagCompound(tag);
}
int wearTicks = tag.getByte("wearTicks") + 1;
if (wearTicks == this.type.wearTicksPerAura)
{
// Attempt to use aura for the frame.
if (!ThaumcraftApi.decreaseClosestAura(w, x, y, z, this.type.auraPerUse, true))
{
// Insufficient aura, or no nearby node.
damage = wear + this.type.auraPerUse * this.type.wearTicksPerAura;
fluxMod = 1 + w.rand.nextInt(this.type.wearTicksPerAura);
}
wearTicks = 0;
}
tag.setByte("wearTicks", (byte)wearTicks);
}
frame.setItemDamage(frame.getItemDamage() + damage);
for (int i = 0; i < fluxMod; ++i)
{
this.doFluxEffect(w, x, y, z);
}
if (frame.getItemDamage() >= frame.getMaxDamage())
{
// Break!
// Break the frame.
frame = null;
}
@@ -59,13 +59,7 @@ public class ItemMiscResources extends Item
@Override
public String getItemDisplayName(ItemStack stack)
{
String result = "";
int meta = stack.getItemDamage();
if (meta >= 0 && meta < ResourceType.values().length)
{
result = ResourceType.values()[meta].name;
}
return result;
return ResourceType.values()[stack.getItemDamage()].getName();
}
}
@@ -80,17 +80,11 @@ public class ItemPollen extends Item
return colour;
}
@Override
public String getItemDisplayName(ItemStack stack)
{
String result = "";
int meta = stack.getItemDamage();
if (meta >= 0 && meta < PollenType.values().length)
{
result = PollenType.values()[meta].name;
}
return result;
return PollenType.values()[stack.getItemDamage()].getName();
}
}
@@ -57,13 +57,7 @@ public class ItemPropolis extends Item
@Override
public String getItemDisplayName(ItemStack stack)
{
String result = "";
int meta = stack.getItemDamage();
if (meta >= 0 && meta < PropolisType.values().length)
{
result = PropolisType.values()[meta].name;
}
return result;
return PropolisType.values()[stack.getItemDamage()].getName();
}
}
@@ -2,11 +2,13 @@ package thaumicbees.item;
import java.util.List;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.core.Tabs;
import thaumcraft.api.EnumTag;
import thaumicbees.main.CommonProxy;
import thaumicbees.main.utils.LocalizationManager;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -32,7 +34,6 @@ public class ItemSolidFlux extends Item
{
continue;
}
list.add(new ItemStack(this.itemID, 1, tag.id));
}
}
@@ -40,7 +41,7 @@ public class ItemSolidFlux extends Item
@Override
public String getItemDisplayName(ItemStack stack)
{
return "Crystalized " + EnumTag.get(stack.getItemDamage()).name + " Aspect";
return String.format(LocalizationManager.getLocalizedString("tb.resource.crystalFlux"), EnumTag.get(stack.getItemDamage()).name);
}
@Override
@@ -0,0 +1,89 @@
package thaumicbees.item;
import thaumcraft.api.IVisRepairable;
import thaumcraft.api.ThaumcraftApi;
import thaumicbees.main.CommonProxy;
import thaumicbees.main.Config;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import forestry.api.arboriculture.IToolGrafter;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
public class ItemThaumiumGrafter extends Item implements IVisRepairable, IToolGrafter
{
public ItemThaumiumGrafter(int id)
{
super(id);
this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture);
this.setMaxDamage(25);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
this.setIconIndex(21);
this.setItemName("tb.thaumiumGrafter");
}
@Override
public float getSaplingModifier(ItemStack stack, World world, int x, int y, int z)
{
return 100f;
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : getStrVsBlock(itemStack, block);
}
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, int id, int x, int y, int z, EntityLiving entityliving) {
itemstack.damageItem(1, entityliving);
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
public void doRepair(ItemStack stack, Entity e)
{
if (stack.getItemDamage() > 0)
{
if (ThaumcraftApi.decreaseClosestAura(e.worldObj, e.posX, e.posY, e.posZ, 1, true))
{
stack.damageItem(-1, (EntityLiving)e);
}
}
}
}
@@ -0,0 +1,81 @@
package thaumicbees.item;
import thaumcraft.api.IVisRepairable;
import thaumcraft.api.ThaumcraftApi;
import thaumicbees.main.CommonProxy;
import net.minecraft.block.Block;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemTool;
import net.minecraft.world.World;
import net.minecraftforge.common.ForgeHooks;
public class ItemThaumiumScoop extends Item implements IVisRepairable
{
public ItemThaumiumScoop(int itemID)
{
super(itemID);
this.setMaxStackSize(1);
this.setMaxDamage(30);
this.setIconIndex(20);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
this.setItemName("tb.thaumiumScoop");
this.setCreativeTab(forestry.api.core.Tabs.tabApiculture);
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block)
{
return 1f;
}
@Override
public float getStrVsBlock(ItemStack itemStack, Block block, int metadata)
{
return ForgeHooks.isToolEffective(itemStack, block, metadata) ? 4.8f : getStrVsBlock(itemStack, block);
}
@Override
public boolean onBlockDestroyed(ItemStack itemstack, World world, int i, int j, int k, int l, EntityLiving entityliving) {
itemstack.damageItem(1, entityliving);
return true;
}
/**
* Return the enchantability factor of the item, most of the time is based on material.
*/
public int getItemEnchantability()
{
return ThaumcraftApi.toolMatThaumium.getEnchantability();
}
/**
* Return the name for this tool's material.
*/
public String getToolMaterialName()
{
return ThaumcraftApi.toolMatThaumium.toString();
}
/**
* Return whether this item is repairable in an anvil.
*/
public boolean getIsRepairable(ItemStack par1ItemStack, ItemStack par2ItemStack)
{
return ThaumcraftApi.toolMatThaumium.getToolCraftingMaterial() == par2ItemStack.itemID ? true : super.getIsRepairable(par1ItemStack, par2ItemStack);
}
@Override
public void doRepair(ItemStack stack, Entity e)
{
if (stack.getItemDamage() > 0)
{
if (ThaumcraftApi.decreaseClosestAura(e.worldObj, e.posX, e.posY, e.posZ, 1, true))
{
stack.damageItem(-1, (EntityLiving)e);
}
}
}
}
@@ -70,12 +70,6 @@ public class ItemWax extends Item
@Override
public String getItemDisplayName(ItemStack stack)
{
String result = "";
int meta = stack.getItemDamage();
if (meta >= 0 && meta < WaxType.values().length)
{
result = WaxType.values()[meta].name;
}
return result;
return WaxType.values()[stack.getItemDamage()].getName();
}
}
@@ -1,10 +1,14 @@
package thaumicbees.item.types;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
public enum CapsuleType
{
MAGIC("Magic Capsule", 2000, 0),
MAGIC("magic", 2000, 0),
VOID("void", 8000, 1),
;
public String name;
private String name;
public int capacity;
public int iconIdx;
@@ -14,4 +18,9 @@ public enum CapsuleType
this.capacity = c;
this.iconIdx = idx;
}
public String getName()
{
return LocalizationManager.getLocalizedString("tb.capsule." + name);
}
}
@@ -1,18 +1,21 @@
package thaumicbees.item.types;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
public enum CombType
{
OCCULT("Occult Comb", 0x6e1c6d, 0xff8fff, true),
OTHERWORLDLY("Otherworldy Comb", 0x000056, 0x765cc1, true),
PAPERY("Papery Comb", 0x503900, 0xbd9a30, true),
STARK("Stark Comb", 0xB0B0BC, 0x6e6e79, false),
AIRY("Airy Comb", 0xffff7e, 0x717600, false),
FIREY("Firey Comb", 0xff3C01, 0x740002, false),
WATERY("Watery Comb", 0x0090ff, 0x00308c, false),
EARTHY("Earthy Comb", 0x00a000, 0x005100, false),
INFUSED("Infused Comb", 0xaa32fc, 0x7A489E, false),
INTELLECT("Memory Comb", 0x618fff, 0xb0092e9, false),
SKULKING("Furtive Comb", 0x545454, 0xcda6cd, true),
OCCULT("occult", 0x6e1c6d, 0xff8fff, true),
OTHERWORLDLY("otherworldly", 0x000056, 0x765cc1, true),
PAPERY("paper", 0x503900, 0xbd9a30, true),
STARK("stark", 0xB0B0BC, 0x6e6e79, false),
AIRY("air", 0xffff7e, 0x717600, false),
FIREY("fire", 0xff3C01, 0x740002, false),
WATERY("water", 0x0090ff, 0x00308c, false),
EARTHY("earth", 0x00a000, 0x005100, false),
INFUSED("magic", 0xaa32fc, 0x7A489E, false),
INTELLECT("aware", 0x618fff, 0xb0092e9, false),
SKULKING("furtive", 0x545454, 0xcda6cd, true),
;
private CombType(String pName, int colourA, int colourB, boolean show)
@@ -25,7 +28,12 @@ public enum CombType
this.showInList = show;
}
public final String name;
private String name;
public int[] combColour;
public boolean showInList;
public String getName()
{
return LocalizationManager.getLocalizedString("tb.comb." + this.name);
}
}
@@ -1,9 +1,12 @@
package thaumicbees.item.types;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
public enum DropType
{
ENCHANTED("Enchanting Drop", 0x6e1c6d, 0xff8fff),
INTELLECT("Intellect Drop", 0x25914D, 0x18E072),
ENCHANTED("enchanting", 0x6e1c6d, 0xff8fff),
INTELLECT("intellect", 0x25914D, 0x18E072),
;
private DropType(String pName, int colourA, int colourB)
@@ -13,6 +16,11 @@ public enum DropType
this.combColour[1] = colourB;
}
public final String name;
private final String name;
public int[] combColour = new int[2];
public String getName()
{
return LocalizationManager.getLocalizedString("tb.drop." + this.name);
}
}
@@ -1,35 +1,37 @@
package thaumicbees.item.types;
import cpw.mods.fml.common.registry.LanguageRegistry;
import thaumcraft.api.EnumTag;
import thaumcraft.api.ObjectTags;
import thaumicbees.main.utils.LocalizationManager;
public enum HiveFrameType
{
MAGIC("Magic Frame", 32, 240, 1f, 1f, 1f, 2f, 2,
MAGIC("magic", 32, 240, 1f, 1f, 1f, 2f, 2, 5,
null),
RESILIENT("Resilient Frame", 33, 840, 1f, 1f, 1f, 2f, 2,
RESILIENT("resillient", 33, 840, 1f, 1f, 1f, 2f, 2, 5,
new ObjectTags().add(EnumTag.ARMOR, 1)),
GENTLE("Gentle Frame", 34, 200, 1f, 0.7f, 1.5f, 1.4f, 1,
GENTLE("gentle", 34, 200, 1f, 0.7f, 1.5f, 1.4f, 1, 5,
new ObjectTags().add(EnumTag.HEAL, 1).add(EnumTag.LIFE, 1)),
METABOLIC("Metabolic Frame", 35, 120, 1f, 1.8f, 1f, 1.2f, 5,
METABOLIC("metabolic", 35, 120, 1f, 1.8f, 1f, 1.2f, 5, 5,
new ObjectTags().add(EnumTag.EXCHANGE, 1).add(EnumTag.MOTION, 1)),
NECROTIC("Necrotic Frame", 36, 290, 1f, 1f, 0.3f, 0.75f, 1,
NECROTIC("necrotic", 36, 290, 1f, 1f, 0.3f, 0.75f, 1, 5,
new ObjectTags().add(EnumTag.DEATH, 3).add(EnumTag.POISON, 2)),
TEMPORAL("Temporal Frame", 37, 300, 1f, 1f, 2.5f, 1f, 1,
TEMPORAL("temporal", 37, 300, 1f, 1f, 2.5f, 1f, 1, 5,
new ObjectTags().add(EnumTag.TIME, 5)),
;
private HiveFrameType(String name, int icon, int damage,
float territory, float mutation, float lifespan, float production,
int auraUse, ObjectTags fluxTags)
int auraUse, int wearTicks, ObjectTags fluxTags)
{
this(name, icon, damage, territory, mutation, lifespan, production, 1f, false, false, false, false, auraUse, fluxTags);
this(name, icon, damage, territory, mutation, lifespan, production, 1f, false, false, false, false, auraUse, wearTicks, fluxTags);
}
private HiveFrameType(String name, int icon, int damage,
float territory, float mutation, float lifespan, float production, float flowering,
boolean sealed, boolean lit, boolean sunlit, boolean hellish,
int auraUse, ObjectTags fluxTags)
int auraUse, int wearTicks, ObjectTags fluxTags)
{
this.frameName = name;
this.iconIdx = icon;
@@ -47,9 +49,10 @@ public enum HiveFrameType
this.auraPerUse = auraUse;
this.flux = fluxTags;
this.wearTicksPerAura = wearTicks;
}
public String frameName;
private String frameName;
public int iconIdx;
public int maxDamage;
@@ -65,4 +68,10 @@ public enum HiveFrameType
public ObjectTags flux;
public int auraPerUse;
public int wearTicksPerAura;
public String getName()
{
return LocalizationManager.getLocalizedString("tb.frame." + this.frameName);
}
}
@@ -1,50 +1,57 @@
package thaumicbees.item.types;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraftforge.liquids.LiquidDictionary;
public enum LiquidType
{
// Incidentally, Item meta is the liquid ID.
// Args are: forgeLiquidID, Display Name, Icon idx
EMPTY("", "Empty", 16),
EMPTY("", 16),
// Vanilla
WATER("water", "Water", 17),
LAVA("lava", "Lava", 18),
WATER("water", 17),
LAVA("lava", 18),
// Forestry
BIOMASS("biomass", "Biomass", 19),
BIOFUEL("biofuel", "Biofuel", 20),
BIOMASS("biomass", 19),
BIOFUEL("biofuel", 20),
// Buildcraft
OIL("Oil", "Oil", 21),
FUEL("Fuel", "Fuel", 22),
OIL("Oil", 21),
FUEL("Fuel", 22),
// More Forestry
SEEDOIL("seedoil", "Seed Oil", 23),
HONEY("honey", "Honey", 24),
JUICE("juice", "Juice", 25),
CRUSHEDICE("ice", "Crushed Ice", 26),
MILK("milk", "Milk", 27),
SEEDOIL("seedoil", 23),
HONEY("honey", 24),
JUICE("juice", 25),
CRUSHEDICE("ice", 26),
MILK("milk", 27),
// ExtraBees liquids
ACID("acid", "Acid", 28),
POISON("poison", "Poison", 29),
LIQUIDNITROGEN("liquidNitrogen", "Liquid Nitrogen", 30),
DNA("liquidDNA", "Liquid DNA", 31),
ACID("acid", 28),
POISON("poison", 29),
LIQUIDNITROGEN("liquidNitrogen", 30),
DNA("liquidDNA", 31),
// Railcraft
CREOSOTEOIL("Creosote Oil", "Creosote Oil", 32),
STEAM("Steam", "Steam", 33),
CREOSOTEOIL("Creosote Oil", 32),
STEAM("Steam", 33),
;
public String liquidID;
public String displayName;
public int iconIdx;
public boolean available = false;
private LiquidType(String l, String display, int idx)
private LiquidType(String l, int idx)
{
this.liquidID = l;
this.displayName = display;
this.iconIdx = idx;
}
public String getDisplayName()
{
return LocalizationManager.getLocalizedString("tb.liquid." + liquidID);
}
}
@@ -0,0 +1,45 @@
package thaumicbees.item.types;
public enum PlankType
{
GREATWOOD("greatwood", 48),
SILVERWOOD("silverwood", 49),
;
public String name;
public int textureIdx;
private static String[] nameList;
private PlankType(String n, int idx)
{
this.name = n;
this.textureIdx = idx;
}
public static PlankType getType(int meta)
{
PlankType type = null;
if (meta >= 0 && meta <= values().length)
{
type = values()[meta];
}
return type;
}
public static String[] getAllNames()
{
return (nameList == null) ? nameList = generateNames() : nameList;
}
private static String[] generateNames()
{
String[] names = new String[values().length];
for (int i = 0; i < names.length; ++i)
{
names[i] = values()[i].name;
}
return names;
}
}
@@ -1,8 +1,12 @@
package thaumicbees.item.types;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
public enum PollenType
{
UNUSUAL("Unusual Pollen", 0xA03059, 0xD8417B),
UNUSUAL("unusual", 0xA03059, 0xD8417B),
PHASED("phased", 0x456BA5, 0x4974B4),
;
private PollenType(String pName, int colourA, int colourB)
@@ -12,6 +16,11 @@ public enum PollenType
this.combColour[1] = colourB;
}
public final String name;
private String name;
public int[] combColour = new int[2];
public String getName()
{
return LocalizationManager.getLocalizedString("tb.pollen." + this.name);
}
}
@@ -1,13 +1,16 @@
package thaumicbees.item.types;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
public enum PropolisType
{
STARK("Dull Propolis", 0xBBBBBB),
AIR("Air Propolis", 0xA19E10),
FIRE("Firey Propolis", 0x95132F),
WATER("Watery Propolis", 0x1054A1),
EARTH("Earthen Propolis", 0x00a000),
INFUSED("Infused Propolis", 0xaa32fc),
STARK("dull", 0xBBBBBB),
AIR("air", 0xA19E10),
FIRE("fire", 0x95132F),
WATER("water", 0x1054A1),
EARTH("earth", 0x00a000),
INFUSED("magic", 0xaa32fc),
;
private PropolisType(String pName, int overlayColour)
@@ -16,6 +19,11 @@ public enum PropolisType
this.colour = overlayColour;
}
public String name;
private String name;
public int colour;
public String getName()
{
return LocalizationManager.getLocalizedString("tb.propolis." + this.name);
}
}
@@ -1,12 +1,16 @@
package thaumicbees.item.types;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
public enum ResourceType
{
LORE_FRAGMENT("Lore Fragment", 2, true),
AROMATIC_LUMP("Aromatic Lump", 3, true),
EXTENDED_FERTILIZER("Concentrated Compound", 4, true),
LORE_FRAGMENT("fragment", 2, true),
AROMATIC_LUMP("lump", 3, true),
EXTENDED_FERTILIZER("fertilizer", 4, true),
// Dummy items for Thaumanomicon research icons.
// These won't ever actually exist in-game, and so
RESEARCH_StartNode("Start Node", 241, false),
RESEARCH_BeeInfusion("Bee Infusion", 240, false),
;
@@ -17,7 +21,12 @@ public enum ResourceType
this.iconIdx = i;
this.showInList = show;
}
public String name;
private String name;
public int iconIdx;
public boolean showInList;
public String getName()
{
return LocalizationManager.getLocalizedString("tb.resource." + this.name);
}
}
@@ -1,8 +1,11 @@
package thaumicbees.item.types;
import thaumicbees.main.utils.LocalizationManager;
import cpw.mods.fml.common.registry.LanguageRegistry;
public enum WaxType
{
MAGIC("Magic Wax", false, 0xd242df),
MAGIC("magic", false, 0xd242df),
;
private WaxType(String n, boolean sp, int c)
@@ -12,7 +15,12 @@ public enum WaxType
this.colour = c;
}
public String name;
private String name;
public boolean sparkly;
public int colour;
public String getName()
{
return LocalizationManager.getLocalizedString("tb.wax." + this.name);
}
}
@@ -8,6 +8,7 @@ public class CommonProxy
{
public static final String TCBEES_GFX = "/gfx/thaumicbees/";
public static final String TCBEES_RESEARCH = "/research/thaumicbees/";
public static final String TCBEES_LOCDIR = "/lang/thaumicbees/";
public static final String TCBEES_ITEM_GFX = TCBEES_GFX + "items/";
public static String FORESTRY_GFX_ITEMS;
+74 -12
View File
@@ -3,9 +3,9 @@ package thaumicbees.main;
import java.io.File;
import thaumicbees.block.BlockMagicApiary;
import thaumicbees.compat.CompatabilityManager;
import thaumicbees.compat.ForestryHelper;
import thaumicbees.compat.ThaumcraftHelper;
import thaumicbees.block.BlockPlanks;
import thaumicbees.block.BlockWoodSlab;
import thaumicbees.block.TileEntityMagicApiary;
import thaumicbees.item.ItemCapsule;
import thaumicbees.item.ItemComb;
import thaumicbees.item.ItemDrop;
@@ -13,23 +13,37 @@ import thaumicbees.item.ItemMagicHiveFrame;
import thaumicbees.item.ItemMiscResources;
import thaumicbees.item.ItemPollen;
import thaumicbees.item.ItemPropolis;
import thaumicbees.item.ItemThaumiumGrafter;
import thaumicbees.item.ItemThaumiumScoop;
import thaumicbees.item.ItemSolidFlux;
import thaumicbees.item.ItemWax;
import thaumicbees.item.types.CapsuleType;
import thaumicbees.item.types.HiveFrameType;
import thaumicbees.item.types.PlankType;
import thaumicbees.item.types.ResourceType;
import thaumicbees.main.utils.CompatabilityManager;
import thaumicbees.main.utils.LocalizationManager;
import thaumicbees.main.utils.compat.ForestryHelper;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import thaumicbees.storage.BackpackDefinition;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import forestry.api.apiculture.BeeManager;
import forestry.api.storage.BackpackManager;
import forestry.api.storage.EnumBackpackType;
import net.minecraft.block.Block;
import net.minecraft.block.BlockLog;
import net.minecraft.item.Item;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemMultiTextureTile;
import net.minecraft.item.ItemSlab;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.Property;
import net.minecraftforge.oredict.OreDictionary;
@@ -45,8 +59,11 @@ public class Config
public boolean ExtraBeesInstalled;
public boolean AddThaumcraftItemsToBackpacks;
public String ThaumaturgeExtraItems;
public int capsuleStackSizeMax;
public static BlockPlanks planksWood;
public static BlockWoodSlab slabWoodHalf;
public static BlockWoodSlab slabWoodFull;
public static BlockMagicApiary magicApiary;
public static ItemComb combs;
@@ -57,9 +74,12 @@ public class Config
public static ItemSolidFlux solidFlux;
public static ItemMiscResources miscResources;
public static ItemFood jellyBaby;
public static ItemThaumiumScoop thaumiumScoop;
public static ItemThaumiumGrafter thaumiumGrafter;
//----- Liquid Capsules --------------------
public static ItemCapsule magicCapsule;
public static ItemCapsule voidCapsule;
//----- Apiary Frames ----------------------
public static ItemMagicHiveFrame hiveFrameMagic;
@@ -121,8 +141,35 @@ public class Config
int blockIdBase = 1750;
magicApiary = new BlockMagicApiary(tbConfig.getBlock("magicApiary", blockIdBase).getInt());
GameRegistry.registerBlock(magicApiary, "Magic Apiary");
planksWood = new BlockPlanks(tbConfig.getBlock("planksTC", blockIdBase++).getInt());
Item item = new ItemMultiTextureTile(planksWood.blockID - 256, planksWood, PlankType.getAllNames())
.setItemName(planksWood.getBlockName()).setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
Item.itemsList[planksWood.blockID] = item;
OreDictionary.registerOre("plankWood", new ItemStack(planksWood, 1, -1));
slabWoodFull = new BlockWoodSlab(tbConfig.getBlock("slabFull", blockIdBase++).getInt(), true);
slabWoodHalf = new BlockWoodSlab(tbConfig.getBlock("slabHalf", blockIdBase++).getInt(), false);
item = new ItemSlab(slabWoodHalf.blockID - 256, slabWoodHalf, slabWoodFull, false)
.setItemName(slabWoodHalf.getBlockName()).setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
Item.itemsList[slabWoodHalf.blockID] = item;
item = new ItemSlab(slabWoodFull.blockID - 256, slabWoodHalf, slabWoodFull, true)
.setItemName(slabWoodFull.getBlockName()).setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
Item.itemsList[slabWoodFull.blockID] = item;
OreDictionary.registerOre("slabWood", new ItemStack(slabWoodHalf, 1, -1));
blockIdBase++; // Stair
/*magicApiary = new BlockMagicApiary(tbConfig.getBlock("magicApiary", blockIdBase++).getInt());
GameRegistry.registerBlock(magicApiary, "tb.magicApiary");*/
}
public void registerTileEntities()
{
TileEntity.addMapping(TileEntityMagicApiary.class, "MagicApiary");
}
public void setupItems()
@@ -141,10 +188,15 @@ public class Config
drops = new ItemDrop(tbConfig.getItem("drop", itemIDBase++).getInt());
miscResources = new ItemMiscResources(tbConfig.getItem("miscResources", itemIDBase++).getInt());
// Make Aromatic Lumps a swarmer inducer. Chance is /1000.
BeeManager.inducers.put(miscResources.getStackForType(ResourceType.AROMATIC_LUMP), 80);
try
{
// 0x8700C6 = purpleish.
BackpackDefinition def = new BackpackDefinition("thaumaturge", "Thaumaturge's Backpack", 0x8700C6);
String backpackName = LocalizationManager.getLocalizedString("tb.backpack.thaumaturge");
BackpackDefinition def = new BackpackDefinition("thaumaturge", backpackName, 0x8700C6);
thaumaturgeBackpackT1 =
BackpackManager.backpackInterface.addBackpack(tbConfig.getItem("thaumaturgePack1", itemIDBase++).getInt(),
def, EnumBackpackType.T1);
@@ -165,7 +217,7 @@ public class Config
}
magicCapsule = new ItemCapsule(CapsuleType.MAGIC, tbConfig.getItem("magicCapsule", itemIDBase++).getInt());
magicCapsule = new ItemCapsule(CapsuleType.MAGIC, tbConfig.getItem("magicCapsule", itemIDBase++).getInt(), this.capsuleStackSizeMax);
pollen = new ItemPollen(tbConfig.getItem("pollen", itemIDBase++).getInt());
solidFlux = new ItemSolidFlux(tbConfig.getItem("fluxCrystal", itemIDBase++).getInt());
@@ -187,12 +239,17 @@ public class Config
itemIDBase++;
itemIDBase++;
// New items here.
jellyBaby = new ItemFood(tbConfig.getItem("sugarSnack", itemIDBase++).getInt(), 1, false).setAlwaysEdible()
// Jelly babies for Dr. Whoniversary.
jellyBaby = new ItemFood(tbConfig.getItem("jellyBabies", itemIDBase++).getInt(), 1, false).setAlwaysEdible()
.setPotionEffect(Potion.moveSpeed.id, 5, 1, 1f);
jellyBaby.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE).setIconIndex(19).setItemName("sugarSnack");
LanguageRegistry.addName(jellyBaby, "Jelly Baby");
jellyBaby.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE).setIconIndex(19).setItemName("jellyBabies");
voidCapsule = new ItemCapsule(CapsuleType.VOID, tbConfig.getItem("voidCapsule", itemIDBase++).getInt(), this.capsuleStackSizeMax);
thaumiumScoop = new ItemThaumiumScoop(tbConfig.getItem("thaumiumScoop", itemIDBase++).getInt());
MinecraftForge.setToolClass(thaumiumScoop, "scoop", 3);
thaumiumGrafter = new ItemThaumiumGrafter(tbConfig.getItem("thaumiumGrafter", itemIDBase++).getInt());
}
private void doMiscConfig()
@@ -208,6 +265,11 @@ public class Config
p.comment = "Set to true if you want ThaumicBees to add several Thaumcraft blocks & items to Forestry backpacks." +
"\n Set to false to disable.";
this.AddThaumcraftItemsToBackpacks = p.getBoolean(true);
p = tbConfig.get("general", "capsuleStackSize", 64);
p.comment = "Allows you to edit the stack size of the capsules in ThaumicBees if using GregTech, \n" +
"or the reduced capsule size in Forestry & Railcraft. Default: 64";
this.capsuleStackSizeMax = p.getInt();
}
}
@@ -3,8 +3,9 @@ package thaumicbees.main;
import net.minecraftforge.common.Configuration;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.ForgeSubscribe;
import thaumicbees.compat.CompatabilityManager;
import thaumicbees.main.utils.CompatabilityManager;
import thaumicbees.main.utils.CraftingManager;
import thaumicbees.main.utils.LocalizationManager;
import thaumicbees.main.utils.VersionInfo;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Mod;
@@ -41,6 +42,8 @@ public class ThaumicBees
@Mod.PreInit
public void preInit(FMLPreInitializationEvent event)
{
LocalizationManager.setupLocalizationInfo();
this.configsPath = event.getModConfigurationDirectory().getAbsolutePath();
this.modConfig = new Config(event.getSuggestedConfigurationFile());
@@ -67,6 +70,7 @@ public class ThaumicBees
}
this.modConfig.setupBlocks();
this.modConfig.registerTileEntities();
this.modConfig.setupItems();
CompatabilityManager.setupBackpacks();
@@ -86,7 +90,6 @@ public class ThaumicBees
// Forestry has init'd by this point.
MinecraftForge.EVENT_BUS.register(this);
CompatabilityManager.setupResearch();
}
@@ -1,4 +1,4 @@
package thaumicbees.compat;
package thaumicbees.main.utils;
import java.io.File;
import java.lang.reflect.Field;
@@ -24,8 +24,18 @@ import thaumicbees.item.types.WaxType;
import thaumicbees.main.CommonProxy;
import thaumicbees.main.Config;
import thaumicbees.main.ThaumicBees;
import thaumicbees.main.utils.compat.ForestryHelper;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import thaumicbees.main.utils.compat.ForestryHelper.CircuitBoard;
import thaumicbees.main.utils.compat.ForestryHelper.Comb;
import thaumicbees.main.utils.compat.ForestryHelper.CraftingMaterial;
import thaumicbees.main.utils.compat.ForestryHelper.Pollen;
import thaumicbees.main.utils.compat.ForestryHelper.Propolis;
import thaumicbees.main.utils.compat.ForestryHelper.Tube;
import thaumicbees.main.utils.compat.ThaumcraftHelper.MiscResource;
import thaumicbees.storage.BackpackDefinition;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.event.FMLInterModComms;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.api.apiculture.EnumBeeChromosome;
@@ -55,10 +65,7 @@ public class CompatabilityManager
Item i = (Item) f.get(null);
value = new ItemStack(i);
}
catch (Exception e)
{
}
catch (Exception e) { }
return value;
}
@@ -115,6 +122,9 @@ public class CompatabilityManager
ObjectTags tags;
ItemStack itemStack;
tags = new ObjectTags().add(EnumTag.WOOD, 2);
ThaumcraftApi.registerObjectTag(Config.planksWood.blockID, -1, tags);
tags = new ObjectTags().add(EnumTag.MAGIC, 2);
ThaumcraftApi.registerObjectTag(Config.wax.itemID, WaxType.MAGIC.ordinal(), tags);
@@ -123,8 +133,10 @@ public class CompatabilityManager
tags = new ObjectTags().add(EnumTag.KNOWLEDGE, 1);
ThaumcraftApi.registerObjectTag(Config.drops.itemID, DropType.INTELLECT.ordinal(), tags);
tags = new ObjectTags().add(EnumTag.ELDRITCH, 1);
tags = new ObjectTags().add(EnumTag.ELDRITCH, 2);
ThaumcraftApi.registerObjectTag(Config.pollen.itemID, PollenType.UNUSUAL.ordinal(), tags);
tags = new ObjectTags().add(EnumTag.TIME, 2);
ThaumcraftApi.registerObjectTag(Config.pollen.itemID, PollenType.PHASED.ordinal(), tags);
tags = new ObjectTags().add(EnumTag.CONTROL, 1);
ThaumcraftApi.registerObjectTag(Config.propolis.itemID, -1, tags);
@@ -221,12 +233,12 @@ public class CompatabilityManager
itemStack = ItemInterface.getItem("beealyzer");
tags = new ObjectTags().add(EnumTag.VALUABLE, 3).add(EnumTag.MECHANISM, 3).add(EnumTag.METAL, 19)
.add(EnumTag.POWER, 8).add(EnumTag.CRYSTAL, 18);
.add(EnumTag.POWER, 8).add(EnumTag.TOOL, 18);
ThaumcraftApi.registerObjectTag(itemStack.itemID, itemStack.getItemDamage(), tags);
itemStack = ItemInterface.getItem("treealyzer");
tags = new ObjectTags().add(EnumTag.POWER, 3).add(EnumTag.PURE, 3).add(EnumTag.LIFE, 6)
.add(EnumTag.CRYSTAL, 12).add(EnumTag.METAL, 19);
.add(EnumTag.TOOL, 12).add(EnumTag.METAL, 19);
ThaumcraftApi.registerObjectTag(itemStack.itemID, itemStack.getItemDamage(), tags);
itemStack = ItemInterface.getItem("apatite");
@@ -234,11 +246,11 @@ public class CompatabilityManager
ThaumcraftApi.registerObjectTag(itemStack.itemID, itemStack.getItemDamage(), tags);
itemStack = ItemInterface.getItem("impregnatedCasing");
tags = new ObjectTags().add(EnumTag.WOOD, 58).add(EnumTag.PLANT, 8);
tags = new ObjectTags().add(EnumTag.WOOD, 56).add(EnumTag.EXCHANGE, 8);
ThaumcraftApi.registerObjectTag(itemStack.itemID, itemStack.getItemDamage(), tags);
itemStack = ItemInterface.getItem("stickImpregnated");
tags = new ObjectTags().add(EnumTag.WOOD, 8).add(EnumTag.PLANT, 2);
tags = new ObjectTags().add(EnumTag.WOOD, 6).add(EnumTag.EXCHANGE, 2);
ThaumcraftApi.registerObjectTag(itemStack.itemID, itemStack.getItemDamage(), tags);
itemStack = ItemInterface.getItem("peat");
@@ -362,11 +374,11 @@ public class CompatabilityManager
itemStack = ItemInterface.getItem("tubes");
tags = new ObjectTags(ItemInterface.getItem("ingotCopper").itemID, 0).add(EnumTag.MECHANISM, 1).add(EnumTag.POWER, 1);
ThaumcraftApi.registerObjectTag(itemStack.itemID, ForestryHelper.Tube.COPPER.ordinal(), tags);
//ThaumcraftApi.registerObjectTag(itemStack.itemID, ForestryHelper.Tube.COPPER.ordinal(), tags);
tags = new ObjectTags(ItemInterface.getItem("ingotTin").itemID, 0).add(EnumTag.MECHANISM, 1).add(EnumTag.POWER, 1);
ThaumcraftApi.registerObjectTag(itemStack.itemID, ForestryHelper.Tube.TIN.ordinal(), tags);
//ThaumcraftApi.registerObjectTag(itemStack.itemID, ForestryHelper.Tube.TIN.ordinal(), tags);
tags = new ObjectTags(ItemInterface.getItem("ingotBronze").itemID, 0).add(EnumTag.MECHANISM, 1).add(EnumTag.POWER, 1);
ThaumcraftApi.registerObjectTag(itemStack.itemID, ForestryHelper.Tube.BRONZE.ordinal(), tags);
//ThaumcraftApi.registerObjectTag(itemStack.itemID, ForestryHelper.Tube.BRONZE.ordinal(), tags);
tags = new ObjectTags(Item.ingotIron.itemID, 0).add(EnumTag.MECHANISM, 1).add(EnumTag.POWER, 1);
ThaumcraftApi.registerObjectTag(itemStack.itemID, ForestryHelper.Tube.IRON.ordinal(), tags);
tags = new ObjectTags(Item.ingotGold.itemID, 0).add(EnumTag.MECHANISM, 1).add(EnumTag.POWER, 1);
@@ -391,20 +403,20 @@ public class CompatabilityManager
{
ItemStack itemStack;
ObjectTags tags;
}
private static void setupItemAspectsOreDict()
{
if ((itemStack = getExtraBeeItem("comb")) != null)
{
tags = new ObjectTags().add(EnumTag.INSECT, 2).add(EnumTag.TRAP, 2);
ThaumcraftApi.registerObjectTag(itemStack.itemID, -1, tags);
}
}
public static void setupResearch()
{
ObjectTags tags;
ResearchItem startNode = new ResearchItem("TBSTARTNODE", null, 10, 0, Config.miscResources.getStackForType(ResourceType.RESEARCH_StartNode))
.setAutoUnlock()
tags = new ObjectTags().add(EnumTag.WOOD, 10).add(EnumTag.PLANT, 10).add(EnumTag.INSECT, 10);
ResearchItem startNode = new ResearchItem("TBSTARTNODE", tags, 10, 1, Config.miscResources.getStackForType(ResourceType.RESEARCH_StartNode))
.setParents(ResearchList.getResearch("UTFT"))
.registerResearchItem();
tags = new ObjectTags().add(EnumTag.INSECT, 9).add(EnumTag.MAGIC, 4).add(EnumTag.FLUX, 4);
@@ -415,7 +427,7 @@ public class CompatabilityManager
tags = new ObjectTags().add(EnumTag.INSECT, 15).add(EnumTag.MAGIC, 5).add(EnumTag.WATER, 5).add(EnumTag.EARTH, 5)
.add(EnumTag.WIND, 5).add(EnumTag.FIRE, 5);
ResearchItem beeInfusion = new ResearchItem("BEEINFUSION", tags, 5, 3, Config.miscResources.getStackForType(ResourceType.RESEARCH_BeeInfusion))
.setParents(starkHint, ResearchList.getResearch("UTFT")).setHidden()
.setParents(starkHint).setHidden()
.registerResearchItem();
tags = new ObjectTags().add(EnumTag.CROP, 20).add(EnumTag.EARTH, 20).add(EnumTag.WATER, 5);
@@ -423,7 +435,7 @@ public class CompatabilityManager
.setParents(startNode)
.registerResearchItem();
tags = new ObjectTags().add(EnumTag.WOOD, 10).add(EnumTag.TOOL, 6).add(EnumTag.INSECT, 15).add(EnumTag.BEAST, 2)
tags = new ObjectTags().add(EnumTag.TOOL, 6).add(EnumTag.INSECT, 15).add(EnumTag.BEAST, 2)
.add(EnumTag.MAGIC, 5);
ResearchItem magicFrame = new ResearchItem("HIVEFRAME", tags, 10, -2, Config.hiveFrameMagic)
.setParents(startNode)
@@ -457,6 +469,21 @@ public class CompatabilityManager
ResearchItem temporalFrame = new ResearchItem("HIVEFRAMETIME", tags, 9, -5, Config.hiveFrameTemporal)
.setParents(magicFrame).setHidden()
.registerResearchItem();
tags = new ObjectTags().add(EnumTag.VOID, 15).add(EnumTag.CRYSTAL, 8).add(EnumTag.ELDRITCH, 8).add(EnumTag.EXCHANGE, 15);
ResearchItem voidCapsule = new ResearchItem("VOIDCAPSULE", tags, 10, 9, Config.voidCapsule)
.setParents(startNode, ResearchList.getResearch("PORTABLEHOLE")).setHidden()
.registerResearchItem();
tags = new ObjectTags().add(EnumTag.WOOD, 8).add(EnumTag.INSECT, 10).add(EnumTag.TOOL, 6).add(EnumTag.MAGIC, 6);
ResearchItem scoop = new ResearchItem("THAUMIUMSCOOP", tags, 0, -3, Config.thaumiumScoop)
.setParents(ResearchList.getResearch("THAUMIUM"))
.registerResearchItem();
tags = new ObjectTags().add(EnumTag.WOOD, 16).add(EnumTag.PLANT, 20).add(EnumTag.TOOL, 6).add(EnumTag.MAGIC, 6);
ResearchItem grafter = new ResearchItem("THAUMIUMGRAFTER", tags, 0, -4, Config.thaumiumGrafter)
.setParents(scoop)
.registerResearchItem();
}
public static void registerResearch()
@@ -6,17 +6,18 @@ import thaumcraft.api.ThaumcraftApi;
import thaumicbees.bees.Allele;
import thaumicbees.bees.BeeGenomeManager;
import thaumicbees.bees.BeeSpecies;
import thaumicbees.compat.ShapelessBeeInfusionCraftingRecipe;
import thaumicbees.compat.ThaumcraftHelper;
import thaumicbees.item.ItemCapsule;
import thaumicbees.item.types.CombType;
import thaumicbees.item.types.DropType;
import thaumicbees.item.types.HiveFrameType;
import thaumicbees.item.types.LiquidType;
import thaumicbees.item.types.PlankType;
import thaumicbees.item.types.PropolisType;
import thaumicbees.item.types.ResourceType;
import thaumicbees.item.types.WaxType;
import thaumicbees.main.Config;
import thaumicbees.main.utils.compat.ShapelessBeeInfusionCraftingRecipe;
import thaumicbees.main.utils.compat.ThaumcraftHelper;
import cpw.mods.fml.common.registry.GameRegistry;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.EnumBeeChromosome;
@@ -37,10 +38,35 @@ public class CraftingManager
{
public static void setupCrafting()
{
ItemStack inputStack; // Variable to hold forestry items
// Broken up into seperate sections to make things a bit easier to find.
setupVanillaCrafting();
setupCentrifugeRecipes();
setupSqueezerRecipes();
setupCarpenterRecipes();
setupThaumcraftCrafting();
registerLiquidContainer(Config.magicCapsule);
registerLiquidContainer(Config.voidCapsule);
}
private static void setupVanillaCrafting()
{
ItemStack input;
ItemStack output;
// Slabs
for (int i = 0; i < PlankType.values().length; ++i)
{
input = new ItemStack(Config.planksWood, 1, i);
output = new ItemStack(Config.slabWoodHalf, 6, i);
GameRegistry.addRecipe(output, new Object[] {
"PPP",
'P', input
});
}
// Essentia bottles
ItemStack output = new ItemStack(Config.tcEssentiaBottle);
output = new ItemStack(Config.tcEssentiaBottle);
output.stackSize = 8;
GameRegistry.addRecipe(output, new Object[] {
" C ", "GPG", "PGP",
@@ -79,17 +105,17 @@ public class CraftingManager
});
// Concentrated Fertilizer -> Forestry fertilizer
inputStack = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER);
input = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER);
output = ItemInterface.getItem("fertilizerCompound");
output.stackSize = 6;
GameRegistry.addRecipe(output, new Object[] {
" S ", " F ", " S ",
'F', inputStack,
'F', input,
'S', Block.sand
});
GameRegistry.addRecipe(output, new Object[] {
" ", "SFS", " ",
'F', inputStack,
'F', input,
'S', Block.sand
});
@@ -97,7 +123,7 @@ public class CraftingManager
output.stackSize = 12;
GameRegistry.addRecipe(output, new Object[] {
"aaa", "aFa", "aaa",
'F', inputStack,
'F', input,
'a', ItemInterface.getItem("ash")
});
@@ -121,7 +147,10 @@ public class CraftingManager
});
}
}
}
private static void setupCentrifugeRecipes()
{
// 20 is the 'average' time to centrifuge a comb.
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.OCCULT),
new ItemStack[] {Config.wax.getStackForType(WaxType.MAGIC), ItemInterface.getItem("honeyDrop") },
@@ -152,7 +181,7 @@ public class CraftingManager
new int[] { 100, 50, 65 });
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.INTELLECT),
new ItemStack[] { Config.wax.getStackForType(WaxType.MAGIC), ItemInterface.getItem("honeydew"), Config.drops.getStackForType(DropType.INTELLECT) },
new int[] { 90, 40, 2 });
new int[] { 90, 40, 10 });
RecipeManagers.centrifugeManager.addRecipe(20, Config.combs.getStackForType(CombType.SKULKING),
new ItemStack[] {ItemInterface.getItem("beeswax"), ItemInterface.getItem("propolis"), ItemInterface.getItem("honeydew") },
new int[] { 90, 20, 35 });
@@ -175,7 +204,10 @@ public class CraftingManager
RecipeManagers.centrifugeManager.addRecipe(8, Config.propolis.getStackForType(PropolisType.INFUSED),
new ItemStack[] {new ItemStack(Config.tcShard, 1, ThaumcraftHelper.ShardType.MAGIC.ordinal())},
new int[] { 10 });
}
private static void setupSqueezerRecipes()
{
// Squeezer recipes
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[] {Config.propolis.getStackForType(PropolisType.FIRE) },
new LiquidStack(Block.lavaStill, 250),
@@ -183,15 +215,21 @@ public class CraftingManager
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[] {Config.propolis.getStackForType(PropolisType.WATER) },
new LiquidStack(Block.waterStill, 500),
new ItemStack(Config.tcShard, 1, ThaumcraftHelper.ShardType.WATER.ordinal()), 18);
}
private static void setupCarpenterRecipes()
{
ItemStack input;
ItemStack output;
// Carpenter recipes
inputStack = ItemInterface.getItem("craftingMaterial");
inputStack.setItemDamage(3); // Set to Silk Mesh
input = ItemInterface.getItem("craftingMaterial");
input.setItemDamage(3); // Set to Silk Mesh
output = new ItemStack(Config.thaumaturgeBackpackT2);
RecipeManagers.carpenterManager.addRecipe(200, new LiquidStack(Block.waterStill.blockID, 1000), null, output, new Object[] {
"WXW", "WTW", "WWW",
'X', Item.diamond,
'W', inputStack,
'W', input,
'T', new ItemStack(Config.thaumaturgeBackpackT1)
});
@@ -205,12 +243,12 @@ public class CraftingManager
output = BlockInterface.getBlock("candle");
output.stackSize = 6;
inputStack = ItemInterface.getItem("craftingMaterial");
inputStack.setItemDamage(2); // Set to Silk Wisp
input = ItemInterface.getItem("craftingMaterial");
input.setItemDamage(2); // Set to Silk Wisp
RecipeManagers.carpenterManager.addRecipe(30, new LiquidStack(Block.waterStill, 600), null, output, new Object[] {
"WSW",
'W', Config.wax,
'S', inputStack
'S', input
});
output = Config.miscResources.getStackForType(ResourceType.AROMATIC_LUMP, 2);
@@ -227,22 +265,51 @@ public class CraftingManager
'J', ItemInterface.getItem("royalJelly"),
'D', Config.drops.getStackForType(DropType.ENCHANTED)
});
// Make Aromatic Lumps a swarmer inducer. Chance is /1000.
BeeManager.inducers.put(output, 80);
output = new ItemStack(Config.planksWood, 4, 0);
RecipeManagers.carpenterManager.addRecipe(8, new LiquidStack(Block.waterStill, 500), null, output, new Object[] {
"B",
'B', new ItemStack(Config.tcLog, 1, 0)
});
output = new ItemStack(Config.planksWood, 6, 1);
RecipeManagers.carpenterManager.addRecipe(8, new LiquidStack(Block.waterStill, 500), null, output, new Object[] {
"B",
'B', new ItemStack(Config.tcLog, 1, 1)
});
}
private static void setupThaumcraftCrafting()
{
ItemStack input;
ItemStack output;
ThaumcraftApi.addArcaneCraftingRecipe("THAUMIUMSCOOP", "THAUMIUMSCOOP", 45, new ItemStack(Config.thaumiumScoop), new Object[] {
"sWs", "sTs", " T ",
's', Item.stick,
'W', Block.cloth,
'T', new ItemStack(Config.tcMiscResource, 1, ThaumcraftHelper.MiscResource.THAUMIUM.ordinal())
});
ThaumcraftApi.addArcaneCraftingRecipe("THAUMIUMGRAFTER", "THAUMIUMGRAFTER", 160, new ItemStack(Config.thaumiumGrafter), new Object[] {
" T", " T ", "s ",
's', Item.stick,
'T', new ItemStack(Config.tcMiscResource, 1, ThaumcraftHelper.MiscResource.THAUMIUM.ordinal())
});
output = Config.miscResources.getStackForType(ResourceType.EXTENDED_FERTILIZER);
ItemStack inputA = ItemInterface.getItem("apatite");
input = ItemInterface.getItem("apatite");
ObjectTags tags = (new ObjectTags()).add(EnumTag.CROP, 12);
output.stackSize = 2;
ThaumcraftApi.addShapelessInfusionCraftingRecipe("FERTILIZER", "FERTILIZER", 5, tags, output, new Object[] {
inputA
input
});
output = new ItemStack(Config.hiveFrameMagic);
inputA = ItemInterface.getItem("frameUntreated");
input = ItemInterface.getItem("frameUntreated");
tags = new ObjectTags().add(EnumTag.WOOD, 4).add(EnumTag.INSECT, 8);
ThaumcraftApi.addShapelessInfusionCraftingRecipe("HIVEFRAME", "FRAMEMAGIC", 50, tags, output, new Object[] {
inputA
input
});
output = new ItemStack(Config.hiveFrameResilient);
@@ -257,7 +324,7 @@ public class CraftingManager
tags = new ObjectTags().add(EnumTag.WOOD, 4).add(EnumTag.INSECT, 8).add(EnumTag.HEAL, 12);
ThaumcraftApi.addInfusionCraftingRecipe("HIVEFRAMEGENTLE", "FRAMEGENTLE", 50, tags, output, new Object[] {
"www", "wFw", "www",
'F', inputA,
'F', input,
'w', ItemInterface.getItem("beeswax")
});
@@ -267,16 +334,16 @@ public class CraftingManager
.add(EnumTag.EXCHANGE, 8);
ThaumcraftApi.addShapelessInfusionCraftingRecipe("HIVEFRAMEMETA", "FRAMEMETABOLIC", 50, tags, output, new Object[] {
Item.magmaCream,
inputA
input
});
output = new ItemStack(Config.hiveFrameNecrotic);
tags = new ObjectTags().add(EnumTag.WOOD, 4).add(EnumTag.INSECT, 8).add(EnumTag.EXCHANGE, 12).add(EnumTag.DEATH, 16)
.add(EnumTag.POISON, 4);
.add(EnumTag.POISON, 1);
ThaumcraftApi.addInfusionCraftingRecipe("HIVEFRAMENECRO", "FRAMENECROTIC", 50, tags, output, new Object[] {
" S ", "SxS", " S ",
'S', Item.rottenFlesh,
'x', inputA
'x', input
});
output = new ItemStack(Config.hiveFrameTemporal);
@@ -285,7 +352,17 @@ public class CraftingManager
"tSt", "SFS", "tSt",
't', Item.stick,
'S', Block.sand,
'F', inputA
'F', input
});
output = Config.voidCapsule.getCapsuleForLiquid(LiquidType.EMPTY);
output.stackSize = 4;
tags = new ObjectTags().add(EnumTag.VOID, 16).add(EnumTag.ELDRITCH, 4).add(EnumTag.EXCHANGE, 8);
ThaumcraftApi.addInfusionCraftingRecipe("VOIDCAPSULE", "VOIDCAPSULE", 10, tags, output, new Object[] {
" G ", "GPG", "TGT",
'G', Block.thinGlass,
'P', Item.enderPearl,
'T', Item.ingotIron
});
ItemStack drone = BeeGenomeManager.getBeeNBTForSpecies(BeeSpecies.STARK, EnumBeeType.DRONE);
@@ -332,8 +409,6 @@ public class CraftingManager
ShapelessBeeInfusionCraftingRecipe.createNewRecipe(researchKey, "BEEINFUSION0", BeeSpecies.INFUSED.getBeeItem(EnumBeeType.PRINCESS), new Object[]
{ princess, new ItemStack(Config.tcShard, 1, ThaumcraftHelper.ShardType.MAGIC.ordinal()) },
100, tags, BeeSpecies.STARK, EnumBeeChromosome.SPECIES);
registerLiquidContainer(Config.magicCapsule);
}
private static void registerLiquidContainer(ItemCapsule baseCapsule)
@@ -0,0 +1,38 @@
package thaumicbees.main.utils;
import net.minecraft.util.StringTranslate;
import thaumicbees.main.CommonProxy;
import cpw.mods.fml.common.registry.LanguageRegistry;
public class LocalizationManager
{
private enum Locale
{
en_US("en_US"),
;
public String locale;
private Locale(String loc)
{
this.locale = loc;
}
}
public static void setupLocalizationInfo()
{
for (Locale l : Locale.values())
{
LanguageRegistry.instance().loadLocalization(CommonProxy.TCBEES_LOCDIR + l.locale + ".xml", l.locale, true);
}
}
public static String getLocalizedString(String key)
{
String result = LanguageRegistry.instance().getStringLocalization(key);
if (result.isEmpty())
{
result = LanguageRegistry.instance().getStringLocalization(key, "en_US");
}
return result;
}
}
@@ -1,5 +1,6 @@
package thaumicbees.main.utils;
import cpw.mods.fml.common.registry.LanguageRegistry;
import net.minecraft.world.World;
/**
@@ -7,14 +8,20 @@ import net.minecraft.world.World;
*/
public enum MoonPhase
{
FULL,
WANING_GIBBOUS,
WANING_HALF,
WANING_CRESCENT,
NEW,
WAXING_CRESCENT,
WAXING_HALF,
WAXING_GIBBOUS;
FULL("full"),
WANING_GIBBOUS("gibbousWaning"),
WANING_HALF("halfWaning"),
WANING_CRESCENT("crescentWaning"),
NEW("new"),
WAXING_CRESCENT("crecentWaxing"),
WAXING_HALF("halfWaxing"),
WAXING_GIBBOUS("gibbousWaxing");
private String phaseName;
private MoonPhase(String name)
{
this.phaseName = name;
}
public boolean isBetween(MoonPhase first, MoonPhase second)
{
@@ -35,6 +42,11 @@ public enum MoonPhase
return flag;
}
public String getName()
{
return LocalizationManager.getLocalizedString("tb.moon." + this.phaseName);
}
public static MoonPhase getMoonPhase(World w)
{
return MoonPhase.values()[(int)((w.getWorldTime() - 0) / 24000L) % 8];
@@ -1,6 +1,8 @@
package thaumicbees.compat;
package thaumicbees.main.utils.compat;
import net.minecraft.item.Item;
import forestry.api.core.EnumHumidity;
import forestry.api.core.EnumTemperature;
import forestry.api.core.ItemInterface;
import thaumicbees.main.Config;
@@ -92,4 +94,44 @@ public class ForestryHelper
LAPIS,
;
}
public static EnumTemperature getEnumTemperatureFromValue(float rawTemp)
{
EnumTemperature value = EnumTemperature.ICY;
if (rawTemp >= 2.0f)
{
value = EnumTemperature.HOT;
}
else if (rawTemp >= 1.2f)
{
value = EnumTemperature.WARM;
}
else if (rawTemp >= 0.2f)
{
value = EnumTemperature.NORMAL;
}
else if (rawTemp >= 0.05f)
{
value = EnumTemperature.COLD;
}
return value;
}
public static EnumHumidity getEnumHumidityFromValue(float rawHumidity)
{
EnumHumidity value = EnumHumidity.ARID;
if (rawHumidity >= 0.9f)
{
value = EnumHumidity.DAMP;
}
else if (rawHumidity >= 0.3f)
{
value = EnumHumidity.NORMAL;
}
return value;
}
}
@@ -1,4 +1,4 @@
package thaumicbees.compat;
package thaumicbees.main.utils.compat;
import java.util.ArrayList;
import java.util.Arrays;
@@ -1,4 +1,4 @@
package thaumicbees.compat;
package thaumicbees.main.utils.compat;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
@@ -104,7 +104,14 @@ public class ThaumcraftHelper
{
GREATWOOD_SAPLING,
SILVERWOOD_SAPLING,
SILVERLEAF,
SHIMMERLEAF,
CINDERPEARL;
}
public enum TreeType
{
GREATWOOD,
SILVERWOOD,
;
}
}