Basic reformat, hit once, hope never again

This commit is contained in:
thatsIch
2015-04-03 08:54:31 +02:00
parent 4ff1631f89
commit d34c988c88
886 changed files with 31400 additions and 30990 deletions
+12 -9
View File
@@ -18,6 +18,7 @@
package appeng.core;
import java.io.File;
import java.lang.reflect.Field;
import java.util.regex.Matcher;
@@ -29,33 +30,35 @@ import net.minecraftforge.common.config.Configuration;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.GameRegistry.UniqueIdentifier;
public class FacadeConfig extends Configuration
{
public static FacadeConfig instance;
final Pattern replacementPattern;
public FacadeConfig( File facadeFile ) {
public FacadeConfig( File facadeFile )
{
super( facadeFile );
this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" );
}
public boolean checkEnabled(Block id, int metadata, boolean automatic)
public boolean checkEnabled( Block id, int metadata, boolean automatic )
{
if ( id == null )
if( id == null )
return false;
UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id );
if ( blk == null )
if( blk == null )
{
for (Field f : Block.class.getFields())
for( Field f : Block.class.getFields() )
{
try
{
if ( f.get( Block.class ) == id )
return this.get( "minecraft", f.getName() + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic );
if( f.get( Block.class ) == id )
return this.get( "minecraft", f.getName() + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic );
}
catch (Throwable e)
catch( Throwable e )
{
// :P
}
@@ -65,7 +68,7 @@ public class FacadeConfig extends Configuration
{
Matcher mod = this.replacementPattern.matcher( blk.modId );
Matcher name = this.replacementPattern.matcher( blk.name );
return this.get( mod.replaceAll( "" ), name.replaceAll( "" ) + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic );
return this.get( mod.replaceAll( "" ), name.replaceAll( "" ) + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic );
}
return false;