Close #477 Auto-Format code with new formatting settings

This commit is contained in:
mezz committed 2015-01-26 22:26:21 -08:00
1 parent 8e92d16320
commit 5b8b0c78b0
763 files changed
+13174 -8868

No files matched your search

@@ -4,14 +4,23 @@
* are made available under the terms of the GNU Lesser Public License v3
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/lgpl-3.0.txt
*
*
* Various Contributors including, but not limited to:
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
******************************************************************************/
package forestry.arboriculture;
import java.util.Locale;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import forestry.api.arboriculture.EnumTreeChromosome;
import forestry.api.arboriculture.IAlleleFruit;
import forestry.api.arboriculture.ITreeGenome;
@@ -19,23 +28,17 @@ import forestry.api.genetics.IFruitFamily;
import forestry.core.render.TextureManager;
import forestry.core.utils.BlockUtil;
import forestry.plugins.PluginArboriculture;
import java.util.Locale;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class FruitProviderPod extends FruitProviderNone {
public static enum EnumPodType {
COCOA((short) 2000, (short) 2001, (short) 2002), DATES((short) 2010, (short) 2011, (short) 2012),
PAPAYA((short)2013, (short)2014, (short)2015);//, COCONUT((short)2016, (short)2017, (short)2018);
PAPAYA((short) 2013, (short) 2014, (short) 2015);//, COCONUT((short)2016, (short)2017, (short)2018);
public final short[] uids;
private EnumPodType(short stage1, short stage2, short stage3) {
uids = new short[] { stage1, stage2, stage3 };
uids = new short[]{stage1, stage2, stage3};
}
}
@@ -57,13 +60,15 @@ public class FruitProviderPod extends FruitProviderNone {
@Override
public ItemStack[] getFruits(ITreeGenome genome, World world, int x, int y, int z, int ripeningTime) {
if (drop == null || drop.length == 0)
if (drop == null || drop.length == 0) {
return DUMMY;
}
if (ripeningTime >= 2) {
ItemStack[] dropping = new ItemStack[drop.length];
for (int i = 0; i < drop.length; i++)
for (int i = 0; i < drop.length; i++) {
dropping[i] = drop[i].copy();
}
return dropping;
}
@@ -73,12 +78,13 @@ public class FruitProviderPod extends FruitProviderNone {
@Override
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, int x, int y, int z) {
if (world.rand.nextFloat() > genome.getSappiness())
if (world.rand.nextFloat() > genome.getSappiness()) {
return false;
}
if (type == EnumPodType.COCOA)
if (type == EnumPodType.COCOA) {
return BlockUtil.tryPlantPot(world, x, y, z, Blocks.cocoa);
else {
} else {
return PluginArboriculture.treeInterface.setFruitBlock(world, (IAlleleFruit) genome.getActiveAllele(EnumTreeChromosome.FRUITS),
genome.getSappiness(), type.uids, x, y, z);
}
@@ -92,8 +98,9 @@ public class FruitProviderPod extends FruitProviderNone {
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister register) {
if (type == EnumPodType.COCOA)
if (type == EnumPodType.COCOA) {
return;
}
TextureManager.getInstance().registerTexUID(register, type.uids[0], "pods/" + type.toString().toLowerCase(Locale.ENGLISH) + ".0");
TextureManager.getInstance().registerTexUID(register, type.uids[1], "pods/" + type.toString().toLowerCase(Locale.ENGLISH) + ".1");