Compare commits

..
3 Commits
6 changed files with 25 additions and 14 deletions

No files matched your search

-1
View File
@@ -89,7 +89,6 @@
<filter token="VERSION" value="${thaumicbees.version}" /> <filter token="VERSION" value="${thaumicbees.version}" />
<filter token="BUILD_NUMBER" value="${build.number}" /> <filter token="BUILD_NUMBER" value="${build.number}" />
<filter token="FINGERPRINT" value="${key.fingerprint}" /> <filter token="FINGERPRINT" value="${key.fingerprint}" />
<filter token="MODVERSION" value="${thaumicbees.version} - ${build.number}" />
</filterset> </filterset>
</copy> </copy>
+4
View File
@@ -1,3 +1,7 @@
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 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. 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. Fixed missing aspects on Extra Bees combs.
+1 -1
View File
@@ -1,7 +1,7 @@
[ [
{ {
"modid": "ThaumicBees", "modid": "ThaumicBees",
"version": "@MODVERSION@", "version": "@VERSION@ - @BUILD_NUMBER",
"name": "ThaumicBees", "name": "ThaumicBees",
"url": "http://bit.ly/XFDvLY", "url": "http://bit.ly/XFDvLY",
"description": "Crossover mod for Forestry and Thaumcraft. Magic bees & more.", "description": "Crossover mod for Forestry and Thaumcraft. Magic bees & more.",
@@ -16,15 +16,15 @@ import net.minecraftforge.common.ForgeHooks;
public class ItemThaumiumGrafter extends Item implements IVisRepairable, IToolGrafter public class ItemThaumiumGrafter extends Item implements IVisRepairable, IToolGrafter
{ {
public ItemThaumiumGrafter(int id) public ItemThaumiumGrafter(int id)
{ {
super(id); super(id);
this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture); this.setMaxStackSize(1);
this.setMaxDamage(15); this.setMaxDamage(15);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
this.setIconIndex(21); this.setIconIndex(21);
this.setTextureFile(CommonProxy.TCBEES_ITEMS_IMAGE);
this.setItemName("tb.thaumiumGrafter"); this.setItemName("tb.thaumiumGrafter");
this.setCreativeTab(forestry.api.core.Tabs.tabArboriculture);
} }
@Override @Override
@@ -20,7 +20,7 @@ import forestry.api.core.ItemInterface;
name="Thaumic Bees", name="Thaumic Bees",
useMetadata=true, useMetadata=true,
acceptedMinecraftVersions=VersionInfo.MCVersion, acceptedMinecraftVersions=VersionInfo.MCVersion,
version=VersionInfo.Version, version=VersionInfo.Version + " - " + VersionInfo.Build,
dependencies=VersionInfo.Depends dependencies=VersionInfo.Depends
) )
public class ThaumicBees public class ThaumicBees
@@ -22,9 +22,9 @@ import cpw.mods.fml.relauncher.Side;
public class VersionInfo public class VersionInfo
{ {
public static final String Version = "@MODVERSION@"; public static final String Version = "1.4.3";
public static final String MCVersion = "@MCVERSION@";
public static final String Build = "@BUILD_NUMBER@"; 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 VersionURL = "http://bit.ly/thaumicbeeversion";
public static final String Logo = "/gfx/thaumicbees/logo.png"; public static final String Logo = "/gfx/thaumicbees/logo.png";
@@ -52,18 +52,20 @@ public class VersionInfo
for (int i = 0; i < tokens.length; ++i) for (int i = 0; i < tokens.length; ++i)
{ {
if (tokens[i].matches("[0-9]+[a-z]")) 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); String numberString = tokens[i].substring(0, tokens[i].length()-1);
versionTokens.add(Integer.valueOf(numberString)); versionTokens.add(Integer.valueOf(numberString));
versionTokens.add(Character.getNumericValue(tokens[i].charAt(tokens[i].length()-1))); versionTokens.add(Character.getNumericValue(tokens[i].charAt(tokens[i].length()-1)));
} }
else
{
versionTokens.add(Integer.valueOf(tokens[i]));
}
} }
// Can't use versionTokens.toArray 'cause that returns an Integer[], not int[]
int[] value = new int[versionTokens.size()]; int[] value = new int[versionTokens.size()];
for (int i = 0; i < value.length; ++i) for (int i = 0; i < value.length; ++i)
{ {
@@ -91,6 +93,13 @@ public class VersionInfo
result = false; result = false;
break; 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; return result;
@@ -181,7 +190,6 @@ public class VersionInfo
@Override @Override
public void run() public void run()
{ {
try try
{ {
String location = VersionURL; String location = VersionURL;