Implemented Automatic Versioning in Build Script

1. Changed build.gradle so that it edits the version numbers in
mod_pocketDim.java and mcmod.info.
2. Changed mod_pocketDim to use a placeholder for its version number and
fixed an annotation that was wrong. It would cause our mod_pocketDim
instance to not initialize properly. I removed what seemed to be
workarounds that were hiding the problem.
3. Fixed space in TileEntityDimDoor.invalidate() and corrected a
non-static access to a static field in mod_pocketDim.
4. Changed mcmod.info so that it users placeholders for the mod version
and MC version values.
This commit is contained in:
SenseiKiwi
2014-07-09 04:01:37 -04:00
parent 7d840ff895
commit 2904ec146d
4 changed files with 25 additions and 25 deletions

View File

@@ -13,8 +13,6 @@ buildscript {
apply plugin: 'forge' apply plugin: 'forge'
version = "2.2.4-" + System.getenv("BUILD_NUMBER") version = "2.2.4-" + System.getenv("BUILD_NUMBER")
group = "com.stevenrs11.dimdoors" // http://maven.apache.org/guides/mini/guide-naming-conventions.html group = "com.stevenrs11.dimdoors" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "DimensionalDoors" archivesBaseName = "DimensionalDoors"
@@ -28,17 +26,19 @@ sourceCompatibility = '1.6'
processResources processResources
{ {
// replace stuff in mcmod.info, nothing else // Replace stuff $version and $mcversion in mcmod.info and mod_pocketDim.java
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info' include 'mcmod.info'
include 'mod_pocketDim.java'
// replace version and mcversion // Replace version and mcversion
expand 'version':project.version, 'mcversion':project.minecraft.version expand 'version':project.version, 'mcversion':project.minecraft.version
} }
// copy everything else, thats not the mcmod.info // Copy everything else
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
exclude 'mcmod.info' exclude 'mcmod.info'
exclude 'mod_pocketDim.java'
} }
} }

View File

@@ -97,7 +97,7 @@ serverPacketHandlerSpec =
@SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ServerPacketHandler.class)) @SidedPacketHandler(channels = {PacketConstants.CHANNEL_NAME}, packetHandler = ServerPacketHandler.class))
public class mod_pocketDim public class mod_pocketDim
{ {
public static final String version = "1.6.4-R2.2.4"; public static final String version = "$version";
public static final String modid = "dimdoors"; public static final String modid = "dimdoors";
//TODO need a place to stick all these constants //TODO need a place to stick all these constants
@@ -107,8 +107,8 @@ public class mod_pocketDim
@SidedProxy(clientSide = "StevenDimDoors.mod_pocketDimClient.ClientProxy", serverSide = "StevenDimDoors.mod_pocketDim.CommonProxy") @SidedProxy(clientSide = "StevenDimDoors.mod_pocketDimClient.ClientProxy", serverSide = "StevenDimDoors.mod_pocketDim.CommonProxy")
public static CommonProxy proxy; public static CommonProxy proxy;
@Instance("PocketDimensions") @Instance(mod_pocketDim.modid)
public static mod_pocketDim instance = new mod_pocketDim(); public static mod_pocketDim instance;
public static Block transientDoor; public static Block transientDoor;
public static Block warpDoor; public static Block warpDoor;
@@ -169,7 +169,6 @@ public class mod_pocketDim
@EventHandler @EventHandler
public void onPreInitialization(FMLPreInitializationEvent event) public void onPreInitialization(FMLPreInitializationEvent event)
{ {
instance = this;
//This should be the FIRST thing that gets done. //This should be the FIRST thing that gets done.
String path = event.getSuggestedConfigurationFile().getAbsolutePath().replace(modid, "DimDoors"); String path = event.getSuggestedConfigurationFile().getAbsolutePath().replace(modid, "DimDoors");

View File

@@ -37,6 +37,7 @@ public class TileEntityDimDoor extends DDTileEntityBase
return null; return null;
} }
@Override
public void invalidate() public void invalidate()
{ {
this.tileEntityInvalid = true; this.tileEntityInvalid = true;
@@ -45,7 +46,7 @@ public class TileEntityDimDoor extends DDTileEntityBase
{ {
if(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj)!=null) if(PocketManager.getLink(xCoord, yCoord, zCoord, worldObj)!=null)
{ {
mod_pocketDim.instance.fastRiftRegenerator.registerRiftForRegen(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId); mod_pocketDim.fastRiftRegenerator.registerRiftForRegen(xCoord, yCoord, zCoord, this.worldObj.provider.dimensionId);
} }
} }
} }

View File

@@ -6,10 +6,10 @@
"modid": "dimdoors", "modid": "dimdoors",
"name": "Dimensional Doors", "name": "Dimensional Doors",
"description": "Bend and twist reality itself, creating pocket dimensions, rifts, and much more", "description": "Bend and twist reality itself, creating pocket dimensions, rifts, and much more",
"version": "1.6.4-R2.2.4", "version": "$version",
"credits": "Created by StevenRS11, Coded by StevenRS11 and SenseiKiwi, Logo and Testing by Jaitsu", "credits": "Created by StevenRS11, Coded by StevenRS11 and SenseiKiwi, Logo and Testing by Jaitsu",
"logoFile": "/dimdoors_logo.png", "logoFile": "/dimdoors_logo.png",
"mcversion": "", "mcversion": "$mcversion",
"url": "http://www.minecraftforum.net/topic/1650007-147smpssplan-dimensional-doors-v110-physics-what-physics-updated-with-fancy-opengl/", "url": "http://www.minecraftforum.net/topic/1650007-147smpssplan-dimensional-doors-v110-physics-what-physics-updated-with-fancy-opengl/",
"updateUrl": "", "updateUrl": "",
"authors": [ "StevenRS11", "SenseiKiwi" ], "authors": [ "StevenRS11", "SenseiKiwi" ],