Skip to content

Commit

Permalink
neaten up code, document the purpose of the 2 registration methods
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Oct 1, 2013
1 parent 5a75f66 commit 2b48c2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions src/tconstruct/plugins/fmp/ForgeMultiPart.java
Expand Up @@ -25,15 +25,12 @@ public static void load (FMLInitializationEvent ev)
try
{
FMLLog.fine("ForgeMultipart detected. Registering TConstruct decorative blocks with FMP.");
//register blocks without metadata here
RegisterWithFMP.registerBlock(TContent.clearGlass);
//register blocks w/ metadata here
RegisterWithFMP.registerBlock(TContent.stainedGlassClear, 0, 15);
RegisterWithFMP.registerBlock(TContent.multiBrick, 0,13);
RegisterWithFMP.registerBlock(TContent.multiBrick, 0, 13);
RegisterWithFMP.registerBlock(TContent.metalBlock, 0, 10);
RegisterWithFMP.registerBlock(TContent.multiBrickFancy, 0, 15);


}
catch (Exception e)
{
Expand Down
10 changes: 5 additions & 5 deletions src/tconstruct/plugins/fmp/register/RegisterWithFMP.java
Expand Up @@ -6,19 +6,19 @@

public class RegisterWithFMP
{
//For blocks with metadata values only
public static void registerBlock (Block block, int metastart, int metaend)
{
// meta = number 0->15
for (int meta = metastart; meta <= metaend; meta++)
{
String identifier = new String(block.getUnlocalizedName());
MicroMaterialRegistry.registerMaterial(new BlockMicroMaterial(block, meta), identifier + 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)
{
String identifier = new String(block.getUnlocalizedName());
new String(block.getUnlocalizedName());
BlockMicroMaterial.createAndRegister(block);
}
}

0 comments on commit 2b48c2f

Please sign in to comment.