Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mDiyo committed Oct 2, 2013
2 parents f954784 + c0b0d48 commit b5e545f
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 9 deletions.
63 changes: 60 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@
<property name="mc.version" value="1.6.4"/>
<property name="forge.version" value="9.11.0.880"/>

<!-- FMP stuff - copied from projectred w/ CB's permission -->
<property name="build.dependencies.file" value="${build.dir}/dependencies.properties" />
<property name="ccl.version" value="1.0.0.36" />
<property name="fmp.version" value="1.0.0.182" />
<property name="ccl.name" value="CodeChickenLib-dev-${mc.version}-${ccl.version}.jar" />
<property name="fmp.name" value="ForgeMultipart-dev-${mc.version}-${fmp.version}.jar" />
<available property="fmp-downloaded" file="${download.dir}/${fmp.name}" />
<available property="ccl-downloaded" file="${download.dir}/${ccl.name}" />
<condition property="ccl-installed">
<and>
<isset property="forge-installed" />
<equals arg1="${build.dependencies.ccl}" arg2="${ccl.version}" />
</and>
</condition>
<condition property="fmp-installed">
<and>
<isset property="forge-installed" />
<equals arg1="${build.dependencies.fmp}" arg2="${fmp.version}" />
</and>
</condition>
<property name="version.major" value="0"/>
<property name="version.minor" value="0"/>

Expand All @@ -41,6 +61,43 @@

<!-- Targets -->

<!-- Targets FMP stuff from ProjectRed w/ CB's Permission -->
<target name="download-ccl" unless="ccl-downloaded">
<get src="http://files.minecraftforge.net/CodeChickenLib/${ccl.name}" dest="${download.dir}" usetimestamp="true" />
</target>
<target name="install-ccl" depends="setup,download-ccl" unless="ccl-installed">
<echo message="Deleting old CodeChickenLib" />
<delete file="${mcp.dir}/lib/${build.dependencies.ccl.name}" />

<echo message="Installing CodeChickenLib" />
<copy file="${download.dir}/${ccl.name}" todir="${mcp.dir}/lib" />

<echo message="Updating build.dependencies" />
<propertyfile file="${build.dependencies.file}">
<entry key="ccl" value="${ccl.version}" />
<entry key="ccl.name" value="${ccl.name}" />
</propertyfile>
</target>
<target name="install-fmp" depends="setup,download-fmp" unless="fmp-installed">
<echo message="Deleting old ForgeMultipart" />
<delete file="${mcp.dir}/lib/${build.dependencies.fmp.name}" />

<echo message="Installing ForgeMultipart" />
<copy file="${download.dir}/${fmp.name}" todir="${mcp.dir}/lib" />

<echo message="Updating build.dependencies" />
<propertyfile file="${build.dependencies.file}">
<entry key="fmp" value="${fmp.version}" />
<entry key="fmp.name" value="${fmp.name}" />
</propertyfile>
</target>
<target name="install-deps" depends="install-ccl,install-fmp" />


<target name="download-fmp" unless="fmp-downloaded">
<get src="http://files.minecraftforge.net/ForgeMultipart/${fmp.name}" dest="${download.dir}" usetimestamp="true" />
</target>

<!-- Clear build directory -->
<target name="clean">
<delete dir="${build.dir}"/>
Expand Down Expand Up @@ -113,7 +170,7 @@
</copy>
</target>

<target name="compile" depends="initialize-version,setup,copy-src">
<target name="compile" depends="initialize-version,install-deps,setup,copy-src">

<delete dir="${classes.dir}"/>
<mkdir dir="${classes.dir}"/>
Expand Down Expand Up @@ -151,7 +208,7 @@
<copy todir="${classes.dir}">
<fileset dir="${mcp.dir}/reobf/minecraft"/>
</copy>

<!-- Copy resources -->
<copy todir="${classes.dir}" outputencoding="UTF-8">
<fileset dir="${classes.dir}">
Expand All @@ -176,7 +233,7 @@
<delete dir="${mcpsrc.dir}/minecraft/sparrow"/>
<delete dir="${mcpsrc.dir}/minecraft/powercrystals"/>
<delete dir="${mcpsrc.dir}/minecraft/ic2"/>

<delete dir="${mcpsrc.dir}/minecraft/codechicken"/>
</target>

<!-- Package the compiled files -->
Expand Down
1 change: 1 addition & 0 deletions resources/assets/tinker/lang/en_US.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<entry key="item.InfiTool.Shortbow.name">Shortbow</entry>
<entry key="item.InfiTool.Arrow.name">Arrow</entry>
<entry key="item.InfiTool.PotionLauncher.name">Potion Launcher</entry>
<entry key="item.InfiTool.Mattock.name">Mattock</entry>

