Replaced C-style array instantiation with Java-Style

This commit is contained in:
thatsIch
2015-01-01 21:15:03 +01:00
parent e38293a291
commit 8179259afa
48 changed files with 69 additions and 69 deletions
@@ -61,7 +61,7 @@ public class BaseBlockRender
final double MAX_DISTANCE;
final public boolean hasTESR;
final static private byte OrientationMap[][][] = new byte[6][6][6];
final static private byte[][][] OrientationMap = new byte[6][6][6];
protected int adjustBrightness(int v, double d)
{
@@ -277,7 +277,7 @@ public class BusRenderHelper implements IPartRenderHelper
@Override
public void setTexture(IIcon Down, IIcon Up, IIcon North, IIcon South, IIcon West, IIcon East)
{
IIcon list[] = new IIcon[6];
IIcon[] list = new IIcon[6];
list[0] = Down;
list[1] = Up;
@@ -56,7 +56,7 @@ public class RenderBlockPaint extends BaseBlockRender
{
// super.renderInWorld( imb, world, x, y, z, renderer );
IIcon icoSet[] = new IIcon[] { imb.getIcon( 0, 0 ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() };
IIcon[] icoSet = new IIcon[] { imb.getIcon( 0, 0 ), ExtraBlockTextures.BlockPaint2.getIcon(), ExtraBlockTextures.BlockPaint3.getIcon() };
Tessellator tess = Tessellator.instance;
@@ -77,7 +77,7 @@ public class RenderBlockWireless extends BaseBlockRender
ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );
ForgeDirection sides[] = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };
ForgeDirection[] sides = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };
int s = 1;
@@ -147,7 +147,7 @@ public class RenderBlockWireless extends BaseBlockRender
ri.setTemporaryRenderIcons( r, r, ExtraBlockTextures.BlockWirelessInside.getIcon(), ExtraBlockTextures.BlockWirelessInside.getIcon(), r, r );
ForgeDirection sides[] = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };
ForgeDirection[] sides = new ForgeDirection[] { ForgeDirection.EAST, ForgeDirection.WEST, ForgeDirection.UP, ForgeDirection.DOWN };
int s = 1;
@@ -35,7 +35,7 @@ import appeng.client.texture.OffsetIcon;
public class RenderQuartzGlass extends BaseBlockRender
{
static byte offsets[][][];
static byte[][][] offsets;
public RenderQuartzGlass() {
super( false, 0 );
@@ -94,8 +94,8 @@ public class LightningFX extends EntityFX
double scale = 0.02;// 0.02F * this.particleScale;
double a[] = new double[3];
double b[] = new double[3];
double[] a = new double[3];
double[] b = new double[3];
double ox = 0;
double oy = 0;
@@ -170,7 +170,7 @@ public class SlotCraftingTerm extends AppEngCraftingSlot
return true;
}
public void postCraft( EntityPlayer p, IMEMonitor<IAEItemStack> inv, ItemStack set[], ItemStack result )
public void postCraft( EntityPlayer p, IMEMonitor<IAEItemStack> inv, ItemStack[] set, ItemStack result )
{
List<ItemStack> drops = new ArrayList<ItemStack>();
+1 -1
View File
@@ -120,7 +120,7 @@ public class AEConfig extends Configuration implements IConfigurableObject, ICon
public double spatialPowerExponent = 1.35;
public double spatialPowerMultiplier = 1250.0;
public String grinderOres[] = {
public String[] grinderOres = {
// Vanilla Items
"Obsidian", "Ender", "EnderPearl", "Coal", "Iron", "Gold", "Charcoal", "NetherQuartz",
// Common Mod Ores
@@ -84,7 +84,7 @@ public class ColoredItemDefinition implements AEColoredItemDefinition
@Override
public ItemStack[] allStacks(int stackSize)
{
ItemStack is[] = new ItemStack[this.colors.length];
ItemStack[] is = new ItemStack[this.colors.length];
for (int x = 0; x < is.length; x++)
is[x] = this.colors[x].stack( 1 );
return is;
@@ -86,7 +86,7 @@ public class PacketMEInventoryUpdate extends AppEngPacket
} );
ByteBuf uncompressed = Unpooled.buffer( stream.readableBytes() );
byte tmp[] = new byte[1024];
byte[] tmp = new byte[1024];
while (gzReader.available() != 0)
{
int bytes = gzReader.read( tmp );
@@ -39,7 +39,7 @@ public class PacketPatternSlot extends AppEngPacket
final public IAEItemStack slotItem;
final public IAEItemStack pattern[] = new IAEItemStack[9];
final public IAEItemStack[] pattern = new IAEItemStack[9];
final public boolean shift;
@@ -69,7 +69,7 @@ public class CraftingTreeProcess
if ( details.isCraftable() )
{
IAEItemStack list[] = details.getInputs();
IAEItemStack[] list = details.getInputs();
InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
IAEItemStack[] is = details.getInputs();
+3 -3
View File
@@ -84,9 +84,9 @@ import appeng.util.Platform;
public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IRedstonePart, AEMultiTile
{
final static Cuboid6 sideTests[] = new Cuboid6[] {
final static Cuboid6[] sideTests = new Cuboid6[] {
new Cuboid6( 6.0 / 16.0, 0, 6.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0 ), // DOWN(0, -1, 0),
new Cuboid6( 6.0 / 16.0, 0, 6.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0 ), // DOWN(0, -1, 0),
new Cuboid6( 6.0 / 16.0, 10.0 / 16.0, 6.0 / 16.0, 10.0 / 16.0, 1.0, 10.0 / 16.0 ), // UP(0, 1, 0),
@@ -167,7 +167,7 @@ public class CableBusPart extends JCuboidPart implements JNormalOcclusion, IReds
public void readDesc(MCDataInput packet)
{
int len = packet.readInt();
byte data[] = packet.readByteArray( len );
byte[] data = packet.readByteArray( len );
try
{
@@ -97,8 +97,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
IConfigManagerHost, ICraftingProvider, IUpgradeableHost, IPriorityHost
{
final int sides[] = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };
final IAEItemStack requireWork[] = new IAEItemStack[] { null, null, null, null, null, null, null, null };
final int[] sides = new int[] { 0, 1, 2, 3, 4, 5, 6, 7 };
final IAEItemStack[] requireWork = new IAEItemStack[] { null, null, null, null, null, null, null, null };
final MultiCraftingTracker craftingTracker;
boolean hasConfig = false;
@@ -128,7 +128,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
public void updateCraftingList()
{
Boolean accountedFor[] = new Boolean[] { false, false, false, false, false, false, false, false, false }; // 9...
Boolean[] accountedFor = new Boolean[] { false, false, false, false, false, false, false, false, false }; // 9...
assert (accountedFor.length == this.patterns.getSizeInventory());
@@ -53,10 +53,10 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
final ItemStack correctOutput;
final IRecipe standardRecipe;
final IAEItemStack condensedInputs[];
final IAEItemStack condensedOutputs[];
final IAEItemStack inputs[];
final IAEItemStack outputs[];
final IAEItemStack[] condensedInputs;
final IAEItemStack[] condensedOutputs;
final IAEItemStack[] inputs;
final IAEItemStack[] outputs;
final boolean isCrafting;
public int priority = 0;
@@ -336,8 +336,8 @@ public class BC extends BaseModule implements IBC
{
try
{
Block blk[] = ItemFacade.getBlocks( facade );
int meta[] = ItemFacade.getMetaValues( facade );
Block[] blk = ItemFacade.getBlocks( facade );
int[] meta = ItemFacade.getMetaValues( facade );
if ( blk == null || blk.length < 1 )
return null;
@@ -94,9 +94,9 @@ public class FMP implements IIntegrationModule, IPartFactory, IPartConverter, IF
this.createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 2 );
this.createAndRegister( AEApi.instance().blocks().blockSkyStone.block(), 3 );
PartRegistry reg[] = PartRegistry.values();
PartRegistry[] reg = PartRegistry.values();
String data[] = new String[reg.length];
String[] data = new String[reg.length];
for (int x = 0; x < data.length; x++)
data[x] = reg[x].getName();
@@ -196,7 +196,7 @@ public class ItemMultiMaterial extends AEBaseItem implements IStorageComponent,
{
ItemStack replacement = null;
String names[] = mt.getOreName().split( "," );
String[] names = mt.getOreName().split( "," );
for (String name : names)
{
@@ -173,7 +173,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
@Override
public IIcon getIconIndex(ItemStack stack)
{
IIcon list[] = null;
IIcon[] list = null;
int damage = this.getProgress( stack );
@@ -57,7 +57,7 @@ public class QuantumCluster implements ILocatable, IAECluster
ConnectionWrapper connection;
public TileQuantumBridge Ring[];
public TileQuantumBridge[] Ring;
private TileQuantumBridge center;
@Override
@@ -107,7 +107,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
public void rotateLeft()
{
IPart newSides[] = new IPart[6];
IPart[] newSides = new IPart[6];
newSides[ForgeDirection.UP.ordinal()] = this.getSide( ForgeDirection.UP );
newSides[ForgeDirection.DOWN.ordinal()] = this.getSide( ForgeDirection.DOWN );
@@ -31,8 +31,8 @@ public class CableBusStorage
{
private IPartCable center;
private IPart sides[];
private IFacadePart facades[];
private IPart[] sides;
private IFacadePart[] facades;
protected IPartCable getCenter()
{
@@ -31,11 +31,11 @@ public class InvLayerData
private final static int[] nullSides = new int[] {};
// cache of inventory state.
final private int sides[][];
final private int[][] sides;
final private List<ISidedInventory> inventories;
final private List<InvSot> slots;
public InvLayerData(int a[][], List<ISidedInventory> b, List<InvSot> c) {
public InvLayerData( int[][] a, List<ISidedInventory> b, List<InvSot> c) {
this.sides = a;
this.inventories = b;
this.slots = c;
@@ -57,7 +57,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
public void notifyNeighbors()
{
// cache of inventory state.
int sideData[][] = null;
int[][] sideData = null;
List<ISidedInventory> inventories = null;
List<InvSot> slots = null;
@@ -99,7 +99,7 @@ public class LayerISidedInventory extends LayerBase implements ISidedInventory
break;
}
int cSidesList[] = sideData[currentSide.ordinal()] = new int[slotCount];
int[] cSidesList = sideData[currentSide.ordinal()] = new int[slotCount];
for (int cSlot = 0; cSlot < slotCount; cSlot++)
{
cSidesList[cSlot] = offsetForLayer;
@@ -38,7 +38,7 @@ public class Crusher implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient pro_output[];
IIngredient[] pro_output;
@Override
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
@@ -36,7 +36,7 @@ public class Grind implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient pro_output[];
IIngredient[] pro_output;
@Override
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
@@ -38,7 +38,7 @@ public class GrindFZ implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient pro_output[];
IIngredient[] pro_output;
@Override
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
@@ -38,7 +38,7 @@ public class HCCrusher implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient pro_output[];
IIngredient[] pro_output;
@Override
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
@@ -38,7 +38,7 @@ public class Macerator implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient pro_output[];
IIngredient[] pro_output;
@Override
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
@@ -38,7 +38,7 @@ public class MekCrusher implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient pro_output[];
IIngredient[] pro_output;
@Override
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
@@ -38,7 +38,7 @@ public class MekEnrichment implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient pro_output[];
IIngredient[] pro_output;
@Override
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
@@ -37,7 +37,7 @@ public class Pulverizer implements ICraftHandler, IWebsiteSerializer
{
IIngredient pro_input;
IIngredient pro_output[];
IIngredient[] pro_output;
@Override
public void setup(List<List<IIngredient>> input, List<List<IIngredient>> output) throws RecipeError
@@ -49,7 +49,7 @@ public class CachedPlane
private final int x;
private final int z;
private final Chunk c;
private final Object ch[] = { 0, 0, 0 };
private final Object[] ch = { 0, 0, 0 };
private List<Integer> skipThese = null;
private final ExtendedBlockStorage[] storage;
@@ -41,8 +41,8 @@ public class TileGrinder extends AEBaseInvTile implements ICrankable
int points;
final int inputs[] = new int[] { 0, 1, 2 };
final int sides[] = new int[] { 0, 1, 2, 3, 4, 5 };
final int[] inputs = new int[] { 0, 1, 2 };
final int[] sides = new int[] { 0, 1, 2, 3, 4, 5 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 7 );
@Override
@@ -51,7 +51,7 @@ import appeng.util.item.AEItemStack;
public class TileCharger extends AENetworkPowerTile implements ICrankable
{
final int sides[] = new int[] { 0 };
final int[] sides = new int[] { 0 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
int tickTickTimer = 0;
@@ -63,9 +63,9 @@ import appeng.util.item.AEItemStack;
public class TileInscriber extends AENetworkPowerTile implements IGridTickable, IUpgradeableHost, IConfigManagerHost
{
final int top[] = new int[] { 0 };
final int bottom[] = new int[] { 1 };
final int sides[] = new int[] { 2, 3 };
final int[] top = new int[] { 0 };
final int[] bottom = new int[] { 1 };
final int[] sides = new int[] { 2, 3 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 4 );
@@ -47,7 +47,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
final double powerPerTick = 5;
final int sides[] = new int[] { 0 };
final int[] sides = new int[] { 0 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
public int burnSpeed = 100;
@@ -172,7 +172,7 @@ public class TileController extends AENetworkPowerTile
this.worldObj.setBlockMetadataWithNotify( this.xCoord, this.yCoord, this.zCoord, meta, 2 );
}
final int sides[] = new int[] {};
final int[] sides = new int[] { };
static final AppEngInternalInventory inv = new AppEngInternalInventory( null, 0 );
@Override
@@ -36,7 +36,7 @@ import appeng.tile.inventory.InvOperation;
public class TileEnergyAcceptor extends AENetworkPowerTile
{
final int sides[] = new int[] {};
final int[] sides = new int[] { };
final static AppEngInternalInventory inv = new AppEngInternalInventory( null, 0 );
@Override
@@ -54,7 +54,7 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
public static final int POWERED_FLAG = 1;
public static final int CHANNEL_FLAG = 2;
final int sides[] = new int[] { 0 };
final int[] sides = new int[] { 0 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 1 );
public int clientFlags = 0;
@@ -50,7 +50,7 @@ import appeng.util.Platform;
public class TileSpatialIOPort extends AENetworkInvTile implements Callable
{
final int sides[] = { 0, 1 };
final int[] sides = { 0, 1 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
YesNo lastRedstoneState = YesNo.UNDECIDED;
@@ -103,9 +103,9 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, IFluidHan
static final ChestNoHandler noHandler = new ChestNoHandler();
static final int sides[] = new int[] { 0 };
static final int front[] = new int[] { 1 };
static final int noSlots[] = new int[] {};
static final int[] sides = new int[] { 0 };
static final int[] front = new int[] { 1 };
static final int[] noSlots = new int[] { };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
final BaseActionSource mySrc = new MachineSource( this );
@@ -60,7 +60,7 @@ import appeng.util.Platform;
public class TileDrive extends AENetworkInvTile implements IChestOrDrive, IPriorityHost
{
final int sides[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
final int[] sides = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 10 );
boolean isCached = false;
@@ -72,10 +72,10 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
final ConfigManager cm = new ConfigManager( this );
final int input[] = { 0, 1, 2, 3, 4, 5 };
final int output[] = { 6, 7, 8, 9, 10, 11 };
final int[] input = { 0, 1, 2, 3, 4, 5 };
final int[] output = { 6, 7, 8, 9, 10, 11 };
final int outputSlots[] = { 6, 7, 8, 9, 10, 11 };
final int[] outputSlots = { 6, 7, 8, 9, 10, 11 };
final AppEngInternalInventory cells = new AppEngInternalInventory( this, 12 );
final UpgradeInventory upgrades = new UpgradeInventory( AEApi.instance().blocks().blockIOPort.block(), this, 3 );
@@ -34,7 +34,7 @@ import appeng.util.Platform;
public class TileSkyChest extends AEBaseInvTile
{
final int sides[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 };
final int[] sides = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 };
final AppEngInternalInventory inv = new AppEngInternalInventory( this, 9 * 4 );
@TileEvent(TileEventType.NETWORK_WRITE)
+1 -1
View File
@@ -181,7 +181,7 @@ public class Platform
int offset = 0;
String Lvl = "";
String preFixes[] = new String[] { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" };
String[] preFixes = new String[] { "k", "M", "G", "T", "P", "T", "P", "E", "Z", "Y" };
String unitName = displayUnits.name();
if ( displayUnits == PowerUnits.WA )
@@ -104,7 +104,7 @@ public class AdaptorISpecialInventory extends InventoryAdaptor
if ( this.i instanceof ISidedInventory )
{
ISidedInventory sided = (ISidedInventory) this.i;
int slots[] = sided.getAccessibleSlotsFromSide( this.d.ordinal() );
int[] slots = sided.getAccessibleSlotsFromSide( this.d.ordinal() );
if ( slots == null )
return false;
@@ -276,7 +276,7 @@ public final class AEFluidStack extends AEStack<IAEFluidStack> implements IAEFlu
NBTTagCompound d = new NBTTagCompound();
byte len2 = data.readByte();
byte name[] = new byte[len2];
byte[] name = new byte[len2];
data.readBytes( name, 0, len2 );
d.setString( "FluidName", new String( name, "UTF-8" ) );