mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-13 00:37:51 +00:00
Merge branch 'machineDev' of https://bitbucket.org/MysteriousAges/thaumicbees into machineDev
This commit is contained in:
commit
c6720b7417
15 files changed
+705
-478
No files matched your search
+191
@@ -0,0 +1,191 @@
|
||||
<?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>
|
||||
|
||||
<!-- 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>
|
||||
@@ -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.4.2"/>
|
||||
<property name="thaumicbees.version" value="1.4.3"/>
|
||||
|
||||
<!-- for local deployment only, not used by main -->
|
||||
<property name="deploy.type" value="previews" />
|
||||
@@ -74,13 +74,14 @@
|
||||
<include name="thaumcraft/**" />
|
||||
</fileset>
|
||||
<fileset dir="${src.dir}/thaumicbees_src">
|
||||
<include name="**/net/mysteriousages/**" />
|
||||
<include name="**/thaumicbees/**" />
|
||||
<include name="**/forestry/**" />
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${clientsrc.dir}" overwrite="true" failonerror="true">
|
||||
<fileset dir="${src.dir}/thaumicbees_src">
|
||||
<fileset dir="${src.dir}/thaumicbees_src">
|
||||
<include name="**/VersionInfo.java" />
|
||||
</fileset>
|
||||
<filterset>
|
||||
@@ -88,7 +89,6 @@
|
||||
<filter token="VERSION" value="${thaumicbees.version}" />
|
||||
<filter token="BUILD_NUMBER" value="${build.number}" />
|
||||
<filter token="FINGERPRINT" value="${key.fingerprint}" />
|
||||
<filter token="MODVERSION" value="${thaumicbees.version} - ${build.number}" />
|
||||
</filterset>
|
||||
</copy>
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
<fileset dir="${mcp.dir}/reobf/minecraft">
|
||||
<include name="**/thaumicbees/**" />
|
||||
<include name="**/forestry/plugins/**" />
|
||||
<include name="**/net/mysteriousages/**" />
|
||||
|
||||
<exclude name="forestry/api/**" />
|
||||
<exclude name="thaumcraft/**" />
|
||||
@@ -134,12 +135,15 @@
|
||||
<exclude name="build.number"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
<!-- Copy localizations (We have none yet.) -->
|
||||
<!--<copy todir="${classes.dir}/client">
|
||||
<fileset dir="${lang.dir}">
|
||||
<exclude name="README.md"/>
|
||||
</fileset>
|
||||
</copy>-->
|
||||
|
||||
<copy todir="${classes.dir}/client" overwrite="true" failonerror="true">
|
||||
<fileset dir="${src.dir}/thaumicbees_res">
|
||||
<include name="**/mcmod.info" />
|
||||
</fileset>
|
||||
<filterset>
|
||||
<filter token="MODVERSION" value="${thaumicbees.version} - ${build.number}" />
|
||||
</filterset>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<!-- Package the jars -->
|
||||
|
||||
@@ -1,6 +1,16 @@
|
||||
1.4.3a
|
||||
Changed Version info embedded in mod to match format supported by Version checking. Will need to make this more robust in the future.
|
||||
Fixed bug with Thaumium Grafter not being enchantable.
|
||||
|
||||
1.4.3
|
||||
Added automatic version-checking for ThaumicBees! From this version on, when a new version becomes available, it will notify you in-game. Notifications can be switched off via a config file option.
|
||||
Fixed missing aspects on Extra Bees combs.
|
||||
|
||||
1.4.2
|
||||
Added Void Capsules - hold up to 8 buckets of liquid with one! It's a waterproof bag of holding!
|
||||
Added Void Capsules - hold up to 8 buckets of liquid with one! It's a waterproof bag of holding! Plus stacking.
|
||||
Fix: Added Greatwood & Silverwood slabs to the ore dictionary so they should work as normal.
|
||||
Added Thaumium Scoop - 30 uses, can be enchanted with Repair.
|
||||
Added Thaumium Grafter - 15 uses, can be enchanted with Repair.
|
||||
|
||||
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.
|
||||
@@ -15,6 +25,7 @@ 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.
|
||||
ACTUALLY fixed issue with untyped node mutations failing.
|
||||
|
||||
1.3.0d
|
||||
Fixed an issue with mutations requiring a non-specific type of node to fail.
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
<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>
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
[
|
||||
{
|
||||
"modid": "ThaumicBees",
|
||||
"version": "@VERSION@ - @BUILD_NUMBER",
|
||||
"name": "ThaumicBees",
|
||||
"url": "http://bit.ly/XFDvLY",
|
||||
"description": "Crossover mod for Forestry and Thaumcraft. Magic bees & more.",
|
||||
"authors": [ "MysteriousAges" ],
|
||||
"credits": "Thanks to Sengir and Azanor for awesome mods! Also thanks to Binnie and Florastar. (:",
|
||||
"credits": "SirSengir, Azanor, Binnie & the Forestry Dev peeps",
|
||||
"logoFile": "/gfx/thaumicbees/logo.png"
|
||||
}
|
||||
]
|
||||
@@ -1,73 +0,0 @@
|
||||
package thaumicbees.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import thaumicbees.main.CommonProxy;
|
||||
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;
|
||||
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 BlockMagicApiary extends Block
|
||||
{
|
||||
public BlockMagicApiary(int par1)
|
||||
{
|
||||
super(par1, Material.wood);
|
||||
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
|
||||
this.setBlockName("Magic Apiary");
|
||||
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 = 50;
|
||||
if (side == 0)
|
||||
{
|
||||
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 = 50;
|
||||
if (side == 0 || side == 1)
|
||||
{
|
||||
texture = 51;
|
||||
}
|
||||
return texture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entity)
|
||||
{
|
||||
super.onBlockPlacedBy(world, x, y, z, entity);
|
||||
|
||||
// Validate block arrangement
|
||||
}
|
||||
}
|
||||
@@ -1,273 +0,0 @@
|
||||
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 thaumicbees.main.utils.compat.ForestryHelper;
|
||||
|
||||
public class LogicMagicApiary implements IBeeHousing
|
||||
{
|
||||
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)
|
||||
{
|
||||
this.parent = master;
|
||||
this.beeLogic = BeeManager.breedingManager.createBeekeepingLogic(this);
|
||||
this.tileInventory = new GenericInventory("MagicApiary", 11);
|
||||
}
|
||||
|
||||
public TileEntityMagicApiary getParent()
|
||||
{
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setOwner(EntityPlayer player)
|
||||
{
|
||||
this.ownerName = player.username;
|
||||
}
|
||||
|
||||
public String getOwner()
|
||||
{
|
||||
return this.ownerName;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome)
|
||||
{
|
||||
return 1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate)
|
||||
{
|
||||
return 1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate)
|
||||
{
|
||||
return 1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome)
|
||||
{
|
||||
return 2f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome)
|
||||
{
|
||||
return 1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
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()
|
||||
{
|
||||
return parent.xCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getYCoord()
|
||||
{
|
||||
return parent.yCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getZCoord()
|
||||
{
|
||||
return parent.zCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getQueen()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getDrone()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
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()
|
||||
{
|
||||
return this.biome.biomeID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumTemperature getTemperature()
|
||||
{
|
||||
return ForestryHelper.getEnumTemperatureFromValue(this.biome.temperature);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumHumidity getHumidity()
|
||||
{
|
||||
return ForestryHelper.getEnumHumidityFromValue(this.biome.rainfall);
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld()
|
||||
{
|
||||
return this.getWorld();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOwnerName()
|
||||
{
|
||||
return parent.getOwner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setErrorState(int state)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getErrorOrdinal()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBreed()
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addProduct(ItemStack product, boolean all)
|
||||
{
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,97 +0,0 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,15 +16,15 @@ 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.setMaxStackSize(1);
|
||||
this.setMaxDamage(15);
|
||||
this.setIconIndex(21);
|
||||
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
|
||||
this.setItemName("tb.thaumiumGrafter");
|
||||
this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,10 +2,8 @@ package thaumicbees.main;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import thaumicbees.block.BlockMagicApiary;
|
||||
import thaumicbees.block.BlockPlanks;
|
||||
import thaumicbees.block.BlockWoodSlab;
|
||||
import thaumicbees.block.TileEntityMagicApiary;
|
||||
import thaumicbees.item.ItemCapsule;
|
||||
import thaumicbees.item.ItemComb;
|
||||
import thaumicbees.item.ItemDrop;
|
||||
@@ -58,13 +56,13 @@ public class Config
|
||||
public boolean BeeInfusionsAdded;
|
||||
public boolean ExtraBeesInstalled;
|
||||
public boolean AddThaumcraftItemsToBackpacks;
|
||||
public boolean SkipUpdateCheck;
|
||||
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;
|
||||
public static ItemWax wax;
|
||||
@@ -162,14 +160,11 @@ public class Config
|
||||
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()
|
||||
@@ -270,6 +265,10 @@ public class Config
|
||||
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();
|
||||
|
||||
p = tbConfig.get("general", "disableVersionCheck", false);
|
||||
p.comment = "Set to true to stop ThaumicBees from checking for updates.";
|
||||
this.SkipUpdateCheck = p.getBoolean(false);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ import forestry.api.core.ItemInterface;
|
||||
name="Thaumic Bees",
|
||||
useMetadata=true,
|
||||
acceptedMinecraftVersions=VersionInfo.MCVersion,
|
||||
version=VersionInfo.Version,
|
||||
version=VersionInfo.Version + " - " + VersionInfo.Build,
|
||||
dependencies=VersionInfo.Depends
|
||||
)
|
||||
public class ThaumicBees
|
||||
@@ -91,6 +91,8 @@ public class ThaumicBees
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
|
||||
CompatabilityManager.setupResearch();
|
||||
|
||||
VersionInfo.doVersionCheck();
|
||||
}
|
||||
|
||||
public static Config getConfig()
|
||||
|
||||
@@ -24,6 +24,7 @@ import thaumicbees.item.types.WaxType;
|
||||
import thaumicbees.main.CommonProxy;
|
||||
import thaumicbees.main.Config;
|
||||
import thaumicbees.main.ThaumicBees;
|
||||
import thaumicbees.main.utils.compat.ExtraBeesHelper;
|
||||
import thaumicbees.main.utils.compat.ForestryHelper;
|
||||
import thaumicbees.main.utils.compat.ThaumcraftHelper;
|
||||
import thaumicbees.main.utils.compat.ForestryHelper.CircuitBoard;
|
||||
@@ -51,6 +52,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.Property;
|
||||
import net.minecraftforge.common.Configuration;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class CompatabilityManager
|
||||
{
|
||||
@@ -158,17 +160,20 @@ public class CompatabilityManager
|
||||
|
||||
tags = new ObjectTags().add(EnumTag.INSECT, 2).add(EnumTag.TRAP, 2);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, -1, tags);
|
||||
|
||||
itemStack = Config.combs.getStackForType(CombType.OCCULT);
|
||||
tags = new ObjectTags().add(EnumTag.INSECT, 2).add(EnumTag.TRAP, 2).add(EnumTag.MAGIC, 2);
|
||||
tags = new ObjectTags(Config.combs.itemID, -1).add(EnumTag.MAGIC, 2);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.OCCULT.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.OTHERWORLDLY.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.STARK.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.AIRY.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.FIREY.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.WATERY.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.EARTHY.ordinal(), tags);
|
||||
tags = new ObjectTags(Config.combs.itemID, -1).add(EnumTag.MAGIC, 4);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.INFUSED.ordinal(), tags);
|
||||
tags = new ObjectTags(Config.combs.itemID, -1).add(EnumTag.MAGIC, 2).add(EnumTag.MOTION, 2);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.AIRY.ordinal(), tags);
|
||||
tags = new ObjectTags(Config.combs.itemID, -1).add(EnumTag.MAGIC, 2).add(EnumTag.POWER, 2);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.FIREY.ordinal(), tags);
|
||||
tags = new ObjectTags(Config.combs.itemID, -1).add(EnumTag.MAGIC, 2).add(EnumTag.COLD, 2);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.WATERY.ordinal(), tags);
|
||||
tags = new ObjectTags(Config.combs.itemID, -1).add(EnumTag.MAGIC, 2).add(EnumTag.ROCK, 2);
|
||||
ThaumcraftApi.registerObjectTag(Config.combs.itemID, CombType.EARTHY.ordinal(), tags);
|
||||
|
||||
// Tagging capsules.
|
||||
tags = new ObjectTags().add(EnumTag.VOID, 2).add(EnumTag.MAGIC, 2);
|
||||
@@ -403,6 +408,31 @@ public class CompatabilityManager
|
||||
{
|
||||
ItemStack itemStack;
|
||||
ObjectTags tags;
|
||||
|
||||
try // One try block suffices. If we can't get one item, it's probably safe to assume we can't get any others.
|
||||
{
|
||||
itemStack = getExtraBeeItem("comb");
|
||||
tags = new ObjectTags().add(EnumTag.INSECT, 2).add(EnumTag.TRAP, 2);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, -1, tags);
|
||||
tags = new ObjectTags(itemStack.itemID, -1).add(EnumTag.POWER, 2);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, ExtraBeesHelper.CombType.OIL.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, ExtraBeesHelper.CombType.COAL.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, ExtraBeesHelper.CombType.FUEL.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, ExtraBeesHelper.CombType.ALCOHOL.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, ExtraBeesHelper.CombType.REDSTONE.ordinal(), tags);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, ExtraBeesHelper.CombType.URANIUM.ordinal(), tags);
|
||||
tags = new ObjectTags(itemStack.itemID, -1).add(EnumTag.POISON, 2);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, ExtraBeesHelper.CombType.VENOMOUS.ordinal(), tags);
|
||||
|
||||
itemStack = getExtraBeeItem("propolis");
|
||||
tags = new ObjectTags().add(EnumTag.CONTROL, 1);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, -1, tags);
|
||||
|
||||
itemStack = getExtraBeeItem("honeyDrop");
|
||||
tags = new ObjectTags().add(EnumTag.EXCHANGE, 2).add(EnumTag.LIFE, 1);
|
||||
ThaumcraftApi.registerObjectTag(itemStack.itemID, -1, tags);
|
||||
}
|
||||
catch (NullPointerException e) { }
|
||||
}
|
||||
|
||||
private static void setupItemAspectsOreDict()
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
package thaumicbees.main.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import cpw.mods.fml.common.IScheduledTickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
|
||||
public class TickHandlerVersion implements IScheduledTickHandler
|
||||
{
|
||||
|
||||
public static TickHandlerVersion instance = new TickHandlerVersion();
|
||||
|
||||
private static ArrayList<VersionInfo> modVersionInfo = new ArrayList();
|
||||
private static boolean initialized;
|
||||
private static boolean sent;
|
||||
private static int modIndex = 0;
|
||||
|
||||
public static boolean initialize()
|
||||
{
|
||||
if (initialized)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
initialized = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isInitialized()
|
||||
{
|
||||
return initialized;
|
||||
}
|
||||
|
||||
public static boolean registerModVersionInfo(VersionInfo info)
|
||||
{
|
||||
if (modVersionInfo.contains(info))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
modVersionInfo.add(info);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickStart(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
if (sent)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (modIndex < modVersionInfo.size())
|
||||
{
|
||||
VersionInfo anInfo = modVersionInfo.get(modIndex);
|
||||
|
||||
if (anInfo.isNewVersionAvailable())
|
||||
{
|
||||
EntityPlayer player = (EntityPlayer) tickData[0];
|
||||
player.sendChatToPlayer("[" + anInfo.modName + "] A new version is available: " + anInfo.getLatestVersion());
|
||||
player.sendChatToPlayer(anInfo.getVersionDescription());
|
||||
}
|
||||
modIndex += 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sent = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tickEnd(EnumSet<TickType> type, Object... tickData)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<TickType> ticks()
|
||||
{
|
||||
if (TickHandlerVersion.sent)
|
||||
{
|
||||
return EnumSet.noneOf(TickType.class);
|
||||
}
|
||||
return EnumSet.of(TickType.PLAYER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel()
|
||||
{
|
||||
return "thaumicbees.version";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int nextTickSpacing()
|
||||
{
|
||||
if (!sent)
|
||||
{
|
||||
return 200;
|
||||
}
|
||||
return 72000;
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,254 @@
|
||||
package thaumicbees.main.utils;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import thaumicbees.main.ThaumicBees;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
|
||||
/**
|
||||
* Using some of the VersionInfo code from cofh. (Thanks, Lemming!)
|
||||
* @author MysteriousAges
|
||||
*
|
||||
*/
|
||||
public class VersionInfo
|
||||
{
|
||||
|
||||
public static final String Version = "@MODVERSION@";
|
||||
public static final String MCVersion = "@MCVERSION@";
|
||||
public static final String Version = "1.4.3";
|
||||
public static final String Build = "@BUILD_NUMBER@";
|
||||
|
||||
public static final String MCVersion = "@MCVERSION@";
|
||||
public static final String VersionURL = "http://bit.ly/thaumicbeeversion";
|
||||
|
||||
public static final String Logo = "/gfx/thaumicbees/logo.png";
|
||||
|
||||
|
||||
public static final String Depends = "required-after:Forestry;required-after:Thaumcraft@[3.0.3,);after:ExtraBees";
|
||||
|
||||
boolean criticalUpdate;
|
||||
boolean newVersion;
|
||||
boolean newMinecraftVersion;
|
||||
boolean versionCheckComplete;
|
||||
|
||||
String latestModVersion;
|
||||
String latestMCVersion = MCVersion;
|
||||
String description = "";
|
||||
|
||||
String modName;
|
||||
String modVersion;
|
||||
String releaseURL;
|
||||
Logger modLogger = FMLLog.getLogger();
|
||||
|
||||
public static int[] parseVersion(String rawVersion)
|
||||
{
|
||||
ArrayList<Integer> versionTokens = new ArrayList<Integer>();
|
||||
String[] tokens = rawVersion.trim().split("\\.");
|
||||
|
||||
for (int i = 0; i < tokens.length; ++i)
|
||||
{
|
||||
tokens[i] = tokens[i].trim();
|
||||
if (tokens[i].matches("[0-9]+"))
|
||||
{
|
||||
versionTokens.add(Integer.valueOf(tokens[i]));
|
||||
}
|
||||
else if (tokens[i].matches("[0-9]+[a-z]"))
|
||||
{
|
||||
String numberString = tokens[i].substring(0, tokens[i].length()-1);
|
||||
versionTokens.add(Integer.valueOf(numberString));
|
||||
versionTokens.add(Character.getNumericValue(tokens[i].charAt(tokens[i].length()-1)));
|
||||
}
|
||||
}
|
||||
|
||||
// Can't use versionTokens.toArray 'cause that returns an Integer[], not int[]
|
||||
int[] value = new int[versionTokens.size()];
|
||||
for (int i = 0; i < value.length; ++i)
|
||||
{
|
||||
value[i] = versionTokens.get(i).intValue();
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
/* VERSION COMPARISON */
|
||||
public static boolean beforeTargetVersion(String version, String target)
|
||||
{
|
||||
boolean result = false;
|
||||
int[] versionTokens = parseVersion(version);
|
||||
int[] targetTokens = parseVersion(target);
|
||||
|
||||
for (int i = 0; i < versionTokens.length; ++i)
|
||||
{
|
||||
if (versionTokens[i] < targetTokens[i])
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
else if (versionTokens[i] > targetTokens[i])
|
||||
{
|
||||
result = false;
|
||||
break;
|
||||
}
|
||||
|
||||
if (i == versionTokens.length-1 && versionTokens.length < targetTokens.length)
|
||||
{
|
||||
// If the versions compared are the same, but target has an extra token, it's probably a "letter" build
|
||||
// and is ahead of this one.
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static boolean afterTargetVersion(String version, String target)
|
||||
{
|
||||
boolean result = false;
|
||||
int[] versionTokens = parseVersion(version);
|
||||
int[] targetTokens = parseVersion(target);
|
||||
|
||||
for (int i = 0; i < versionTokens.length; ++i)
|
||||
{
|
||||
if (versionTokens[i] > targetTokens[i])
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public VersionInfo(String name, String version, String url)
|
||||
{
|
||||
modName = name;
|
||||
modVersion = latestModVersion = version;
|
||||
releaseURL = url;
|
||||
}
|
||||
|
||||
public VersionInfo(String name, String version, String url, Logger logger)
|
||||
{
|
||||
modName = name;
|
||||
modVersion = latestModVersion = version;
|
||||
releaseURL = url;
|
||||
modLogger = logger;
|
||||
}
|
||||
|
||||
public void checkForNewVersion()
|
||||
{
|
||||
Thread versionCheckThread = new VersionCheckThread();
|
||||
versionCheckThread.start();
|
||||
}
|
||||
|
||||
public String getCurrentVersion()
|
||||
{
|
||||
return modVersion;
|
||||
}
|
||||
|
||||
public String getLatestVersion()
|
||||
{
|
||||
return latestModVersion;
|
||||
}
|
||||
|
||||
public String getLatestMCVersion()
|
||||
{
|
||||
return latestMCVersion;
|
||||
}
|
||||
|
||||
public String getVersionDescription()
|
||||
{
|
||||
return description;
|
||||
}
|
||||
|
||||
public boolean isCriticalUpdate()
|
||||
{
|
||||
return criticalUpdate;
|
||||
}
|
||||
|
||||
public boolean isNewVersionAvailable()
|
||||
{
|
||||
return newVersion;
|
||||
}
|
||||
|
||||
public boolean isMinecraftOutdated()
|
||||
{
|
||||
return newMinecraftVersion;
|
||||
}
|
||||
|
||||
public boolean isVersionCheckComplete()
|
||||
{
|
||||
return versionCheckComplete;
|
||||
}
|
||||
|
||||
/* VERSION CHECK THREAD CLASS */
|
||||
private class VersionCheckThread extends Thread
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try
|
||||
{
|
||||
String location = VersionURL;
|
||||
|
||||
HttpURLConnection connection = null;
|
||||
|
||||
// Used to "dereference" any location headers we may get.
|
||||
while (location != null && !location.isEmpty())
|
||||
{
|
||||
URL url = new URL(location);
|
||||
connection = (HttpURLConnection) url.openConnection();
|
||||
connection.setRequestProperty("User-Agent",
|
||||
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.60 Safari/537.17");
|
||||
connection.connect();
|
||||
location = connection.getHeaderField("Location");
|
||||
}
|
||||
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
latestModVersion = reader.readLine();
|
||||
criticalUpdate = Boolean.parseBoolean(reader.readLine());
|
||||
latestMCVersion = reader.readLine();
|
||||
description = reader.readLine();
|
||||
reader.close();
|
||||
|
||||
if (beforeTargetVersion(modVersion, latestModVersion))
|
||||
{
|
||||
modLogger.log(Level.INFO, "An updated version of " + modName + " is available: " + latestModVersion + ".");
|
||||
newVersion = true;
|
||||
if (criticalUpdate)
|
||||
{
|
||||
modLogger.log(Level.INFO, "This update has been marked as CRITICAL and will ignore notification suppression.");
|
||||
}
|
||||
if (beforeTargetVersion(MCVersion, latestMCVersion))
|
||||
{
|
||||
newMinecraftVersion = true;
|
||||
modLogger.log(Level.INFO, "This update is for Minecraft " + latestMCVersion + ".");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
modLogger.log(Level.WARNING, "Version Check Failed: " + e.getMessage());
|
||||
}
|
||||
versionCheckComplete = true;
|
||||
}
|
||||
}
|
||||
|
||||
public static void doVersionCheck()
|
||||
{
|
||||
if (!ThaumicBees.getConfig().SkipUpdateCheck)
|
||||
{
|
||||
VersionInfo main = new VersionInfo("ThaumicBees", Version, VersionURL);
|
||||
TickHandlerVersion.registerModVersionInfo(main);
|
||||
TickHandlerVersion.initialize();
|
||||
TickRegistry.registerScheduledTickHandler(TickHandlerVersion.instance, Side.CLIENT);
|
||||
|
||||
VersionCheckThread thread = main.new VersionCheckThread();
|
||||
thread.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package thaumicbees.main.utils.compat;
|
||||
|
||||
public class ExtraBeesHelper
|
||||
{
|
||||
|
||||
public enum CombType
|
||||
{
|
||||
BARREN,
|
||||
ROTTEN,
|
||||
BONE,
|
||||
OIL,
|
||||
COAL,
|
||||
FUEL,
|
||||
WATER,
|
||||
MILK,
|
||||
FRUIT,
|
||||
SEED,
|
||||
ALCOHOL,
|
||||
STONE,
|
||||
REDSTONE,
|
||||
RESIN,
|
||||
IC2,
|
||||
IRON,
|
||||
GOLD,
|
||||
COPPER,
|
||||
TIN,
|
||||
SILVER,
|
||||
BRONZE,
|
||||
URANIUM,
|
||||
CLAY,
|
||||
OLD,
|
||||
FUNGAL,
|
||||
CREOSOTE,
|
||||
LATEX,
|
||||
ACIDIC,
|
||||
VENOMOUS,
|
||||
SLIME,
|
||||
BLAZE,
|
||||
COFFEE,
|
||||
GLACIAL,
|
||||
MINT,
|
||||
CITRUS,
|
||||
PEAT,
|
||||
SHADOW,
|
||||
LEAD,
|
||||
BRASS,
|
||||
ELECTRUM,
|
||||
ZINC,
|
||||
TITANIUM,
|
||||
TUNGSTEN,
|
||||
STEEL,
|
||||
IRIDIUM,
|
||||
PLATINUM,
|
||||
LAPIS,
|
||||
SODALITE,
|
||||
PYRITE,
|
||||
BAUXITE,
|
||||
CINNABAR,
|
||||
SPHALERITE,
|
||||
EMERALD,
|
||||
RUBY,
|
||||
SAPPHIRE,
|
||||
OLIVINE,
|
||||
DIAMOND,
|
||||
RED,
|
||||
YELLOW,
|
||||
BLUE,
|
||||
GREEN,
|
||||
BLACK,
|
||||
WHITE,
|
||||
BROWN,
|
||||
ORANGE,
|
||||
CYAN,
|
||||
PURPLE,
|
||||
GRAY,
|
||||
LIGHTBLUE,
|
||||
PINK,
|
||||
LIMEGREEN,
|
||||
MAGENTA,
|
||||
LIGHTGRAY,
|
||||
NICKEL,
|
||||
INVAR,
|
||||
GLOWSTONE,
|
||||
SALTPETER,
|
||||
PULP,
|
||||
MULCH,
|
||||
COMPOST,
|
||||
SAWDUST,
|
||||
;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user