mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-26 14:53:05 +00:00
Close #477 Auto-Format code with new formatting settings
This commit is contained in:
1 parent
8e92d16320
commit
5b8b0c78b0
763 files changed
+13174
-8868
No files matched your search
@@ -4,21 +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.apiculture.genetics;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import forestry.core.vect.Vect;
|
||||
import java.lang.reflect.Field;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MutationEMC extends MutationReqRes {
|
||||
|
||||
@@ -40,26 +42,30 @@ public class MutationEMC extends MutationReqRes {
|
||||
float chance = super.getChance(housing, allele0, allele1, genome0, genome1);
|
||||
|
||||
// If we don't have any chance, return at once.
|
||||
if (chance <= 0)
|
||||
if (chance <= 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (emcRequired <= 0)
|
||||
if (emcRequired <= 0) {
|
||||
return chance;
|
||||
}
|
||||
|
||||
World world = housing.getWorld();
|
||||
|
||||
Vect[] possibleTargets = new Vect[] { new Vect(housing.getXCoord() + 1, housing.getYCoord(), housing.getZCoord()),
|
||||
Vect[] possibleTargets = new Vect[]{new Vect(housing.getXCoord() + 1, housing.getYCoord(), housing.getZCoord()),
|
||||
new Vect(housing.getXCoord() - 1, housing.getYCoord(), housing.getZCoord()),
|
||||
new Vect(housing.getXCoord(), housing.getYCoord(), housing.getZCoord() + 1),
|
||||
new Vect(housing.getXCoord(), housing.getYCoord(), housing.getZCoord() - 1) };
|
||||
new Vect(housing.getXCoord(), housing.getYCoord(), housing.getZCoord() - 1)};
|
||||
|
||||
for (Vect target : possibleTargets) {
|
||||
if (!world.blockExists(target.x, target.y, target.z))
|
||||
if (!world.blockExists(target.x, target.y, target.z)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
TileEntity entity = world.getTileEntity(target.x, target.y, target.z);
|
||||
if (entity == null)
|
||||
if (entity == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!condenserClass.isInstance(entity)) {
|
||||
Proxies.log.warning("Did not find a relay at " + target.toString());
|
||||
@@ -73,8 +79,9 @@ public class MutationEMC extends MutationReqRes {
|
||||
Proxies.log.warning("Failed to fetch EMC information.");
|
||||
}
|
||||
|
||||
if (emc < emcRequired * 80)
|
||||
if (emc < emcRequired * 80) {
|
||||
continue;
|
||||
}
|
||||
|
||||
boolean removedEMC = false;
|
||||
try {
|
||||
@@ -84,8 +91,9 @@ public class MutationEMC extends MutationReqRes {
|
||||
Proxies.log.warning("Failed to set EMC information.");
|
||||
}
|
||||
|
||||
if (removedEMC)
|
||||
if (removedEMC) {
|
||||
return chance;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user