mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-27 23:33:00 +00:00
Simple Cleanup
This commit is contained in:
1 parent
09df969bcf
commit
e2fff11ea8
141 files changed
+545
-859
No files matched your search
@@ -43,8 +43,8 @@ public class FruitProviderNone implements IFruitProvider {
|
||||
overlayTypes.put("plums", new OverlayType("plums", (short) 1004));
|
||||
}
|
||||
|
||||
String key;
|
||||
IFruitFamily family = null;
|
||||
private final String key;
|
||||
private final IFruitFamily family;
|
||||
|
||||
int ripeningPeriod = 10;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class FruitProviderPod extends FruitProviderNone {
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack[] DUMMY = new ItemStack[0];
|
||||
private static final ItemStack[] DUMMY = new ItemStack[0];
|
||||
|
||||
private final EnumPodType type;
|
||||
private final ItemStack[] drop;
|
||||
|
||||
@@ -93,10 +93,7 @@ public class BlockArbFence extends BlockFence implements IWoodTyped {
|
||||
|
||||
public boolean isFence(IBlockAccess world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (PluginArboriculture.validFences.contains(block))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
return PluginArboriculture.validFences.contains(block);
|
||||
}
|
||||
|
||||
/* PROPERTIES */
|
||||
|
||||
@@ -341,9 +341,7 @@ public class TileLeaves extends TileTreeContainer implements IPollinatable, IFru
|
||||
**/
|
||||
@Override
|
||||
public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) {
|
||||
if (!Block.isEqualTo(oldBlock, newBlock))
|
||||
return true;
|
||||
return false;
|
||||
return !Block.isEqualTo(oldBlock, newBlock);
|
||||
}
|
||||
|
||||
/* IFRUITBEARER */
|
||||
|
||||
@@ -218,10 +218,7 @@ public class Tree extends Individual implements ITree, ITreeGenData, IPlantable
|
||||
return false;
|
||||
|
||||
Collection<IFruitFamily> suitable = genome.getPrimary().getSuitableFruit();
|
||||
if (!suitable.contains(provider.getFamily()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return suitable.contains(provider.getFamily());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -360,18 +357,17 @@ public class Tree extends Individual implements ITree, ITreeGenData, IPlantable
|
||||
}
|
||||
|
||||
for (ITreeMutation mutation : PluginArboriculture.treeInterface.getMutations(true)) {
|
||||
float chance = 0;
|
||||
|
||||
// Stop blacklisted species.
|
||||
// if (BeeManager.breedingManager.isBlacklisted(mutation.getTemplate()[0].getUID())) {
|
||||
// continue;
|
||||
// }
|
||||
|
||||
if ((chance = mutation.getChance(world, x, y, z, allele0, allele1, genome0, genome1)) > 0)
|
||||
if (world.rand.nextFloat()*100 < chance)
|
||||
// IApiaristTracker breedingTracker = BeeManager.breedingManager.getApiaristTracker(world);
|
||||
// breedingTracker.registerMutation(mutation);
|
||||
return PluginArboriculture.treeInterface.templateAsChromosomes(mutation.getTemplate());
|
||||
float chance = mutation.getChance(world, x, y, z, allele0, allele1, genome0, genome1);
|
||||
if (chance > world.rand.nextFloat() * 100) {
|
||||
// IApiaristTracker breedingTracker = BeeManager.breedingManager.getApiaristTracker(world);
|
||||
// breedingTracker.registerMutation(mutation);
|
||||
return PluginArboriculture.treeInterface.templateAsChromosomes(mutation.getTemplate());
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
@@ -10,8 +10,24 @@
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.genetics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Locale;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
|
||||
import forestry.api.arboriculture.EnumGermlingType;
|
||||
import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.arboriculture.IAlleleFruit;
|
||||
@@ -38,19 +54,6 @@ import forestry.core.config.ForestryItem;
|
||||
import forestry.core.genetics.SpeciesRoot;
|
||||
import forestry.core.utils.BlockUtil;
|
||||
import forestry.plugins.PluginArboriculture;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Locale;
|
||||
import java.util.Map.Entry;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TreeHelper extends SpeciesRoot implements ITreeRoot {
|
||||
|
||||
@@ -79,9 +82,7 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot {
|
||||
public int getSpeciesCount() {
|
||||
if (treeSpeciesCount < 0) {
|
||||
treeSpeciesCount = 0;
|
||||
Iterator<Entry<String, IAllele>> it = AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet().iterator();
|
||||
while (it.hasNext()) {
|
||||
Entry<String, IAllele> entry = it.next();
|
||||
for (Entry<String, IAllele> entry : AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) {
|
||||
if (entry.getValue() instanceof IAlleleTreeSpecies)
|
||||
if (((IAlleleTreeSpecies) entry.getValue()).isCounted())
|
||||
treeSpeciesCount++;
|
||||
|
||||
@@ -10,19 +10,20 @@
|
||||
******************************************************************************/
|
||||
package forestry.arboriculture.gui;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.arboriculture.items.ItemGermlingGE;
|
||||
import forestry.arboriculture.items.ItemTreealyzer.TreealyzerInventory;
|
||||
import forestry.core.config.ForestryItem;
|
||||
import forestry.core.gui.ContainerAlyzer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
public class ContainerTreealyzer extends ContainerAlyzer {
|
||||
|
||||
TreealyzerInventory inventory;
|
||||
private static Object[] acceptedEnergy = new Object[] {ForestryItem.honeydew, ForestryItem.honeyDrop};
|
||||
private static Object[] acceptedSpecimens = ArrayUtils.addAll(AlleleManager.ersatzSaplings.keySet().toArray(), ItemGermlingGE.class);
|
||||
private static final Object[] acceptedEnergy = new Object[] {ForestryItem.honeydew, ForestryItem.honeyDrop};
|
||||
private static final Object[] acceptedSpecimens = ArrayUtils.addAll(AlleleManager.ersatzSaplings.keySet().toArray(), ItemGermlingGE.class);
|
||||
|
||||
public ContainerTreealyzer(InventoryPlayer inventoryplayer, TreealyzerInventory inventory) {
|
||||
super(inventoryplayer, inventory, acceptedEnergy, acceptedSpecimens);
|
||||
|
||||
@@ -50,10 +50,8 @@ public class LeavesRenderingHandler extends OverlayRenderingHandler implements I
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
|
||||
// Render overlay for fruit leaves.
|
||||
IIcon fruitIcon = null;
|
||||
int fruitColor = 0xffffff;
|
||||
fruitIcon = tile.getFruitTexture();
|
||||
fruitColor = tile.getFruitColour();
|
||||
IIcon fruitIcon = tile.getFruitTexture();
|
||||
int fruitColor = tile.getFruitColour();
|
||||
|
||||
if (fruitIcon != null)
|
||||
renderFruitOverlay(world, block, x, y, z, renderer, fruitIcon, fruitColor);
|
||||
|
||||
@@ -39,10 +39,10 @@ public class SaplingRenderHandler implements ISimpleBlockRenderingHandler {
|
||||
|
||||
TileSapling tile = BlockSapling.getSaplingTile(world, x, y, z);
|
||||
|
||||
IAlleleTreeSpecies species = (IAlleleTreeSpecies) PluginArboriculture.treeInterface.getDefaultTemplate()[0];
|
||||
if (tile == null || tile.getTree() == null)
|
||||
return true;
|
||||
species = tile.getTree().getGenome().getPrimary();
|
||||
|
||||
IAlleleTreeSpecies species = tile.getTree().getGenome().getPrimary();
|
||||
|
||||
renderCrossedSquares(species, world, block, x, y, z);
|
||||
renderLayer = 1;
|
||||
|
||||
Reference in new issue
Block a user