final variables and parameters
This commit is contained in:
@@ -36,7 +36,7 @@ public final class ConfigManager implements IConfigManager
|
||||
private final Map<Settings, Enum<?>> settings = new EnumMap<Settings, Enum<?>>( Settings.class );
|
||||
private final IConfigManagerHost target;
|
||||
|
||||
public ConfigManager( IConfigManagerHost tile )
|
||||
public ConfigManager( final IConfigManagerHost tile )
|
||||
{
|
||||
this.target = tile;
|
||||
}
|
||||
@@ -48,15 +48,15 @@ public final class ConfigManager implements IConfigManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSetting( Settings settingName, Enum defaultValue )
|
||||
public void registerSetting( final Settings settingName, final Enum defaultValue )
|
||||
{
|
||||
this.settings.put( settingName, defaultValue );
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum<?> getSetting( Settings settingName )
|
||||
public Enum<?> getSetting( final Settings settingName )
|
||||
{
|
||||
Enum<?> oldValue = this.settings.get( settingName );
|
||||
final Enum<?> oldValue = this.settings.get( settingName );
|
||||
|
||||
if( oldValue != null )
|
||||
{
|
||||
@@ -67,9 +67,9 @@ public final class ConfigManager implements IConfigManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public Enum<?> putSetting( Settings settingName, Enum newValue )
|
||||
public Enum<?> putSetting( final Settings settingName, final Enum newValue )
|
||||
{
|
||||
Enum<?> oldValue = this.getSetting( settingName );
|
||||
final Enum<?> oldValue = this.getSetting( settingName );
|
||||
this.settings.put( settingName, newValue );
|
||||
this.target.updateSetting( this, settingName, newValue );
|
||||
return oldValue;
|
||||
@@ -81,9 +81,9 @@ public final class ConfigManager implements IConfigManager
|
||||
* @param tagCompound to be written to compound
|
||||
*/
|
||||
@Override
|
||||
public void writeToNBT( NBTTagCompound tagCompound )
|
||||
public void writeToNBT( final NBTTagCompound tagCompound )
|
||||
{
|
||||
for( Map.Entry<Settings, Enum<?>> entry : this.settings.entrySet() )
|
||||
for( final Map.Entry<Settings, Enum<?>> entry : this.settings.entrySet() )
|
||||
{
|
||||
tagCompound.setString( entry.getKey().name(), this.settings.get( entry.getKey() ).toString() );
|
||||
}
|
||||
@@ -95,9 +95,9 @@ public final class ConfigManager implements IConfigManager
|
||||
* @param tagCompound to be read from compound
|
||||
*/
|
||||
@Override
|
||||
public void readFromNBT( NBTTagCompound tagCompound )
|
||||
public void readFromNBT( final NBTTagCompound tagCompound )
|
||||
{
|
||||
for( Map.Entry<Settings, Enum<?>> entry : this.settings.entrySet() )
|
||||
for( final Map.Entry<Settings, Enum<?>> entry : this.settings.entrySet() )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -115,14 +115,14 @@ public final class ConfigManager implements IConfigManager
|
||||
value = LevelEmitterMode.STORABLE_AMOUNT.toString();
|
||||
}
|
||||
|
||||
Enum<?> oldValue = this.settings.get( entry.getKey() );
|
||||
final Enum<?> oldValue = this.settings.get( entry.getKey() );
|
||||
|
||||
Enum<?> newValue = Enum.valueOf( oldValue.getClass(), value );
|
||||
final Enum<?> newValue = Enum.valueOf( oldValue.getClass(), value );
|
||||
|
||||
this.putSetting( entry.getKey(), newValue );
|
||||
}
|
||||
}
|
||||
catch( IllegalArgumentException e )
|
||||
catch( final IllegalArgumentException e )
|
||||
{
|
||||
AELog.error( e );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user