Changed access to use this qualifier

This commit is contained in:
yueh
2014-12-29 15:13:47 +01:00
parent 2a5e57a59b
commit f471513bd0
604 changed files with 11573 additions and 11573 deletions
+111 -111
View File
@@ -77,7 +77,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
public int quartzOresClusterAmount = 15;
public int chargedChange = 4;
public int minMeteoriteDistance = 707;
public int minMeteoriteDistanceSq = minMeteoriteDistance * minMeteoriteDistance;
public int minMeteoriteDistanceSq = this.minMeteoriteDistance * this.minMeteoriteDistance;
private double WirelessBaseCost = 8;
private double WirelessCostMultiplier = 1;
@@ -90,17 +90,17 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
public double wireless_getDrainRate(double range)
{
return WirelessTerminalDrainMultiplier * range;
return this.WirelessTerminalDrainMultiplier * range;
}
public double wireless_getMaxRange(int boosters)
{
return WirelessBaseRange + WirelessBoosterRangeMultiplier * Math.pow( boosters, WirelessBoosterExp );
return this.WirelessBaseRange + this.WirelessBoosterRangeMultiplier * Math.pow( boosters, this.WirelessBoosterExp );
}
public double wireless_getPowerDrain(int boosters)
{
return WirelessBaseCost + WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / WirelessHighWirelessCount );
return this.WirelessBaseCost + this.WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / this.WirelessHighWirelessCount );
}
@Override
@@ -161,44 +161,44 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
{
if ( eventArgs.modID.equals( AppEng.MOD_ID ) )
{
clientSync();
this.clientSync();
}
}
private void clientSync()
{
disableColoredCableRecipesInNEI = get( "Client", "disableColoredCableRecipesInNEI", true ).getBoolean( true );
enableEffects = get( "Client", "enableEffects", true ).getBoolean( true );
useLargeFonts = get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false );
this.disableColoredCableRecipesInNEI = this.get( "Client", "disableColoredCableRecipesInNEI", true ).getBoolean( true );
this.enableEffects = this.get( "Client", "enableEffects", true ).getBoolean( true );
this.useLargeFonts = this.get( "Client", "useTerminalUseLargeFont", false ).getBoolean( false );
// load buttons..
for (int btnNum = 0; btnNum < 4; btnNum++)
{
Property cmb = get( "Client", "craftAmtButton" + (btnNum + 1), craftByStacks[btnNum] );
Property pmb = get( "Client", "priorityAmtButton" + (btnNum + 1), priorityByStacks[btnNum] );
Property lmb = get( "Client", "levelAmtButton" + (btnNum + 1), levelByStacks[btnNum] );
Property cmb = this.get( "Client", "craftAmtButton" + (btnNum + 1), this.craftByStacks[btnNum] );
Property pmb = this.get( "Client", "priorityAmtButton" + (btnNum + 1), this.priorityByStacks[btnNum] );
Property lmb = this.get( "Client", "levelAmtButton" + (btnNum + 1), this.levelByStacks[btnNum] );
int buttonCap = (int) (Math.pow( 10, btnNum + 1 ) - 1);
craftByStacks[btnNum] = Math.abs( cmb.getInt( craftByStacks[btnNum] ) );
priorityByStacks[btnNum] = Math.abs( pmb.getInt( priorityByStacks[btnNum] ) );
levelByStacks[btnNum] = Math.abs( pmb.getInt( levelByStacks[btnNum] ) );
this.craftByStacks[btnNum] = Math.abs( cmb.getInt( this.craftByStacks[btnNum] ) );
this.priorityByStacks[btnNum] = Math.abs( pmb.getInt( this.priorityByStacks[btnNum] ) );
this.levelByStacks[btnNum] = Math.abs( pmb.getInt( this.levelByStacks[btnNum] ) );
cmb.comment = "Controls buttons on Crafting Screen : Capped at " + buttonCap;
pmb.comment = "Controls buttons on Priority Screen : Capped at " + buttonCap;
lmb.comment = "Controls buttons on Level Emitter Screen : Capped at " + buttonCap;
craftByStacks[btnNum] = Math.min( craftByStacks[btnNum], buttonCap );
priorityByStacks[btnNum] = Math.min( priorityByStacks[btnNum], buttonCap );
levelByStacks[btnNum] = Math.min( levelByStacks[btnNum], buttonCap );
this.craftByStacks[btnNum] = Math.min( this.craftByStacks[btnNum], buttonCap );
this.priorityByStacks[btnNum] = Math.min( this.priorityByStacks[btnNum], buttonCap );
this.levelByStacks[btnNum] = Math.min( this.levelByStacks[btnNum], buttonCap );
}
for (Enum e : settings.getSettings())
for (Enum e : this.settings.getSettings())
{
String Category = "Client"; // e.getClass().getSimpleName();
Enum value = settings.getSetting( e );
Enum value = this.settings.getSetting( e );
Property p = this.get( Category, e.name(), value.name(), getListComment( value ) );
Property p = this.get( Category, e.name(), value.name(), this.getListComment( value ) );
try
{
@@ -209,24 +209,24 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
AELog.info( "Invalid value '" + p.getString() + "' for " + e.name() + " using '" + value.name() + "' instead" );
}
settings.putSetting( e, value );
this.settings.putSetting( e, value );
}
}
public boolean disableColoredCableRecipesInNEI()
{
return disableColoredCableRecipesInNEI;
return this.disableColoredCableRecipesInNEI;
}
public String getFilePath()
{
return myPath.toString();
return this.myPath.toString();
}
public AEConfig(String path) {
super( new File( path + "AppliedEnergistics2.cfg" ) );
myPath = new File( path + "AppliedEnergistics2.cfg" );
this.myPath = new File( path + "AppliedEnergistics2.cfg" );
FMLCommonHandler.instance().bus().register( this );
@@ -236,69 +236,69 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
final double DEFAULT_RF_EXCHANGE = 0.5;
final double DEFAULT_MEKANISM_EXCHANGE = 0.2;
PowerUnits.MJ.conversionRatio = get( "PowerRatios", "BuildCraft", DEFAULT_BC_EXCHANGE ).getDouble( DEFAULT_BC_EXCHANGE );
PowerUnits.MK.conversionRatio = get( "PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE ).getDouble( DEFAULT_MEKANISM_EXCHANGE );
PowerUnits.EU.conversionRatio = get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
PowerUnits.WA.conversionRatio = get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE );
PowerUnits.RF.conversionRatio = get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
PowerUnits.MJ.conversionRatio = this.get( "PowerRatios", "BuildCraft", DEFAULT_BC_EXCHANGE ).getDouble( DEFAULT_BC_EXCHANGE );
PowerUnits.MK.conversionRatio = this.get( "PowerRatios", "Mekanism", DEFAULT_MEKANISM_EXCHANGE ).getDouble( DEFAULT_MEKANISM_EXCHANGE );
PowerUnits.EU.conversionRatio = this.get( "PowerRatios", "IC2", DEFAULT_IC2_EXCHANGE ).getDouble( DEFAULT_IC2_EXCHANGE );
PowerUnits.WA.conversionRatio = this.get( "PowerRatios", "RotaryCraft", DEFAULT_RTC_EXCHANGE ).getDouble( DEFAULT_RTC_EXCHANGE );
PowerUnits.RF.conversionRatio = this.get( "PowerRatios", "ThermalExpansion", DEFAULT_RF_EXCHANGE ).getDouble( DEFAULT_RF_EXCHANGE );
double usageEffective = get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
double usageEffective = this.get( "PowerRatios", "UsageMultiplier", 1.0 ).getDouble( 1.0 );
PowerMultiplier.CONFIG.multiplier = Math.max( 0.01, usageEffective );
CondenserOutput.MATTER_BALLS.requiredPower = get( "Condenser", "MatterBalls", 256 ).getInt( 256 );
CondenserOutput.SINGULARITY.requiredPower = get( "Condenser", "Singularity", 256000 ).getInt( 256000 );
CondenserOutput.MATTER_BALLS.requiredPower = this.get( "Condenser", "MatterBalls", 256 ).getInt( 256 );
CondenserOutput.SINGULARITY.requiredPower = this.get( "Condenser", "Singularity", 256000 ).getInt( 256000 );
grinderOres = get( "GrindStone", "grinderOres", grinderOres ).getStringList();
oreDoublePercentage = get( "GrindStone", "oreDoublePercentage", oreDoublePercentage ).getDouble( oreDoublePercentage );
this.grinderOres = this.get( "GrindStone", "grinderOres", this.grinderOres ).getStringList();
this.oreDoublePercentage = this.get( "GrindStone", "oreDoublePercentage", this.oreDoublePercentage ).getDouble( this.oreDoublePercentage );
settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
settings.registerSetting( Settings.TERMINAL_STYLE, TerminalStyle.TALL );
settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH );
this.settings.registerSetting( Settings.SEARCH_TOOLTIPS, YesNo.YES );
this.settings.registerSetting( Settings.TERMINAL_STYLE, TerminalStyle.TALL );
this.settings.registerSetting( Settings.SEARCH_MODE, SearchBoxMode.AUTOSEARCH );
spawnChargedChance = (float) (1.0 - get( "worldGen", "spawnChargedChance", 1.0 - spawnChargedChance ).getDouble( 1.0 - spawnChargedChance ));
minMeteoriteDistance = get( "worldGen", "minMeteoriteDistance", minMeteoriteDistance ).getInt( minMeteoriteDistance );
meteoriteClusterChance = get( "worldGen", "meteoriteClusterChance", meteoriteClusterChance ).getDouble( meteoriteClusterChance );
meteoriteSpawnChance = get( "worldGen", "meteoriteSpawnChance", meteoriteSpawnChance ).getDouble( meteoriteSpawnChance );
meteoriteDimensionWhitelist = get ("worldGen", "meteoriteDimensionWhitelist", meteoriteDimensionWhitelist).getIntList();
this.spawnChargedChance = (float) (1.0 - this.get( "worldGen", "spawnChargedChance", 1.0 - this.spawnChargedChance ).getDouble( 1.0 - this.spawnChargedChance ));
this.minMeteoriteDistance = this.get( "worldGen", "minMeteoriteDistance", this.minMeteoriteDistance ).getInt( this.minMeteoriteDistance );
this.meteoriteClusterChance = this.get( "worldGen", "meteoriteClusterChance", this.meteoriteClusterChance ).getDouble( this.meteoriteClusterChance );
this.meteoriteSpawnChance = this.get( "worldGen", "meteoriteSpawnChance", this.meteoriteSpawnChance ).getDouble( this.meteoriteSpawnChance );
this.meteoriteDimensionWhitelist = this.get ("worldGen", "meteoriteDimensionWhitelist", this.meteoriteDimensionWhitelist).getIntList();
quartzOresPerCluster = get( "worldGen", "quartzOresPerCluster", quartzOresPerCluster ).getInt( quartzOresPerCluster );
quartzOresClusterAmount = get( "worldGen", "quartzOresClusterAmount", quartzOresClusterAmount ).getInt( quartzOresClusterAmount );
this.quartzOresPerCluster = this.get( "worldGen", "quartzOresPerCluster", this.quartzOresPerCluster ).getInt( this.quartzOresPerCluster );
this.quartzOresClusterAmount = this.get( "worldGen", "quartzOresClusterAmount", this.quartzOresClusterAmount ).getInt( this.quartzOresClusterAmount );
minMeteoriteDistanceSq = minMeteoriteDistance * minMeteoriteDistance;
this.minMeteoriteDistanceSq = this.minMeteoriteDistance * this.minMeteoriteDistance;
addCustomCategoryComment(
this.addCustomCategoryComment(
"wireless",
"Range= WirelessBaseRange + WirelessBoosterRangeMultiplier * Math.pow( boosters, WirelessBoosterExp )\nPowerDrain= WirelessBaseCost + WirelessCostMultiplier * Math.pow( boosters, 1 + boosters / WirelessHighWirelessCount )" );
WirelessBaseCost = get( "wireless", "WirelessBaseCost", WirelessBaseCost ).getDouble( WirelessBaseCost );
WirelessCostMultiplier = get( "wireless", "WirelessCostMultiplier", WirelessCostMultiplier ).getDouble( WirelessCostMultiplier );
WirelessBaseRange = get( "wireless", "WirelessBaseRange", WirelessBaseRange ).getDouble( WirelessBaseRange );
WirelessBoosterRangeMultiplier = get( "wireless", "WirelessBoosterRangeMultiplier", WirelessBoosterRangeMultiplier ).getDouble(
WirelessBoosterRangeMultiplier );
WirelessBoosterExp = get( "wireless", "WirelessBoosterExp", WirelessBoosterExp ).getDouble( WirelessBoosterExp );
WirelessTerminalDrainMultiplier = get( "wireless", "WirelessTerminalDrainMultiplier", WirelessTerminalDrainMultiplier ).getDouble(
WirelessTerminalDrainMultiplier );
this.WirelessBaseCost = this.get( "wireless", "WirelessBaseCost", this.WirelessBaseCost ).getDouble( this.WirelessBaseCost );
this.WirelessCostMultiplier = this.get( "wireless", "WirelessCostMultiplier", this.WirelessCostMultiplier ).getDouble( this.WirelessCostMultiplier );
this.WirelessBaseRange = this.get( "wireless", "WirelessBaseRange", this.WirelessBaseRange ).getDouble( this.WirelessBaseRange );
this.WirelessBoosterRangeMultiplier = this.get( "wireless", "WirelessBoosterRangeMultiplier", this.WirelessBoosterRangeMultiplier ).getDouble(
this.WirelessBoosterRangeMultiplier );
this.WirelessBoosterExp = this.get( "wireless", "WirelessBoosterExp", this.WirelessBoosterExp ).getDouble( this.WirelessBoosterExp );
this.WirelessTerminalDrainMultiplier = this.get( "wireless", "WirelessTerminalDrainMultiplier", this.WirelessTerminalDrainMultiplier ).getDouble(
this.WirelessTerminalDrainMultiplier );
formationPlaneEntityLimit = get( "automation", "formationPlaneEntityLimit", formationPlaneEntityLimit ).getInt( formationPlaneEntityLimit );
this.formationPlaneEntityLimit = this.get( "automation", "formationPlaneEntityLimit", this.formationPlaneEntityLimit ).getInt( this.formationPlaneEntityLimit );
wirelessTerminalBattery = get( "battery", "wirelessTerminal", wirelessTerminalBattery ).getInt( wirelessTerminalBattery );
chargedStaffBattery = get( "battery", "chargedStaff", chargedStaffBattery ).getInt( chargedStaffBattery );
entropyManipulatorBattery = get( "battery", "entropyManipulator", entropyManipulatorBattery ).getInt( entropyManipulatorBattery );
portableCellBattery = get( "battery", "portableCell", portableCellBattery ).getInt( portableCellBattery );
colorApplicatorBattery = get( "battery", "colorApplicator", colorApplicatorBattery ).getInt( colorApplicatorBattery );
matterCannonBattery = get( "battery", "matterCannon", matterCannonBattery ).getInt( matterCannonBattery );
this.wirelessTerminalBattery = this.get( "battery", "wirelessTerminal", this.wirelessTerminalBattery ).getInt( this.wirelessTerminalBattery );
this.chargedStaffBattery = this.get( "battery", "chargedStaff", this.chargedStaffBattery ).getInt( this.chargedStaffBattery );
this.entropyManipulatorBattery = this.get( "battery", "entropyManipulator", this.entropyManipulatorBattery ).getInt( this.entropyManipulatorBattery );
this.portableCellBattery = this.get( "battery", "portableCell", this.portableCellBattery ).getInt( this.portableCellBattery );
this.colorApplicatorBattery = this.get( "battery", "colorApplicator", this.colorApplicatorBattery ).getInt( this.colorApplicatorBattery );
this.matterCannonBattery = this.get( "battery", "matterCannon", this.matterCannonBattery ).getInt( this.matterCannonBattery );
clientSync();
this.clientSync();
for (AEFeature feature : AEFeature.values())
{
if ( feature.isVisible )
{
if ( get( "Features." + feature.category, feature.name(), feature.defaultValue ).getBoolean( feature.defaultValue ) )
featureFlags.add( feature );
if ( this.get( "Features." + feature.category, feature.name(), feature.defaultValue ).getBoolean( feature.defaultValue ) )
this.featureFlags.add( feature );
}
else
featureFlags.add( feature );
this.featureFlags.add( feature );
}
ModContainer imb = cpw.mods.fml.common.Loader.instance().getIndexedModList().get( "ImmibisCore" );
@@ -306,16 +306,16 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
{
List<String> version = Arrays.asList( "59.0.0", "59.0.1", "59.0.2" );
if ( version.contains( imb.getVersion() ) )
featureFlags.remove( AEFeature.AlphaPass );
this.featureFlags.remove( AEFeature.AlphaPass );
}
try
{
selectedPowerUnit = PowerUnits.valueOf( get( "Client", "PowerUnit", selectedPowerUnit.name(), getListComment( selectedPowerUnit ) ).getString() );
this.selectedPowerUnit = PowerUnits.valueOf( this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).getString() );
}
catch (Throwable t)
{
selectedPowerUnit = PowerUnits.AE;
this.selectedPowerUnit = PowerUnits.AE;
}
for (TickRates tr : TickRates.values())
@@ -323,45 +323,45 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
tr.Load( this );
}
if ( isFeatureEnabled( AEFeature.SpatialIO ) )
if ( this.isFeatureEnabled( AEFeature.SpatialIO ) )
{
storageBiomeID = get( "spatialio", "storageBiomeID", storageBiomeID ).getInt( storageBiomeID );
storageProviderID = get( "spatialio", "storageProviderID", storageProviderID ).getInt( storageProviderID );
spatialPowerMultiplier = get( "spatialio", "spatialPowerMultiplier", spatialPowerMultiplier ).getDouble( spatialPowerMultiplier );
spatialPowerExponent = get( "spatialio", "spatialPowerExponent", spatialPowerExponent ).getDouble( spatialPowerExponent );
this.storageBiomeID = this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).getInt( this.storageBiomeID );
this.storageProviderID = this.get( "spatialio", "storageProviderID", this.storageProviderID ).getInt( this.storageProviderID );
this.spatialPowerMultiplier = this.get( "spatialio", "spatialPowerMultiplier", this.spatialPowerMultiplier ).getDouble( this.spatialPowerMultiplier );
this.spatialPowerExponent = this.get( "spatialio", "spatialPowerExponent", this.spatialPowerExponent ).getDouble( this.spatialPowerExponent );
}
if ( isFeatureEnabled( AEFeature.CraftingCPU ) )
if ( this.isFeatureEnabled( AEFeature.CraftingCPU ) )
{
craftingCalculationTimePerTick = get( "craftingCPU", "craftingCalculationTimePerTick", craftingCalculationTimePerTick ).getInt(
craftingCalculationTimePerTick );
this.craftingCalculationTimePerTick = this.get( "craftingCPU", "craftingCalculationTimePerTick", this.craftingCalculationTimePerTick ).getInt(
this.craftingCalculationTimePerTick );
}
if ( isFeatureEnabled( AEFeature.VersionChecker ) )
if ( this.isFeatureEnabled( AEFeature.VersionChecker ) )
{
try
{
latestVersion = get( "VersionChecker", "LatestVersion", "" ).getString();
latestTimeStamp = Long.parseLong( get( "VersionChecker", "LatestTimeStamp", "" ).getString() );
this.latestVersion = this.get( "VersionChecker", "LatestVersion", "" ).getString();
this.latestTimeStamp = Long.parseLong( this.get( "VersionChecker", "LatestTimeStamp", "" ).getString() );
}
catch (NumberFormatException err)
{
latestTimeStamp = 0;
this.latestTimeStamp = 0;
}
}
updatable = true;
this.updatable = true;
}
public boolean useAEVersion(MaterialType mt)
{
if ( isFeatureEnabled( AEFeature.WebsiteRecipes ) )
if ( this.isFeatureEnabled( AEFeature.WebsiteRecipes ) )
return true;
setCategoryComment(
this.setCategoryComment(
"OreCamouflage",
"AE2 Automatically uses alternative ores present in your instance of MC to blend better with its surroundings, if you prefer you can disable this selectively using these flags; Its important to note, that some if these items even if enabled may not be craftable in game because other items are overriding their recipes." );
Property p = get( "OreCamouflage", mt.name(), true );
Property p = this.get( "OreCamouflage", mt.name(), true );
p.comment = "OreDictionary Names: " + mt.getOreName();
return !p.getBoolean( true );
@@ -391,38 +391,38 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
@Override
public void updateSetting(IConfigManager manager, Enum setting, Enum newValue)
{
for (Enum e : settings.getSettings())
for (Enum e : this.settings.getSettings())
{
if ( e == setting )
{
String Category = "Client";
Property p = this.get( Category, e.name(), settings.getSetting( e ).name(), getListComment( newValue ) );
Property p = this.get( Category, e.name(), this.settings.getSetting( e ).name(), this.getListComment( newValue ) );
p.set( newValue.name() );
}
}
if ( updatable )
save();
if ( this.updatable )
this.save();
}
@Override
public void save()
{
if ( isFeatureEnabled( AEFeature.VersionChecker ) )
if ( this.isFeatureEnabled( AEFeature.VersionChecker ) )
{
get( "VersionChecker", "LatestVersion", latestVersion ).set( latestVersion );
get( "VersionChecker", "LatestTimeStamp", "" ).set( Long.toString( latestTimeStamp ) );
this.get( "VersionChecker", "LatestVersion", this.latestVersion ).set( this.latestVersion );
this.get( "VersionChecker", "LatestTimeStamp", "" ).set( Long.toString( this.latestTimeStamp ) );
}
if ( isFeatureEnabled( AEFeature.SpatialIO ) )
if ( this.isFeatureEnabled( AEFeature.SpatialIO ) )
{
get( "spatialio", "storageBiomeID", storageBiomeID ).set( storageBiomeID );
get( "spatialio", "storageProviderID", storageProviderID ).set( storageProviderID );
this.get( "spatialio", "storageBiomeID", this.storageBiomeID ).set( this.storageBiomeID );
this.get( "spatialio", "storageProviderID", this.storageProviderID ).set( this.storageProviderID );
}
get( "Client", "PowerUnit", selectedPowerUnit.name(), getListComment( selectedPowerUnit ) ).set( selectedPowerUnit.name() );
this.get( "Client", "PowerUnit", this.selectedPowerUnit.name(), this.getListComment( this.selectedPowerUnit ) ).set( this.selectedPowerUnit.name() );
if ( hasChanged() )
if ( this.hasChanged() )
super.save();
}
@@ -431,7 +431,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
boolean alreadyUsed = false;
int min = 0;
for (Property p : getCategory( Category ).getValues().values())
for (Property p : this.getCategory( Category ).getValues().values())
{
int thisInt = p.getInt();
@@ -454,49 +454,49 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
public int getFreeMaterial(int varID)
{
return getFreeIDSLot( varID, "materials" );
return this.getFreeIDSLot( varID, "materials" );
}
public int getFreePart(int varID)
{
return getFreeIDSLot( varID, "parts" );
return this.getFreeIDSLot( varID, "parts" );
}
@Override
public IConfigManager getConfigManager()
{
return settings;
return this.settings;
}
public boolean isFeatureEnabled(AEFeature f)
{
return featureFlags.contains( f );
return this.featureFlags.contains( f );
}
public boolean useTerminalUseLargeFont()
{
return useLargeFonts;
return this.useLargeFonts;
}
public int craftItemsByStackAmounts(int i)
{
return craftByStacks[i];
return this.craftByStacks[i];
}
public int priorityByStacksAmounts(int i)
{
return priorityByStacks[i];
return this.priorityByStacks[i];
}
public int levelByStackAmounts(int i)
{
return levelByStacks[i];
return this.levelByStacks[i];
}
public Enum getSetting(String Category, Class<? extends Enum> class1, Enum myDefault)
{
String name = class1.getSimpleName();
Property p = get( Category, name, myDefault.name() );
Property p = this.get( Category, name, myDefault.name() );
try
{
@@ -513,19 +513,19 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
public void setSetting(String Category, Enum s)
{
String name = s.getClass().getSimpleName();
get( Category, name, s.name() ).set( s.name() );
save();
this.get( Category, name, s.name() ).set( s.name() );
this.save();
}
public PowerUnits selectedPowerUnit()
{
return selectedPowerUnit;
return this.selectedPowerUnit;
}
public void nextPowerUnit(boolean backwards)
{
selectedPowerUnit = Platform.rotateEnum( selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues() );
save();
this.selectedPowerUnit = Platform.rotateEnum( this.selectedPowerUnit, backwards, Settings.POWER_UNITS.getPossibleValues() );
this.save();
}
}
+7 -7
View File
@@ -61,43 +61,43 @@ public class Api implements IAppEngApi
@Override
public IRegistryContainer registries()
{
return rc;
return this.rc;
}
@Override
public Items items()
{
return items;
return this.items;
}
@Override
public Materials materials()
{
return materials;
return this.materials;
}
@Override
public Blocks blocks()
{
return blocks;
return this.blocks;
}
@Override
public Parts parts()
{
return parts;
return this.parts;
}
@Override
public IStorageHelper storage()
{
return storageHelper;
return this.storageHelper;
}
@Override
public IPartHelper partHelper()
{
return partHelper;
return this.partHelper;
}
@Override
+2 -2
View File
@@ -37,13 +37,13 @@ public final class CreativeTab extends CreativeTabs
@Override
public Item getTabIconItem()
{
return getIconItemStack().getItem();
return this.getIconItemStack().getItem();
}
@Override
public ItemStack getIconItemStack()
{
return findFirst( AEApi.instance().blocks().blockController, AEApi.instance().blocks().blockChest, AEApi.instance().blocks().blockCellWorkbench, AEApi
return this.findFirst( AEApi.instance().blocks().blockController, AEApi.instance().blocks().blockChest, AEApi.instance().blocks().blockCellWorkbench, AEApi
.instance().blocks().blockFluix, AEApi.instance().items().itemCell1k, AEApi.instance().items().itemNetworkTool,
AEApi.instance().materials().materialFluixCrystal, AEApi.instance().materials().materialCertusQuartzCrystal );
}
@@ -36,7 +36,7 @@ public final class CreativeTabFacade extends CreativeTabs
@Override
public Item getTabIconItem()
{
return getIconItemStack().getItem();
return this.getIconItemStack().getItem();
}
@Override
+5 -5
View File
@@ -36,7 +36,7 @@ public class FacadeConfig extends Configuration
public FacadeConfig(String path) {
super( new File( path + "Facades.cfg" ) );
replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" );
this.replacementPattern = Pattern.compile( "[^a-zA-Z0-9]" );
}
public boolean checkEnabled(Block id, int metadata, boolean automatic)
@@ -52,7 +52,7 @@ public class FacadeConfig extends Configuration
try
{
if ( f.get( Block.class ) == id )
return get( "minecraft", f.getName() + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic );
return this.get( "minecraft", f.getName() + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic );
}
catch (Throwable e)
{
@@ -62,9 +62,9 @@ public class FacadeConfig extends Configuration
}
else
{
Matcher mod = replacementPattern.matcher( blk.modId );
Matcher name = replacementPattern.matcher( blk.name );
return get( mod.replaceAll( "" ), name.replaceAll( "" ) + (metadata == 0 ? "" : "." + metadata), automatic ).getBoolean( automatic );
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 false;
+100 -100
View File
@@ -219,13 +219,13 @@ public class Registration
private Registration()
{
recipeHandler = new RecipeHandler();
featuresToEntities = ArrayListMultimap.create();
this.recipeHandler = new RecipeHandler();
this.featuresToEntities = ArrayListMultimap.create();
}
public void PreInit( FMLPreInitializationEvent event )
{
registerSpatial( false );
this.registerSpatial( false );
IRecipeHandlerRegistry recipeRegistry = AEApi.instance().registries().recipes();
recipeRegistry.addNewSubItemResolver( new AEItemResolver() );
@@ -257,7 +257,7 @@ public class Registration
Parts parts = Api.instance.parts();
Blocks blocks = Api.instance.blocks();
AEItemDefinition materialItem = addFeature( ItemMultiMaterial.class );
AEItemDefinition materialItem = this.addFeature( ItemMultiMaterial.class );
Class<?> materialClass = materials.getClass();
for ( MaterialType mat : MaterialType.values() )
@@ -283,7 +283,7 @@ public class Registration
}
}
AEItemDefinition partItem = addFeature( ItemMultiPart.class );
AEItemDefinition partItem = this.addFeature( ItemMultiPart.class );
Class<?> partClass = parts.getClass();
for ( PartType type : PartType.values() )
@@ -330,111 +330,111 @@ public class Registration
}
// very important block!
blocks.blockMultiPart = addFeature( BlockCableBus.class );
blocks.blockMultiPart = this.addFeature( BlockCableBus.class );
blocks.blockCraftingUnit = addFeature( BlockCraftingUnit.class );
blocks.blockCraftingUnit = this.addFeature( BlockCraftingUnit.class );
blocks.blockCraftingAccelerator = new WrappedDamageItemDefinition( blocks.blockCraftingUnit, 1 );
blocks.blockCraftingMonitor = addFeature( BlockCraftingMonitor.class );
blocks.blockCraftingStorage1k = addFeature( BlockCraftingStorage.class );
blocks.blockCraftingMonitor = this.addFeature( BlockCraftingMonitor.class );
blocks.blockCraftingStorage1k = this.addFeature( BlockCraftingStorage.class );
blocks.blockCraftingStorage4k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 1 );
blocks.blockCraftingStorage16k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 2 );
blocks.blockCraftingStorage64k = new WrappedDamageItemDefinition( blocks.blockCraftingStorage1k, 3 );
blocks.blockMolecularAssembler = addFeature( BlockMolecularAssembler.class );
blocks.blockMolecularAssembler = this.addFeature( BlockMolecularAssembler.class );
blocks.blockQuartzOre = addFeature( OreQuartz.class );
blocks.blockQuartzOreCharged = addFeature( OreQuartzCharged.class );
blocks.blockMatrixFrame = addFeature( BlockMatrixFrame.class );
blocks.blockQuartz = addFeature( BlockQuartz.class );
blocks.blockFluix = addFeature( BlockFluix.class );
blocks.blockSkyStone = addFeature( BlockSkyStone.class );
blocks.blockSkyChest = addFeature( BlockSkyChest.class );
blocks.blockSkyCompass = addFeature( BlockSkyCompass.class );
blocks.blockQuartzOre = this.addFeature( OreQuartz.class );
blocks.blockQuartzOreCharged = this.addFeature( OreQuartzCharged.class );
blocks.blockMatrixFrame = this.addFeature( BlockMatrixFrame.class );
blocks.blockQuartz = this.addFeature( BlockQuartz.class );
blocks.blockFluix = this.addFeature( BlockFluix.class );
blocks.blockSkyStone = this.addFeature( BlockSkyStone.class );
blocks.blockSkyChest = this.addFeature( BlockSkyChest.class );
blocks.blockSkyCompass = this.addFeature( BlockSkyCompass.class );
blocks.blockQuartzGlass = addFeature( BlockQuartzGlass.class );
blocks.blockQuartzVibrantGlass = addFeature( BlockQuartzLamp.class );
blocks.blockQuartzPillar = addFeature( BlockQuartzPillar.class );
blocks.blockQuartzChiseled = addFeature( BlockQuartzChiseled.class );
blocks.blockQuartzTorch = addFeature( BlockQuartzTorch.class );
blocks.blockLightDetector = addFeature( BlockLightDetector.class );
blocks.blockCharger = addFeature( BlockCharger.class );
blocks.blockQuartzGrowthAccelerator = addFeature( BlockQuartzGrowthAccelerator.class );
blocks.blockQuartzGlass = this.addFeature( BlockQuartzGlass.class );
blocks.blockQuartzVibrantGlass = this.addFeature( BlockQuartzLamp.class );
blocks.blockQuartzPillar = this.addFeature( BlockQuartzPillar.class );
blocks.blockQuartzChiseled = this.addFeature( BlockQuartzChiseled.class );
blocks.blockQuartzTorch = this.addFeature( BlockQuartzTorch.class );
blocks.blockLightDetector = this.addFeature( BlockLightDetector.class );
blocks.blockCharger = this.addFeature( BlockCharger.class );
blocks.blockQuartzGrowthAccelerator = this.addFeature( BlockQuartzGrowthAccelerator.class );
blocks.blockGrindStone = addFeature( BlockGrinder.class );
blocks.blockCrankHandle = addFeature( BlockCrank.class );
blocks.blockInscriber = addFeature( BlockInscriber.class );
blocks.blockWireless = addFeature( BlockWireless.class );
blocks.blockTinyTNT = addFeature( BlockTinyTNT.class );
blocks.blockGrindStone = this.addFeature( BlockGrinder.class );
blocks.blockCrankHandle = this.addFeature( BlockCrank.class );
blocks.blockInscriber = this.addFeature( BlockInscriber.class );
blocks.blockWireless = this.addFeature( BlockWireless.class );
blocks.blockTinyTNT = this.addFeature( BlockTinyTNT.class );
blocks.blockQuantumRing = addFeature( BlockQuantumRing.class );
blocks.blockQuantumLink = addFeature( BlockQuantumLinkChamber.class );
blocks.blockQuantumRing = this.addFeature( BlockQuantumRing.class );
blocks.blockQuantumLink = this.addFeature( BlockQuantumLinkChamber.class );
blocks.blockSpatialPylon = addFeature( BlockSpatialPylon.class );
blocks.blockSpatialIOPort = addFeature( BlockSpatialIOPort.class );
blocks.blockSpatialPylon = this.addFeature( BlockSpatialPylon.class );
blocks.blockSpatialIOPort = this.addFeature( BlockSpatialIOPort.class );
blocks.blockController = addFeature( BlockController.class );
blocks.blockDrive = addFeature( BlockDrive.class );
blocks.blockChest = addFeature( BlockChest.class );
blocks.blockInterface = addFeature( BlockInterface.class );
blocks.blockCellWorkbench = addFeature( BlockCellWorkbench.class );
blocks.blockIOPort = addFeature( BlockIOPort.class );
blocks.blockCondenser = addFeature( BlockCondenser.class );
blocks.blockEnergyAcceptor = addFeature( BlockEnergyAcceptor.class );
blocks.blockVibrationChamber = addFeature( BlockVibrationChamber.class );
blocks.blockController = this.addFeature( BlockController.class );
blocks.blockDrive = this.addFeature( BlockDrive.class );
blocks.blockChest = this.addFeature( BlockChest.class );
blocks.blockInterface = this.addFeature( BlockInterface.class );
blocks.blockCellWorkbench = this.addFeature( BlockCellWorkbench.class );
blocks.blockIOPort = this.addFeature( BlockIOPort.class );
blocks.blockCondenser = this.addFeature( BlockCondenser.class );
blocks.blockEnergyAcceptor = this.addFeature( BlockEnergyAcceptor.class );
blocks.blockVibrationChamber = this.addFeature( BlockVibrationChamber.class );
blocks.blockEnergyCell = addFeature( BlockEnergyCell.class );
blocks.blockEnergyCellDense = addFeature( BlockDenseEnergyCell.class );
blocks.blockEnergyCellCreative = addFeature( BlockCreativeEnergyCell.class );
blocks.blockEnergyCell = this.addFeature( BlockEnergyCell.class );
blocks.blockEnergyCellDense = this.addFeature( BlockDenseEnergyCell.class );
blocks.blockEnergyCellCreative = this.addFeature( BlockCreativeEnergyCell.class );
blocks.blockSecurity = addFeature( BlockSecurity.class );
blocks.blockPaint = addFeature( BlockPaint.class );
blocks.blockSecurity = this.addFeature( BlockSecurity.class );
blocks.blockPaint = this.addFeature( BlockPaint.class );
items.itemCellCreative = addFeature( ItemCreativeStorageCell.class );
items.itemViewCell = addFeature( ItemViewCell.class );
items.itemEncodedPattern = addFeature( ItemEncodedPattern.class );
items.itemCellCreative = this.addFeature( ItemCreativeStorageCell.class );
items.itemViewCell = this.addFeature( ItemViewCell.class );
items.itemEncodedPattern = this.addFeature( ItemEncodedPattern.class );
items.itemCell1k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell1kPart, 1 );
items.itemCell4k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell4kPart, 4 );
items.itemCell16k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell16kPart, 16 );
items.itemCell64k = addFeature( ItemBasicStorageCell.class, MaterialType.Cell64kPart, 64 );
items.itemCell1k = this.addFeature( ItemBasicStorageCell.class, MaterialType.Cell1kPart, 1 );
items.itemCell4k = this.addFeature( ItemBasicStorageCell.class, MaterialType.Cell4kPart, 4 );
items.itemCell16k = this.addFeature( ItemBasicStorageCell.class, MaterialType.Cell16kPart, 16 );
items.itemCell64k = this.addFeature( ItemBasicStorageCell.class, MaterialType.Cell64kPart, 64 );
items.itemSpatialCell2 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell2SpatialPart, 2 );
items.itemSpatialCell16 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell16SpatialPart, 16 );
items.itemSpatialCell128 = addFeature( ItemSpatialStorageCell.class, MaterialType.Cell128SpatialPart, 128 );
items.itemSpatialCell2 = this.addFeature( ItemSpatialStorageCell.class, MaterialType.Cell2SpatialPart, 2 );
items.itemSpatialCell16 = this.addFeature( ItemSpatialStorageCell.class, MaterialType.Cell16SpatialPart, 16 );
items.itemSpatialCell128 = this.addFeature( ItemSpatialStorageCell.class, MaterialType.Cell128SpatialPart, 128 );
items.itemCertusQuartzKnife = addFeature( ToolQuartzCuttingKnife.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzWrench = addFeature( ToolQuartzWrench.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzAxe = addFeature( ToolQuartzAxe.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzHoe = addFeature( ToolQuartzHoe.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzPick = addFeature( ToolQuartzPickaxe.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzShovel = addFeature( ToolQuartzSpade.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzSword = addFeature( ToolQuartzSword.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzKnife = this.addFeature( ToolQuartzCuttingKnife.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzWrench = this.addFeature( ToolQuartzWrench.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzAxe = this.addFeature( ToolQuartzAxe.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzHoe = this.addFeature( ToolQuartzHoe.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzPick = this.addFeature( ToolQuartzPickaxe.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzShovel = this.addFeature( ToolQuartzSpade.class, AEFeature.CertusQuartzTools );
items.itemCertusQuartzSword = this.addFeature( ToolQuartzSword.class, AEFeature.CertusQuartzTools );
items.itemNetherQuartzKnife = addFeature( ToolQuartzCuttingKnife.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzWrench = addFeature( ToolQuartzWrench.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzAxe = addFeature( ToolQuartzAxe.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzHoe = addFeature( ToolQuartzHoe.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzPick = addFeature( ToolQuartzPickaxe.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzShovel = addFeature( ToolQuartzSpade.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzSword = addFeature( ToolQuartzSword.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzKnife = this.addFeature( ToolQuartzCuttingKnife.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzWrench = this.addFeature( ToolQuartzWrench.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzAxe = this.addFeature( ToolQuartzAxe.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzHoe = this.addFeature( ToolQuartzHoe.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzPick = this.addFeature( ToolQuartzPickaxe.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzShovel = this.addFeature( ToolQuartzSpade.class, AEFeature.NetherQuartzTools );
items.itemNetherQuartzSword = this.addFeature( ToolQuartzSword.class, AEFeature.NetherQuartzTools );
items.itemMassCannon = addFeature( ToolMassCannon.class );
items.itemMemoryCard = addFeature( ToolMemoryCard.class );
items.itemChargedStaff = addFeature( ToolChargedStaff.class );
items.itemEntropyManipulator = addFeature( ToolEntropyManipulator.class );
items.itemColorApplicator = addFeature( ToolColorApplicator.class );
items.itemMassCannon = this.addFeature( ToolMassCannon.class );
items.itemMemoryCard = this.addFeature( ToolMemoryCard.class );
items.itemChargedStaff = this.addFeature( ToolChargedStaff.class );
items.itemEntropyManipulator = this.addFeature( ToolEntropyManipulator.class );
items.itemColorApplicator = this.addFeature( ToolColorApplicator.class );
items.itemWirelessTerminal = addFeature( ToolWirelessTerminal.class );
items.itemNetworkTool = addFeature( ToolNetworkTool.class );
items.itemPortableCell = addFeature( ToolPortableCell.class );
items.itemBiometricCard = addFeature( ToolBiometricCard.class );
items.itemWirelessTerminal = this.addFeature( ToolWirelessTerminal.class );
items.itemNetworkTool = this.addFeature( ToolNetworkTool.class );
items.itemPortableCell = this.addFeature( ToolPortableCell.class );
items.itemBiometricCard = this.addFeature( ToolBiometricCard.class );
items.itemFacade = addFeature( ItemFacade.class );
items.itemCrystalSeed = addFeature( ItemCrystalSeed.class );
items.itemFacade = this.addFeature( ItemFacade.class );
items.itemCrystalSeed = this.addFeature( ItemCrystalSeed.class );
ColoredItemDefinition paintBall, lumenPaintBall;
items.itemPaintBall = paintBall = new ColoredItemDefinition();
items.itemLumenPaintBall = lumenPaintBall = new ColoredItemDefinition();
AEItemDefinition pb = addFeature( ItemPaintBall.class );
AEItemDefinition pb = this.addFeature( ItemPaintBall.class );
for ( AEColor c : AEColor.values() )
{
@@ -456,14 +456,14 @@ public class Registration
this.addFeature( QuartzPillarStairBlock.class, blocks.blockQuartzPillar.block() );
// unsupported developer tools
addFeature( ToolEraser.class );
addFeature( ToolMeteoritePlacer.class );
addFeature( ToolDebugCard.class );
addFeature( ToolReplicatorCard.class );
addFeature( BlockItemGen.class );
addFeature( BlockChunkloader.class );
addFeature( BlockPhantomNode.class );
addFeature( BlockCubeGenerator.class );
this.addFeature( ToolEraser.class );
this.addFeature( ToolMeteoritePlacer.class );
this.addFeature( ToolDebugCard.class );
this.addFeature( ToolReplicatorCard.class );
this.addFeature( BlockItemGen.class );
this.addFeature( BlockChunkloader.class );
this.addFeature( BlockPhantomNode.class );
this.addFeature( BlockCubeGenerator.class );
}
private void registerSpatial( boolean force )
@@ -473,7 +473,7 @@ public class Registration
AEConfig config = AEConfig.instance;
if ( storageBiome == null )
if ( this.storageBiome == null )
{
if ( force && config.storageBiomeID == -1 )
{
@@ -481,12 +481,12 @@ public class Registration
if ( config.storageBiomeID == -1 )
throw new RuntimeException( "Biome Array is full, please free up some Biome ID's or disable spatial." );
storageBiome = new BiomeGenStorage( config.storageBiomeID );
this.storageBiome = new BiomeGenStorage( config.storageBiomeID );
config.save();
}
if ( !force && config.storageBiomeID != -1 )
storageBiome = new BiomeGenStorage( config.storageBiomeID );
this.storageBiome = new BiomeGenStorage( config.storageBiomeID );
}
if ( config.storageProviderID != -1 )
@@ -543,9 +543,9 @@ public class Registration
ItemMultiMaterial.instance.makeUnique();
if ( AEConfig.instance.isFeatureEnabled( AEFeature.CustomRecipes ) )
recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigPath() ), "index.recipe" );
this.recipeHandler.parseRecipes( new ConfigLoader( AppEng.instance.getConfigPath() ), "index.recipe" );
else
recipeHandler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" );
this.recipeHandler.parseRecipes( new JarLoader( "/assets/appliedenergistics2/recipes/" ), "index.recipe" );
IPartHelper ph = AEApi.instance().partHelper();
ph.registerNewLayer( "appeng.parts.layers.LayerISidedInventory", "net.minecraft.inventory.ISidedInventory" );
@@ -594,7 +594,7 @@ public class Registration
AEApi.instance().registries().matterCannon().registerAmmo( AEApi.instance().materials().materialMatterBall.stack( 1 ), 32.0 );
recipeHandler.injectRecipes();
this.recipeHandler.injectRecipes();
final PlayerStatsRegistration registration = new PlayerStatsRegistration( FMLCommonHandler.instance().bus(), AEConfig.instance );
registration.registerAchievementHandlers();
@@ -609,7 +609,7 @@ public class Registration
public void PostInit( FMLPostInitializationEvent event )
{
registerSpatial( true );
this.registerSpatial( true );
// default settings..
( ( P2PTunnelRegistry ) AEApi.instance().registries().p2pTunnel() ).configure();
+20 -20
View File
@@ -69,7 +69,7 @@ public class ApiPart implements IPartHelper
public void initFMPSupport()
{
for (Class layerInterface : interfaces2Layer.keySet())
for (Class layerInterface : this.interfaces2Layer.keySet())
{
if ( AppEng.instance.isIntegrationEnabled( IntegrationType.FMP ) )
((IFMP) AppEng.instance.getIntegration( IntegrationType.FMP )).registerPassThrough( layerInterface );
@@ -82,7 +82,7 @@ public class ApiPart implements IPartHelper
Class clazz = null;
try
{
ClassLoader loader = getClass().getClassLoader();// ClassLoader.getSystemClassLoader();
ClassLoader loader = this.getClass().getClassLoader();// ClassLoader.getSystemClassLoader();
Class<ClassLoader> root = ClassLoader.class;
Class<? extends ClassLoader> cls = loader.getClass();
Method defineClassMethod = root.getDeclaredMethod( "defineClass", String.class, byte[].class, int.class, int.class );
@@ -118,7 +118,7 @@ public class ApiPart implements IPartHelper
{
ClassReader cr;
String path = '/' + name.replace( ".", "/" ) + ".class";
InputStream is = getClass().getResourceAsStream( path );
InputStream is = this.getClass().getResourceAsStream( path );
cr = new ClassReader( is );
ClassNode cn = new ClassNode();
cr.accept( cn, ClassReader.EXPAND_FRAMES );
@@ -132,7 +132,7 @@ public class ApiPart implements IPartHelper
public Class getCombinedInstance(String base)
{
if ( desc.size() == 0 )
if ( this.desc.size() == 0 )
{
try
{
@@ -144,13 +144,13 @@ public class ApiPart implements IPartHelper
}
}
String description = base + ':' + Joiner.on( ";" ).skipNulls().join( desc.iterator() );
String description = base + ':' + Joiner.on( ";" ).skipNulls().join( this.desc.iterator() );
if ( tileImplementations.get( description ) != null )
if ( this.tileImplementations.get( description ) != null )
{
try
{
return tileImplementations.get( description );
return this.tileImplementations.get( description );
}
catch (Throwable t)
{
@@ -181,12 +181,12 @@ public class ApiPart implements IPartHelper
String path = f;
for (String name : desc)
for (String name : this.desc)
{
try
{
String newPath = path + ';' + name;
myCLass = getClassByDesc( Addendum, newPath, f, interfaces2Layer.get( Class.forName( name ) ) );
myCLass = this.getClassByDesc( Addendum, newPath, f, this.interfaces2Layer.get( Class.forName( name ) ) );
path = newPath;
}
catch (Throwable t)
@@ -198,7 +198,7 @@ public class ApiPart implements IPartHelper
f = myCLass.getName();
}
tileImplementations.put( description, myCLass );
this.tileImplementations.put( description, myCLass );
try
{
@@ -218,7 +218,7 @@ public class ApiPart implements IPartHelper
@Override
public String map(String typeName)
{
String o = inputOutput.get( typeName );
String o = this.inputOutput.get( typeName );
if ( o == null )
return typeName;
return o;
@@ -228,11 +228,11 @@ public class ApiPart implements IPartHelper
public Class getClassByDesc(String Addendum, String fullPath, String root, String next)
{
if ( roots.get( fullPath ) != null )
return roots.get( fullPath );
if ( this.roots.get( fullPath ) != null )
return this.roots.get( fullPath );
ClassWriter cw = new ClassWriter( ClassWriter.COMPUTE_MAXS );
ClassNode n = getReader( next );
ClassNode n = this.getReader( next );
String originalName = n.name;
try
@@ -250,7 +250,7 @@ public class ApiPart implements IPartHelper
Iterator<AbstractInsnNode> i = mn.instructions.iterator();
while (i.hasNext())
{
processNode( i.next(), n.superName );
this.processNode( i.next(), n.superName );
}
}
@@ -263,7 +263,7 @@ public class ApiPart implements IPartHelper
// n.accept( new TraceClassVisitor( new PrintWriter( System.out ) ) );
byte[] byteArray = cw.toByteArray();
int size = byteArray.length;
Class clazz = loadClass( n.name.replace( "/", "." ), byteArray );
Class clazz = this.loadClass( n.name.replace( "/", "." ), byteArray );
try
{
@@ -311,7 +311,7 @@ public class ApiPart implements IPartHelper
AELog.error( t );
}
roots.put( fullPath, clazz );
this.roots.put( fullPath, clazz );
return clazz;
}
@@ -346,10 +346,10 @@ public class ApiPart implements IPartHelper
try
{
final Class<?> layerInterfaceClass = Class.forName( layerInterface );
if ( interfaces2Layer.get( layerInterfaceClass ) == null )
if ( this.interfaces2Layer.get( layerInterfaceClass ) == null )
{
interfaces2Layer.put( layerInterfaceClass, layer );
desc.add( layerInterface );
this.interfaces2Layer.put( layerInterfaceClass, layer );
this.desc.add( layerInterface );
return true;
}
else
@@ -42,31 +42,31 @@ public class CrashEnhancement implements ICrashCallable
if ( Output == CrashInfo.MOD_VERSION )
{
name = "AE2 Version";
value = ModVersion;
this.name = "AE2 Version";
this.value = this.ModVersion;
}
else if ( Output == CrashInfo.INTEGRATION )
{
name = "AE2 Integration";
value = IntegrationRegistry.INSTANCE.getStatus();
this.name = "AE2 Integration";
this.value = IntegrationRegistry.INSTANCE.getStatus();
}
else
{
name = "AE2_UNKNOWN";
value = "UNKNOWN_VALUE";
this.name = "AE2_UNKNOWN";
this.value = "UNKNOWN_VALUE";
}
}
@Override
public String call() throws Exception
{
return value;
return this.value;
}
@Override
public String getLabel()
{
return name;
return this.name;
}
}
@@ -62,19 +62,19 @@ public class AEFeatureHandler implements AEItemDefinition
public void register()
{
if ( isFeatureAvailable() )
if ( this.isFeatureAvailable() )
{
if ( feature instanceof Item )
if ( this.feature instanceof Item )
{
initItem( ( Item ) feature );
this.initItem( ( Item ) this.feature );
}
else if ( this.feature instanceof BlockStairs )
{
this.initStairBlock( ( BlockStairs ) this.feature );
}
else if ( feature instanceof Block )
else if ( this.feature instanceof Block )
{
initBlock( ( Block ) feature );
this.initBlock( ( Block ) this.feature );
}
}
}
@@ -83,7 +83,7 @@ public class AEFeatureHandler implements AEItemDefinition
{
boolean enabled = true;
for ( AEFeature f : features )
for ( AEFeature f : this.features )
enabled = enabled && AEConfig.instance.isFeatureEnabled( f );
return enabled;
@@ -91,9 +91,9 @@ public class AEFeatureHandler implements AEItemDefinition
private void initItem( Item i )
{
ItemData = i;
this.ItemData = i;
String name = getName( i.getClass(), subName );
String name = getName( i.getClass(), this.subName );
i.setTextureName( "appliedenergistics2:" + name );
i.setUnlocalizedName( /* "item." */"appliedenergistics2." + name );
@@ -114,7 +114,7 @@ public class AEFeatureHandler implements AEItemDefinition
{
this.stairData = stair;
String name = getName( stair.getClass(), subName );
String name = getName( stair.getClass(), this.subName );
stair.setCreativeTab( CreativeTab.instance );
stair.setBlockName( /* "tile." */"appliedenergistics2." + name );
stair.setBlockTextureName( "appliedenergistics2:" + name );
@@ -124,14 +124,14 @@ public class AEFeatureHandler implements AEItemDefinition
private void initBlock( Block b )
{
BlockData = b;
this.BlockData = b;
String name = getName( b.getClass(), subName );
String name = getName( b.getClass(), this.subName );
b.setCreativeTab( CreativeTab.instance );
b.setBlockName( /* "tile." */"appliedenergistics2." + name );
b.setBlockTextureName( "appliedenergistics2:" + name );
if ( Platform.isClient() && BlockData instanceof AEBaseBlock )
if ( Platform.isClient() && this.BlockData instanceof AEBaseBlock )
{
AEBaseBlock bb = ( AEBaseBlock ) b;
CommonHelper.proxy.bindTileEntitySpecialRenderer( bb.getTileEntityClass(), bb );
@@ -173,13 +173,13 @@ public class AEFeatureHandler implements AEItemDefinition
public EnumSet<AEFeature> getFeatures()
{
return features.clone();
return this.features.clone();
}
@Override
public Block block()
{
return BlockData;
return this.BlockData;
}
@Override
@@ -204,9 +204,9 @@ public class AEFeatureHandler implements AEItemDefinition
@Override
public Class<? extends TileEntity> entity()
{
if ( BlockData instanceof AEBaseBlock )
if ( this.BlockData instanceof AEBaseBlock )
{
AEBaseBlock bb = ( AEBaseBlock ) BlockData;
AEBaseBlock bb = ( AEBaseBlock ) this.BlockData;
return bb.getTileEntityClass();
}
@@ -216,14 +216,14 @@ public class AEFeatureHandler implements AEItemDefinition
@Override
public ItemStack stack( int stackSize )
{
if ( isFeatureAvailable() )
if ( this.isFeatureAvailable() )
{
ItemStack rv;
if ( ItemData != null )
rv = new ItemStack( ItemData );
if ( this.ItemData != null )
rv = new ItemStack( this.ItemData );
else
rv = new ItemStack( BlockData );
rv = new ItemStack( this.BlockData );
rv.stackSize = stackSize;
return rv;
@@ -235,7 +235,7 @@ public class AEFeatureHandler implements AEItemDefinition
@Override
public boolean sameAsStack( ItemStack is )
{
return isFeatureAvailable() && Platform.isSameItemType( is, stack( 1 ) );
return this.isFeatureAvailable() && Platform.isSameItemType( is, this.stack( 1 ) );
}
/**
@@ -255,7 +255,7 @@ public class AEFeatureHandler implements AEItemDefinition
@Override
public boolean sameAsBlock( IBlockAccess world, int x, int y, int z )
{
return isFeatureAvailable() && BlockData != null && world.getBlock( x, y, z ) == BlockData;
return this.isFeatureAvailable() && this.BlockData != null && world.getBlock( x, y, z ) == this.BlockData;
}
}
@@ -33,7 +33,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition
@Override
public Item item(AEColor color)
{
ItemStackSrc is = colors[color.ordinal()];
ItemStackSrc is = this.colors[color.ordinal()];
if ( is == null )
return null;
@@ -44,7 +44,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition
@Override
public ItemStack stack(AEColor color, int stackSize)
{
ItemStackSrc is = colors[color.ordinal()];
ItemStackSrc is = this.colors[color.ordinal()];
if ( is == null )
return null;
@@ -55,7 +55,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition
@Override
public boolean sameAs(AEColor color, ItemStack comparableItem)
{
ItemStackSrc is = colors[color.ordinal()];
ItemStackSrc is = this.colors[color.ordinal()];
if ( comparableItem == null || is == null )
return false;
@@ -65,7 +65,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition
public void add(AEColor v, ItemStackSrc is)
{
colors[v.ordinal()] = is;
this.colors[v.ordinal()] = is;
}
@Override
@@ -83,9 +83,9 @@ public class ColoredItemDefinition implements AEColoredItemDefinition
@Override
public ItemStack[] allStacks(int stackSize)
{
ItemStack is[] = new ItemStack[colors.length];
ItemStack is[] = new ItemStack[this.colors.length];
for (int x = 0; x < is.length; x++)
is[x] = colors[x].stack( 1 );
is[x] = this.colors[x].stack( 1 );
return is;
}
@@ -31,7 +31,7 @@ public class DamagedItemDefinition implements AEItemDefinition
final IStackSrc src;
public DamagedItemDefinition(IStackSrc is) {
src = is;
this.src = is;
}
@Override
@@ -43,7 +43,7 @@ public class DamagedItemDefinition implements AEItemDefinition
@Override
public Item item()
{
return src.getItem();
return this.src.getItem();
}
@Override
@@ -55,7 +55,7 @@ public class DamagedItemDefinition implements AEItemDefinition
@Override
public ItemStack stack(int stackSize)
{
return src.stack( stackSize );
return this.src.stack( stackSize );
}
@Override
@@ -64,7 +64,7 @@ public class DamagedItemDefinition implements AEItemDefinition
if ( comparableItem == null )
return false;
return comparableItem.getItem() == src.getItem() && comparableItem.getItemDamage() == src.getDamage();
return comparableItem.getItem() == this.src.getItem() && comparableItem.getItemDamage() == this.src.getDamage();
}
@Override
@@ -30,25 +30,25 @@ public class ItemStackSrc implements IStackSrc
public final int damage;
public ItemStackSrc(Item i, int dmg) {
block = null;
item = i;
damage = dmg;
this.block = null;
this.item = i;
this.damage = dmg;
}
public ItemStackSrc(Block b, int dmg) {
item = null;
block = b;
damage = dmg;
this.item = null;
this.block = b;
this.damage = dmg;
}
@Override
public ItemStack stack(int i)
{
if ( block != null )
return new ItemStack( block, i, damage );
if ( this.block != null )
return new ItemStack( this.block, i, this.damage );
if ( item != null )
return new ItemStack( item, i, damage );
if ( this.item != null )
return new ItemStack( this.item, i, this.damage );
return null;
}
@@ -56,12 +56,12 @@ public class ItemStackSrc implements IStackSrc
@Override
public Item getItem()
{
return item;
return this.item;
}
@Override
public int getDamage()
{
return damage;
return this.damage;
}
}
@@ -36,19 +36,19 @@ public class MaterialStackSrc implements IStackSrc
@Override
public ItemStack stack(int stackSize)
{
return src.stack( stackSize );
return this.src.stack( stackSize );
}
@Override
public Item getItem()
{
return src.itemInstance;
return this.src.itemInstance;
}
@Override
public int getDamage()
{
return src.damageValue;
return this.src.damageValue;
}
}
@@ -32,35 +32,35 @@ public class WrappedDamageItemDefinition implements AEItemDefinition
final int damage;
public WrappedDamageItemDefinition(AEItemDefinition def, int dmg) {
baseItem = def;
damage = dmg;
this.baseItem = def;
this.damage = dmg;
}
@Override
public Block block()
{
return baseItem.block();
return this.baseItem.block();
}
@Override
public Item item()
{
return baseItem.item();
return this.baseItem.item();
}
@Override
public Class<? extends TileEntity> entity()
{
return baseItem.entity();
return this.baseItem.entity();
}
@Override
public ItemStack stack(int stackSize)
{
if ( baseItem == null )
if ( this.baseItem == null )
return null;
return new ItemStack( baseItem.block(), stackSize, damage );
return new ItemStack( this.baseItem.block(), stackSize, this.damage );
}
@Override
@@ -69,14 +69,14 @@ public class WrappedDamageItemDefinition implements AEItemDefinition
if ( comparableItem == null )
return false;
return comparableItem.getItem() == baseItem.item() && comparableItem.getItemDamage() == damage;
return comparableItem.getItem() == this.baseItem.item() && comparableItem.getItemDamage() == this.damage;
}
@Override
public boolean sameAsBlock(IBlockAccess world, int x, int y, int z)
{
if ( block() != null )
return world.getBlock( x, y, z ) == block() && world.getBlockMetadata( x, y, z ) == damage;
if ( this.block() != null )
return world.getBlock( x, y, z ) == this.block() && world.getBlockMetadata( x, y, z ) == this.damage;
return false;
}
@@ -34,14 +34,14 @@ public class CellRegistry implements ICellRegistry
final List<ICellHandler> handlers;
public CellRegistry() {
handlers = new ArrayList<ICellHandler>();
this.handlers = new ArrayList<ICellHandler>();
}
@Override
public void addCellHandler(ICellHandler h)
{
if ( h != null )
handlers.add( h );
this.handlers.add( h );
}
@Override
@@ -49,7 +49,7 @@ public class CellRegistry implements ICellRegistry
{
if ( is == null )
return false;
for (ICellHandler ch : handlers)
for (ICellHandler ch : this.handlers)
if ( ch.isCell( is ) )
return true;
return false;
@@ -60,7 +60,7 @@ public class CellRegistry implements ICellRegistry
{
if ( is == null )
return null;
for (ICellHandler ch : handlers)
for (ICellHandler ch : this.handlers)
{
if ( ch.isCell( is ) )
{
@@ -75,7 +75,7 @@ public class CellRegistry implements ICellRegistry
{
if ( is == null )
return null;
for (ICellHandler ch : handlers)
for (ICellHandler ch : this.handlers)
{
if ( ch.isCell( is ) )
{
@@ -36,20 +36,20 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry
final ExternalIInv lastHandler = new ExternalIInv();
public ExternalStorageRegistry() {
Handlers = new ArrayList<IExternalStorageHandler>();
this.Handlers = new ArrayList<IExternalStorageHandler>();
}
@Override
public IExternalStorageHandler getHandler(TileEntity te, ForgeDirection d, StorageChannel chan, BaseActionSource mySrc)
{
for (IExternalStorageHandler x : Handlers)
for (IExternalStorageHandler x : this.Handlers)
{
if ( x.canHandle( te, d, chan, mySrc ) )
return x;
}
if ( lastHandler.canHandle( te, d, chan, mySrc ) )
return lastHandler;
if ( this.lastHandler.canHandle( te, d, chan, mySrc ) )
return this.lastHandler;
return null;
}
@@ -57,7 +57,7 @@ public class ExternalStorageRegistry implements IExternalStorageRegistry
@Override
public void addExternalStorageInterface(IExternalStorageHandler ei)
{
Handlers.add( ei );
this.Handlers.add( ei );
}
}
@@ -35,7 +35,7 @@ public class GridCacheRegistry implements IGridCacheRegistry
public void registerGridCache(Class<? extends IGridCache> iface, Class<? extends IGridCache> implementation)
{
if ( iface.isAssignableFrom( implementation ) )
caches.put( iface, implementation );
this.caches.put( iface, implementation );
else
throw new RuntimeException( "Invalid setup, grid cache must either be the same class, or an interface that the implementation implements" );
}
@@ -45,11 +45,11 @@ public class GridCacheRegistry implements IGridCacheRegistry
{
HashMap<Class<? extends IGridCache>, IGridCache> map = new HashMap<Class<? extends IGridCache>, IGridCache>();
for (Class<? extends IGridCache> iface : caches.keySet())
for (Class<? extends IGridCache> iface : this.caches.keySet())
{
try
{
Constructor<? extends IGridCache> c = caches.get( iface ).getConstructor( IGrid.class );
Constructor<? extends IGridCache> c = this.caches.get( iface ).getConstructor( IGrid.class );
map.put( iface, c.newInstance( g ) );
}
catch (Throwable e)
@@ -49,26 +49,26 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
}
public GrinderRecipeManager() {
RecipeList = new ArrayList<IGrinderEntry>();
this.RecipeList = new ArrayList<IGrinderEntry>();
addOre( "Coal", new ItemStack( Items.coal ) );
addOre( "Charcoal", new ItemStack( Items.coal, 1, 1 ) );
this.addOre( "Coal", new ItemStack( Items.coal ) );
this.addOre( "Charcoal", new ItemStack( Items.coal, 1, 1 ) );
addOre( "NetherQuartz", new ItemStack( Blocks.quartz_ore ) );
addIngot( "NetherQuartz", new ItemStack( Items.quartz ) );
this.addOre( "NetherQuartz", new ItemStack( Blocks.quartz_ore ) );
this.addIngot( "NetherQuartz", new ItemStack( Items.quartz ) );
addOre( "Gold", new ItemStack( Blocks.gold_ore ) );
addIngot( "Gold", new ItemStack( Items.gold_ingot ) );
this.addOre( "Gold", new ItemStack( Blocks.gold_ore ) );
this.addIngot( "Gold", new ItemStack( Items.gold_ingot ) );
addOre( "Iron", new ItemStack( Blocks.iron_ore ) );
addIngot( "Iron", new ItemStack( Items.iron_ingot ) );
this.addOre( "Iron", new ItemStack( Blocks.iron_ore ) );
this.addIngot( "Iron", new ItemStack( Items.iron_ingot ) );
addOre( "Obsidian", new ItemStack( Blocks.obsidian ) );
this.addOre( "Obsidian", new ItemStack( Blocks.obsidian ) );
addIngot( "Ender", new ItemStack( Items.ender_pearl ) );
addIngot( "EnderPearl", new ItemStack( Items.ender_pearl ) );
this.addIngot( "Ender", new ItemStack( Items.ender_pearl ) );
this.addIngot( "EnderPearl", new ItemStack( Items.ender_pearl ) );
addIngot( "Wheat", new ItemStack( Items.wheat ) );
this.addIngot( "Wheat", new ItemStack( Items.wheat ) );
OreDictionaryHandler.instance.observe( this );
}
@@ -76,17 +76,17 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
@Override
public List<IGrinderEntry> getRecipes()
{
log( "API - getRecipes" );
return RecipeList;
this.log( "API - getRecipes" );
return this.RecipeList;
}
private void injectRecipe(AppEngGrinderRecipe appEngGrinderRecipe)
{
for (IGrinderEntry gr : RecipeList)
for (IGrinderEntry gr : this.RecipeList)
if ( Platform.isSameItemPrecise( gr.getInput(), appEngGrinderRecipe.getInput() ) )
return;
RecipeList.add( appEngGrinderRecipe );
this.RecipeList.add( appEngGrinderRecipe );
}
@Override
@@ -94,12 +94,12 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
{
if ( in == null || out == null )
{
log( "Invalid Grinder Recipe Specified." );
this.log( "Invalid Grinder Recipe Specified." );
return;
}
log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " for " + cost );
injectRecipe( new AppEngGrinderRecipe( copy( in ), copy( out ), cost ) );
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " for " + cost );
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), cost ) );
}
@Override
@@ -107,13 +107,13 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
{
if ( in == null || (optional == null && out == null) )
{
log( "Invalid Grinder Recipe Specified." );
this.log( "Invalid Grinder Recipe Specified." );
return;
}
log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
+ Platform.getItemDisplayName( optional ) + " for " + cost );
injectRecipe( new AppEngGrinderRecipe( copy( in ), copy( out ), copy( optional ), chance, cost ) );
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
}
@Override
@@ -121,31 +121,31 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
{
if ( in == null || (optional == null && out == null && optional2 == null) )
{
log( "Invalid Grinder Recipe Specified." );
this.log( "Invalid Grinder Recipe Specified." );
return;
}
log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
this.log( "Allow Grinding of " + Platform.getItemDisplayName( in ) + " to " + Platform.getItemDisplayName( out ) + " with optional "
+ Platform.getItemDisplayName( optional ) + " for " + cost );
injectRecipe( new AppEngGrinderRecipe( copy( in ), copy( out ), copy( optional ), chance, cost ) );
this.injectRecipe( new AppEngGrinderRecipe( this.copy( in ), this.copy( out ), this.copy( optional ), chance, cost ) );
}
@Override
public IGrinderEntry getRecipeForInput(ItemStack input)
{
log( "Looking up recipe for " + Platform.getItemDisplayName( input ) );
this.log( "Looking up recipe for " + Platform.getItemDisplayName( input ) );
if ( input != null )
{
for (IGrinderEntry r : RecipeList)
for (IGrinderEntry r : this.RecipeList)
{
if ( Platform.isSameItem( input, r.getInput() ) )
{
log( "Recipe for " + input.getUnlocalizedName() + " found " + Platform.getItemDisplayName( r.getOutput() ) );
this.log( "Recipe for " + input.getUnlocalizedName() + " found " + Platform.getItemDisplayName( r.getOutput() ) );
return r;
}
}
log( "Could not find recipe for " + Platform.getItemDisplayName( input ) );
this.log( "Could not find recipe for " + Platform.getItemDisplayName( input ) );
}
return null;
@@ -175,22 +175,22 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
{
if ( item == null )
return;
log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) );
this.log( "Adding Ore - " + name + " : " + Platform.getItemDisplayName( item ) );
Ores.put( item, name );
this.Ores.put( item, name );
if ( Dusts.containsKey( name ) )
if ( this.Dusts.containsKey( name ) )
{
ItemStack is = Dusts.get( name ).copy();
int ratio = getDustToOreRatio( name );
ItemStack is = this.Dusts.get( name ).copy();
int ratio = this.getDustToOreRatio( name );
if ( ratio > 1 )
{
ItemStack extra = is.copy();
extra.stackSize = ratio - 1;
addRecipe( item, is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
this.addRecipe( item, is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
}
else
addRecipe( item, is, 8 );
this.addRecipe( item, is, 8 );
}
}
@@ -198,13 +198,13 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
{
if ( item == null )
return;
log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) );
this.log( "Adding Ingot - " + name + " : " + Platform.getItemDisplayName( item ) );
Ingots.put( item, name );
this.Ingots.put( item, name );
if ( Dusts.containsKey( name ) )
if ( this.Dusts.containsKey( name ) )
{
addRecipe( item, Dusts.get( name ), 4 );
this.addRecipe( item, this.Dusts.get( name ), 4 );
}
}
@@ -212,35 +212,35 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
{
if ( item == null )
return;
if ( Dusts.containsKey( name ) )
if ( this.Dusts.containsKey( name ) )
{
log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
this.log( "Rejecting Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
return;
}
log( "Adding Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
this.log( "Adding Dust - " + name + " : " + Platform.getItemDisplayName( item ) );
Dusts.put( name, item );
this.Dusts.put( name, item );
for (Entry<ItemStack, String> d : Ores.entrySet())
for (Entry<ItemStack, String> d : this.Ores.entrySet())
if ( name.equals( d.getValue() ) )
{
ItemStack is = item.copy();
is.stackSize = 1;
int ratio = getDustToOreRatio( name );
int ratio = this.getDustToOreRatio( name );
if ( ratio > 1 )
{
ItemStack extra = is.copy();
extra.stackSize = ratio - 1;
addRecipe( d.getKey(), is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
this.addRecipe( d.getKey(), is, extra, (float) (AEConfig.instance.oreDoublePercentage / 100.0), 8 );
}
else
addRecipe( d.getKey(), is, 8 );
this.addRecipe( d.getKey(), is, 8 );
}
for (Entry<ItemStack, String> d : Ingots.entrySet())
for (Entry<ItemStack, String> d : this.Ingots.entrySet())
if ( name.equals( d.getValue() ) )
addRecipe( d.getKey(), item, 4 );
this.addRecipe( d.getKey(), item, 4 );
}
@Override
@@ -252,15 +252,15 @@ public class GrinderRecipeManager implements IGrinderRegistry, IOreListener
{
if ( name.equals( "ore" + ore ) )
{
addOre( ore, item );
this.addOre( ore, item );
}
else if ( name.equals( "crystal" + ore ) || name.equals( "ingot" + ore ) || name.equals( "gem" + ore ) )
{
addIngot( ore, item );
this.addIngot( ore, item );
}
else if ( name.equals( "dust" + ore ) )
{
addDust( ore, item );
this.addDust( ore, item );
}
}
}
@@ -41,16 +41,16 @@ public class LocatableRegistry implements ILocatableRegistry
if ( e.change == LocatableEvent.Register )
{
set.put( e.target.getLocatableSerial(), e.target );
this.set.put( e.target.getLocatableSerial(), e.target );
}
else if ( e.change == LocatableEvent.Unregister )
{
set.remove( e.target.getLocatableSerial() );
this.set.remove( e.target.getLocatableSerial() );
}
}
public LocatableRegistry() {
set = new HashMap<Long, ILocatable>();
this.set = new HashMap<Long, ILocatable>();
MinecraftForge.EVENT_BUS.register( this );
}
@@ -60,7 +60,7 @@ public class LocatableRegistry implements ILocatableRegistry
@Override
public Object findLocatableBySerial(long ser)
{
return set.get( ser );
return this.set.get( ser );
}
}
@@ -35,14 +35,14 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
@Override
public void registerAmmo(ItemStack ammo, double weight)
{
DamageModifiers.put( ammo, weight );
this.DamageModifiers.put( ammo, weight );
}
private void considerItem(String ore, ItemStack item, String Name, double weight)
{
if ( ore.equals( "berry" + Name ) || ore.equals( "nugget" + Name ) )
{
registerAmmo( item, weight );
this.registerAmmo( item, weight );
}
}
@@ -53,90 +53,90 @@ public class MatterCannonAmmoRegistry implements IOreListener, IMatterCannonAmmo
return;
// addNugget( "Cobble", 18 ); // ?
considerItem( name, item, "MeatRaw", 32 );
considerItem( name, item, "MeatCooked", 32 );
considerItem( name, item, "Meat", 32 );
considerItem( name, item, "Chicken", 32 );
considerItem( name, item, "Beef", 32 );
considerItem( name, item, "Sheep", 32 );
considerItem( name, item, "Fish", 32 );
this.considerItem( name, item, "MeatRaw", 32 );
this.considerItem( name, item, "MeatCooked", 32 );
this.considerItem( name, item, "Meat", 32 );
this.considerItem( name, item, "Chicken", 32 );
this.considerItem( name, item, "Beef", 32 );
this.considerItem( name, item, "Sheep", 32 );
this.considerItem( name, item, "Fish", 32 );
// real world...
considerItem( name, item, "Lithium", 6.941 );
considerItem( name, item, "Beryllium", 9.0122 );
considerItem( name, item, "Boron", 10.811 );
considerItem( name, item, "Carbon", 12.0107 );
considerItem( name, item, "Coal", 12.0107 );
considerItem( name, item, "Charcoal", 12.0107 );
considerItem( name, item, "Sodium", 22.9897 );
considerItem( name, item, "Magnesium", 24.305 );
considerItem( name, item, "Aluminum", 26.9815 );
considerItem( name, item, "Silicon", 28.0855 );
considerItem( name, item, "Phosphorus", 30.9738 );
considerItem( name, item, "Sulfur", 32.065 );
considerItem( name, item, "Potassium", 39.0983 );
considerItem( name, item, "Calcium", 40.078 );
considerItem( name, item, "Scandium", 44.9559 );
considerItem( name, item, "Titanium", 47.867 );
considerItem( name, item, "Vanadium", 50.9415 );
considerItem( name, item, "Manganese", 54.938 );
considerItem( name, item, "Iron", 55.845 );
considerItem( name, item, "Nickel", 58.6934 );
considerItem( name, item, "Cobalt", 58.9332 );
considerItem( name, item, "Copper", 63.546 );
considerItem( name, item, "Zinc", 65.39 );
considerItem( name, item, "Gallium", 69.723 );
considerItem( name, item, "Germanium", 72.64 );
considerItem( name, item, "Bromine", 79.904 );
considerItem( name, item, "Krypton", 83.8 );
considerItem( name, item, "Rubidium", 85.4678 );
considerItem( name, item, "Strontium", 87.62 );
considerItem( name, item, "Yttrium", 88.9059 );
considerItem( name, item, "Zirconiumm", 91.224 );
considerItem( name, item, "Niobiumm", 92.9064 );
considerItem( name, item, "Technetium", 98 );
considerItem( name, item, "Ruthenium", 101.07 );
considerItem( name, item, "Rhodium", 102.9055 );
considerItem( name, item, "Palladium", 106.42 );
considerItem( name, item, "Silver", 107.8682 );
considerItem( name, item, "Cadmium", 112.411 );
considerItem( name, item, "Indium", 114.818 );
considerItem( name, item, "Tin", 118.71 );
considerItem( name, item, "Antimony", 121.76 );
considerItem( name, item, "Iodine", 126.9045 );
considerItem( name, item, "Tellurium", 127.6 );
considerItem( name, item, "Xenon", 131.293 );
considerItem( name, item, "Cesium", 132.9055 );
considerItem( name, item, "Barium", 137.327 );
considerItem( name, item, "Lanthanum", 138.9055 );
considerItem( name, item, "Cerium", 140.116 );
considerItem( name, item, "Tantalum", 180.9479 );
considerItem( name, item, "Tungsten", 183.84 );
considerItem( name, item, "Osmium", 190.23 );
considerItem( name, item, "Iridium", 192.217 );
considerItem( name, item, "Platinum", 195.078 );
considerItem( name, item, "Lead", 207.2 );
considerItem( name, item, "Bismuth", 208.9804 );
considerItem( name, item, "Uranium", 238.0289 );
considerItem( name, item, "Plutonium", 244 );
this.considerItem( name, item, "Lithium", 6.941 );
this.considerItem( name, item, "Beryllium", 9.0122 );
this.considerItem( name, item, "Boron", 10.811 );
this.considerItem( name, item, "Carbon", 12.0107 );
this.considerItem( name, item, "Coal", 12.0107 );
this.considerItem( name, item, "Charcoal", 12.0107 );
this.considerItem( name, item, "Sodium", 22.9897 );
this.considerItem( name, item, "Magnesium", 24.305 );
this.considerItem( name, item, "Aluminum", 26.9815 );
this.considerItem( name, item, "Silicon", 28.0855 );
this.considerItem( name, item, "Phosphorus", 30.9738 );
this.considerItem( name, item, "Sulfur", 32.065 );
this.considerItem( name, item, "Potassium", 39.0983 );
this.considerItem( name, item, "Calcium", 40.078 );
this.considerItem( name, item, "Scandium", 44.9559 );
this.considerItem( name, item, "Titanium", 47.867 );
this.considerItem( name, item, "Vanadium", 50.9415 );
this.considerItem( name, item, "Manganese", 54.938 );
this.considerItem( name, item, "Iron", 55.845 );
this.considerItem( name, item, "Nickel", 58.6934 );
this.considerItem( name, item, "Cobalt", 58.9332 );
this.considerItem( name, item, "Copper", 63.546 );
this.considerItem( name, item, "Zinc", 65.39 );
this.considerItem( name, item, "Gallium", 69.723 );
this.considerItem( name, item, "Germanium", 72.64 );
this.considerItem( name, item, "Bromine", 79.904 );
this.considerItem( name, item, "Krypton", 83.8 );
this.considerItem( name, item, "Rubidium", 85.4678 );
this.considerItem( name, item, "Strontium", 87.62 );
this.considerItem( name, item, "Yttrium", 88.9059 );
this.considerItem( name, item, "Zirconiumm", 91.224 );
this.considerItem( name, item, "Niobiumm", 92.9064 );
this.considerItem( name, item, "Technetium", 98 );
this.considerItem( name, item, "Ruthenium", 101.07 );
this.considerItem( name, item, "Rhodium", 102.9055 );
this.considerItem( name, item, "Palladium", 106.42 );
this.considerItem( name, item, "Silver", 107.8682 );
this.considerItem( name, item, "Cadmium", 112.411 );
this.considerItem( name, item, "Indium", 114.818 );
this.considerItem( name, item, "Tin", 118.71 );
this.considerItem( name, item, "Antimony", 121.76 );
this.considerItem( name, item, "Iodine", 126.9045 );
this.considerItem( name, item, "Tellurium", 127.6 );
this.considerItem( name, item, "Xenon", 131.293 );
this.considerItem( name, item, "Cesium", 132.9055 );
this.considerItem( name, item, "Barium", 137.327 );
this.considerItem( name, item, "Lanthanum", 138.9055 );
this.considerItem( name, item, "Cerium", 140.116 );
this.considerItem( name, item, "Tantalum", 180.9479 );
this.considerItem( name, item, "Tungsten", 183.84 );
this.considerItem( name, item, "Osmium", 190.23 );
this.considerItem( name, item, "Iridium", 192.217 );
this.considerItem( name, item, "Platinum", 195.078 );
this.considerItem( name, item, "Lead", 207.2 );
this.considerItem( name, item, "Bismuth", 208.9804 );
this.considerItem( name, item, "Uranium", 238.0289 );
this.considerItem( name, item, "Plutonium", 244 );
// TE stuff...
considerItem( name, item, "Invar", (58.6934 + 55.845 + 55.845) / 3.0 );
considerItem( name, item, "Electrum", (107.8682 + 196.96655) / 2.0 );
this.considerItem( name, item, "Invar", (58.6934 + 55.845 + 55.845) / 3.0 );
this.considerItem( name, item, "Electrum", (107.8682 + 196.96655) / 2.0 );
}
public MatterCannonAmmoRegistry() {
OreDictionaryHandler.instance.observe( this );
registerAmmo( new ItemStack( Items.gold_nugget ), 196.96655 );
this.registerAmmo( new ItemStack( Items.gold_nugget ), 196.96655 );
}
@Override
public float getPenetration(ItemStack is)
{
for (ItemStack o : DamageModifiers.keySet())
for (ItemStack o : this.DamageModifiers.keySet())
{
if ( Platform.isSameItem( o, is ) )
return DamageModifiers.get( o ).floatValue();
return this.DamageModifiers.get( o ).floatValue();
}
return 0;
}
@@ -47,7 +47,7 @@ public class MovableTileRegistry implements IMovableRegistry
IMovableHandler handler = null;
// ask handlers...
for (IMovableHandler han : handlers)
for (IMovableHandler han : this.handlers)
{
if ( han.canHandle( myClass, te ) )
{
@@ -59,7 +59,7 @@ public class MovableTileRegistry implements IMovableRegistry
// if you have a handler your opted in
if ( handler != null )
{
Valid.put( myClass, handler );
this.Valid.put( myClass, handler );
return handler;
}
@@ -67,34 +67,34 @@ public class MovableTileRegistry implements IMovableRegistry
// if your movable our opted in
if ( te instanceof IMovableTile )
{
Valid.put( myClass, dsh );
return dsh;
this.Valid.put( myClass, this.dsh );
return this.dsh;
}
// if you are on the white list your opted in.
for (Class<? extends TileEntity> testClass : test)
for (Class<? extends TileEntity> testClass : this.test)
{
if ( testClass.isAssignableFrom( myClass ) )
{
Valid.put( myClass, dsh );
return dsh;
this.Valid.put( myClass, this.dsh );
return this.dsh;
}
}
Valid.put( myClass, nullHandler );
return nullHandler;
this.Valid.put( myClass, this.nullHandler );
return this.nullHandler;
}
@Override
public boolean askToMove(TileEntity te)
{
Class myClass = te.getClass();
IMovableHandler canMove = Valid.get( myClass );
IMovableHandler canMove = this.Valid.get( myClass );
if ( canMove == null )
canMove = testClass( myClass, te );
canMove = this.testClass( myClass, te );
if ( canMove != nullHandler )
if ( canMove != this.nullHandler )
{
if ( te instanceof IMovableTile )
((IMovableTile) te).prepareToMove();
@@ -126,39 +126,39 @@ public class MovableTileRegistry implements IMovableRegistry
"Someone tried to make all tiles movable, this is a clear violation of the purpose of the white list." ) );
}
test.add( c );
this.test.add( c );
}
@Override
public void addHandler(IMovableHandler han)
{
handlers.add( han );
this.handlers.add( han );
}
@Override
public IMovableHandler getHandler(TileEntity te)
{
Class myClass = te.getClass();
IMovableHandler h = Valid.get( myClass );
return h == null ? dsh : h;
IMovableHandler h = this.Valid.get( myClass );
return h == null ? this.dsh : h;
}
@Override
public IMovableHandler getDefaultHandler()
{
return dsh;
return this.dsh;
}
@Override
public void blacklistBlock(Block blk)
{
blacklisted.add( blk );
this.blacklisted.add( blk );
}
@Override
public boolean isBlacklisted(Block blk)
{
return blacklisted.contains( blk );
return this.blacklisted.contains( blk );
}
}
@@ -54,24 +54,24 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
/**
* light!
*/
addNewAttunement( new ItemStack( Blocks.torch ), TunnelType.LIGHT );
addNewAttunement( new ItemStack( Blocks.glowstone ), TunnelType.LIGHT );
this.addNewAttunement( new ItemStack( Blocks.torch ), TunnelType.LIGHT );
this.addNewAttunement( new ItemStack( Blocks.glowstone ), TunnelType.LIGHT );
/**
* attune based on most redstone base items.
*/
addNewAttunement( new ItemStack( Items.redstone ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Items.repeater ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.redstone_lamp ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.unpowered_comparator ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.powered_comparator ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.powered_repeater ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.unpowered_repeater ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.daylight_detector ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.redstone_wire ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.redstone_block ), TunnelType.REDSTONE );
addNewAttunement( new ItemStack( Blocks.lever ), TunnelType.REDSTONE );
addNewAttunement( getModItem( "EnderIO", "itemRedstoneConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Items.redstone ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Items.repeater ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.redstone_lamp ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.unpowered_comparator ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.powered_comparator ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.powered_repeater ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.unpowered_repeater ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.daylight_detector ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.redstone_wire ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.redstone_block ), TunnelType.REDSTONE );
this.addNewAttunement( new ItemStack( Blocks.lever ), TunnelType.REDSTONE );
this.addNewAttunement( this.getModItem( "EnderIO", "itemRedstoneConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.REDSTONE );
/**
* attune based on lots of random item related stuff
@@ -79,37 +79,37 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
appeng.api.definitions.Blocks AEBlocks = AEApi.instance().blocks();
Parts Parts = AEApi.instance().parts();
addNewAttunement( AEBlocks.blockInterface.stack( 1 ), TunnelType.ITEM );
addNewAttunement( Parts.partInterface.stack( 1 ), TunnelType.ITEM );
addNewAttunement( Parts.partStorageBus.stack( 1 ), TunnelType.ITEM );
addNewAttunement( Parts.partImportBus.stack( 1 ), TunnelType.ITEM );
addNewAttunement( Parts.partExportBus.stack( 1 ), TunnelType.ITEM );
addNewAttunement( new ItemStack( Blocks.hopper ), TunnelType.ITEM );
addNewAttunement( new ItemStack( Blocks.chest ), TunnelType.ITEM );
addNewAttunement( new ItemStack( Blocks.trapped_chest ), TunnelType.ITEM );
addNewAttunement( getModItem( "ExtraUtilities", "extractor_base", 0 ), TunnelType.ITEM );
addNewAttunement( getModItem( "Mekanism", "PartTransmitter", 9 ), TunnelType.ITEM );
addNewAttunement( getModItem( "EnderIO", "itemItemConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.ITEM );
this.addNewAttunement( AEBlocks.blockInterface.stack( 1 ), TunnelType.ITEM );
this.addNewAttunement( Parts.partInterface.stack( 1 ), TunnelType.ITEM );
this.addNewAttunement( Parts.partStorageBus.stack( 1 ), TunnelType.ITEM );
this.addNewAttunement( Parts.partImportBus.stack( 1 ), TunnelType.ITEM );
this.addNewAttunement( Parts.partExportBus.stack( 1 ), TunnelType.ITEM );
this.addNewAttunement( new ItemStack( Blocks.hopper ), TunnelType.ITEM );
this.addNewAttunement( new ItemStack( Blocks.chest ), TunnelType.ITEM );
this.addNewAttunement( new ItemStack( Blocks.trapped_chest ), TunnelType.ITEM );
this.addNewAttunement( this.getModItem( "ExtraUtilities", "extractor_base", 0 ), TunnelType.ITEM );
this.addNewAttunement( this.getModItem( "Mekanism", "PartTransmitter", 9 ), TunnelType.ITEM );
this.addNewAttunement( this.getModItem( "EnderIO", "itemItemConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.ITEM );
/**
* attune based on lots of random item related stuff
*/
addNewAttunement( new ItemStack( Items.bucket ), TunnelType.FLUID );
addNewAttunement( new ItemStack( Items.lava_bucket ), TunnelType.FLUID );
addNewAttunement( new ItemStack( Items.milk_bucket ), TunnelType.FLUID );
addNewAttunement( new ItemStack( Items.water_bucket ), TunnelType.FLUID );
addNewAttunement( getModItem( "Mekanism", "MachineBlock2", 11 ), TunnelType.FLUID );
addNewAttunement( getModItem( "Mekanism", "PartTransmitter", 4 ), TunnelType.FLUID );
addNewAttunement( getModItem( "ExtraUtilities", "extractor_base", 6 ), TunnelType.FLUID );
addNewAttunement( getModItem( "ExtraUtilities", "drum", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID );
addNewAttunement( getModItem( "EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID );
this.addNewAttunement( new ItemStack( Items.bucket ), TunnelType.FLUID );
this.addNewAttunement( new ItemStack( Items.lava_bucket ), TunnelType.FLUID );
this.addNewAttunement( new ItemStack( Items.milk_bucket ), TunnelType.FLUID );
this.addNewAttunement( new ItemStack( Items.water_bucket ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "Mekanism", "MachineBlock2", 11 ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "Mekanism", "PartTransmitter", 4 ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "ExtraUtilities", "extractor_base", 6 ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "ExtraUtilities", "drum", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID );
this.addNewAttunement( this.getModItem( "EnderIO", "itemLiquidConduit", OreDictionary.WILDCARD_VALUE ), TunnelType.FLUID );
for (AEColor c : AEColor.values())
{
addNewAttunement( Parts.partCableGlass.stack( c, 1 ), TunnelType.ME );
addNewAttunement( Parts.partCableCovered.stack( c, 1 ), TunnelType.ME );
addNewAttunement( Parts.partCableSmart.stack( c, 1 ), TunnelType.ME );
addNewAttunement( Parts.partCableDense.stack( c, 1 ), TunnelType.ME );
this.addNewAttunement( Parts.partCableGlass.stack( c, 1 ), TunnelType.ME );
this.addNewAttunement( Parts.partCableCovered.stack( c, 1 ), TunnelType.ME );
this.addNewAttunement( Parts.partCableSmart.stack( c, 1 ), TunnelType.ME );
this.addNewAttunement( Parts.partCableDense.stack( c, 1 ), TunnelType.ME );
}
}
@@ -119,7 +119,7 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
if ( type == null || trigger == null )
return;
Tunnels.put( trigger, type );
this.Tunnels.put( trigger, type );
}
@Override
@@ -130,13 +130,13 @@ public class P2PTunnelRegistry implements IP2PTunnelRegistry
if ( FluidContainerRegistry.isContainer( trigger ) )
return TunnelType.FLUID;
for (ItemStack is : Tunnels.keySet())
for (ItemStack is : this.Tunnels.keySet())
{
if ( is.getItem() == trigger.getItem() && is.getItemDamage() == OreDictionary.WILDCARD_VALUE )
return Tunnels.get( is );
return this.Tunnels.get( is );
if ( Platform.isSameItem( is, trigger ) )
return Tunnels.get( is );
return this.Tunnels.get( is );
}
}
@@ -37,13 +37,13 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
@Override
public void addNewCraftHandler(String name, Class<? extends ICraftHandler> handler)
{
handlers.put( name.toLowerCase(), handler );
this.handlers.put( name.toLowerCase(), handler );
}
@Override
public ICraftHandler getCraftHandlerFor(String name)
{
Class<? extends ICraftHandler> clz = handlers.get( name );
Class<? extends ICraftHandler> clz = this.handlers.get( name );
if ( clz == null )
return null;
try
@@ -54,7 +54,7 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
{
AELog.severe( "Error Caused when trying to construct " + clz.getName() );
AELog.error( e );
handlers.put( name, null ); // clear it..
this.handlers.put( name, null ); // clear it..
return null;
}
}
@@ -68,13 +68,13 @@ public class RecipeHandlerRegistry implements IRecipeHandlerRegistry
@Override
public void addNewSubItemResolver(ISubItemResolver sir)
{
resolvers.add( sir );
this.resolvers.add( sir );
}
@Override
public Object resolveItem(String nameSpace, String itemName)
{
for (ISubItemResolver sir : resolvers)
for (ISubItemResolver sir : this.resolvers)
{
Object rr = null;
@@ -52,73 +52,73 @@ public class RegistryContainer implements IRegistryContainer
@Override
public IWirelessTermRegistry wireless()
{
return WirelessRegistry;
return this.WirelessRegistry;
}
@Override
public ICellRegistry cell()
{
return CellRegistry;
return this.CellRegistry;
}
@Override
public IGrinderRegistry grinder()
{
return GrinderRecipes;
return this.GrinderRecipes;
}
@Override
public ISpecialComparisonRegistry specialComparison()
{
return SpecialComparisonRegistry;
return this.SpecialComparisonRegistry;
}
@Override
public IExternalStorageRegistry externalStorage()
{
return ExternalStorageHandlers;
return this.ExternalStorageHandlers;
}
@Override
public ILocatableRegistry locatable()
{
return LocatableRegistry;
return this.LocatableRegistry;
}
@Override
public IGridCacheRegistry gridCache()
{
return GridCacheRegistry;
return this.GridCacheRegistry;
}
@Override
public IMovableRegistry movable()
{
return MovableReg;
return this.MovableReg;
}
@Override
public IP2PTunnelRegistry p2pTunnel()
{
return P2PRegistry;
return this.P2PRegistry;
}
@Override
public IMatterCannonAmmoRegistry matterCannon()
{
return matterCannonReg;
return this.matterCannonReg;
}
@Override
public IPlayerRegistry players()
{
return playerRegistry;
return this.playerRegistry;
}
@Override
public IRecipeHandlerRegistry recipes()
{
return recipeReg;
return this.recipeReg;
}
@Override
@@ -32,13 +32,13 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry
private final List<IItemComparisonProvider> CompRegistry;
public SpecialComparisonRegistry() {
CompRegistry = new ArrayList<IItemComparisonProvider>();
this.CompRegistry = new ArrayList<IItemComparisonProvider>();
}
@Override
public IItemComparison getSpecialComparison(ItemStack stack)
{
for (IItemComparisonProvider i : CompRegistry)
for (IItemComparisonProvider i : this.CompRegistry)
{
IItemComparison comp = i.getComparison( stack );
if ( comp != null )
@@ -53,7 +53,7 @@ public class SpecialComparisonRegistry implements ISpecialComparisonRegistry
@Override
public void addComparisonProvider(IItemComparisonProvider prov)
{
CompRegistry.add( prov );
this.CompRegistry.add( prov );
}
}
@@ -24,8 +24,8 @@ public class WirelessRangeResult
{
public WirelessRangeResult(TileEntity t, float d) {
dist = d;
te = t;
this.dist = d;
this.te = t;
}
final public float dist;
@@ -37,20 +37,20 @@ public class WirelessRegistry implements IWirelessTermRegistry
final List<IWirelessTermHandler> handlers;
public WirelessRegistry() {
handlers = new ArrayList<IWirelessTermHandler>();
this.handlers = new ArrayList<IWirelessTermHandler>();
}
@Override
public void registerWirelessHandler(IWirelessTermHandler handler)
{
if ( handler != null )
handlers.add( handler );
this.handlers.add( handler );
}
@Override
public boolean isWirelessTerminal(ItemStack is)
{
for (IWirelessTermHandler h : handlers)
for (IWirelessTermHandler h : this.handlers)
{
if ( h.canHandle( is ) )
return true;
@@ -61,7 +61,7 @@ public class WirelessRegistry implements IWirelessTermRegistry
@Override
public IWirelessTermHandler getWirelessTerminalHandler(ItemStack is)
{
for (IWirelessTermHandler h : handlers)
for (IWirelessTermHandler h : this.handlers)
{
if ( h.canHandle( is ) )
return h;
@@ -75,7 +75,7 @@ public class WirelessRegistry implements IWirelessTermRegistry
if ( Platform.isClient() )
return;
IWirelessTermHandler handler = getWirelessTerminalHandler( item );
IWirelessTermHandler handler = this.getWirelessTerminalHandler( item );
if ( handler == null )
{
player.addChatMessage( new ChatComponentText( "Item is not a wireless terminal." ) );
@@ -42,11 +42,11 @@ public class WorldGenRegistry implements IWorldGen
private WorldGenRegistry() {
types = new TypeSet[WorldGenType.values().length];
this.types = new TypeSet[WorldGenType.values().length];
for (WorldGenType type : WorldGenType.values())
{
types[type.ordinal()] = new TypeSet();
this.types[type.ordinal()] = new TypeSet();
}
}
@@ -60,9 +60,9 @@ public class WorldGenRegistry implements IWorldGen
if ( w == null )
throw new IllegalArgumentException( "Bad Provider Passed" );
boolean isBadProvider = types[type.ordinal()].badProviders.contains( w.provider.getClass() );
boolean isBadDimension = types[type.ordinal()].badDimensions.contains( w.provider.dimensionId );
boolean isGoodDimension = types[type.ordinal()].enabledDimensions.contains( w.provider.dimensionId );
boolean isBadProvider = this.types[type.ordinal()].badProviders.contains( w.provider.getClass() );
boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains( w.provider.dimensionId );
boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains( w.provider.dimensionId );
if ( isBadProvider || isBadDimension )
{
@@ -86,7 +86,7 @@ public class WorldGenRegistry implements IWorldGen
if ( provider == null )
throw new IllegalArgumentException( "Bad Provider Passed" );
types[type.ordinal()].badProviders.add( provider );
this.types[type.ordinal()].badProviders.add( provider );
}
@Override
@@ -97,7 +97,7 @@ public class WorldGenRegistry implements IWorldGen
throw new IllegalArgumentException( "Bad Type Passed" );
}
types[type.ordinal()].badDimensions.add( dimensionID );
this.types[type.ordinal()].badDimensions.add( dimensionID );
}
@Override
@@ -106,7 +106,7 @@ public class WorldGenRegistry implements IWorldGen
if ( type == null )
throw new IllegalArgumentException( "Bad Type Passed" );
types[type.ordinal()].enabledDimensions.add( dimensionID );
this.types[type.ordinal()].enabledDimensions.add( dimensionID );
}
}
@@ -36,106 +36,106 @@ public class AppEngGrinderRecipe implements IGrinderEntry
private int energy;
public AppEngGrinderRecipe(ItemStack a, ItemStack b, int cost) {
in = a;
out = b;
energy = cost;
this.in = a;
this.out = b;
this.energy = cost;
}
public AppEngGrinderRecipe(ItemStack a, ItemStack b, ItemStack c, float chance, int cost) {
in = a;
out = b;
this.in = a;
this.out = b;
optionalOutput = c;
optionalChance = chance;
this.optionalOutput = c;
this.optionalChance = chance;
energy = cost;
this.energy = cost;
}
public AppEngGrinderRecipe(ItemStack a, ItemStack b, ItemStack c, ItemStack d, float chance, float chance2, int cost) {
in = a;
out = b;
this.in = a;
this.out = b;
optionalOutput = c;
optionalChance = chance;
this.optionalOutput = c;
this.optionalChance = chance;
optionalOutput2 = d;
optionalChance2 = chance2;
this.optionalOutput2 = d;
this.optionalChance2 = chance2;
energy = cost;
this.energy = cost;
}
@Override
public ItemStack getInput()
{
return in;
return this.in;
}
@Override
public void setInput(ItemStack i)
{
in = i.copy();
this.in = i.copy();
}
@Override
public ItemStack getOutput()
{
return out;
return this.out;
}
@Override
public void setOutput(ItemStack o)
{
out = o.copy();
this.out = o.copy();
}
@Override
public int getEnergyCost()
{
return energy;
return this.energy;
}
@Override
public void setEnergyCost(int c)
{
energy = c;
this.energy = c;
}
@Override
public ItemStack getOptionalOutput()
{
return optionalOutput;
return this.optionalOutput;
}
@Override
public void setOptionalOutput(ItemStack output, float chance)
{
optionalOutput = output.copy();
optionalChance = chance;
this.optionalOutput = output.copy();
this.optionalChance = chance;
}
@Override
public float getOptionalChance()
{
return optionalChance;
return this.optionalChance;
}
@Override
public ItemStack getSecondOptionalOutput()
{
return optionalOutput2;
return this.optionalOutput2;
}
@Override
public void setSecondOptionalOutput(ItemStack output, float chance)
{
optionalChance2 = chance;
optionalOutput2 = output.copy();
this.optionalChance2 = chance;
this.optionalOutput2 = output.copy();
}
@Override
public float getSecondOptionalChance()
{
return optionalChance2;
return this.optionalChance2;
}
}
@@ -59,21 +59,21 @@ public enum ButtonToolTips
final String root;
ButtonToolTips() {
root = "gui.tooltips.appliedenergistics2";
this.root = "gui.tooltips.appliedenergistics2";
}
ButtonToolTips(String r) {
root = r;
this.root = r;
}
public String getUnlocalized()
{
return root + '.' + toString();
return this.root + '.' + this.toString();
}
public String getLocal()
{
return StatCollector.translateToLocal( getUnlocalized() );
return StatCollector.translateToLocal( this.getUnlocalized() );
}
}
@@ -73,21 +73,21 @@ public enum GuiText
final String root;
GuiText() {
root = "gui.appliedenergistics2";
this.root = "gui.appliedenergistics2";
}
GuiText(String r) {
root = r;
this.root = r;
}
public String getUnlocalized()
{
return root + '.' + toString();
return this.root + '.' + this.toString();
}
public String getLocal()
{
return StatCollector.translateToLocal( getUnlocalized() );
return StatCollector.translateToLocal( this.getUnlocalized() );
}
}
@@ -29,12 +29,12 @@ public enum PlayerMessages
String getName()
{
return "chat.appliedenergistics2." + toString();
return "chat.appliedenergistics2." + this.toString();
}
public IChatComponent get()
{
return new ChatComponentTranslation( getName() );
return new ChatComponentTranslation( this.getName() );
}
}
@@ -32,21 +32,21 @@ public enum WailaText
final String root;
WailaText() {
root = "waila.appliedenergistics2";
this.root = "waila.appliedenergistics2";
}
WailaText(String r) {
root = r;
this.root = r;
}
public String getUnlocalized()
{
return root + '.' + toString();
return this.root + '.' + this.toString();
}
public String getLocal()
{
return StatCollector.translateToLocal( getUnlocalized() );
return StatCollector.translateToLocal( this.getUnlocalized() );
}
}
@@ -60,8 +60,8 @@ public enum TickRates
config.addCustomCategoryComment(
"TickRates",
" Min / Max Tickrates for dynamic ticking, most of these components also use sleeping, to prevent constant ticking, adjust with care, non standard rates are not supported or tested." );
min = config.get( "TickRates", name() + ".min", min ).getInt( min );
max = config.get( "TickRates", name() + ".max", max ).getInt( max );
this.min = config.get( "TickRates", this.name() + ".min", this.min ).getInt( this.min );
this.max = config.get( "TickRates", this.name() + ".max", this.max ).getInt( this.max );
}
}
+5 -5
View File
@@ -38,13 +38,13 @@ public enum Stats
public StatBasic getStat()
{
if ( stat == null )
if ( this.stat == null )
{
stat = new StatBasic( "stat.ae2." + name(), new ChatComponentTranslation( "stat.ae2." + name() ) );
stat.registerStat();
this.stat = new StatBasic( "stat.ae2." + this.name(), new ChatComponentTranslation( "stat.ae2." + this.name() ) );
this.stat.registerStat();
}
return stat;
return this.stat;
}
private Stats() {
@@ -52,7 +52,7 @@ public enum Stats
public void addToPlayer(EntityPlayer player, int howMany)
{
player.addStat( getStat(), howMany );
player.addStat( this.getStat(), howMany );
}
}
@@ -41,29 +41,29 @@ public abstract class AppEngPacket
public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
{
throw new RuntimeException( "This packet ( " + getPacketID() + " does not implement a server side handler." );
throw new RuntimeException( "This packet ( " + this.getPacketID() + " does not implement a server side handler." );
}
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
{
throw new RuntimeException( "This packet ( " + getPacketID() + " does not implement a client side handler." );
throw new RuntimeException( "This packet ( " + this.getPacketID() + " does not implement a client side handler." );
}
protected void configureWrite(ByteBuf data)
{
data.capacity( data.readableBytes() );
p = data;
this.p = data;
}
public FMLProxyPacket getProxy()
{
if ( p.array().length > 2 * 1024 * 1024 ) // 2k walking room :)
throw new IllegalArgumentException( "Sorry AE2 made a " + p.array().length + " byte packet by accident!" );
if ( this.p.array().length > 2 * 1024 * 1024 ) // 2k walking room :)
throw new IllegalArgumentException( "Sorry AE2 made a " + this.p.array().length + " byte packet by accident!" );
FMLProxyPacket pp = new FMLProxyPacket( p, NetworkHandler.instance.getChannel() );
FMLProxyPacket pp = new FMLProxyPacket( this.p, NetworkHandler.instance.getChannel() );
if ( AEConfig.instance.isFeatureEnabled( AEFeature.PacketLogging ) )
AELog.info( getClass().getName() + " : " + pp.payload().readableBytes() );
AELog.info( this.getClass().getName() + " : " + pp.payload().readableBytes() );
return pp;
}
@@ -109,12 +109,12 @@ public class AppEngPacketHandlerBase
final public Constructor con;
private PacketTypes(Class c) {
pc = c;
this.pc = c;
Constructor x = null;
try
{
x = pc.getConstructor( ByteBuf.class );
x = this.pc.getConstructor( ByteBuf.class );
}
catch (NoSuchMethodException ignored)
{
@@ -123,16 +123,16 @@ public class AppEngPacketHandlerBase
{
}
con = x;
AppEngPacketHandlerBase.reverseLookup.put( pc, this );
this.con = x;
AppEngPacketHandlerBase.reverseLookup.put( this.pc, this );
if ( con == null )
if ( this.con == null )
throw new RuntimeException( "Invalid Packet Class, must be constructable on DataInputStream" );
}
public AppEngPacket parsePacket(ByteBuf in) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException
{
return (AppEngPacket) con.newInstance( in );
return (AppEngPacket) this.con.newInstance( in );
}
public static PacketTypes getPacket(int id)
+35 -35
View File
@@ -194,9 +194,9 @@ public enum GuiBridge implements IGuiHandler
private SecurityPermissions requiredPermission;
private GuiBridge() {
Tile = null;
Gui = null;
Container = null;
this.Tile = null;
this.Gui = null;
this.Container = null;
}
/**
@@ -207,52 +207,52 @@ public enum GuiBridge implements IGuiHandler
{
if ( Platform.isClient() )
{
String start = Container.getName();
String start = this.Container.getName();
String GuiClass = start.replaceFirst( "container.", "client.gui." ).replace( ".Container", ".Gui" );
if ( start.equals( GuiClass ) )
throw new RuntimeException( "Unable to find gui class" );
Gui = ReflectionHelper.getClass( this.getClass().getClassLoader(), GuiClass );
if ( Gui == null )
this.Gui = ReflectionHelper.getClass( this.getClass().getClassLoader(), GuiClass );
if ( this.Gui == null )
throw new RuntimeException( "Cannot Load class: " + GuiClass );
}
}
private GuiBridge(Class _Container, SecurityPermissions requiredPermission) {
this.requiredPermission = requiredPermission;
Container = _Container;
Tile = null;
getGui();
this.Container = _Container;
this.Tile = null;
this.getGui();
}
private GuiBridge(Class _Container, Class _Tile, GuiHostType type, SecurityPermissions requiredPermission) {
this.requiredPermission = requiredPermission;
Container = _Container;
this.Container = _Container;
this.type = type;
Tile = _Tile;
getGui();
this.Tile = _Tile;
this.getGui();
}
public boolean CorrectTileOrPart(Object tE)
{
if ( Tile == null )
if ( this.Tile == null )
throw new RuntimeException( "This Gui Cannot use the standard Handler." );
return Tile.isInstance( tE );
return this.Tile.isInstance( tE );
}
public Object ConstructContainer(InventoryPlayer inventory, ForgeDirection side, Object tE)
{
try
{
Constructor[] c = Container.getConstructors();
Constructor[] c = this.Container.getConstructors();
if ( c.length == 0 )
throw new AppEngException( "Invalid Gui Class" );
Constructor target = findConstructor( c, inventory, tE );
Constructor target = this.findConstructor( c, inventory, tE );
if ( target == null )
{
throw new RuntimeException( "Cannot find " + Container.getName() + "( " + typeName( inventory ) + ", " + typeName( tE ) + " )" );
throw new RuntimeException( "Cannot find " + this.Container.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" );
}
Object o = target.newInstance( inventory, tE );
@@ -291,15 +291,15 @@ public enum GuiBridge implements IGuiHandler
{
try
{
Constructor[] c = Gui.getConstructors();
Constructor[] c = this.Gui.getConstructors();
if ( c.length == 0 )
throw new AppEngException( "Invalid Gui Class" );
Constructor target = findConstructor( c, inventory, tE );
Constructor target = this.findConstructor( c, inventory, tE );
if ( target == null )
{
throw new RuntimeException( "Cannot find " + Container.getName() + "( " + typeName( inventory ) + ", " + typeName( tE ) + " )" );
throw new RuntimeException( "Cannot find " + this.Container.getName() + "( " + this.typeName( inventory ) + ", " + this.typeName( tE ) + " )" );
}
return target.newInstance( inventory, tE );
@@ -358,9 +358,9 @@ public enum GuiBridge implements IGuiHandler
if ( ID.type.isItem() && stem )
{
ItemStack it = player.inventory.getCurrentItem();
Object myItem = getGuiObject( it, player, w, x, y, z );
Object myItem = this.getGuiObject( it, player, w, x, y, z );
if ( myItem != null && ID.CorrectTileOrPart( myItem ) )
return updateGui( ID.ConstructContainer( player.inventory, side, myItem ), w, x, y, z, side, myItem );
return this.updateGui( ID.ConstructContainer( player.inventory, side, myItem ), w, x, y, z, side, myItem );
}
if ( ID.type.isTile() )
@@ -371,12 +371,12 @@ public enum GuiBridge implements IGuiHandler
((IPartHost) TE).getPart( side );
IPart part = ((IPartHost) TE).getPart( side );
if ( ID.CorrectTileOrPart( part ) )
return updateGui( ID.ConstructContainer( player.inventory, side, part ), w, x, y, z, side, part );
return this.updateGui( ID.ConstructContainer( player.inventory, side, part ), w, x, y, z, side, part );
}
else
{
if ( ID.CorrectTileOrPart( TE ) )
return updateGui( ID.ConstructContainer( player.inventory, side, TE ), w, x, y, z, side, TE );
return this.updateGui( ID.ConstructContainer( player.inventory, side, TE ), w, x, y, z, side, TE );
}
}
@@ -410,7 +410,7 @@ public enum GuiBridge implements IGuiHandler
if ( ID.type.isItem() && stem )
{
ItemStack it = player.inventory.getCurrentItem();
Object myItem = getGuiObject( it, player, w, x, y, z );
Object myItem = this.getGuiObject( it, player, w, x, y, z );
if ( ID.CorrectTileOrPart( myItem ) )
return ID.ConstructGui( player.inventory, side, myItem );
}
@@ -442,33 +442,33 @@ public enum GuiBridge implements IGuiHandler
if ( Platform.hasPermissions( te != null ? new DimensionalCoord( te ) : new DimensionalCoord( player.worldObj, x, y, z ), player ) )
{
if ( type.isItem() )
if ( this.type.isItem() )
{
ItemStack it = player.inventory.getCurrentItem();
if ( it != null && it.getItem() instanceof IGuiItem )
{
Object myItem = ((IGuiItem) it.getItem()).getGuiObject( it, w, x, y, z );
if ( CorrectTileOrPart( myItem ) )
if ( this.CorrectTileOrPart( myItem ) )
{
return true;
}
}
}
if ( type.isTile() )
if ( this.type.isTile() )
{
TileEntity TE = w.getTileEntity( x, y, z );
if ( TE instanceof IPartHost )
{
((IPartHost) TE).getPart( side );
IPart part = ((IPartHost) TE).getPart( side );
if ( CorrectTileOrPart( part ) )
return securityCheck( part, player );
if ( this.CorrectTileOrPart( part ) )
return this.securityCheck( part, player );
}
else
{
if ( CorrectTileOrPart( TE ) )
return securityCheck( TE, player );
if ( this.CorrectTileOrPart( TE ) )
return this.securityCheck( TE, player );
}
}
}
@@ -477,7 +477,7 @@ public enum GuiBridge implements IGuiHandler
private boolean securityCheck(Object te, EntityPlayer player)
{
if ( te instanceof IActionHost && requiredPermission != null )
if ( te instanceof IActionHost && this.requiredPermission != null )
{
boolean requirePower = false;
@@ -497,7 +497,7 @@ public enum GuiBridge implements IGuiHandler
}
ISecurityGrid sg = g.getCache( ISecurityGrid.class );
if ( sg.hasPermission( player, requiredPermission ) )
if ( sg.hasPermission( player, this.requiredPermission ) )
return true;
}
}
@@ -509,7 +509,7 @@ public enum GuiBridge implements IGuiHandler
public GuiHostType getType()
{
return type;
return this.type;
}
}
@@ -47,11 +47,11 @@ public class NetworkHandler
public NetworkHandler(String channelName) {
FMLCommonHandler.instance().bus().register( this );
ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( myChannelName = channelName );
ec.register( this );
this.ec = NetworkRegistry.INSTANCE.newEventDrivenChannel( this.myChannelName = channelName );
this.ec.register( this );
clientHandler = createClientSide();
serveHandler = createServerSide();
this.clientHandler = this.createClientSide();
this.serveHandler = this.createServerSide();
}
private IPacketHandler createServerSide()
@@ -95,45 +95,45 @@ public class NetworkHandler
public void serverPacket(ServerCustomPacketEvent ev)
{
NetHandlerPlayServer srv = (NetHandlerPlayServer) ev.packet.handler();
if ( serveHandler != null )
serveHandler.onPacketData( null, ev.packet, srv.playerEntity );
if ( this.serveHandler != null )
this.serveHandler.onPacketData( null, ev.packet, srv.playerEntity );
}
@SubscribeEvent
public void clientPacket(ClientCustomPacketEvent ev)
{
if ( clientHandler != null )
clientHandler.onPacketData( null, ev.packet, null );
if ( this.clientHandler != null )
this.clientHandler.onPacketData( null, ev.packet, null );
}
public String getChannel()
{
return myChannelName;
return this.myChannelName;
}
public void sendToAll(AppEngPacket message)
{
ec.sendToAll( message.getProxy() );
this.ec.sendToAll( message.getProxy() );
}
public void sendTo(AppEngPacket message, EntityPlayerMP player)
{
ec.sendTo( message.getProxy(), player );
this.ec.sendTo( message.getProxy(), player );
}
public void sendToAllAround(AppEngPacket message, NetworkRegistry.TargetPoint point)
{
ec.sendToAllAround( message.getProxy(), point );
this.ec.sendToAllAround( message.getProxy(), point );
}
public void sendToDimension(AppEngPacket message, int dimensionId)
{
ec.sendToDimension( message.getProxy(), dimensionId );
this.ec.sendToDimension( message.getProxy(), dimensionId );
}
public void sendToServer(AppEngPacket message)
{
ec.sendToServer( message.getProxy() );
this.ec.sendToServer( message.getProxy() );
}
}
@@ -42,11 +42,11 @@ public class PacketAssemblerAnimation extends AppEngPacket
// automatic.
public PacketAssemblerAnimation(ByteBuf stream) throws IOException {
x = stream.readInt();
y = stream.readInt();
z = stream.readInt();
rate = stream.readByte();
is = AEItemStack.loadItemStackFromPacket( stream );
this.x = stream.readInt();
this.y = stream.readInt();
this.z = stream.readInt();
this.rate = stream.readByte();
this.is = AEItemStack.loadItemStackFromPacket( stream );
}
@Override
@@ -57,7 +57,7 @@ public class PacketAssemblerAnimation extends AppEngPacket
double d1 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
double d2 = 0.5d;// + ((double) (Platform.getRandomFloat() - 0.5F) * 0.26D);
CommonHelper.proxy.spawnEffect( EffectType.Assembler, player.getEntityWorld(), x + d0, y + d1, z + d2, this );
CommonHelper.proxy.spawnEffect( EffectType.Assembler, player.getEntityWorld(), this.x + d0, this.y + d1, this.z + d2, this );
}
// api
@@ -65,7 +65,7 @@ public class PacketAssemblerAnimation extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( this.x = x );
data.writeInt( this.y = y );
data.writeInt( this.z = z );
@@ -73,6 +73,6 @@ public class PacketAssemblerAnimation extends AppEngPacket
is.writeToPacket( data );
this.is = is;
configureWrite( data );
this.configureWrite( data );
}
}
@@ -44,13 +44,13 @@ public class PacketClick extends AppEngPacket
// automatic.
public PacketClick(ByteBuf stream) {
x = stream.readInt();
y = stream.readInt();
z = stream.readInt();
side = stream.readInt();
hitX = stream.readFloat();
hitY = stream.readFloat();
hitZ = stream.readFloat();
this.x = stream.readInt();
this.y = stream.readInt();
this.z = stream.readInt();
this.side = stream.readInt();
this.hitX = stream.readFloat();
this.hitY = stream.readFloat();
this.hitZ = stream.readFloat();
}
@Override
@@ -60,7 +60,7 @@ public class PacketClick extends AppEngPacket
if ( is != null && is.getItem() instanceof ToolNetworkTool )
{
ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
tnt.serverSideToolLogic( is, player, player.worldObj, x, y, z, side, hitX, hitY, hitZ );
tnt.serverSideToolLogic( is, player, player.worldObj, this.x, this.y, this.z, this.side, this.hitX, this.hitY, this.hitZ );
}
else if ( is != null && AEApi.instance().items().itemMemoryCard.sameAsStack( is ) )
{
@@ -80,7 +80,7 @@ public class PacketClick extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( this.x = x );
data.writeInt( this.y = y );
data.writeInt( this.z = z );
@@ -89,6 +89,6 @@ public class PacketClick extends AppEngPacket
data.writeFloat( this.hitY = hitY );
data.writeFloat( this.hitZ = hitZ );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -40,22 +40,22 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
// automatic.
public PacketCompassRequest(ByteBuf stream) {
attunement = stream.readLong();
cx = stream.readInt();
cz = stream.readInt();
cdy = stream.readInt();
this.attunement = stream.readLong();
this.cx = stream.readInt();
this.cz = stream.readInt();
this.cdy = stream.readInt();
}
@Override
public void calculatedDirection(boolean hasResult, boolean spin, double radians, double dist)
{
NetworkHandler.instance.sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (EntityPlayerMP) talkBackTo );
NetworkHandler.instance.sendTo( new PacketCompassResponse( this, hasResult, spin, radians ), (EntityPlayerMP) this.talkBackTo );
}
@Override
public void serverPacketData(INetworkInfo manager, AppEngPacket packet, EntityPlayer player)
{
talkBackTo = player;
this.talkBackTo = player;
DimensionalCoord loc = new DimensionalCoord( player.worldObj, this.cx << 4, this.cdy << 5, this.cz << 4 );
WorldSettings.getInstance().getCompass().getCompassDirection( loc, 174, this );
@@ -66,13 +66,13 @@ public class PacketCompassRequest extends AppEngPacket implements ICompassCallba
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeLong( this.attunement = attunement );
data.writeInt( this.cx = cx );
data.writeInt( this.cz = cz );
data.writeInt( this.cdy = cdy );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -37,18 +37,18 @@ public class PacketCompassResponse extends AppEngPacket
// automatic.
public PacketCompassResponse(ByteBuf stream) {
attunement = stream.readLong();
cx = stream.readInt();
cz = stream.readInt();
cdy = stream.readInt();
this.attunement = stream.readLong();
this.cx = stream.readInt();
this.cz = stream.readInt();
this.cdy = stream.readInt();
cr = new CompassResult( stream.readBoolean(), stream.readBoolean(), stream.readDouble() );
this.cr = new CompassResult( stream.readBoolean(), stream.readBoolean(), stream.readDouble() );
}
@Override
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
{
CompassManager.instance.postResult( attunement, cx << 4, cdy << 5, cz << 4, cr );
CompassManager.instance.postResult( this.attunement, this.cx << 4, this.cdy << 5, this.cz << 4, this.cr );
}
// api
@@ -56,7 +56,7 @@ public class PacketCompassResponse extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeLong( this.attunement = req.attunement );
data.writeInt( this.cx = req.cx );
data.writeInt( this.cz = req.cz );
@@ -66,7 +66,7 @@ public class PacketCompassResponse extends AppEngPacket
data.writeBoolean( spin );
data.writeDouble( radians );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -56,8 +56,8 @@ public class PacketCompressedNBT extends AppEngPacket
// automatic.
public PacketCompressedNBT(final ByteBuf stream) throws IOException {
data = null;
compressFrame = null;
this.data = null;
this.compressFrame = null;
GZIPInputStream gzReader = new GZIPInputStream( new InputStream() {
@@ -73,7 +73,7 @@ public class PacketCompressedNBT extends AppEngPacket
} );
DataInputStream inStream = new DataInputStream( gzReader );
in = CompressedStreamTools.read( inStream );
this.in = CompressedStreamTools.read( inStream );
inStream.close();
}
@@ -84,32 +84,32 @@ public class PacketCompressedNBT extends AppEngPacket
GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if ( gs instanceof GuiInterfaceTerminal )
((GuiInterfaceTerminal) gs).postUpdate( in );
((GuiInterfaceTerminal) gs).postUpdate( this.in );
}
// api
public PacketCompressedNBT(NBTTagCompound din) throws IOException {
data = Unpooled.buffer( 2048 );
data.writeInt( getPacketID() );
this.data = Unpooled.buffer( 2048 );
this.data.writeInt( this.getPacketID() );
in = din;
this.in = din;
compressFrame = new GZIPOutputStream( new OutputStream() {
this.compressFrame = new GZIPOutputStream( new OutputStream() {
@Override
public void write(int value) throws IOException
{
data.writeByte( value );
PacketCompressedNBT.this.data.writeByte( value );
}
} );
CompressedStreamTools.write( din, new DataOutputStream( compressFrame ) );
compressFrame.close();
CompressedStreamTools.write( din, new DataOutputStream( this.compressFrame ) );
this.compressFrame.close();
configureWrite( data );
this.configureWrite( this.data );
}
}
@@ -39,8 +39,8 @@ public class PacketConfigButton extends AppEngPacket
// automatic.
public PacketConfigButton(ByteBuf stream) {
option = Settings.values()[stream.readInt()];
rotationDirection = stream.readBoolean();
this.option = Settings.values()[stream.readInt()];
this.rotationDirection = stream.readBoolean();
}
@Override
@@ -51,8 +51,8 @@ public class PacketConfigButton extends AppEngPacket
if ( baseContainer.getTarget() instanceof IConfigurableObject )
{
IConfigManager cm = ((IConfigurableObject) baseContainer.getTarget()).getConfigManager();
Enum newState = Platform.rotateEnum( cm.getSetting( option ), rotationDirection, option.getPossibleValues() );
cm.putSetting( option, newState );
Enum newState = Platform.rotateEnum( cm.getSetting( this.option ), this.rotationDirection, this.option.getPossibleValues() );
cm.putSetting( this.option, newState );
}
}
@@ -63,10 +63,10 @@ public class PacketConfigButton extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( option.ordinal() );
data.writeBoolean( rotationDirection );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -49,8 +49,8 @@ public class PacketCraftRequest extends AppEngPacket
// automatic.
public PacketCraftRequest(ByteBuf stream)
{
heldShift = stream.readBoolean();
amount = stream.readLong();
this.heldShift = stream.readBoolean();
this.amount = stream.readLong();
}
@Override
@@ -73,7 +73,7 @@ public class PacketCraftRequest extends AppEngPacket
Future<ICraftingJob> futureJob = null;
cca.whatToMake.setStackSize( amount );
cca.whatToMake.setStackSize( this.amount );
try
{
@@ -89,7 +89,7 @@ public class PacketCraftRequest extends AppEngPacket
if ( player.openContainer instanceof ContainerCraftConfirm )
{
ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer;
ccc.autoStart = heldShift;
ccc.autoStart = this.heldShift;
ccc.job = futureJob;
cca.detectAndSendChanges();
}
@@ -113,11 +113,11 @@ public class PacketCraftRequest extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeBoolean( shift );
data.writeLong( amount );
data.writeLong( this.amount );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -48,14 +48,14 @@ public class PacketInventoryAction extends AppEngPacket
// automatic.
public PacketInventoryAction(ByteBuf stream) throws IOException {
action = InventoryAction.values()[stream.readInt()];
slot = stream.readInt();
id = stream.readLong();
this.action = InventoryAction.values()[stream.readInt()];
this.slot = stream.readInt();
this.id = stream.readLong();
boolean hasItem = stream.readBoolean();
if ( hasItem )
slotItem = AEItemStack.loadItemStackFromPacket( stream );
this.slotItem = AEItemStack.loadItemStackFromPacket( stream );
else
slotItem = null;
this.slotItem = null;
}
@Override
@@ -65,7 +65,7 @@ public class PacketInventoryAction extends AppEngPacket
if ( sender.openContainer instanceof AEBaseContainer )
{
AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
if ( action == InventoryAction.AUTO_CRAFT )
if ( this.action == InventoryAction.AUTO_CRAFT )
{
ContainerOpenContext context = baseContainer.openContext;
if ( context != null )
@@ -89,7 +89,7 @@ public class PacketInventoryAction extends AppEngPacket
}
else
{
baseContainer.doAction( sender, action, slot, id );
baseContainer.doAction( sender, this.action, this.slot, this.id );
}
}
}
@@ -97,12 +97,12 @@ public class PacketInventoryAction extends AppEngPacket
@Override
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
{
if ( action == InventoryAction.UPDATE_HAND )
if ( this.action == InventoryAction.UPDATE_HAND )
{
if ( slotItem == null )
if ( this.slotItem == null )
ClientHelper.proxy.getPlayers().get( 0 ).inventory.setItemStack( null );
else
ClientHelper.proxy.getPlayers().get( 0 ).inventory.setItemStack( slotItem.getItemStack() );
ClientHelper.proxy.getPlayers().get( 0 ).inventory.setItemStack( this.slotItem.getItemStack() );
}
}
@@ -119,10 +119,10 @@ public class PacketInventoryAction extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( action.ordinal() );
data.writeInt( slot );
data.writeLong( id );
data.writeLong( this.id );
if ( slotItem == null )
data.writeBoolean( false );
@@ -132,7 +132,7 @@ public class PacketInventoryAction extends AppEngPacket
slotItem.writeToPacket( data );
}
configureWrite( data );
this.configureWrite( data );
}
// api
@@ -145,12 +145,12 @@ public class PacketInventoryAction extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( action.ordinal() );
data.writeInt( slot );
data.writeLong( id );
data.writeBoolean( false );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -41,9 +41,9 @@ public class PacketLightning extends AppEngPacket
// automatic.
public PacketLightning(ByteBuf stream) {
x = stream.readFloat();
y = stream.readFloat();
z = stream.readFloat();
this.x = stream.readFloat();
this.y = stream.readFloat();
this.z = stream.readFloat();
}
@Override
@@ -54,7 +54,7 @@ public class PacketLightning extends AppEngPacket
{
if ( Platform.isClient() && AEConfig.instance.enableEffects )
{
LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), x, y, z, 0.0f, 0.0f, 0.0f );
LightningFX fx = new LightningFX( ClientHelper.proxy.getWorld(), this.x, this.y, this.z, 0.0f, 0.0f, 0.0f );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
}
@@ -72,12 +72,12 @@ public class PacketLightning extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeFloat( (float) x );
data.writeFloat( (float) y );
data.writeFloat( (float) z );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -63,10 +63,10 @@ public class PacketMEInventoryUpdate extends AppEngPacket
// automatic.
public PacketMEInventoryUpdate(final ByteBuf stream) throws IOException {
data = null;
compressFrame = null;
list = new LinkedList<IAEItemStack>();
ref = stream.readByte();
this.data = null;
this.compressFrame = null;
this.list = new LinkedList<IAEItemStack>();
this.ref = stream.readByte();
// int originalBytes = stream.readableBytes();
@@ -97,9 +97,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket
// AELog.info( "Receiver: " + originalBytes + " -> " + uncompressedBytes );
while (uncompressed.readableBytes() > 0)
list.add( AEItemStack.loadItemStackFromPacket( uncompressed ) );
this.list.add( AEItemStack.loadItemStackFromPacket( uncompressed ) );
empty = list.isEmpty();
this.empty = this.list.isEmpty();
}
@Override
@@ -109,16 +109,16 @@ public class PacketMEInventoryUpdate extends AppEngPacket
GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if ( gs instanceof GuiCraftConfirm )
((GuiCraftConfirm) gs).postUpdate( list, ref );
((GuiCraftConfirm) gs).postUpdate( this.list, this.ref );
if ( gs instanceof GuiCraftingCPU )
((GuiCraftingCPU) gs).postUpdate( list, ref );
((GuiCraftingCPU) gs).postUpdate( this.list, this.ref );
if ( gs instanceof GuiMEMonitorable )
((GuiMEMonitorable) gs).postUpdate( list );
((GuiMEMonitorable) gs).postUpdate( this.list );
if ( gs instanceof GuiNetworkStatus )
((GuiNetworkStatus) gs).postUpdate( list );
((GuiNetworkStatus) gs).postUpdate( this.list );
}
@@ -127,9 +127,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket
{
try
{
compressFrame.close();
this.compressFrame.close();
configureWrite( data );
this.configureWrite( this.data );
return super.getProxy();
}
catch (IOException e)
@@ -147,21 +147,21 @@ public class PacketMEInventoryUpdate extends AppEngPacket
// api
public PacketMEInventoryUpdate(byte ref) throws IOException {
data = Unpooled.buffer( 2048 );
data.writeInt( getPacketID() );
data.writeByte( this.ref = ref );
this.data = Unpooled.buffer( 2048 );
this.data.writeInt( this.getPacketID() );
this.data.writeByte( this.ref = ref );
compressFrame = new GZIPOutputStream( new OutputStream() {
this.compressFrame = new GZIPOutputStream( new OutputStream() {
@Override
public void write(int value) throws IOException
{
data.writeByte( value );
PacketMEInventoryUpdate.this.data.writeByte( value );
}
} );
list = null;
this.list = null;
}
public void appendItem(IAEItemStack is) throws IOException, BufferOverflowException
@@ -169,25 +169,25 @@ public class PacketMEInventoryUpdate extends AppEngPacket
ByteBuf tmp = Unpooled.buffer( 2048 );
is.writeToPacket( tmp );
compressFrame.flush();
if ( writtenBytes + tmp.readableBytes() > 2 * 1024 * 1024 ) // 2mb!
this.compressFrame.flush();
if ( this.writtenBytes + tmp.readableBytes() > 2 * 1024 * 1024 ) // 2mb!
throw new BufferOverflowException();
else
{
writtenBytes += tmp.readableBytes();
compressFrame.write( tmp.array(), 0, tmp.readableBytes() );
empty = false;
this.writtenBytes += tmp.readableBytes();
this.compressFrame.write( tmp.array(), 0, tmp.readableBytes() );
this.empty = false;
}
}
public int getLength()
{
return data.readableBytes();
return this.data.readableBytes();
}
public boolean isEmpty()
{
return empty;
return this.empty;
}
}
@@ -46,13 +46,13 @@ public class PacketMatterCannon extends AppEngPacket
// automatic.
public PacketMatterCannon(ByteBuf stream)
{
x = stream.readFloat();
y = stream.readFloat();
z = stream.readFloat();
dx = stream.readFloat();
dy = stream.readFloat();
dz = stream.readFloat();
len = stream.readByte();
this.x = stream.readFloat();
this.y = stream.readFloat();
this.z = stream.readFloat();
this.dx = stream.readFloat();
this.dy = stream.readFloat();
this.dz = stream.readFloat();
this.len = stream.readByte();
}
@Override
@@ -63,9 +63,9 @@ public class PacketMatterCannon extends AppEngPacket
{
World world = FMLClientHandler.instance().getClient().theWorld;
for (int a = 1; a < len; a++)
for (int a = 1; a < this.len; a++)
{
MatterCannonFX fx = new MatterCannonFX( world, x + dx * a, y + dy * a, z + dz * a, Items.diamond );
MatterCannonFX fx = new MatterCannonFX( world, this.x + this.dx * a, this.y + this.dy * a, this.z + this.dz * a, Items.diamond );
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
@@ -91,7 +91,7 @@ public class PacketMatterCannon extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeFloat( (float) x );
data.writeFloat( (float) y );
data.writeFloat( (float) z );
@@ -100,7 +100,7 @@ public class PacketMatterCannon extends AppEngPacket
data.writeFloat( (float) this.dz );
data.writeByte( len );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -47,9 +47,9 @@ public class PacketMockExplosion extends AppEngPacket
// automatic.
public PacketMockExplosion(ByteBuf stream)
{
x = stream.readDouble();
y = stream.readDouble();
z = stream.readDouble();
this.x = stream.readDouble();
this.y = stream.readDouble();
this.z = stream.readDouble();
}
// api
@@ -61,12 +61,12 @@ public class PacketMockExplosion extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeDouble( x );
data.writeDouble( y );
data.writeDouble( z );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -54,9 +54,9 @@ public class PacketMultiPart extends AppEngPacket
{
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -68,16 +68,16 @@ public class PacketNEIRecipe extends AppEngPacket
NBTTagCompound comp = CompressedStreamTools.readCompressed( bytes );
if ( comp != null )
{
recipe = new ItemStack[9][];
for (int x = 0; x < recipe.length; x++)
this.recipe = new ItemStack[9][];
for (int x = 0; x < this.recipe.length; x++)
{
NBTTagList list = comp.getTagList( "#" + x, 10 );
if ( list.tagCount() > 0 )
{
recipe[x] = new ItemStack[list.tagCount()];
this.recipe[x] = new ItemStack[list.tagCount()];
for (int y = 0; y < list.tagCount(); y++)
{
recipe[x][y] = ItemStack.loadItemStackFromNBT( list.getCompoundTagAt( y ) );
this.recipe[x][y] = ItemStack.loadItemStackFromNBT( list.getCompoundTagAt( y ) );
}
}
}
@@ -108,14 +108,14 @@ public class PacketNEIRecipe extends AppEngPacket
Actionable realForFake = cct.useRealItems() ? Actionable.MODULATE : Actionable.SIMULATE;
if ( inv != null && recipe != null && security != null )
if ( inv != null && this.recipe != null && security != null )
{
InventoryCrafting testInv = new InventoryCrafting( new ContainerNull(), 3, 3 );
for (int x = 0; x < 9; x++)
{
if ( recipe[x] != null && recipe[x].length > 0 )
if ( this.recipe[x] != null && this.recipe[x].length > 0 )
{
testInv.setInventorySlotContents(x, recipe[x][0]);
testInv.setInventorySlotContents(x, this.recipe[x][0]);
}
}
@@ -170,9 +170,9 @@ public class PacketNEIRecipe extends AppEngPacket
// TODO see if this code is necessary
if ( whichItem == null )
{
for (int y = 0; y < recipe[x].length; y++)
for (int y = 0; y < this.recipe[x].length; y++)
{
IAEItemStack request = AEItemStack.create( recipe[x][y] );
IAEItemStack request = AEItemStack.create( this.recipe[x][y] );
if ( request != null )
{
if ( filter == null || filter.isListed( request ) )
@@ -228,11 +228,11 @@ public class PacketNEIRecipe extends AppEngPacket
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
DataOutputStream outputStream = new DataOutputStream( bytes );
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
CompressedStreamTools.writeCompressed( recipe, outputStream );
data.writeBytes( bytes.toByteArray() );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -37,7 +37,7 @@ public class PacketNewStorageDimension extends AppEngPacket
// automatic.
public PacketNewStorageDimension(ByteBuf stream)
{
newDim = stream.readInt();
this.newDim = stream.readInt();
}
@Override
@@ -46,7 +46,7 @@ public class PacketNewStorageDimension extends AppEngPacket
{
try
{
DimensionManager.registerDimension( newDim, AEConfig.instance.storageProviderID );
DimensionManager.registerDimension( this.newDim, AEConfig.instance.storageProviderID );
}
catch (IllegalArgumentException iae)
{
@@ -61,10 +61,10 @@ public class PacketNewStorageDimension extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( newDim );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -38,16 +38,16 @@ public class PacketPaintedEntity extends AppEngPacket
// automatic.
public PacketPaintedEntity(ByteBuf stream)
{
entityId = stream.readInt();
myColor = AEColor.values()[stream.readByte()];
ticks = stream.readInt();
this.entityId = stream.readInt();
this.myColor = AEColor.values()[stream.readByte()];
this.ticks = stream.readInt();
}
@Override
public void clientPacketData(INetworkInfo network, AppEngPacket packet, EntityPlayer player)
{
PlayerColor pc = new PlayerColor( entityId, myColor, ticks );
TickHandler.instance.getPlayerColors().put( entityId, pc );
PlayerColor pc = new PlayerColor( this.entityId, this.myColor, this.ticks );
TickHandler.instance.getPlayerColors().put( this.entityId, pc );
}
// api
@@ -55,11 +55,11 @@ public class PacketPaintedEntity extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( this.entityId = myEntity );
data.writeByte( (this.myColor = myColor).ordinal() );
data.writeInt( ticksLeft );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -37,11 +37,11 @@ public class PacketPartPlacement extends AppEngPacket
// automatic.
public PacketPartPlacement(ByteBuf stream)
{
x = stream.readInt();
y = stream.readInt();
z = stream.readInt();
face = stream.readByte();
eyeHeight = stream.readFloat();
this.x = stream.readInt();
this.y = stream.readInt();
this.z = stream.readInt();
this.face = stream.readByte();
this.eyeHeight = stream.readFloat();
}
@Override
@@ -49,8 +49,8 @@ public class PacketPartPlacement extends AppEngPacket
{
EntityPlayerMP sender = (EntityPlayerMP) player;
CommonHelper.proxy.updateRenderMode( sender );
PartPlacement.eyeHeight = eyeHeight;
PartPlacement.place( sender.getHeldItem(), x, y, z, face, sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
PartPlacement.eyeHeight = this.eyeHeight;
PartPlacement.place( sender.getHeldItem(), this.x, this.y, this.z, this.face, sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
CommonHelper.proxy.updateRenderMode( null );
}
@@ -59,14 +59,14 @@ public class PacketPartPlacement extends AppEngPacket
{
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( x );
data.writeInt( y );
data.writeInt( z );
data.writeByte( face );
data.writeFloat( eyeHeight );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -35,8 +35,8 @@ public class PacketPartialItem extends AppEngPacket
// automatic.
public PacketPartialItem(ByteBuf stream)
{
pageNum = stream.readShort();
stream.readBytes( data = new byte[stream.readableBytes()] );
this.pageNum = stream.readShort();
stream.readBytes( this.data = new byte[stream.readableBytes()] );
}
@Override
@@ -54,28 +54,28 @@ public class PacketPartialItem extends AppEngPacket
ByteBuf data = Unpooled.buffer();
pageNum = (short) (page | (maxPages << 8));
this.pageNum = (short) (page | (maxPages << 8));
this.data = buf;
data.writeInt( getPacketID() );
data.writeShort( pageNum );
data.writeInt( this.getPacketID() );
data.writeShort( this.pageNum );
data.writeBytes( buf );
configureWrite( data );
this.configureWrite( data );
}
public int getPageCount()
{
return pageNum >> 8;
return this.pageNum >> 8;
}
public int getSize()
{
return data.length;
return this.data.length;
}
public int write(byte[] buffer, int cursor)
{
System.arraycopy( data, 0, buffer, cursor, data.length );
return cursor + data.length;
System.arraycopy( this.data, 0, buffer, cursor, this.data.length );
return cursor + this.data.length;
}
}
@@ -55,12 +55,12 @@ public class PacketPatternSlot extends AppEngPacket
// automatic.
public PacketPatternSlot(ByteBuf stream) throws IOException {
shift = stream.readBoolean();
this.shift = stream.readBoolean();
slotItem = readItem( stream );
this.slotItem = this.readItem( stream );
for (int x = 0; x < 9; x++)
pattern[x] = readItem( stream );
this.pattern[x] = this.readItem( stream );
}
@Override
@@ -93,18 +93,18 @@ public class PacketPatternSlot extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeBoolean( shift );
writeItem( slotItem, data );
this.writeItem( slotItem, data );
for (int x = 0; x < 9; x++)
{
pattern[x] = AEApi.instance().storage().createItemStack( pat.getStackInSlot( x ) );
writeItem( pattern[x], data );
this.pattern[x] = AEApi.instance().storage().createItemStack( pat.getStackInSlot( x ) );
this.writeItem( this.pattern[x], data );
}
configureWrite( data );
this.configureWrite( data );
}
}
@@ -36,8 +36,8 @@ public class PacketProgressBar extends AppEngPacket
// automatic.
public PacketProgressBar(ByteBuf stream)
{
id = stream.readShort();
value = stream.readLong();
this.id = stream.readShort();
this.value = stream.readLong();
}
@Override
@@ -45,7 +45,7 @@ public class PacketProgressBar extends AppEngPacket
{
Container c = player.openContainer;
if ( c instanceof AEBaseContainer )
((AEBaseContainer) c).updateFullProgressBar( id, value );
((AEBaseContainer) c).updateFullProgressBar( this.id, this.value );
}
@Override
@@ -53,7 +53,7 @@ public class PacketProgressBar extends AppEngPacket
{
Container c = player.openContainer;
if ( c instanceof AEBaseContainer )
((AEBaseContainer) c).updateFullProgressBar( id, value );
((AEBaseContainer) c).updateFullProgressBar( this.id, this.value );
}
// api
@@ -64,10 +64,10 @@ public class PacketProgressBar extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeShort( short_id );
data.writeLong( value );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -35,8 +35,8 @@ public class PacketSwapSlots extends AppEngPacket
// automatic.
public PacketSwapSlots(ByteBuf stream)
{
slotA = stream.readInt();
slotB = stream.readInt();
this.slotA = stream.readInt();
this.slotB = stream.readInt();
}
@Override
@@ -44,7 +44,7 @@ public class PacketSwapSlots extends AppEngPacket
{
if ( player != null && player.openContainer instanceof AEBaseContainer )
{
((AEBaseContainer) player.openContainer).swapSlotContents( slotA, slotB );
((AEBaseContainer) player.openContainer).swapSlotContents( this.slotA, this.slotB );
}
}
@@ -53,10 +53,10 @@ public class PacketSwapSlots extends AppEngPacket
{
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( this.slotA = slotA );
data.writeInt( this.slotB = slotB );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -40,7 +40,7 @@ public class PacketSwitchGuis extends AppEngPacket
// automatic.
public PacketSwitchGuis(ByteBuf stream)
{
newGui = GuiBridge.values()[stream.readInt()];
this.newGui = GuiBridge.values()[stream.readInt()];
}
@Override
@@ -54,7 +54,7 @@ public class PacketSwitchGuis extends AppEngPacket
if ( context != null )
{
TileEntity te = context.getTile();
Platform.openGUI( player, te, context.side, newGui );
Platform.openGUI( player, te, context.side, this.newGui );
}
}
}
@@ -75,9 +75,9 @@ public class PacketSwitchGuis extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeInt( newGui.ordinal() );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -50,11 +50,11 @@ public class PacketTransitionEffect extends AppEngPacket
// automatic.
public PacketTransitionEffect(ByteBuf stream)
{
x = stream.readFloat();
y = stream.readFloat();
z = stream.readFloat();
d = ForgeDirection.getOrientation( stream.readByte() );
mode = stream.readBoolean();
this.x = stream.readFloat();
this.y = stream.readFloat();
this.z = stream.readFloat();
this.d = ForgeDirection.getOrientation( stream.readByte() );
this.mode = stream.readBoolean();
}
@Override
@@ -63,33 +63,33 @@ public class PacketTransitionEffect extends AppEngPacket
{
World world = ClientHelper.proxy.getWorld();
for (int zz = 0; zz < (mode ? 32 : 8); zz++)
for (int zz = 0; zz < (this.mode ? 32 : 8); zz++)
if ( CommonHelper.proxy.shouldAddParticles( Platform.getRandom() ) )
{
EnergyFx fx = new EnergyFx( world, x + (mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), y
+ (mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), z
+ (mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), Items.diamond );
EnergyFx fx = new EnergyFx( world, this.x + (this.mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), this.y
+ (this.mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), this.z
+ (this.mode ? (Platform.getRandomInt() % 100) * 0.01 : (Platform.getRandomInt() % 100) * 0.005 - 0.25), Items.diamond );
if ( !mode )
fx.fromItem( d );
if ( !this.mode )
fx.fromItem( this.d );
fx.motionX = -0.1 * d.offsetX;
fx.motionY = -0.1 * d.offsetY;
fx.motionZ = -0.1 * d.offsetZ;
fx.motionX = -0.1 * this.d.offsetX;
fx.motionY = -0.1 * this.d.offsetY;
fx.motionZ = -0.1 * this.d.offsetZ;
Minecraft.getMinecraft().effectRenderer.addEffect( fx );
}
if ( mode )
if ( this.mode )
{
Block block = world.getBlock( (int) x, (int) y, (int) z );
Block block = world.getBlock( (int) this.x, (int) this.y, (int) this.z );
Minecraft
.getMinecraft()
.getSoundHandler()
.playSound(
new PositionedSoundRecord( new ResourceLocation( block.stepSound.getBreakSound() ), (block.stepSound.getVolume() + 1.0F) / 2.0F,
block.stepSound.getPitch() * 0.8F, (float) x + 0.5F, (float) y + 0.5F, (float) z + 0.5F ) );
block.stepSound.getPitch() * 0.8F, (float) this.x + 0.5F, (float) this.y + 0.5F, (float) this.z + 0.5F ) );
}
}
@@ -104,14 +104,14 @@ public class PacketTransitionEffect extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
data.writeFloat( (float) x );
data.writeFloat( (float) y );
data.writeFloat( (float) z );
data.writeByte( this.d.ordinal() );
data.writeBoolean( wasBlock );
configureWrite( data );
this.configureWrite( data );
}
}
@@ -61,8 +61,8 @@ public class PacketValueConfig extends AppEngPacket
// automatic.
public PacketValueConfig(ByteBuf stream) throws IOException {
DataInputStream dis = new DataInputStream( new ByteArrayInputStream( stream.array(), stream.readerIndex(), stream.readableBytes() ) );
Name = dis.readUTF();
Value = dis.readUTF();
this.Name = dis.readUTF();
this.Value = dis.readUTF();
// dis.close();
}
@@ -71,109 +71,109 @@ public class PacketValueConfig extends AppEngPacket
{
Container c = player.openContainer;
if ( Name.equals( "Item" ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem )
if ( this.Name.equals( "Item" ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem )
{
ItemStack is = player.getHeldItem();
IMouseWheelItem si = (IMouseWheelItem) is.getItem();
si.onWheel( is, Value.equals( "WheelUp" ) );
si.onWheel( is, this.Value.equals( "WheelUp" ) );
}
else if ( Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus )
else if ( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftingStatus )
{
ContainerCraftingStatus qk = (ContainerCraftingStatus) c;
qk.cycleCpu( Value.equals( "Next" ) );
qk.cycleCpu( this.Value.equals( "Next" ) );
}
else if ( Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm )
else if ( this.Name.equals( "Terminal.Cpu" ) && c instanceof ContainerCraftConfirm )
{
ContainerCraftConfirm qk = (ContainerCraftConfirm) c;
qk.cycleCpu( Value.equals( "Next" ) );
qk.cycleCpu( this.Value.equals( "Next" ) );
}
else if ( Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm )
else if ( this.Name.equals( "Terminal.Start" ) && c instanceof ContainerCraftConfirm )
{
ContainerCraftConfirm qk = (ContainerCraftConfirm) c;
qk.startJob();
}
else if ( Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU )
else if ( this.Name.equals( "TileCrafting.Cancel" ) && c instanceof ContainerCraftingCPU )
{
ContainerCraftingCPU qk = (ContainerCraftingCPU) c;
qk.cancelCrafting();
}
else if ( Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife )
else if ( this.Name.equals( "QuartzKnife.Name" ) && c instanceof ContainerQuartzKnife )
{
ContainerQuartzKnife qk = (ContainerQuartzKnife) c;
qk.setName( Value );
qk.setName( this.Value );
}
else if ( Name.equals( "TileSecurity.ToggleOption" ) && c instanceof ContainerSecurity )
else if ( this.Name.equals( "TileSecurity.ToggleOption" ) && c instanceof ContainerSecurity )
{
ContainerSecurity sc = (ContainerSecurity) c;
sc.toggleSetting( Value, player );
sc.toggleSetting( this.Value, player );
}
else if ( Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority )
else if ( this.Name.equals( "PriorityHost.Priority" ) && c instanceof ContainerPriority )
{
ContainerPriority pc = (ContainerPriority) c;
pc.setPriority( Integer.parseInt( Value ), player );
pc.setPriority( Integer.parseInt( this.Value ), player );
}
else if ( Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter )
else if ( this.Name.equals( "LevelEmitter.Value" ) && c instanceof ContainerLevelEmitter )
{
ContainerLevelEmitter lvc = (ContainerLevelEmitter) c;
lvc.setLevel( Long.parseLong( Value ), player );
lvc.setLevel( Long.parseLong( this.Value ), player );
}
else if ( Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm )
else if ( this.Name.startsWith( "PatternTerminal." ) && c instanceof ContainerPatternTerm )
{
ContainerPatternTerm cpt = (ContainerPatternTerm) c;
if ( Name.equals( "PatternTerminal.CraftMode" ) )
if ( this.Name.equals( "PatternTerminal.CraftMode" ) )
{
cpt.ct.setCraftingRecipe( Value.equals( "1" ) );
cpt.ct.setCraftingRecipe( this.Value.equals( "1" ) );
}
else if ( Name.equals( "PatternTerminal.Encode" ) )
else if ( this.Name.equals( "PatternTerminal.Encode" ) )
{
cpt.encode();
}
else if ( Name.equals( "PatternTerminal.Clear" ) )
else if ( this.Name.equals( "PatternTerminal.Clear" ) )
{
cpt.clear();
}
}
else if ( Name.startsWith( "StorageBus." ) && c instanceof ContainerStorageBus )
else if ( this.Name.startsWith( "StorageBus." ) && c instanceof ContainerStorageBus )
{
ContainerStorageBus ccw = (ContainerStorageBus) c;
if ( Name.equals( "StorageBus.Action" ) )
if ( this.Name.equals( "StorageBus.Action" ) )
{
if ( Value.equals( "Partition" ) )
if ( this.Value.equals( "Partition" ) )
{
ccw.partition();
}
else if ( Value.equals( "Clear" ) )
else if ( this.Value.equals( "Clear" ) )
{
ccw.clear();
}
}
}
else if ( Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench )
else if ( this.Name.startsWith( "CellWorkbench." ) && c instanceof ContainerCellWorkbench )
{
ContainerCellWorkbench ccw = (ContainerCellWorkbench) c;
if ( Name.equals( "CellWorkbench.Action" ) )
if ( this.Name.equals( "CellWorkbench.Action" ) )
{
if ( Value.equals( "CopyMode" ) )
if ( this.Value.equals( "CopyMode" ) )
{
ccw.nextCopyMode();
}
else if ( Value.equals( "Partition" ) )
else if ( this.Value.equals( "Partition" ) )
{
ccw.partition();
}
else if ( Value.equals( "Clear" ) )
else if ( this.Value.equals( "Clear" ) )
{
ccw.clear();
}
}
else if ( Name.equals( "CellWorkbench.Fuzzy" ) )
else if ( this.Name.equals( "CellWorkbench.Fuzzy" ) )
{
ccw.setFuzzy( FuzzyMode.valueOf( Value ) );
ccw.setFuzzy( FuzzyMode.valueOf( this.Value ) );
}
}
else if ( c instanceof ContainerNetworkTool )
{
if ( Name.equals( "NetworkTool" ) && Value.equals( "Toggle" ) )
if ( this.Name.equals( "NetworkTool" ) && this.Value.equals( "Toggle" ) )
{
((ContainerNetworkTool) c).toggleFacadeMode();
}
@@ -184,13 +184,13 @@ public class PacketValueConfig extends AppEngPacket
for (Enum e : cm.getSettings())
{
if ( e.name().equals( Name ) )
if ( e.name().equals( this.Name ) )
{
Enum def = cm.getSetting( e );
try
{
cm.putSetting( e, Enum.valueOf( def.getClass(), Value ) );
cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) );
}
catch (IllegalArgumentException err)
{
@@ -209,15 +209,15 @@ public class PacketValueConfig extends AppEngPacket
{
Container c = player.openContainer;
if ( Name.equals( "CustomName" ) && c instanceof AEBaseContainer )
if ( this.Name.equals( "CustomName" ) && c instanceof AEBaseContainer )
{
((AEBaseContainer) c).customName = Value;
((AEBaseContainer) c).customName = this.Value;
}
else if ( Name.startsWith( "SyncDat." ) )
else if ( this.Name.startsWith( "SyncDat." ) )
{
((AEBaseContainer) c).stringSync( Integer.parseInt( Name.substring( 8 ) ), Value );
((AEBaseContainer) c).stringSync( Integer.parseInt( this.Name.substring( 8 ) ), this.Value );
}
else if ( Name.equals( "CraftingStatus" ) && Value.equals( "Clear" ) )
else if ( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) )
{
GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if ( gs instanceof GuiCraftingCPU )
@@ -229,13 +229,13 @@ public class PacketValueConfig extends AppEngPacket
for (Enum e : cm.getSettings())
{
if ( e.name().equals( Name ) )
if ( e.name().equals( this.Name ) )
{
Enum def = cm.getSetting( e );
try
{
cm.putSetting( e, Enum.valueOf( def.getClass(), Value ) );
cm.putSetting( e, Enum.valueOf( def.getClass(), this.Value ) );
}
catch (IllegalArgumentException err)
{
@@ -256,7 +256,7 @@ public class PacketValueConfig extends AppEngPacket
ByteBuf data = Unpooled.buffer();
data.writeInt( getPacketID() );
data.writeInt( this.getPacketID() );
ByteArrayOutputStream bos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream( bos );
@@ -266,6 +266,6 @@ public class PacketValueConfig extends AppEngPacket
data.writeBytes( bos.toByteArray() );
configureWrite( data );
this.configureWrite( data );
}
}