<entry key="item.tconstruct.Pattern.blank_pattern.name">Blank Pattern</entry>
<entry key="item.tconstruct.Pattern.blank_cast.name">Blank Cast</entry>
Expand Down
23 changes: 22 additions & 1 deletion resources/mcmod.info
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,28 @@
"mcversion": "@MCVERSION@",
"url": "http://www.minecraftforum.net/topic/1659892-tinkers-construct",
"updateUrl": "",
"authors": [],
"authors": [
"mDiyo", "fuj1n", "ProgWML6", "Sunstrike"
],
"credits": "",
"logoFile": "",
"screenshots": [],
"parent":"TConstruct",
"dependencies": [
"TConstruct"
]
}
{
"modid": "TConstruct|CompatForgeMultiPart",
"name": "TConstruct Compat: FMP",
"description": "TConstruct support for forgemultipart",
"version": "@VERSION@",
"mcversion": "@MCVERSION@",
"url": "http://www.minecraftforum.net/topic/1659892-tinkers-construct",
"updateUrl": "",
"authors": [
"mDiyo", "fuj1n", "ProgWML6", "Sunstrike"
],
"credits": "",
"logoFile": "",
"screenshots": [],
Expand Down
10 changes: 5 additions & 5 deletions src/tconstruct/blocks/logic/DryingRackLogic.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected String getDefaultName ()
@Override
public void updateEntity ()
{
if (maxTime > 0 && currentTime < maxTime)
if (!worldObj.isRemote && maxTime > 0 && currentTime < maxTime)
{
currentTime++;
if (currentTime >= maxTime)
Expand Down Expand Up @@ -79,16 +79,16 @@ public void updateDryingTime ()
@Override
public void readFromNBT (NBTTagCompound tags)
{
tags.setInteger("Time", currentTime);
tags.setInteger("MaxTime", maxTime);
currentTime = tags.getInteger("Time");
maxTime = tags.getInteger("MaxTime");
readCustomNBT(tags);
}

@Override
public void writeToNBT (NBTTagCompound tags)
{
currentTime = tags.getInteger("Time");
maxTime = tags.getInteger("MaxTime");
tags.setInteger("Time", currentTime);
tags.setInteger("MaxTime", maxTime);
writeCustomNBT(tags);
}

Expand Down
41 changes: 41 additions & 0 deletions src/tconstruct/plugins/fmp/ForgeMultiPart.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package tconstruct.plugins.fmp;

import tconstruct.common.TContent;
import tconstruct.plugins.fmp.register.RegisterWithFMP;
import cpw.mods.fml.common.FMLLog;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.network.NetworkMod;

@Mod(modid = "TConstruct|ForgeMuliPart", name = "TConstruct Compat: FMP", version = "0.1", dependencies = "after:ForgeMultipart;after:TConstruct")
@NetworkMod(clientSideRequired = false, serverSideRequired = false)
public class ForgeMultiPart
{
@EventHandler
public static void load (FMLInitializationEvent ev)
{
if (!Loader.isModLoaded("ForgeMultipart"))
{
FMLLog.warning("Forgemultipart missing - TConstruct Compat: FMP not loading.");

return;
}
try
{
FMLLog.fine("ForgeMultipart detected. Registering TConstruct decorative blocks with FMP.");
RegisterWithFMP.registerBlock(TContent.clearGlass);
RegisterWithFMP.registerBlock(TContent.stainedGlassClear, 0, 15);
RegisterWithFMP.registerBlock(TContent.multiBrick, 0, 13);
RegisterWithFMP.registerBlock(TContent.metalBlock, 0, 10);
RegisterWithFMP.registerBlock(TContent.multiBrickFancy, 0, 15);

}
catch (Exception e)
{
e.printStackTrace();
}
}

}
23 changes: 23 additions & 0 deletions src/tconstruct/plugins/fmp/register/RegisterWithFMP.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package tconstruct.plugins.fmp.register;

import net.minecraft.block.Block;
import codechicken.microblock.BlockMicroMaterial;
import codechicken.microblock.MicroMaterialRegistry;

public class RegisterWithFMP
{
//For blocks with metadata values only
public static void registerBlock (Block block, int metastart, int metaend)
{
for (int meta = metastart; meta <= metaend; meta++)
{
String identifier = new String(block.getUnlocalizedName());
MicroMaterialRegistry.registerMaterial(new BlockMicroMaterial(block, meta), identifier + meta);
}
}
//For blocks without metadata values only.
public static void registerBlock (Block block)
{
BlockMicroMaterial.createAndRegister(block);
}
}

0 comments on commit b5e545f

Please sign in to comment.