Reduces visibility of internal fields/methods
Reduces the visibility of all fields to private and create setters/getters when necessary. Exceptions are fields with GuiSync as these need to be public. Reduces the visibility of internal methods to private/protected/default when possible.
This commit is contained in:
@@ -70,7 +70,7 @@ public final class AEConfig extends Configuration implements IConfigurableObject
|
||||
public float spawnChargedChance = 0.92f;
|
||||
public int quartzOresPerCluster = 4;
|
||||
public int quartzOresClusterAmount = 15;
|
||||
public int chargedChange = 4;
|
||||
public final int chargedChange = 4;
|
||||
public int minMeteoriteDistance = 707;
|
||||
public int minMeteoriteDistanceSq = this.minMeteoriteDistance * this.minMeteoriteDistance;
|
||||
public double spatialPowerExponent = 1.35;
|
||||
|
||||
@@ -101,7 +101,7 @@ public final class AELog
|
||||
}
|
||||
}
|
||||
|
||||
public static void debug( String format, Object... data )
|
||||
public static void debug( final String format, final Object... data )
|
||||
{
|
||||
if( AEConfig.instance.isFeatureEnabled( AEFeature.DebugLogging ) )
|
||||
{
|
||||
|
||||
@@ -53,12 +53,12 @@ public final class ApiDefinitions implements IDefinitions
|
||||
this.parts = new ApiParts( constructor, partHelper );
|
||||
}
|
||||
|
||||
public FeatureHandlerRegistry getFeatureHandlerRegistry()
|
||||
FeatureHandlerRegistry getFeatureHandlerRegistry()
|
||||
{
|
||||
return this.handlers;
|
||||
}
|
||||
|
||||
public FeatureRegistry getFeatureRegistry()
|
||||
FeatureRegistry getFeatureRegistry()
|
||||
{
|
||||
return this.features;
|
||||
}
|
||||
|
||||
@@ -182,9 +182,9 @@ public final class AppEng
|
||||
final Stopwatch start = Stopwatch.createStarted();
|
||||
AELog.info( "Initialization ( started )" );
|
||||
|
||||
if( exportConfig.isExportingItemNamesEnabled() )
|
||||
if( this.exportConfig.isExportingItemNamesEnabled() )
|
||||
{
|
||||
final ExportProcess process = new ExportProcess( this.recipeDirectory, exportConfig );
|
||||
final ExportProcess process = new ExportProcess( this.recipeDirectory, this.exportConfig );
|
||||
final Thread exportProcessThread = new Thread( process );
|
||||
|
||||
this.startService( "AE2 CSV Export", exportProcessThread );
|
||||
|
||||
@@ -41,7 +41,7 @@ public final class CreativeTab extends CreativeTabs
|
||||
super( "appliedenergistics2" );
|
||||
}
|
||||
|
||||
public static void init()
|
||||
static void init()
|
||||
{
|
||||
instance = new CreativeTab();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ public final class CreativeTabFacade extends CreativeTabs
|
||||
super( "appliedenergistics2.facades" );
|
||||
}
|
||||
|
||||
public static void init()
|
||||
static void init()
|
||||
{
|
||||
instance = new CreativeTabFacade();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ public class FacadeConfig extends Configuration
|
||||
{
|
||||
|
||||
public static FacadeConfig instance;
|
||||
final Pattern replacementPattern;
|
||||
private final Pattern replacementPattern;
|
||||
|
||||
public FacadeConfig( final File facadeFile )
|
||||
{
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class FeatureHandlerRegistry
|
||||
this.registry.add( feature );
|
||||
}
|
||||
|
||||
public Set<IFeatureHandler> getRegisteredFeatureHandlers()
|
||||
Set<IFeatureHandler> getRegisteredFeatureHandlers()
|
||||
{
|
||||
return this.registry;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public final class FeatureRegistry
|
||||
this.registry.add( feature );
|
||||
}
|
||||
|
||||
public Set<IAEFeature> getRegisteredFeatures()
|
||||
Set<IAEFeature> getRegisteredFeatures()
|
||||
{
|
||||
return this.registry;
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class IMCHandler
|
||||
*
|
||||
* @param event Event carrying the identifier and message for the handlers
|
||||
*/
|
||||
public void handleIMCEvent( final FMLInterModComms.IMCEvent event )
|
||||
void handleIMCEvent( final FMLInterModComms.IMCEvent event )
|
||||
{
|
||||
for( final FMLInterModComms.IMCMessage message : event.getMessages() )
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ public class RecipeLoader implements Runnable
|
||||
FileUtils.cleanDirectory( generatedRecipesDir );
|
||||
|
||||
copier.copyTo( ".recipe", generatedRecipesDir );
|
||||
copier.copyTo( ".html", recipeDirectory );
|
||||
copier.copyTo( ".html", this.recipeDirectory );
|
||||
|
||||
// parse recipes prioritising the user scripts by using the generated as template
|
||||
this.handler.parseRecipes( new ConfigLoader( generatedRecipesDir, userRecipesDir ), "index.recipe" );
|
||||
|
||||
@@ -138,7 +138,7 @@ public final class Registration
|
||||
return this.storageBiome;
|
||||
}
|
||||
|
||||
public void preInitialize( final FMLPreInitializationEvent event )
|
||||
void preInitialize( final FMLPreInitializationEvent event )
|
||||
{
|
||||
this.registerSpatial( false );
|
||||
|
||||
@@ -512,7 +512,7 @@ public final class Registration
|
||||
target.itemLumenPaintBall = source.coloredLumenPaintBall();
|
||||
}
|
||||
|
||||
public void initialize( @Nonnull final FMLInitializationEvent event, @Nonnull final File recipeDirectory, @Nonnull final CustomRecipeConfig customRecipeConfig )
|
||||
void initialize( @Nonnull final FMLInitializationEvent event, @Nonnull final File recipeDirectory, @Nonnull final CustomRecipeConfig customRecipeConfig )
|
||||
{
|
||||
Preconditions.checkNotNull( event );
|
||||
Preconditions.checkNotNull( recipeDirectory );
|
||||
@@ -581,7 +581,7 @@ public final class Registration
|
||||
}
|
||||
}
|
||||
|
||||
public void postInit( final FMLPostInitializationEvent event )
|
||||
void postInit( final FMLPostInitializationEvent event )
|
||||
{
|
||||
this.registerSpatial( true );
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ public class ApiPart implements IPartHelper
|
||||
return myCLass;
|
||||
}
|
||||
|
||||
public Class getClassByDesc( final String addendum, final String fullPath, final String root, final String next )
|
||||
private Class getClassByDesc( final String addendum, final String fullPath, final String root, final String next )
|
||||
{
|
||||
if( this.roots.get( fullPath ) != null )
|
||||
{
|
||||
@@ -236,7 +236,7 @@ public class ApiPart implements IPartHelper
|
||||
return clazz;
|
||||
}
|
||||
|
||||
public ClassNode getReader( final String name )
|
||||
private ClassNode getReader( final String name )
|
||||
{
|
||||
final String path = '/' + name.replace( ".", "/" ) + ".class";
|
||||
final InputStream is = this.getClass().getResourceAsStream( path );
|
||||
@@ -348,10 +348,10 @@ public class ApiPart implements IPartHelper
|
||||
return CommonHelper.proxy.getRenderMode();
|
||||
}
|
||||
|
||||
static class DefaultPackageClassNameRemapper extends Remapper
|
||||
private static class DefaultPackageClassNameRemapper extends Remapper
|
||||
{
|
||||
|
||||
public final HashMap<String, String> inputOutput = new HashMap<String, String>();
|
||||
private final HashMap<String, String> inputOutput = new HashMap<String, String>();
|
||||
|
||||
@Override
|
||||
public String map( final String typeName )
|
||||
|
||||
@@ -48,7 +48,7 @@ public class DefinitionConstructor
|
||||
this.handlers = handlers;
|
||||
}
|
||||
|
||||
public final ITileDefinition registerTileDefinition( final IAEFeature feature )
|
||||
final ITileDefinition registerTileDefinition( final IAEFeature feature )
|
||||
{
|
||||
final IBlockDefinition definition = this.registerBlockDefinition( feature );
|
||||
|
||||
@@ -60,7 +60,7 @@ public class DefinitionConstructor
|
||||
throw new IllegalStateException( "No tile definition for " + feature );
|
||||
}
|
||||
|
||||
public final IBlockDefinition registerBlockDefinition( final IAEFeature feature )
|
||||
final IBlockDefinition registerBlockDefinition( final IAEFeature feature )
|
||||
{
|
||||
final IItemDefinition definition = this.registerItemDefinition( feature );
|
||||
|
||||
@@ -72,7 +72,7 @@ public class DefinitionConstructor
|
||||
throw new IllegalStateException( "No block definition for " + feature );
|
||||
}
|
||||
|
||||
public final IItemDefinition registerItemDefinition( final IAEFeature feature )
|
||||
final IItemDefinition registerItemDefinition( final IAEFeature feature )
|
||||
{
|
||||
final IFeatureHandler handler = feature.handler();
|
||||
|
||||
@@ -87,7 +87,7 @@ public class DefinitionConstructor
|
||||
return definition;
|
||||
}
|
||||
|
||||
public final AEColoredItemDefinition constructColoredDefinition( final IItemDefinition target, final int offset )
|
||||
final AEColoredItemDefinition constructColoredDefinition( final IItemDefinition target, final int offset )
|
||||
{
|
||||
final ColoredItemDefinition definition = new ColoredItemDefinition();
|
||||
|
||||
@@ -104,7 +104,7 @@ public class DefinitionConstructor
|
||||
return definition;
|
||||
}
|
||||
|
||||
public final AEColoredItemDefinition constructColoredDefinition( final ItemMultiPart target, final PartType type )
|
||||
final AEColoredItemDefinition constructColoredDefinition( final ItemMultiPart target, final PartType type )
|
||||
{
|
||||
final ColoredItemDefinition definition = new ColoredItemDefinition();
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ import net.minecraft.item.ItemStack;
|
||||
public class BlockStackSrc implements IStackSrc
|
||||
{
|
||||
|
||||
public final Block block;
|
||||
public final int damage;
|
||||
private final Block block;
|
||||
private final int damage;
|
||||
private final boolean enabled;
|
||||
|
||||
public BlockStackSrc( final Block block, final int damage, final ActivityState state )
|
||||
|
||||
@@ -31,7 +31,7 @@ import appeng.api.util.AEColoredItemDefinition;
|
||||
public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
{
|
||||
|
||||
final ItemStackSrc[] colors = new ItemStackSrc[17];
|
||||
private final ItemStackSrc[] colors = new ItemStackSrc[17];
|
||||
|
||||
public void add( final AEColor v, final ItemStackSrc is )
|
||||
{
|
||||
@@ -97,6 +97,6 @@ public final class ColoredItemDefinition implements AEColoredItemDefinition
|
||||
return false;
|
||||
}
|
||||
|
||||
return comparableItem.getItem() == is.getItem() && comparableItem.getItemDamage() == is.damage;
|
||||
return comparableItem.getItem() == is.getItem() && comparableItem.getItemDamage() == is.getDamage();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ public final class FeaturedActiveChecker
|
||||
this.features = features;
|
||||
}
|
||||
|
||||
public ActivityState getActivityState()
|
||||
ActivityState getActivityState()
|
||||
{
|
||||
for( final AEFeature f : this.features )
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ItemStackSrc implements IStackSrc
|
||||
{
|
||||
|
||||
private final Item item;
|
||||
public final int damage;
|
||||
private final int damage;
|
||||
private final boolean enabled;
|
||||
|
||||
public ItemStackSrc( final Item item, final int damage, final ActivityState state )
|
||||
|
||||
@@ -47,13 +47,13 @@ public class MaterialStackSrc implements IStackSrc
|
||||
@Override
|
||||
public Item getItem()
|
||||
{
|
||||
return this.src.itemInstance;
|
||||
return this.src.getItemInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDamage()
|
||||
{
|
||||
return this.src.damageValue;
|
||||
return this.src.getDamageValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ import appeng.api.storage.StorageChannel;
|
||||
public class CellRegistry implements ICellRegistry
|
||||
{
|
||||
|
||||
final List<ICellHandler> handlers;
|
||||
private final List<ICellHandler> handlers;
|
||||
|
||||
public CellRegistry()
|
||||
{
|
||||
|
||||
@@ -35,8 +35,8 @@ import appeng.core.features.registries.entries.ExternalIInv;
|
||||
public class ExternalStorageRegistry implements IExternalStorageRegistry
|
||||
{
|
||||
|
||||
final List<IExternalStorageHandler> Handlers;
|
||||
final ExternalIInv lastHandler = new ExternalIInv();
|
||||
private final List<IExternalStorageHandler> Handlers;
|
||||
private final ExternalIInv lastHandler = new ExternalIInv();
|
||||
|
||||
public ExternalStorageRegistry()
|
||||
{
|
||||
|
||||
@@ -164,7 +164,7 @@ public final class GrinderRecipeManager implements IGrinderRegistry, IOreListene
|
||||
return null;
|
||||
}
|
||||
|
||||
public void log( final String o )
|
||||
private void log( final String o )
|
||||
{
|
||||
AELog.grinder( o );
|
||||
}
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* This file is part of Applied Energistics 2.
|
||||
* Copyright (c) 2013 - 2014, AlgorithmX2, All rights reserved.
|
||||
*
|
||||
* Applied Energistics 2 is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Applied Energistics 2 is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Applied Energistics 2. If not, see <http://www.gnu.org/licenses/lgpl>.
|
||||
*/
|
||||
|
||||
package appeng.core.features.registries;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
|
||||
public class WirelessRangeResult
|
||||
{
|
||||
|
||||
public final float dist;
|
||||
public final TileEntity te;
|
||||
|
||||
public WirelessRangeResult( final TileEntity t, final float d )
|
||||
{
|
||||
this.dist = d;
|
||||
this.te = t;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ public final class WorldGenRegistry implements IWorldGen
|
||||
{
|
||||
|
||||
public static final WorldGenRegistry INSTANCE = new WorldGenRegistry();
|
||||
final TypeSet[] types;
|
||||
private final TypeSet[] types;
|
||||
|
||||
private WorldGenRegistry()
|
||||
{
|
||||
|
||||
@@ -65,7 +65,7 @@ public enum ButtonToolTips
|
||||
|
||||
SchedulingMode, SchedulingModeDefault, SchedulingModeRoundRobin, SchedulingModeRandom;
|
||||
|
||||
final String root;
|
||||
private final String root;
|
||||
|
||||
ButtonToolTips()
|
||||
{
|
||||
|
||||
@@ -94,7 +94,7 @@ public enum GuiText
|
||||
// Used in a ME Interface when no appropriate TileEntity was detected near it
|
||||
Nothing;
|
||||
|
||||
final String root;
|
||||
private final String root;
|
||||
|
||||
GuiText()
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ public enum WailaText
|
||||
|
||||
Contains, Channels;
|
||||
|
||||
final String root;
|
||||
private final String root;
|
||||
|
||||
WailaText()
|
||||
{
|
||||
|
||||
@@ -51,20 +51,40 @@ public enum TickRates
|
||||
|
||||
PressureTunnel( 1, 120 );
|
||||
|
||||
public int min;
|
||||
public int max;
|
||||
private int min;
|
||||
private int max;
|
||||
|
||||
TickRates( final int min, final int max )
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.setMin( min );
|
||||
this.setMax( max );
|
||||
}
|
||||
|
||||
public void Load( final AEConfig config )
|
||||
{
|
||||
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." );
|
||||
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 );
|
||||
this.setMin( config.get( "TickRates", this.name() + ".min", this.getMin() ).getInt( this.getMin() ) );
|
||||
this.setMax( config.get( "TickRates", this.name() + ".max", this.getMax() ).getInt( this.getMax() ) );
|
||||
}
|
||||
|
||||
public int getMax()
|
||||
{
|
||||
return this.max;
|
||||
}
|
||||
|
||||
public void setMax( final int max )
|
||||
{
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
public int getMin()
|
||||
{
|
||||
return this.min;
|
||||
}
|
||||
|
||||
public void setMin( final int min )
|
||||
{
|
||||
this.min = min;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -51,17 +51,17 @@ public class AchievementCraftingHandler
|
||||
|
||||
for( final Achievements achievement : Achievements.values() )
|
||||
{
|
||||
switch( achievement.type )
|
||||
switch( achievement.getType() )
|
||||
{
|
||||
case Craft:
|
||||
if( Platform.isSameItemPrecise( achievement.stack, event.crafting ) )
|
||||
if( Platform.isSameItemPrecise( achievement.getStack(), event.crafting ) )
|
||||
{
|
||||
achievement.addToPlayer( event.player );
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case CraftItem:
|
||||
if( achievement.stack != null && achievement.stack.getItem().getClass() == event.crafting.getItem().getClass() )
|
||||
if( achievement.getStack() != null && achievement.getStack().getItem().getClass() == event.crafting.getItem().getClass() )
|
||||
{
|
||||
achievement.addToPlayer( event.player );
|
||||
return;
|
||||
|
||||
@@ -30,7 +30,7 @@ public class AchievementHierarchy
|
||||
/**
|
||||
* Setup hierarchy through assigning parents.
|
||||
*/
|
||||
public void registerAchievementHierarchy()
|
||||
void registerAchievementHierarchy()
|
||||
{
|
||||
Achievements.Presses.setParent( Achievements.Compass );
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ public class AchievementPickupHandler
|
||||
|
||||
for( final Achievements achievement : Achievements.values() )
|
||||
{
|
||||
if( achievement.type == AchievementType.Pickup && Platform.isSameItemPrecise( achievement.stack, is ) )
|
||||
if( achievement.getType() == AchievementType.Pickup && Platform.isSameItemPrecise( achievement.getStack(), is ) )
|
||||
{
|
||||
achievement.addToPlayer( event.player );
|
||||
return;
|
||||
|
||||
@@ -106,8 +106,8 @@ public enum Achievements
|
||||
// done
|
||||
QNB( 10, 2, AEApi.instance().definitions().blocks().quantumLink(), AchievementType.Craft );
|
||||
|
||||
public final ItemStack stack;
|
||||
public final AchievementType type;
|
||||
private final ItemStack stack;
|
||||
private final AchievementType type;
|
||||
private final int x;
|
||||
private final int y;
|
||||
|
||||
@@ -138,16 +138,16 @@ public enum Achievements
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public void setParent( final Achievements parent )
|
||||
void setParent( final Achievements parent )
|
||||
{
|
||||
this.parent = parent.getAchievement();
|
||||
}
|
||||
|
||||
public Achievement getAchievement()
|
||||
{
|
||||
if( this.stat == null && this.stack != null )
|
||||
if( this.stat == null && this.getStack() != null )
|
||||
{
|
||||
this.stat = new Achievement( "achievement.ae2." + this.name(), "ae2." + this.name(), this.x, this.y, this.stack, this.parent );
|
||||
this.stat = new Achievement( "achievement.ae2." + this.name(), "ae2." + this.name(), this.x, this.y, this.getStack(), this.parent );
|
||||
this.stat.registerStat();
|
||||
}
|
||||
|
||||
@@ -159,4 +159,14 @@ public enum Achievements
|
||||
player.addStat( this.getAchievement(), 1 );
|
||||
}
|
||||
|
||||
AchievementType getType()
|
||||
{
|
||||
return this.type;
|
||||
}
|
||||
|
||||
ItemStack getStack()
|
||||
{
|
||||
return this.stack;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class PlayerDifferentiator
|
||||
*
|
||||
* @return true if {@param player} is not a real player
|
||||
*/
|
||||
public boolean isNoPlayer( final EntityPlayer player )
|
||||
boolean isNoPlayer( final EntityPlayer player )
|
||||
{
|
||||
return player == null || player.isDead || player instanceof FakePlayer;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ public enum Stats
|
||||
player.addStat( this.getStat(), howMany );
|
||||
}
|
||||
|
||||
public StatBasic getStat()
|
||||
StatBasic getStat()
|
||||
{
|
||||
if( this.stat == null )
|
||||
{
|
||||
|
||||
@@ -35,7 +35,7 @@ import appeng.core.sync.network.NetworkHandler;
|
||||
public abstract class AppEngPacket
|
||||
{
|
||||
|
||||
AppEngPacketHandlerBase.PacketTypes id;
|
||||
private AppEngPacketHandlerBase.PacketTypes id;
|
||||
private ByteBuf p;
|
||||
|
||||
public void serverPacketData( final INetworkInfo manager, final AppEngPacket packet, final EntityPlayer player )
|
||||
|
||||
@@ -139,7 +139,7 @@ public class AppEngPacketHandlerBase
|
||||
return ( values() )[id];
|
||||
}
|
||||
|
||||
public static PacketTypes getID( final Class<? extends AppEngPacket> c )
|
||||
static PacketTypes getID( final Class<? extends AppEngPacket> c )
|
||||
{
|
||||
return REVERSE_LOOKUP.get( c );
|
||||
}
|
||||
|
||||
@@ -324,12 +324,12 @@ public enum GuiBridge implements IGuiHandler
|
||||
if( newContainer instanceof AEBaseContainer )
|
||||
{
|
||||
final AEBaseContainer bc = (AEBaseContainer) newContainer;
|
||||
bc.openContext = new ContainerOpenContext( myItem );
|
||||
bc.openContext.w = w;
|
||||
bc.openContext.x = x;
|
||||
bc.openContext.y = y;
|
||||
bc.openContext.z = z;
|
||||
bc.openContext.side = side;
|
||||
bc.setOpenContext( new ContainerOpenContext( myItem ) );
|
||||
bc.getOpenContext().setWorld( w );
|
||||
bc.getOpenContext().setX( x );
|
||||
bc.getOpenContext().setY( y );
|
||||
bc.getOpenContext().setZ( z );
|
||||
bc.getOpenContext().setSide( side );
|
||||
}
|
||||
|
||||
return newContainer;
|
||||
|
||||
@@ -28,7 +28,7 @@ public enum GuiHostType
|
||||
return this != WORLD;
|
||||
}
|
||||
|
||||
public boolean isTile()
|
||||
boolean isTile()
|
||||
{
|
||||
return this != ITEM;
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ public class NetworkHandler
|
||||
|
||||
public static NetworkHandler instance;
|
||||
|
||||
final FMLEventChannel ec;
|
||||
final String myChannelName;
|
||||
private final FMLEventChannel ec;
|
||||
private final String myChannelName;
|
||||
|
||||
final IPacketHandler clientHandler;
|
||||
final IPacketHandler serveHandler;
|
||||
private final IPacketHandler clientHandler;
|
||||
private final IPacketHandler serveHandler;
|
||||
|
||||
public NetworkHandler( final String channelName )
|
||||
{
|
||||
|
||||
@@ -40,9 +40,9 @@ import appeng.util.item.AEItemStack;
|
||||
public class PacketAssemblerAnimation extends AppEngPacket
|
||||
{
|
||||
|
||||
public final int x;
|
||||
public final int y;
|
||||
public final int z;
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int z;
|
||||
public final byte rate;
|
||||
public final IAEItemStack is;
|
||||
|
||||
|
||||
@@ -39,13 +39,13 @@ import appeng.items.tools.powered.ToolColorApplicator;
|
||||
public class PacketClick extends AppEngPacket
|
||||
{
|
||||
|
||||
final int x;
|
||||
final int y;
|
||||
final int z;
|
||||
final int side;
|
||||
final float hitX;
|
||||
final float hitY;
|
||||
final float hitZ;
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int z;
|
||||
private final int side;
|
||||
private final float hitX;
|
||||
private final float hitY;
|
||||
private final float hitZ;
|
||||
|
||||
// automatic.
|
||||
public PacketClick( final ByteBuf stream )
|
||||
|
||||
@@ -36,12 +36,12 @@ import appeng.services.compass.ICompassCallback;
|
||||
public class PacketCompassRequest extends AppEngPacket implements ICompassCallback
|
||||
{
|
||||
|
||||
public final long attunement;
|
||||
public final int cx;
|
||||
public final int cz;
|
||||
public final int cdy;
|
||||
final long attunement;
|
||||
final int cx;
|
||||
final int cz;
|
||||
final int cdy;
|
||||
|
||||
EntityPlayer talkBackTo;
|
||||
private EntityPlayer talkBackTo;
|
||||
|
||||
// automatic.
|
||||
public PacketCompassRequest( final ByteBuf stream )
|
||||
|
||||
@@ -33,12 +33,12 @@ import appeng.hooks.CompassResult;
|
||||
public class PacketCompassResponse extends AppEngPacket
|
||||
{
|
||||
|
||||
public final long attunement;
|
||||
public final int cx;
|
||||
public final int cz;
|
||||
public final int cdy;
|
||||
private final long attunement;
|
||||
private final int cx;
|
||||
private final int cz;
|
||||
private final int cdy;
|
||||
|
||||
public CompassResult cr;
|
||||
private CompassResult cr;
|
||||
|
||||
// automatic.
|
||||
public PacketCompassResponse( final ByteBuf stream )
|
||||
|
||||
@@ -48,12 +48,10 @@ public class PacketCompressedNBT extends AppEngPacket
|
||||
{
|
||||
|
||||
// input.
|
||||
final NBTTagCompound in;
|
||||
private final NBTTagCompound in;
|
||||
// output...
|
||||
private final ByteBuf data;
|
||||
private final GZIPOutputStream compressFrame;
|
||||
int writtenBytes = 0;
|
||||
boolean empty = true;
|
||||
|
||||
// automatic.
|
||||
public PacketCompressedNBT( final ByteBuf stream ) throws IOException
|
||||
|
||||
@@ -46,8 +46,8 @@ import appeng.util.Platform;
|
||||
public class PacketCraftRequest extends AppEngPacket
|
||||
{
|
||||
|
||||
public final long amount;
|
||||
public final boolean heldShift;
|
||||
private final long amount;
|
||||
private final boolean heldShift;
|
||||
|
||||
// automatic.
|
||||
public PacketCraftRequest( final ByteBuf stream )
|
||||
@@ -87,30 +87,30 @@ public class PacketCraftRequest extends AppEngPacket
|
||||
}
|
||||
|
||||
final IGrid g = gn.getGrid();
|
||||
if( g == null || cca.whatToMake == null )
|
||||
if( g == null || cca.getItemToCraft() == null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
cca.whatToMake.setStackSize( this.amount );
|
||||
cca.getItemToCraft().setStackSize( this.amount );
|
||||
|
||||
Future<ICraftingJob> futureJob = null;
|
||||
try
|
||||
{
|
||||
final ICraftingGrid cg = g.getCache( ICraftingGrid.class );
|
||||
futureJob = cg.beginCraftingJob( cca.getWorld(), cca.getGrid(), cca.getActionSrc(), cca.whatToMake, null );
|
||||
futureJob = cg.beginCraftingJob( cca.getWorld(), cca.getGrid(), cca.getActionSrc(), cca.getItemToCraft(), null );
|
||||
|
||||
final ContainerOpenContext context = cca.openContext;
|
||||
final ContainerOpenContext context = cca.getOpenContext();
|
||||
if( context != null )
|
||||
{
|
||||
final TileEntity te = context.getTile();
|
||||
Platform.openGUI( player, te, cca.openContext.side, GuiBridge.GUI_CRAFTING_CONFIRM );
|
||||
Platform.openGUI( player, te, cca.getOpenContext().getSide(), GuiBridge.GUI_CRAFTING_CONFIRM );
|
||||
|
||||
if( player.openContainer instanceof ContainerCraftConfirm )
|
||||
{
|
||||
final ContainerCraftConfirm ccc = (ContainerCraftConfirm) player.openContainer;
|
||||
ccc.autoStart = this.heldShift;
|
||||
ccc.job = futureJob;
|
||||
ccc.setAutoStart( this.heldShift );
|
||||
ccc.setJob( futureJob );
|
||||
cca.detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,10 +44,10 @@ import appeng.util.item.AEItemStack;
|
||||
public class PacketInventoryAction extends AppEngPacket
|
||||
{
|
||||
|
||||
public final InventoryAction action;
|
||||
public final int slot;
|
||||
public final long id;
|
||||
public final IAEItemStack slotItem;
|
||||
private final InventoryAction action;
|
||||
private final int slot;
|
||||
private final long id;
|
||||
private final IAEItemStack slotItem;
|
||||
|
||||
// automatic.
|
||||
public PacketInventoryAction( final ByteBuf stream ) throws IOException
|
||||
@@ -128,11 +128,11 @@ public class PacketInventoryAction extends AppEngPacket
|
||||
final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer;
|
||||
if( this.action == InventoryAction.AUTO_CRAFT )
|
||||
{
|
||||
final ContainerOpenContext context = baseContainer.openContext;
|
||||
final ContainerOpenContext context = baseContainer.getOpenContext();
|
||||
if( context != null )
|
||||
{
|
||||
final TileEntity te = context.getTile();
|
||||
Platform.openGUI( sender, te, baseContainer.openContext.side, GuiBridge.GUI_CRAFTING_AMOUNT );
|
||||
Platform.openGUI( sender, te, baseContainer.getOpenContext().getSide(), GuiBridge.GUI_CRAFTING_AMOUNT );
|
||||
|
||||
if( sender.openContainer instanceof ContainerCraftAmount )
|
||||
{
|
||||
@@ -140,8 +140,8 @@ public class PacketInventoryAction extends AppEngPacket
|
||||
|
||||
if( baseContainer.getTargetStack() != null )
|
||||
{
|
||||
cca.craftingItem.putStack( baseContainer.getTargetStack().getItemStack() );
|
||||
cca.whatToMake = baseContainer.getTargetStack();
|
||||
cca.getCraftingItem().putStack( baseContainer.getTargetStack().getItemStack() );
|
||||
cca.setItemToCraft( baseContainer.getTargetStack() );
|
||||
}
|
||||
|
||||
cca.detectAndSendChanges();
|
||||
|
||||
@@ -39,9 +39,9 @@ import appeng.util.Platform;
|
||||
public class PacketLightning extends AppEngPacket
|
||||
{
|
||||
|
||||
final double x;
|
||||
final double y;
|
||||
final double z;
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
|
||||
// automatic.
|
||||
public PacketLightning( final ByteBuf stream )
|
||||
|
||||
@@ -39,13 +39,13 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketMatterCannon extends AppEngPacket
|
||||
{
|
||||
|
||||
final double x;
|
||||
final double y;
|
||||
final double z;
|
||||
final double dx;
|
||||
final double dy;
|
||||
final double dz;
|
||||
final byte len;
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
private final double dx;
|
||||
private final double dy;
|
||||
private final double dz;
|
||||
private final byte len;
|
||||
|
||||
// automatic.
|
||||
public PacketMatterCannon( final ByteBuf stream )
|
||||
|
||||
@@ -36,9 +36,9 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketMockExplosion extends AppEngPacket
|
||||
{
|
||||
|
||||
public final double x;
|
||||
public final double y;
|
||||
public final double z;
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
|
||||
// automatic.
|
||||
public PacketMockExplosion( final ByteBuf stream )
|
||||
|
||||
@@ -65,7 +65,7 @@ import appeng.util.prioitylist.IPartitionList;
|
||||
public class PacketNEIRecipe extends AppEngPacket
|
||||
{
|
||||
|
||||
ItemStack[][] recipe;
|
||||
private ItemStack[][] recipe;
|
||||
|
||||
// automatic.
|
||||
public PacketNEIRecipe( final ByteBuf stream ) throws IOException
|
||||
@@ -172,7 +172,7 @@ public class PacketNEIRecipe extends AppEngPacket
|
||||
final IAEItemStack in = AEItemStack.create( currentItem );
|
||||
if( in != null )
|
||||
{
|
||||
final IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getSource() );
|
||||
final IAEItemStack out = realForFake == Actionable.SIMULATE ? null : Platform.poweredInsert( energy, storage, in, cct.getActionSource() );
|
||||
if( out != null )
|
||||
{
|
||||
craftMatrix.setInventorySlotContents( x, out.getItemStack() );
|
||||
@@ -191,7 +191,7 @@ public class PacketNEIRecipe extends AppEngPacket
|
||||
if( patternItem != null && currentItem == null )
|
||||
{
|
||||
// Grab from network by recipe
|
||||
ItemStack whichItem = Platform.extractItemsByRecipe( energy, cct.getSource(), storage, player.worldObj, r, is, testInv, patternItem, x, all, realForFake, filter );
|
||||
ItemStack whichItem = Platform.extractItemsByRecipe( energy, cct.getActionSource(), storage, player.worldObj, r, is, testInv, patternItem, x, all, realForFake, filter );
|
||||
|
||||
// If that doesn't get it, grab exact items from network (?)
|
||||
// TODO see if this code is necessary
|
||||
@@ -205,7 +205,7 @@ public class PacketNEIRecipe extends AppEngPacket
|
||||
if( filter == null || filter.isListed( request ) )
|
||||
{
|
||||
request.setStackSize( 1 );
|
||||
final IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getSource() );
|
||||
final IAEItemStack out = Platform.poweredExtraction( energy, storage, request, cct.getActionSource() );
|
||||
if( out != null )
|
||||
{
|
||||
whichItem = out.getItemStack();
|
||||
|
||||
@@ -36,7 +36,7 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketNewStorageDimension extends AppEngPacket
|
||||
{
|
||||
|
||||
final int newDim;
|
||||
private final int newDim;
|
||||
|
||||
// automatic.
|
||||
public PacketNewStorageDimension( final ByteBuf stream )
|
||||
|
||||
@@ -34,11 +34,11 @@ import appeng.parts.PartPlacement;
|
||||
public class PacketPartPlacement extends AppEngPacket
|
||||
{
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
int face;
|
||||
float eyeHeight;
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private int face;
|
||||
private float eyeHeight;
|
||||
|
||||
// automatic.
|
||||
public PacketPartPlacement( final ByteBuf stream )
|
||||
@@ -70,7 +70,7 @@ public class PacketPartPlacement extends AppEngPacket
|
||||
{
|
||||
final EntityPlayerMP sender = (EntityPlayerMP) player;
|
||||
CommonHelper.proxy.updateRenderMode( sender );
|
||||
PartPlacement.eyeHeight = this.eyeHeight;
|
||||
PartPlacement.setEyeHeight( 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 );
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketPartialItem extends AppEngPacket
|
||||
{
|
||||
|
||||
final short pageNum;
|
||||
final byte[] data;
|
||||
private final short pageNum;
|
||||
private final byte[] data;
|
||||
|
||||
// automatic.
|
||||
public PacketPartialItem( final ByteBuf stream )
|
||||
|
||||
@@ -59,7 +59,7 @@ public class PacketPatternSlot extends AppEngPacket
|
||||
}
|
||||
}
|
||||
|
||||
public IAEItemStack readItem( final ByteBuf stream ) throws IOException
|
||||
private IAEItemStack readItem( final ByteBuf stream ) throws IOException
|
||||
{
|
||||
final boolean hasItem = stream.readBoolean();
|
||||
|
||||
|
||||
@@ -33,8 +33,8 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketProgressBar extends AppEngPacket
|
||||
{
|
||||
|
||||
final short id;
|
||||
final long value;
|
||||
private final short id;
|
||||
private final long value;
|
||||
|
||||
// automatic.
|
||||
public PacketProgressBar( final ByteBuf stream )
|
||||
|
||||
@@ -32,8 +32,8 @@ import appeng.core.sync.network.INetworkInfo;
|
||||
public class PacketSwapSlots extends AppEngPacket
|
||||
{
|
||||
|
||||
final int slotA;
|
||||
final int slotB;
|
||||
private final int slotA;
|
||||
private final int slotB;
|
||||
|
||||
// automatic.
|
||||
public PacketSwapSlots( final ByteBuf stream )
|
||||
|
||||
@@ -38,7 +38,7 @@ import appeng.util.Platform;
|
||||
public class PacketSwitchGuis extends AppEngPacket
|
||||
{
|
||||
|
||||
final GuiBridge newGui;
|
||||
private final GuiBridge newGui;
|
||||
|
||||
// automatic.
|
||||
public PacketSwitchGuis( final ByteBuf stream )
|
||||
@@ -53,7 +53,7 @@ public class PacketSwitchGuis extends AppEngPacket
|
||||
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
AEBaseGui.switchingGuis = true;
|
||||
AEBaseGui.setSwitchingGuis( true );
|
||||
}
|
||||
|
||||
final ByteBuf data = Unpooled.buffer();
|
||||
@@ -71,11 +71,11 @@ public class PacketSwitchGuis extends AppEngPacket
|
||||
if( c instanceof AEBaseContainer )
|
||||
{
|
||||
final AEBaseContainer bc = (AEBaseContainer) c;
|
||||
final ContainerOpenContext context = bc.openContext;
|
||||
final ContainerOpenContext context = bc.getOpenContext();
|
||||
if( context != null )
|
||||
{
|
||||
final TileEntity te = context.getTile();
|
||||
Platform.openGUI( player, te, context.side, this.newGui );
|
||||
Platform.openGUI( player, te, context.getSide(), this.newGui );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,6 +83,6 @@ public class PacketSwitchGuis extends AppEngPacket
|
||||
@Override
|
||||
public void clientPacketData( final INetworkInfo network, final AppEngPacket packet, final EntityPlayer player )
|
||||
{
|
||||
AEBaseGui.switchingGuis = true;
|
||||
AEBaseGui.setSwitchingGuis( true );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,11 +45,11 @@ import appeng.util.Platform;
|
||||
public class PacketTransitionEffect extends AppEngPacket
|
||||
{
|
||||
|
||||
public final boolean mode;
|
||||
final double x;
|
||||
final double y;
|
||||
final double z;
|
||||
final ForgeDirection d;
|
||||
private final boolean mode;
|
||||
private final double x;
|
||||
private final double y;
|
||||
private final double z;
|
||||
private final ForgeDirection d;
|
||||
|
||||
// automatic.
|
||||
public PacketTransitionEffect( final ByteBuf stream )
|
||||
|
||||
@@ -148,7 +148,7 @@ public class PacketValueConfig extends AppEngPacket
|
||||
final ContainerPatternTerm cpt = (ContainerPatternTerm) c;
|
||||
if( this.Name.equals( "PatternTerminal.CraftMode" ) )
|
||||
{
|
||||
cpt.ct.setCraftingRecipe( this.Value.equals( "1" ) );
|
||||
cpt.getPatternTerminal().setCraftingRecipe( this.Value.equals( "1" ) );
|
||||
}
|
||||
else if( this.Name.equals( "PatternTerminal.Encode" ) )
|
||||
{
|
||||
@@ -160,7 +160,7 @@ public class PacketValueConfig extends AppEngPacket
|
||||
}
|
||||
else if( this.Name.equals( "PatternTerminal.Substitute" ) )
|
||||
{
|
||||
cpt.ct.setSubstitution( this.Value.equals( "1" ) );
|
||||
cpt.getPatternTerminal().setSubstitution( this.Value.equals( "1" ) );
|
||||
}
|
||||
}
|
||||
else if( this.Name.startsWith( "StorageBus." ) && c instanceof ContainerStorageBus )
|
||||
@@ -185,7 +185,7 @@ public class PacketValueConfig extends AppEngPacket
|
||||
{
|
||||
if( this.Value.equals( "CopyMode" ) )
|
||||
{
|
||||
ccw.nextCopyMode();
|
||||
ccw.nextWorkBenchCopyMode();
|
||||
}
|
||||
else if( this.Value.equals( "Partition" ) )
|
||||
{
|
||||
@@ -240,7 +240,7 @@ public class PacketValueConfig extends AppEngPacket
|
||||
|
||||
if( this.Name.equals( "CustomName" ) && c instanceof AEBaseContainer )
|
||||
{
|
||||
( (AEBaseContainer) c ).customName = this.Value;
|
||||
( (AEBaseContainer) c ).setCustomName( this.Value );
|
||||
}
|
||||
else if( this.Name.startsWith( "SyncDat." ) )
|
||||
{
|
||||
|
||||
@@ -80,12 +80,12 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn
|
||||
final String id = String.valueOf( storageID );
|
||||
final String data = this.config.get( "gridstorage", id, "" ).getString();
|
||||
final GridStorage thisStorage = new GridStorage( data, storageID, gss );
|
||||
gss.gridStorage = new WeakReference<GridStorage>( thisStorage );
|
||||
gss.setGridStorage( new WeakReference<GridStorage>( thisStorage ) );
|
||||
this.loadedStorage.put( gss, new WeakReference<GridStorageSearch>( gss ) );
|
||||
return thisStorage;
|
||||
}
|
||||
|
||||
return result.get().gridStorage.get();
|
||||
return result.get().getGridStorage().get();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +98,7 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn
|
||||
final long storageID = this.nextGridStorage();
|
||||
final GridStorageSearch gss = new GridStorageSearch( storageID );
|
||||
final GridStorage newStorage = new GridStorage( storageID, gss );
|
||||
gss.gridStorage = new WeakReference<GridStorage>( newStorage );
|
||||
gss.setGridStorage( new WeakReference<GridStorage>( newStorage ) );
|
||||
this.loadedStorage.put( gss, new WeakReference<GridStorageSearch>( gss ) );
|
||||
|
||||
return newStorage;
|
||||
@@ -152,7 +152,7 @@ final class StorageData implements IWorldGridStorageData, IOnWorldStartable, IOn
|
||||
// populate new data
|
||||
for( final GridStorageSearch gs : this.loadedStorage.keySet() )
|
||||
{
|
||||
final GridStorage thisStorage = gs.gridStorage.get();
|
||||
final GridStorage thisStorage = gs.getGridStorage().get();
|
||||
if( thisStorage != null && thisStorage.getGrid() != null && !thisStorage.getGrid().isEmpty() )
|
||||
{
|
||||
final String value = thisStorage.getValue();
|
||||
|
||||
Reference in New Issue
Block a user