mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-17 19:15:24 +00:00
Work on extra trees
This commit is contained in:
1 parent
192943cb3e
commit
f0d8d6b89d
53 files changed
+1636
-987
No files matched your search
@@ -1,18 +1,5 @@
|
||||
package binnie;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import forestry.core.fluids.BlockForestryFluid;
|
||||
import forestry.core.fluids.Fluids;
|
||||
import forestry.core.items.DrinkProperties;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public final class Constants {
|
||||
public static final String CORE_MOD_ID = "binniecore";
|
||||
public static final String BOTANY_MOD_ID = "botany";
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
@@ -62,6 +63,11 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer) {
|
||||
return layer == BlockRenderLayer.CUTOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetaFromState(IBlockState state) {
|
||||
|
||||
@@ -9,10 +9,8 @@ import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.network.packet.MessageBase;
|
||||
import forestry.core.models.BlockModelEntry;
|
||||
import forestry.core.models.ModelEntry;
|
||||
import forestry.core.models.ModelManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
@@ -13,7 +13,6 @@ import binnie.craftgui.window.Panel;
|
||||
import binnie.extratrees.core.ExtraTreeTexture;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillMachine;
|
||||
import binnie.extratrees.machines.lumbermill.LumbermillRecipes;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@@ -31,7 +31,6 @@ import binnie.extratrees.proxy.Proxy;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
import forestry.arboriculture.blocks.BlockDecorativeLeaves;
|
||||
import forestry.arboriculture.blocks.BlockForestryStairs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
@@ -166,7 +165,7 @@ public class ExtraTrees extends AbstractMod {
|
||||
@SubscribeEvent
|
||||
public void speciesRegister(AlleleSpeciesRegisterEvent event) {
|
||||
if (event.getRoot() instanceof ITreeRoot) {
|
||||
for (final ExtraTreeFruitGene fruit : ExtraTreeFruitGene.values()) {
|
||||
for (final AlleleETFruit fruit : AlleleETFruit.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(fruit);
|
||||
}
|
||||
ETTreeDefinition.preInitTrees();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
|
||||
public enum FruitPod {
|
||||
@@ -21,6 +23,10 @@ public enum FruitPod {
|
||||
public short[] getTextures() {
|
||||
return this.textures;
|
||||
}
|
||||
|
||||
public String getModelName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
|
||||
@@ -6,8 +6,6 @@ import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import forestry.api.arboriculture.IFruitProvider;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.arboriculture.blocks.BlockDecorativeLeaves;
|
||||
import forestry.arboriculture.genetics.TreeDefinition;
|
||||
import forestry.arboriculture.items.ItemBlockLeaves;
|
||||
import forestry.core.items.IColoredItem;
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
|
||||
@@ -26,11 +26,7 @@ import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.arboriculture.WoodBlockKind;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import forestry.arboriculture.WoodAccess;
|
||||
import forestry.arboriculture.blocks.BlockDecorativeLeaves;
|
||||
import forestry.arboriculture.blocks.BlockForestryStairs;
|
||||
import forestry.arboriculture.genetics.LeafProvider;
|
||||
import forestry.arboriculture.genetics.TreeDefinition;
|
||||
import forestry.arboriculture.items.ItemBlockDecorativeLeaves;
|
||||
import forestry.core.recipes.RecipeUtil;
|
||||
import forestry.core.utils.OreDictUtil;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
@@ -5,7 +5,6 @@ import javax.annotation.Nullable;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import forestry.arboriculture.genetics.TreeDefinition;
|
||||
|
||||
public class TreeTypePredicate implements Predicate<ETTreeDefinition> {
|
||||
private final int minMeta;
|
||||
|
||||
@@ -7,7 +7,7 @@ import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.api.IDesignMaterial;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import binnie.extratrees.genetics.ExtraTreeFruitGene;
|
||||
import binnie.extratrees.genetics.AlleleETFruit;
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
@@ -45,15 +45,15 @@ public class ModuleCore implements IInitializable {
|
||||
Collections.addAll(logQueue, EnumExtraTreeLog.values());
|
||||
final Queue<IDesignMaterial> plankQueue = new LinkedList<>();
|
||||
Collections.addAll(plankQueue, PlankType.ExtraTreePlanks.values());
|
||||
final Queue<ExtraTreeFruitGene> fruitQueue = new LinkedList<>();
|
||||
for (final ExtraTreeFruitGene wood3 : ExtraTreeFruitGene.values()) {
|
||||
final Queue<AlleleETFruit> fruitQueue = new LinkedList<>();
|
||||
for (final AlleleETFruit wood3 : AlleleETFruit.values()) {
|
||||
fruitQueue.add(wood3);
|
||||
}
|
||||
final Queue<IDesign> designQueue = new LinkedList<>();
|
||||
for (final IDesign wood4 : CarpentryManager.carpentryInterface.getSortedDesigns()) {
|
||||
designQueue.add(wood4);
|
||||
}
|
||||
fruitQueue.remove(ExtraTreeFruitGene.Apple);
|
||||
fruitQueue.remove(AlleleETFruit.Apple);
|
||||
outputSpecies.println("<table style=\"width: 100%;\">");
|
||||
while (!speciesQueue.isEmpty()) {
|
||||
outputSpecies.println("<tr>");
|
||||
@@ -98,7 +98,7 @@ public class ModuleCore implements IInitializable {
|
||||
while (!fruitQueue.isEmpty()) {
|
||||
outputFruit.println("<tr>");
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
final ExtraTreeFruitGene wood6 = fruitQueue.poll();
|
||||
final AlleleETFruit wood6 = fruitQueue.poll();
|
||||
if (wood6 == null) {
|
||||
outputFruit.println("<td></td>");
|
||||
} else {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAlder {
|
||||
public static class CommonAlder extends WorldGenTree {
|
||||
public CommonAlder(final ITree tree) {
|
||||
public CommonAlder(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenApple {
|
||||
public static class OrchardApple extends WorldGenTree {
|
||||
public OrchardApple(final ITree tree) {
|
||||
public OrchardApple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public class WorldGenApple {
|
||||
}
|
||||
|
||||
public static class SweetCrabapple extends WorldGenTree {
|
||||
public SweetCrabapple(final ITree tree) {
|
||||
public SweetCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ public class WorldGenApple {
|
||||
}
|
||||
|
||||
public static class FloweringCrabapple extends WorldGenTree {
|
||||
public FloweringCrabapple(final ITree tree) {
|
||||
public FloweringCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ public class WorldGenApple {
|
||||
}
|
||||
|
||||
public static class PrairieCrabapple extends WorldGenTree {
|
||||
public PrairieCrabapple(final ITree tree) {
|
||||
public PrairieCrabapple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenAsh {
|
||||
public static class CommonAsh extends WorldGenTree {
|
||||
public CommonAsh(final ITree tree) {
|
||||
public CommonAsh(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBanana extends WorldGenTree {
|
||||
public WorldGenBanana(final ITree tree) {
|
||||
public WorldGenBanana(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenBeech {
|
||||
public static class CommonBeech extends WorldGenTree {
|
||||
public CommonBeech(final ITree tree) {
|
||||
public CommonBeech(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class WorldGenBeech {
|
||||
}
|
||||
|
||||
public static class CopperBeech extends CommonBeech {
|
||||
public CopperBeech(final ITree tree) {
|
||||
public CopperBeech(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenConifer {
|
||||
public static class WesternHemlock extends WorldGenTree {
|
||||
public WesternHemlock(final ITree tree) {
|
||||
public WesternHemlock(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class WorldGenConifer {
|
||||
}
|
||||
|
||||
public static class Cypress extends WorldGenTree {
|
||||
public Cypress(final ITree tree) {
|
||||
public Cypress(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public class WorldGenConifer {
|
||||
}
|
||||
|
||||
public static class Yew extends WorldGenTree {
|
||||
public Yew(final ITree tree) {
|
||||
public Yew(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ public class WorldGenConifer {
|
||||
}
|
||||
|
||||
public static class Cedar extends WorldGenTree {
|
||||
public Cedar(final ITree tree) {
|
||||
public Cedar(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class WorldGenConifer {
|
||||
}
|
||||
|
||||
public static class LoblollyPine extends WorldGenTree {
|
||||
public LoblollyPine(final ITree tree) {
|
||||
public LoblollyPine(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ public class WorldGenConifer {
|
||||
}
|
||||
|
||||
public static class MonkeyPuzzle extends WorldGenTree {
|
||||
public MonkeyPuzzle(final ITree tree) {
|
||||
public MonkeyPuzzle(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenEucalyptus {
|
||||
public static class SwampGum extends WorldGenTree {
|
||||
public SwampGum(final ITree tree) {
|
||||
public SwampGum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ public class WorldGenEucalyptus {
|
||||
}
|
||||
|
||||
public static class RoseGum extends WorldGenTree {
|
||||
public RoseGum(final ITree tree) {
|
||||
public RoseGum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public class WorldGenEucalyptus {
|
||||
}
|
||||
|
||||
public static class RainbowGum extends WorldGenTree {
|
||||
public RainbowGum(final ITree tree) {
|
||||
public RainbowGum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenFir {
|
||||
public static class DouglasFir extends WorldGenTree {
|
||||
public DouglasFir(final ITree tree) {
|
||||
public DouglasFir(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class WorldGenFir {
|
||||
}
|
||||
|
||||
public static class SilverFir extends WorldGenTree {
|
||||
public SilverFir(final ITree tree) {
|
||||
public SilverFir(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ public class WorldGenFir {
|
||||
}
|
||||
|
||||
public static class BalsamFir extends WorldGenTree {
|
||||
public BalsamFir(final ITree tree) {
|
||||
public BalsamFir(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenHolly {
|
||||
public static class Holly extends WorldGenTree {
|
||||
public Holly(final ITree tree) {
|
||||
public Holly(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenJungle {
|
||||
public static class Brazilwood extends WorldGenTree {
|
||||
public Brazilwood(final ITree tree) {
|
||||
public Brazilwood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class WorldGenJungle {
|
||||
}
|
||||
|
||||
public static class Logwood extends WorldGenTree {
|
||||
public Logwood(final ITree tree) {
|
||||
public Logwood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class WorldGenJungle {
|
||||
}
|
||||
|
||||
public static class Rosewood extends WorldGenTree {
|
||||
public Rosewood(final ITree tree) {
|
||||
public Rosewood(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ public class WorldGenJungle {
|
||||
}
|
||||
|
||||
public static class Purpleheart extends WorldGenTree {
|
||||
public Purpleheart(final ITree tree) {
|
||||
public Purpleheart(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ public class WorldGenJungle {
|
||||
}
|
||||
|
||||
public static class OsangeOsange extends WorldGenTree {
|
||||
public OsangeOsange(final ITree tree) {
|
||||
public OsangeOsange(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ public class WorldGenJungle {
|
||||
}
|
||||
|
||||
public static class OldFustic extends WorldGenTree {
|
||||
public OldFustic(final ITree tree) {
|
||||
public OldFustic(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ public class WorldGenJungle {
|
||||
}
|
||||
|
||||
public static class Coffee extends WorldGenTree {
|
||||
public Coffee(final ITree tree) {
|
||||
public Coffee(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -272,7 +272,7 @@ public class WorldGenJungle {
|
||||
}
|
||||
|
||||
public static class BrazilNut extends WorldGenTree {
|
||||
public BrazilNut(final ITree tree) {
|
||||
public BrazilNut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ public class WorldGenJungle {
|
||||
}
|
||||
|
||||
public static class Shrub15 extends WorldGenTree {
|
||||
public Shrub15(final ITree tree) {
|
||||
public Shrub15(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenLazy {
|
||||
public static class Tree extends WorldGenTree {
|
||||
public Tree(final ITree tree) {
|
||||
public Tree(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenMaple {
|
||||
public static class RedMaple extends WorldGenTree {
|
||||
public RedMaple(final ITree tree) {
|
||||
public RedMaple(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPalm {
|
||||
public static class Coconut extends WorldGenTree {
|
||||
public Coconut(final ITree tree) {
|
||||
public Coconut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenPoplar {
|
||||
public static class Aspen extends WorldGenTree {
|
||||
public Aspen(final ITree tree) {
|
||||
public Aspen(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenShrub {
|
||||
public static class Shrub extends WorldGenTree {
|
||||
public Shrub(final ITree tree) {
|
||||
public static class Shrub extends WorldGenTree{
|
||||
public Shrub(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
float leafSpawn = this.height;
|
||||
@@ -30,13 +30,12 @@ public class WorldGenShrub {
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.minHeight = 1;
|
||||
this.height = this.determineHeight(1, 1);
|
||||
this.girth = this.determineGirth(this.treeGen.getGirth());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenSorbus {
|
||||
public static class Whitebeam extends WorldGenTree {
|
||||
public Whitebeam(final ITree tree) {
|
||||
public Whitebeam(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class WorldGenSorbus {
|
||||
}
|
||||
|
||||
public static class Rowan extends WorldGenTree {
|
||||
public Rowan(final ITree tree) {
|
||||
public Rowan(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WorldGenSorbus {
|
||||
}
|
||||
|
||||
public static class ServiceTree extends WorldGenTree {
|
||||
public ServiceTree(final ITree tree) {
|
||||
public ServiceTree(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class WorldGenTree extends WorldGenerator {
|
||||
public class WorldGenTree extends WorldGenerator {
|
||||
protected ITreeGenData treeGen;
|
||||
protected World world;
|
||||
protected Random rand;
|
||||
@@ -79,7 +79,7 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
return new BlockTypeLog(treeGen);
|
||||
}
|
||||
|
||||
public WorldGenTree(final ITreeGenData tree) {
|
||||
public WorldGenTree(ITreeGenData tree) {
|
||||
this.minHeight = 3;
|
||||
this.maxHeight = 80;
|
||||
this.spawnPods = false;
|
||||
@@ -88,9 +88,7 @@ public abstract class WorldGenTree extends WorldGenerator {
|
||||
this.air = new BlockTypeVoid();
|
||||
this.bushiness = 0.0f;
|
||||
this.spawnPods = tree.allowsFruitBlocks();
|
||||
if (tree instanceof ITreeGenData) {
|
||||
this.treeGen = tree;
|
||||
}
|
||||
this.treeGen = tree;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTree2 {
|
||||
public static class Olive extends WorldGenTree {
|
||||
public Olive(final ITree tree) {
|
||||
public Olive(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class WorldGenTree2 {
|
||||
}
|
||||
|
||||
public static class Sweetgum extends WorldGenTree {
|
||||
public Sweetgum(final ITree tree) {
|
||||
public Sweetgum(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class WorldGenTree2 {
|
||||
}
|
||||
|
||||
public static class Locust extends WorldGenTree {
|
||||
public Locust(final ITree tree) {
|
||||
public Locust(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ public class WorldGenTree2 {
|
||||
}
|
||||
|
||||
public static class Pear extends WorldGenTree {
|
||||
public Pear(final ITree tree) {
|
||||
public Pear(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ public class WorldGenTree2 {
|
||||
}
|
||||
|
||||
public static class Iroko extends WorldGenTree {
|
||||
public Iroko(final ITree tree) {
|
||||
public Iroko(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ public class WorldGenTree2 {
|
||||
}
|
||||
|
||||
public static class Gingko extends WorldGenTree {
|
||||
public Gingko(final ITree tree) {
|
||||
public Gingko(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ public class WorldGenTree2 {
|
||||
}
|
||||
|
||||
public static class Box extends WorldGenTree {
|
||||
public Box(final ITree tree) {
|
||||
public Box(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -278,7 +278,7 @@ public class WorldGenTree2 {
|
||||
}
|
||||
|
||||
public static class Clove extends WorldGenTree {
|
||||
public Clove(final ITree tree) {
|
||||
public Clove(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTree3 {
|
||||
public static class Hazel extends WorldGenTree {
|
||||
public Hazel(final ITree tree) {
|
||||
public Hazel(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ public class WorldGenTree3 {
|
||||
}
|
||||
|
||||
public static class Sycamore extends WorldGenTree {
|
||||
public Sycamore(final ITree tree) {
|
||||
public Sycamore(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -90,7 +90,7 @@ public class WorldGenTree3 {
|
||||
}
|
||||
|
||||
public static class Hawthorn extends WorldGenTree {
|
||||
public Hawthorn(final ITree tree) {
|
||||
public Hawthorn(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public class WorldGenTree3 {
|
||||
}
|
||||
|
||||
public static class Pecan extends WorldGenTree {
|
||||
public Pecan(final ITree tree) {
|
||||
public Pecan(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class WorldGenTree3 {
|
||||
}
|
||||
|
||||
public static class Elm extends WorldGenTree {
|
||||
public Elm(final ITree tree) {
|
||||
public Elm(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ public class WorldGenTree3 {
|
||||
}
|
||||
|
||||
public static class Elder extends WorldGenTree {
|
||||
public Elder(final ITree tree) {
|
||||
public Elder(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ public class WorldGenTree3 {
|
||||
}
|
||||
|
||||
public static class Hornbeam extends WorldGenTree {
|
||||
public Hornbeam(final ITree tree) {
|
||||
public Hornbeam(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ public class WorldGenTree3 {
|
||||
}
|
||||
|
||||
public static class Sallow extends WorldGenTree {
|
||||
public Sallow(final ITree tree) {
|
||||
public Sallow(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -352,7 +352,7 @@ public class WorldGenTree3 {
|
||||
}
|
||||
|
||||
public static class AcornOak extends WorldGenTree {
|
||||
public AcornOak(final ITree tree) {
|
||||
public AcornOak(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenTropical {
|
||||
public static class Mango extends WorldGenTree {
|
||||
public Mango(final ITree tree) {
|
||||
public Mango(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package binnie.extratrees.gen;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenWalnut {
|
||||
public static class BlackWalnut extends WorldGenTree {
|
||||
public BlackWalnut(final ITree tree) {
|
||||
public BlackWalnut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class WorldGenWalnut {
|
||||
}
|
||||
|
||||
public static class Butternut extends WorldGenTree {
|
||||
public Butternut(final ITree tree) {
|
||||
public Butternut(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,553 @@
|
||||
package binnie.extratrees.genetics;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.FruitPod;
|
||||
import binnie.extratrees.config.ConfigurationMain;
|
||||
import binnie.extratrees.item.Food;
|
||||
import forestry.api.arboriculture.IAlleleFruit;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.IFruitProvider;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.arboriculture.TreeManager;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.arboriculture.FruitProviderNone;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleTreeSpecies;
|
||||
import forestry.core.genetics.alleles.AlleleCategorized;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IFruitProvider {
|
||||
|
||||
/*public static void createAlleles() {
|
||||
List<IAlleleFruit> fruitAlleles = Arrays.asList(
|
||||
fruitNone = new AlleleFruit("none", new FruitProviderNone("for.fruits.none", null)),
|
||||
fruitApple = new AlleleFruit("apple", new FruitProviderRandom("for.fruits.apple", EnumFruitFamily.POMES, new ItemStack(Items.APPLE), 1.0f)
|
||||
.setColour(new Color(0xff2e2e))
|
||||
.setOverlay("pomes")),
|
||||
fruitCocoa = new AlleleFruit("cocoa", new FruitProviderPod("for.fruits.cocoa", EnumFruitFamily.JUNGLE, FruitProviderPod.EnumPodType.COCOA, new ItemStack(Items.DYE, 1, EnumDyeColor.BROWN.getDyeDamage()))),
|
||||
// .setColours(0xecdca5, 0xc4d24a), true);
|
||||
fruitChestnut = new AlleleFruit("chestnut", new FruitProviderRipening("for.fruits.chestnut", EnumFruitFamily.NUX, ItemFruit.EnumFruit.CHESTNUT.getStack(), 1.0f)
|
||||
.setRipeningPeriod(6)
|
||||
.setColours(new Color(0x7f333d), new Color(0xc4d24a))
|
||||
.setOverlay("nuts"), true),
|
||||
fruitWalnut = new AlleleFruit("walnut", new FruitProviderRipening("for.fruits.walnut", EnumFruitFamily.NUX, ItemFruit.EnumFruit.WALNUT.getStack(), 1.0f)
|
||||
.setRipeningPeriod(8)
|
||||
.setColours(new Color(0xfba248), new Color(0xc4d24a))
|
||||
.setOverlay("nuts"), true),
|
||||
fruitCherry = new AlleleFruit("cherry", new FruitProviderRipening("for.fruits.cherry", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.CHERRY.getStack(), 1.0f)
|
||||
.setColours(new Color(0xff2e2e), new Color(0xc4d24a))
|
||||
.setOverlay("berries"), true),
|
||||
fruitDates = new AlleleFruit("dates", new FruitProviderPod("for.fruits.dates", EnumFruitFamily.JUNGLE, FruitProviderPod.EnumPodType.DATES, ItemFruit.EnumFruit.DATES.getStack(4))),
|
||||
fruitPapaya = new AlleleFruit("papaya", new FruitProviderPod("for.fruits.papaya", EnumFruitFamily.JUNGLE, FruitProviderPod.EnumPodType.PAPAYA, ItemFruit.EnumFruit.PAPAYA.getStack())),
|
||||
fruitLemon = new AlleleFruit("lemon", new FruitProviderRipening("for.fruits.lemon", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.LEMON.getStack(), 1.0f)
|
||||
.setColours(new Color(0xeeee00), new Color(0x99ff00))
|
||||
.setOverlay("citrus"), true),
|
||||
fruitPlum = new AlleleFruit("plum", new FruitProviderRipening("for.fruits.plum", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.PLUM.getStack(), 1.0f)
|
||||
.setColours(new Color(0x663446), new Color(0xeeff1a))
|
||||
.setOverlay("plums"), true)
|
||||
);
|
||||
|
||||
for (IAlleleFruit fruitAllele : fruitAlleles) {
|
||||
AlleleManager.alleleRegistry.registerAllele(fruitAllele, EnumTreeChromosome.FRUITS);
|
||||
}
|
||||
}*/
|
||||
public static final AlleleETFruit Blackthorn = new AlleleETFruit("Blackthorn", 10, 7180062, 14561129, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit CherryPlum = new AlleleETFruit("CherryPlum", 10, 7180062, 15211595, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit Peach = new AlleleETFruit("Peach", 10, 7180062, 16424995, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Nectarine = new AlleleETFruit("Nectarine", 10, 7180062, 16405795, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Apricot = new AlleleETFruit("Apricot", 10, 7180062, 16437027, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Almond = new AlleleETFruit("Almond", 10, 7180062, 9364342, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit WildCherry = new AlleleETFruit("WildCherry", 10, 7180062, 16711680, FruitSprite.TINY);
|
||||
public static final AlleleETFruit SourCherry = new AlleleETFruit("SourCherry", 10, 7180062, 10225963, FruitSprite.TINY);
|
||||
public static final AlleleETFruit BlackCherry = new AlleleETFruit("BlackCherry", 10, 7180062, 4852249, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Orange = new AlleleETFruit("Orange", 10, 3665987, 16749578, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Manderin = new AlleleETFruit("Manderin", 10, 3665987, 16749578, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Tangerine = new AlleleETFruit("Tangerine", 10, 3665987, 16749578, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Satsuma = new AlleleETFruit("Satsuma", 10, 3665987, 16749578, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit KeyLime = new AlleleETFruit("KeyLime", 10, 3665987, 10223428, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit Lime = new AlleleETFruit("Lime", 10, 3665987, 10223428, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit FingerLime = new AlleleETFruit("FingerLime", 10, 3665987, 11156280, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit Pomelo = new AlleleETFruit("Pomelo", 10, 3665987, 6083402, FruitSprite.LARGER);
|
||||
public static final AlleleETFruit Grapefruit = new AlleleETFruit("Grapefruit", 10, 3665987, 16749578, FruitSprite.LARGE);
|
||||
public static final AlleleETFruit Kumquat = new AlleleETFruit("Kumquat", 10, 3665987, 16749578, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit Citron = new AlleleETFruit("Citron", 10, 3665987, 16772192, FruitSprite.LARGE);
|
||||
public static final AlleleETFruit BuddhaHand = new AlleleETFruit("BuddhaHand", 10, 3665987, 16772192, FruitSprite.LARGE);
|
||||
public static final AlleleETFruit Apple = new AlleleETFruit("Apple", 10, 7915859, 16193046, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Crabapple = new AlleleETFruit("Crabapple", 10, 7915859, 16760140, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Banana = new AlleleETFruit("Banana", FruitPod.Banana);
|
||||
public static final AlleleETFruit RedBanana = new AlleleETFruit("Red Banana", FruitPod.RedBanana);
|
||||
public static final AlleleETFruit Plantain = new AlleleETFruit("Platain", FruitPod.Plantain);
|
||||
public static final AlleleETFruit Hazelnut = new AlleleETFruit("Hazelnut", 7, 8223006, 14463606, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit Butternut = new AlleleETFruit("Butternut", 7, 11712336, 16102498, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit Beechnut = new AlleleETFruit("Beechnut", 8, 14401148, 6241845, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Pecan = new AlleleETFruit("Pecan", 8, 10660940, 15781769, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit BrazilNut = new AlleleETFruit("BrazilNut", 10, 5875561, 9852208, FruitSprite.LARGE);
|
||||
public static final AlleleETFruit Fig = new AlleleETFruit("Fig", 9, 14201186, 7094086, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit Acorn = new AlleleETFruit("Acorn", 6, 7516710, 11364893, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Elderberry = new AlleleETFruit("Elderberry", 9, 7444317, 5331779, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Olive = new AlleleETFruit("Olive", 9, 8887861, 6444842, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit GingkoNut = new AlleleETFruit("GingkoNut", 7, 9213787, 15063725, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Coffee = new AlleleETFruit("Coffee", 8, 7433501, 16273254, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Pear = new AlleleETFruit("Pear", 10, 10456913, 10474833, FruitSprite.PEAR);
|
||||
public static final AlleleETFruit OsangeOsange = new AlleleETFruit("OsangeOsange", 10, 9934674, 10665767, FruitSprite.LARGER);
|
||||
public static final AlleleETFruit Clove = new AlleleETFruit("Clove", 9, 6847532, 11224133, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Coconut = new AlleleETFruit("Coconut", FruitPod.Coconut);
|
||||
public static final AlleleETFruit Cashew = new AlleleETFruit("Cashew", 8, 12879132, 15289111, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Avacado = new AlleleETFruit("Avacado", 10, 10272370, 2170640, FruitSprite.PEAR);
|
||||
public static final AlleleETFruit Nutmeg = new AlleleETFruit("Nutmeg", 9, 14861101, 11305813, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Allspice = new AlleleETFruit("Allspice", 9, 15180922, 7423542, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Chilli = new AlleleETFruit("Chilli", 10, 7430757, 15145010, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit StarAnise = new AlleleETFruit("StarAnise", 8, 8733742, 13917189, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Mango = new AlleleETFruit("Mango", 10, 6654997, 15902262, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Starfruit = new AlleleETFruit("Starfruit", 10, 9814541, 15061550, FruitSprite.AVERAGE);
|
||||
public static final AlleleETFruit Candlenut = new AlleleETFruit("Candlenut", 8, 8235123, 14600882, FruitSprite.SMALL);
|
||||
public static final AlleleETFruit Papayimar = new AlleleETFruit("Papayimar", FruitPod.Papayimar);
|
||||
public static final AlleleETFruit Blackcurrant = new AlleleETFruit("Blackcurrant", 8, 9407571, 4935251, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Redcurrant = new AlleleETFruit("Redcurrant", 8, 13008910, 15080974, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Blackberry = new AlleleETFruit("Blackberry", 8, 9399665, 4801393, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Raspberry = new AlleleETFruit("Raspberry", 8, 15520197, 14510449, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Blueberry = new AlleleETFruit("Blueberry", 8, 10203799, 6329278, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Cranberry = new AlleleETFruit("Cranberry", 8, 12232496, 14555696, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Juniper = new AlleleETFruit("Juniper", 8, 10194034, 6316914, FruitSprite.TINY);
|
||||
public static final AlleleETFruit Gooseberry = new AlleleETFruit("Gooseberry", 8, 12164944, 12177232, FruitSprite.TINY);
|
||||
public static final AlleleETFruit GoldenRaspberry = new AlleleETFruit("GoldenRaspberry", 8, 12496955, 15970363, FruitSprite.TINY);
|
||||
|
||||
IFruitFamily family;
|
||||
boolean isRipening;
|
||||
int diffR, diffG, diffB;
|
||||
FruitPod pod;
|
||||
int ripeningPeriod;
|
||||
int colourUnripe;
|
||||
int colour;
|
||||
FruitSprite sprite;
|
||||
HashMap<ItemStack, Float> products;
|
||||
|
||||
|
||||
private static LinkedList<AlleleETFruit> list;
|
||||
|
||||
public static List<AlleleETFruit> values() {
|
||||
if (list == null) {
|
||||
list = new LinkedList<>();
|
||||
for (Field f : AlleleETFruit.class.getFields()) {
|
||||
if (f.getType() == AlleleETFruit.class) {
|
||||
try {
|
||||
list.add((AlleleETFruit) f.get(AlleleETFruit.Acorn));
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
final IFruitFamily familyPrune = AlleleManager.alleleRegistry.getFruitFamily("forestry.prunes");
|
||||
final IFruitFamily familyPome = AlleleManager.alleleRegistry.getFruitFamily("forestry.pomes");
|
||||
final IFruitFamily familyJungle = AlleleManager.alleleRegistry.getFruitFamily("forestry.jungle");
|
||||
final IFruitFamily familyNuts = AlleleManager.alleleRegistry.getFruitFamily("forestry.nuts");
|
||||
final IFruitFamily familyBerry = ETFruitFamily.Berry;
|
||||
final IFruitFamily familyCitrus = ETFruitFamily.Citrus;
|
||||
AlleleManager.alleleRegistry.registerFruitFamily(familyBerry);
|
||||
AlleleManager.alleleRegistry.registerFruitFamily(familyCitrus);
|
||||
AlleleETFruit.Apple.addProduct(new ItemStack(Items.APPLE), 1.0f);
|
||||
AlleleETFruit.Apple.setFamily(familyPome);
|
||||
AlleleETFruit.Crabapple.addProduct(Food.CRABAPPLE.get(1), 1.0f);
|
||||
AlleleETFruit.Crabapple.setFamily(familyPome);
|
||||
AlleleETFruit.Orange.addProduct(Food.ORANGE.get(1), 1.0f);
|
||||
AlleleETFruit.Orange.setFamily(familyCitrus);
|
||||
AlleleETFruit.Manderin.addProduct(Food.MANDERIN.get(1), 1.0f);
|
||||
AlleleETFruit.Manderin.setFamily(familyCitrus);
|
||||
AlleleETFruit.Tangerine.addProduct(Food.TANGERINE.get(1), 1.0f);
|
||||
AlleleETFruit.Tangerine.setFamily(familyCitrus);
|
||||
AlleleETFruit.Satsuma.addProduct(Food.SATSUMA.get(1), 1.0f);
|
||||
AlleleETFruit.Satsuma.setFamily(familyCitrus);
|
||||
AlleleETFruit.KeyLime.addProduct(Food.KEY_LIME.get(1), 1.0f);
|
||||
AlleleETFruit.KeyLime.setFamily(familyCitrus);
|
||||
AlleleETFruit.Lime.addProduct(Food.LIME.get(1), 1.0f);
|
||||
AlleleETFruit.Lime.setFamily(familyCitrus);
|
||||
AlleleETFruit.FingerLime.addProduct(Food.FINGER_LIME.get(1), 1.0f);
|
||||
AlleleETFruit.FingerLime.setFamily(familyCitrus);
|
||||
AlleleETFruit.Pomelo.addProduct(Food.POMELO.get(1), 1.0f);
|
||||
AlleleETFruit.Pomelo.setFamily(familyCitrus);
|
||||
AlleleETFruit.Grapefruit.addProduct(Food.GRAPEFRUIT.get(1), 1.0f);
|
||||
AlleleETFruit.Grapefruit.setFamily(familyCitrus);
|
||||
AlleleETFruit.Kumquat.addProduct(Food.KUMQUAT.get(1), 1.0f);
|
||||
AlleleETFruit.Kumquat.setFamily(familyCitrus);
|
||||
AlleleETFruit.Citron.addProduct(Food.CITRON.get(1), 1.0f);
|
||||
AlleleETFruit.Citron.setFamily(familyCitrus);
|
||||
AlleleETFruit.BuddhaHand.addProduct(Food.BUDDHA_HAND.get(1), 1.0f);
|
||||
AlleleETFruit.BuddhaHand.setFamily(familyCitrus);
|
||||
AlleleETFruit.Blackthorn.addProduct(Food.Blackthorn.get(1), 1.0f);
|
||||
AlleleETFruit.Blackthorn.setFamily(familyPrune);
|
||||
AlleleETFruit.CherryPlum.addProduct(Food.CHERRY_PLUM.get(1), 1.0f);
|
||||
AlleleETFruit.CherryPlum.setFamily(familyPrune);
|
||||
AlleleETFruit.Peach.addProduct(Food.PEACH.get(1), 1.0f);
|
||||
AlleleETFruit.Peach.setFamily(familyPrune);
|
||||
AlleleETFruit.Nectarine.addProduct(Food.NECTARINE.get(1), 1.0f);
|
||||
AlleleETFruit.Nectarine.setFamily(familyPrune);
|
||||
AlleleETFruit.Apricot.addProduct(Food.APRICOT.get(1), 1.0f);
|
||||
AlleleETFruit.Apricot.setFamily(familyPrune);
|
||||
AlleleETFruit.Almond.addProduct(Food.ALMOND.get(1), 1.0f);
|
||||
AlleleETFruit.Almond.setFamily(familyPrune);
|
||||
AlleleETFruit.WildCherry.addProduct(Food.WILD_CHERRY.get(1), 1.0f);
|
||||
AlleleETFruit.WildCherry.setFamily(familyPrune);
|
||||
AlleleETFruit.SourCherry.addProduct(Food.SOUR_CHERRY.get(1), 1.0f);
|
||||
AlleleETFruit.SourCherry.setFamily(familyPrune);
|
||||
AlleleETFruit.BlackCherry.addProduct(Food.BLACK_CHERRY.get(1), 1.0f);
|
||||
AlleleETFruit.BlackCherry.setFamily(familyPrune);
|
||||
AlleleETFruit.Hazelnut.addProduct(Food.HAZELNUT.get(1), 1.0f);
|
||||
AlleleETFruit.Hazelnut.setFamily(familyNuts);
|
||||
AlleleETFruit.Butternut.addProduct(Food.BUTTERNUT.get(1), 1.0f);
|
||||
AlleleETFruit.Butternut.setFamily(familyNuts);
|
||||
AlleleETFruit.Beechnut.addProduct(Food.BEECHNUT.get(1), 1.0f);
|
||||
AlleleETFruit.Beechnut.setFamily(familyNuts);
|
||||
AlleleETFruit.Pecan.addProduct(Food.PECAN.get(1), 1.0f);
|
||||
AlleleETFruit.Pecan.setFamily(familyNuts);
|
||||
AlleleETFruit.Banana.addProduct(Food.BANANA.get(2), 1.0f);
|
||||
AlleleETFruit.Banana.setFamily(familyJungle);
|
||||
AlleleETFruit.RedBanana.addProduct(Food.RED_BANANA.get(2), 1.0f);
|
||||
AlleleETFruit.RedBanana.setFamily(familyJungle);
|
||||
AlleleETFruit.Plantain.addProduct(Food.PLANTAIN.get(2), 1.0f);
|
||||
AlleleETFruit.Plantain.setFamily(familyJungle);
|
||||
AlleleETFruit.BrazilNut.addProduct(Food.BRAZIL_NUT.get(4), 1.0f);
|
||||
AlleleETFruit.BrazilNut.setFamily(familyNuts);
|
||||
AlleleETFruit.Fig.addProduct(Food.FIG.get(1), 1.0f);
|
||||
AlleleETFruit.Fig.setFamily(familyPrune);
|
||||
AlleleETFruit.Acorn.addProduct(Food.ACORN.get(1), 1.0f);
|
||||
AlleleETFruit.Acorn.setFamily(familyNuts);
|
||||
AlleleETFruit.Elderberry.addProduct(Food.ELDERBERRY.get(1), 1.0f);
|
||||
AlleleETFruit.Elderberry.setFamily(familyPrune);
|
||||
AlleleETFruit.Olive.addProduct(Food.OLIVE.get(1), 1.0f);
|
||||
AlleleETFruit.Olive.setFamily(familyPrune);
|
||||
AlleleETFruit.GingkoNut.addProduct(Food.GINGKO_NUT.get(1), 1.0f);
|
||||
AlleleETFruit.GingkoNut.setFamily(familyNuts);
|
||||
AlleleETFruit.Coffee.addProduct(Food.COFFEE.get(1), 1.0f);
|
||||
AlleleETFruit.Coffee.setFamily(familyJungle);
|
||||
AlleleETFruit.Pear.addProduct(Food.PEAR.get(1), 1.0f);
|
||||
AlleleETFruit.Pear.setFamily(familyPome);
|
||||
AlleleETFruit.OsangeOsange.addProduct(Food.OSANGE_ORANGE.get(1), 1.0f);
|
||||
AlleleETFruit.OsangeOsange.setFamily(familyPome);
|
||||
AlleleETFruit.Clove.addProduct(Food.CLOVE.get(1), 1.0f);
|
||||
AlleleETFruit.Clove.setFamily(familyNuts);
|
||||
AlleleETFruit.Blackcurrant.addProduct(Food.BLACKCURRANT.get(2), 1.0f);
|
||||
AlleleETFruit.Blackcurrant.setFamily(familyBerry);
|
||||
AlleleETFruit.Redcurrant.addProduct(Food.REDCURRANT.get(2), 1.0f);
|
||||
AlleleETFruit.Redcurrant.setFamily(familyBerry);
|
||||
AlleleETFruit.Blackberry.addProduct(Food.BLACKBERRY.get(2), 1.0f);
|
||||
AlleleETFruit.Blackberry.setFamily(familyBerry);
|
||||
AlleleETFruit.Raspberry.addProduct(Food.RASPBERRY.get(2), 1.0f);
|
||||
AlleleETFruit.Raspberry.setFamily(familyBerry);
|
||||
AlleleETFruit.Blueberry.addProduct(Food.BLUEBERRY.get(2), 1.0f);
|
||||
AlleleETFruit.Blueberry.setFamily(familyBerry);
|
||||
AlleleETFruit.Cranberry.addProduct(Food.CRANBERRY.get(2), 1.0f);
|
||||
AlleleETFruit.Cranberry.setFamily(familyBerry);
|
||||
AlleleETFruit.Juniper.addProduct(Food.JUNIPER.get(2), 1.0f);
|
||||
AlleleETFruit.Juniper.setFamily(familyBerry);
|
||||
AlleleETFruit.Gooseberry.addProduct(Food.GOOSEBERRY.get(2), 1.0f);
|
||||
AlleleETFruit.Gooseberry.setFamily(familyBerry);
|
||||
AlleleETFruit.GoldenRaspberry.addProduct(Food.GOLDEN_RASPBERRY.get(2), 1.0f);
|
||||
AlleleETFruit.GoldenRaspberry.setFamily(familyBerry);
|
||||
AlleleETFruit.Coconut.addProduct(Food.COCONUT.get(1), 1.0f);
|
||||
AlleleETFruit.Coconut.setFamily(familyJungle);
|
||||
AlleleETFruit.Cashew.addProduct(Food.CASHEW.get(1), 1.0f);
|
||||
AlleleETFruit.Cashew.setFamily(familyJungle);
|
||||
AlleleETFruit.Avacado.addProduct(Food.AVACADO.get(1), 1.0f);
|
||||
AlleleETFruit.Avacado.setFamily(familyJungle);
|
||||
AlleleETFruit.Nutmeg.addProduct(Food.NUTMEG.get(1), 1.0f);
|
||||
AlleleETFruit.Nutmeg.setFamily(familyJungle);
|
||||
AlleleETFruit.Allspice.addProduct(Food.ALLSPICE.get(1), 1.0f);
|
||||
AlleleETFruit.Allspice.setFamily(familyJungle);
|
||||
AlleleETFruit.Chilli.addProduct(Food.CHILLI.get(1), 1.0f);
|
||||
AlleleETFruit.Chilli.setFamily(familyJungle);
|
||||
AlleleETFruit.StarAnise.addProduct(Food.STAR_ANISE.get(1), 1.0f);
|
||||
AlleleETFruit.StarAnise.setFamily(familyJungle);
|
||||
AlleleETFruit.Mango.addProduct(Food.MANGO.get(1), 1.0f);
|
||||
AlleleETFruit.Mango.setFamily(familyPome);
|
||||
AlleleETFruit.Starfruit.addProduct(Food.STARFRUIT.get(1), 1.0f);
|
||||
AlleleETFruit.Starfruit.setFamily(familyJungle);
|
||||
AlleleETFruit.Candlenut.addProduct(Food.CANDLENUT.get(1), 1.0f);
|
||||
AlleleETFruit.Candlenut.setFamily(familyJungle);
|
||||
if (ConfigurationMain.alterLemon) {
|
||||
try {
|
||||
final IAlleleFruit lemon = (IAlleleFruit) AlleleManager.alleleRegistry.getAllele("forestry.fruitLemon");
|
||||
final FruitProviderNone prov = (FruitProviderNone) lemon.getProvider();
|
||||
final Field f = FruitProviderNone.class.getDeclaredField("family");
|
||||
final Field modifiersField = Field.class.getDeclaredField("modifiers");
|
||||
f.setAccessible(true);
|
||||
modifiersField.setAccessible(true);
|
||||
modifiersField.setInt(f, f.getModifiers() & 0xFFFFFFEF);
|
||||
f.set(prov, familyCitrus);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
for (final IAlleleSpecies tree : Binnie.Genetics.treeBreedingSystem.getAllSpecies()) {
|
||||
if (tree instanceof AlleleTreeSpecies && ((IAlleleTreeSpecies) tree).getSuitableFruit().contains(familyPrune)) {
|
||||
((AlleleTreeSpecies) tree).addFruitFamily(familyCitrus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private AlleleETFruit(String name, int time, int unripe, int colour, FruitSprite sprite) {
|
||||
super(Constants.EXTRA_TREES_MOD_ID, "fruit", name, true);
|
||||
this.isRipening = false;
|
||||
this.diffB = 0;
|
||||
this.pod = null;
|
||||
this.ripeningPeriod = 0;
|
||||
this.products = new HashMap<>();
|
||||
this.colour = colour;
|
||||
this.sprite = sprite;
|
||||
this.setRipening(time, unripe);
|
||||
}
|
||||
|
||||
private AlleleETFruit(String name, FruitPod pod) {
|
||||
super(Constants.EXTRA_TREES_MOD_ID, "fruit", name, true);
|
||||
this.isRipening = false;
|
||||
this.diffB = 0;
|
||||
this.sprite = null;
|
||||
this.products = new HashMap<>();
|
||||
this.pod = pod;
|
||||
this.ripeningPeriod = 2;
|
||||
}
|
||||
|
||||
public void setRipening(int time, int unripe) {
|
||||
this.ripeningPeriod = time;
|
||||
this.colourUnripe = unripe;
|
||||
this.isRipening = true;
|
||||
this.diffR = (this.colour >> 16 & 0xFF) - (unripe >> 16 & 0xFF);
|
||||
this.diffG = (this.colour >> 8 & 0xFF) - (unripe >> 8 & 0xFF);
|
||||
this.diffB = (this.colour & 0xFF) - (unripe & 0xFF);
|
||||
}
|
||||
|
||||
public void addProduct(ItemStack product, float chance) {
|
||||
this.products.put(product, chance);
|
||||
}
|
||||
|
||||
private void setFamily(IFruitFamily family) {
|
||||
this.family = family;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFruitProvider getProvider() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerSprites() {
|
||||
if(this == Apple){
|
||||
for(FruitSprite sprite : FruitSprite.VALUES){
|
||||
sprite.registerSprites();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getSprite(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime) {
|
||||
if(sprite != null){
|
||||
return sprite.getLocation();
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@Nonnull IAlleleFruit o) {
|
||||
return o == this ? 0 : -1;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public Map<ItemStack, Float> getSpecialty() {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDecorativeColor() {
|
||||
return getColour(1.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, Random rand, BlockPos pos) {
|
||||
if(this.pod != null && world.rand.nextFloat() <= genome.getSappiness()){
|
||||
TreeManager.treeRoot.setFruitBlock(world, this, genome.getSappiness(), pos);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getFruits(ITreeGenome genome, World world, BlockPos pos, int ripeningTime) {
|
||||
if (this.pod != null) {
|
||||
if (ripeningTime >= 2) {
|
||||
List<ItemStack> products = new ArrayList<ItemStack>();
|
||||
for (Map.Entry<ItemStack, Float> product : this.products.entrySet()) {
|
||||
ItemStack single = product.getKey().copy();
|
||||
single.stackSize = 1;
|
||||
for (int i = 0; i < product.getKey().stackSize; ++i) {
|
||||
if (world.rand.nextFloat() <= product.getValue()) {
|
||||
products.add(single.copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
return products;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
ArrayList<ItemStack> products = new ArrayList<ItemStack>();
|
||||
float stage = this.getRipeningStage(ripeningTime);
|
||||
if (stage < 0.5f) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
float modeYieldMod = 1.0f;
|
||||
for (final Map.Entry<ItemStack, Float> product : this.products.entrySet()) {
|
||||
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * product.getValue() * 5.0f * stage) {
|
||||
products.add(product.getKey().copy());
|
||||
}
|
||||
}
|
||||
return products;
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getModelName() {
|
||||
if(pod != null){
|
||||
return pod.name();
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFruitLeaf(ITreeGenome genome, World world, BlockPos pos) {
|
||||
return sprite != null;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getModID() {
|
||||
return Constants.EXTRA_TREES_MOD_ID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime) {
|
||||
if (!this.isRipening) {
|
||||
return this.colour;
|
||||
}
|
||||
float stage = getRipeningStage(ripeningTime);
|
||||
return getColour(stage);
|
||||
}
|
||||
|
||||
private int getColour(float stage) {
|
||||
final int r = (this.colourUnripe >> 16 & 0xFF) + (int) (this.diffR * stage);
|
||||
final int g = (this.colourUnripe >> 8 & 0xFF) + (int) (this.diffG * stage);
|
||||
final int b = (this.colourUnripe & 0xFF) + (int) (this.diffB * stage);
|
||||
return (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("item.food." + this.getClass().getTypeName().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFruitFamily getFamily() {
|
||||
return this.family;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRipeningPeriod() {
|
||||
return this.ripeningPeriod;
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
public HashMap<ItemStack, Float> getProducts() {
|
||||
return products;
|
||||
}
|
||||
|
||||
private float getRipeningStage(final int ripeningTime) {
|
||||
if (ripeningTime >= this.ripeningPeriod) {
|
||||
return 1.0f;
|
||||
}
|
||||
return ripeningTime / this.ripeningPeriod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresFruitBlocks() {
|
||||
return this.pod != null;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public short getIconIndex(final ITreeGenome genome, final IBlockAccess world, final int x, final int y, final int z, final int ripeningTime, final boolean fancy) {
|
||||
// return this.index.getIndex();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(final IIconRegister register) {
|
||||
// if (this.ordinal() == 0) {
|
||||
// for (final FruitSprite sprite : FruitSprite.values()) {
|
||||
// sprite.registerIcons(register);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getDecorativeSprite() {
|
||||
if(sprite != null){
|
||||
return sprite.getLocation();
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getDescription();
|
||||
}
|
||||
|
||||
public String getNameOfFruit() {
|
||||
if (this == AlleleETFruit.Apple) {
|
||||
return "Apple";
|
||||
}
|
||||
for (final ItemStack stack : this.products.keySet()) {
|
||||
if (stack.getItem() == ExtraTrees.itemFood) {
|
||||
return Food.values()[stack.getItemDamage()].toString();
|
||||
}
|
||||
}
|
||||
return "NoFruit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return this.getUID();
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,6 @@ import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.ILeafProvider;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.arboriculture.genetics.LeafProvider;
|
||||
import forestry.arboriculture.genetics.TreeDefinition;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,568 +0,0 @@
|
||||
package binnie.extratrees.genetics;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.FruitPod;
|
||||
import binnie.extratrees.config.ConfigurationMain;
|
||||
import binnie.extratrees.item.Food;
|
||||
import forestry.api.arboriculture.IAlleleFruit;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
import forestry.api.arboriculture.IFruitProvider;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IFruitFamily;
|
||||
import forestry.arboriculture.FruitProviderNone;
|
||||
import forestry.arboriculture.genetics.alleles.AlleleTreeSpecies;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
|
||||
public class ExtraTreeFruitGene implements IAlleleFruit, IFruitProvider {
|
||||
public static final ExtraTreeFruitGene Blackthorn = new ExtraTreeFruitGene("Blackthorn", 10, 7180062, 14561129, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene CherryPlum = new ExtraTreeFruitGene("CherryPlum", 10, 7180062, 15211595, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene Peach = new ExtraTreeFruitGene("Peach ", 10, 7180062, 16424995, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Nectarine = new ExtraTreeFruitGene("Nectarine", 10, 7180062, 16405795, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Apricot = new ExtraTreeFruitGene("Apricot", 10, 7180062, 16437027, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Almond = new ExtraTreeFruitGene("Almond", 10, 7180062, 9364342, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene WildCherry = new ExtraTreeFruitGene("WildCherry", 10, 7180062, 16711680, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene SourCherry = new ExtraTreeFruitGene("SourCherry", 10, 7180062, 10225963, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene BlackCherry = new ExtraTreeFruitGene("BlackCherry", 10, 7180062, 4852249, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Orange = new ExtraTreeFruitGene("Orange", 10, 3665987, 16749578, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Manderin = new ExtraTreeFruitGene("Manderin", 10, 3665987, 16749578, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Tangerine = new ExtraTreeFruitGene("Tangerine", 10, 3665987, 16749578, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Satsuma = new ExtraTreeFruitGene("Satsuma", 10, 3665987, 16749578, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene KeyLime = new ExtraTreeFruitGene("KeyLime", 10, 3665987, 10223428, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene Lime = new ExtraTreeFruitGene("Lime", 10, 3665987, 10223428, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene FingerLime = new ExtraTreeFruitGene("FingerLime", 10, 3665987, 11156280, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene Pomelo = new ExtraTreeFruitGene("Pomelo", 10, 3665987, 6083402, FruitSprite.Larger);
|
||||
public static final ExtraTreeFruitGene Grapefruit = new ExtraTreeFruitGene("Grapefruit", 10, 3665987, 16749578, FruitSprite.Large);
|
||||
public static final ExtraTreeFruitGene Kumquat = new ExtraTreeFruitGene("Kumquat", 10, 3665987, 16749578, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene Citron = new ExtraTreeFruitGene("Citron", 10, 3665987, 16772192, FruitSprite.Large);
|
||||
public static final ExtraTreeFruitGene BuddhaHand = new ExtraTreeFruitGene("BuddhaHand", 10, 3665987, 16772192, FruitSprite.Large);
|
||||
public static final ExtraTreeFruitGene Apple = new ExtraTreeFruitGene("Apple", 10, 7915859, 16193046, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Crabapple = new ExtraTreeFruitGene("Crabapple ", 10, 7915859, 16760140, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Banana = new ExtraTreeFruitGene("Banana", "Banana", FruitPod.Banana);
|
||||
public static final ExtraTreeFruitGene RedBanana = new ExtraTreeFruitGene("RedBanana", "Red Banana", FruitPod.RedBanana);
|
||||
public static final ExtraTreeFruitGene Plantain = new ExtraTreeFruitGene("Plantain", "Platain", FruitPod.Plantain);
|
||||
public static final ExtraTreeFruitGene Hazelnut = new ExtraTreeFruitGene("Hazelnut", 7, 8223006, 14463606, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene Butternut = new ExtraTreeFruitGene("Butternut", 7, 11712336, 16102498, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene Beechnut = new ExtraTreeFruitGene("Beechnut", 8, 14401148, 6241845, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Pecan = new ExtraTreeFruitGene("Pecan", 8, 10660940, 15781769, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene BrazilNut = new ExtraTreeFruitGene("BrazilNut", 10, 5875561, 9852208, FruitSprite.Large);
|
||||
public static final ExtraTreeFruitGene Fig = new ExtraTreeFruitGene("Fig", 9, 14201186, 7094086, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene Acorn = new ExtraTreeFruitGene("Acorn", 6, 7516710, 11364893, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Elderberry = new ExtraTreeFruitGene("Elderberry", 9, 7444317, 5331779, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Olive = new ExtraTreeFruitGene("Olive", 9, 8887861, 6444842, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene GingkoNut = new ExtraTreeFruitGene("GingkoNut", 7, 9213787, 15063725, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Coffee = new ExtraTreeFruitGene("Coffee", 8, 7433501, 16273254, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Pear = new ExtraTreeFruitGene("Pear", 10, 10456913, 10474833, FruitSprite.Pear);
|
||||
public static final ExtraTreeFruitGene OsangeOsange = new ExtraTreeFruitGene("OsangeOsange", 10, 9934674, 10665767, FruitSprite.Larger);
|
||||
public static final ExtraTreeFruitGene Clove = new ExtraTreeFruitGene("Clove", 9, 6847532, 11224133, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Coconut = new ExtraTreeFruitGene("Coconut", "Coconut", FruitPod.Coconut);
|
||||
public static final ExtraTreeFruitGene Cashew = new ExtraTreeFruitGene("Cashew", 8, 12879132, 15289111, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Avacado = new ExtraTreeFruitGene("Avacado", 10, 10272370, 2170640, FruitSprite.Pear);
|
||||
public static final ExtraTreeFruitGene Nutmeg = new ExtraTreeFruitGene("Nutmeg", 9, 14861101, 11305813, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Allspice = new ExtraTreeFruitGene("Allspice", 9, 15180922, 7423542, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Chilli = new ExtraTreeFruitGene("Chilli", 10, 7430757, 15145010, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene StarAnise = new ExtraTreeFruitGene("StarAnise", 8, 8733742, 13917189, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Mango = new ExtraTreeFruitGene("Mango", 10, 6654997, 15902262, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Starfruit = new ExtraTreeFruitGene("Starfruit", 10, 9814541, 15061550, FruitSprite.Average);
|
||||
public static final ExtraTreeFruitGene Candlenut = new ExtraTreeFruitGene("Candlenut", 8, 8235123, 14600882, FruitSprite.Small);
|
||||
public static final ExtraTreeFruitGene Papayimar = new ExtraTreeFruitGene("Papayimar", "Papayimar", FruitPod.Papayimar);
|
||||
public static final ExtraTreeFruitGene Blackcurrant = new ExtraTreeFruitGene("Blackcurrant", 8, 9407571, 4935251, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Redcurrant = new ExtraTreeFruitGene("Redcurrant", 8, 13008910, 15080974, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Blackberry = new ExtraTreeFruitGene("Blackberry", 8, 9399665, 4801393, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Raspberry = new ExtraTreeFruitGene("Raspberry", 8, 15520197, 14510449, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Blueberry = new ExtraTreeFruitGene("Blueberry", 8, 10203799, 6329278, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Cranberry = new ExtraTreeFruitGene("Cranberry", 8, 12232496, 14555696, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Juniper = new ExtraTreeFruitGene("Juniper", 8, 10194034, 6316914, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene Gooseberry = new ExtraTreeFruitGene("Gooseberry", 8, 12164944, 12177232, FruitSprite.Tiny);
|
||||
public static final ExtraTreeFruitGene GoldenRaspberry = new ExtraTreeFruitGene("GoldenRaspberry", 8, 12496955, 15970363, FruitSprite.Tiny);
|
||||
|
||||
IFruitFamily family;
|
||||
boolean isRipening;
|
||||
int diffR;
|
||||
int diffG;
|
||||
int diffB;
|
||||
FruitPod pod;
|
||||
int ripeningPeriod;
|
||||
int colourUnripe;
|
||||
int colour;
|
||||
FruitSprite index;
|
||||
HashMap<ItemStack, Float> products;
|
||||
|
||||
|
||||
private static LinkedList<ExtraTreeFruitGene> list;
|
||||
|
||||
public static List<ExtraTreeFruitGene> values() {
|
||||
if (list == null) {
|
||||
list = new LinkedList<>();
|
||||
for (Field f : ExtraTreeFruitGene.class.getFields()) {
|
||||
if (f.getType() == ExtraTreeFruitGene.class) {
|
||||
try {
|
||||
list.add((ExtraTreeFruitGene) f.get(ExtraTreeFruitGene.Acorn));
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
final IFruitFamily familyPrune = AlleleManager.alleleRegistry.getFruitFamily("forestry.prunes");
|
||||
final IFruitFamily familyPome = AlleleManager.alleleRegistry.getFruitFamily("forestry.pomes");
|
||||
final IFruitFamily familyJungle = AlleleManager.alleleRegistry.getFruitFamily("forestry.jungle");
|
||||
final IFruitFamily familyNuts = AlleleManager.alleleRegistry.getFruitFamily("forestry.nuts");
|
||||
final IFruitFamily familyBerry = ETFruitFamily.Berry;
|
||||
final IFruitFamily familyCitrus = ETFruitFamily.Citrus;
|
||||
AlleleManager.alleleRegistry.registerFruitFamily(familyBerry);
|
||||
AlleleManager.alleleRegistry.registerFruitFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Apple.addProduct(new ItemStack(Items.APPLE), 1.0f);
|
||||
ExtraTreeFruitGene.Apple.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Crabapple.addProduct(Food.CRABAPPLE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Crabapple.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Orange.addProduct(Food.ORANGE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Orange.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Manderin.addProduct(Food.MANDERIN.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Manderin.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Tangerine.addProduct(Food.TANGERINE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Tangerine.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Satsuma.addProduct(Food.SATSUMA.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Satsuma.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.KeyLime.addProduct(Food.KEY_LIME.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.KeyLime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Lime.addProduct(Food.LIME.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Lime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.FingerLime.addProduct(Food.FINGER_LIME.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.FingerLime.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Pomelo.addProduct(Food.POMELO.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pomelo.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Grapefruit.addProduct(Food.GRAPEFRUIT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Grapefruit.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Kumquat.addProduct(Food.KUMQUAT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Kumquat.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Citron.addProduct(Food.CITRON.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Citron.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.BuddhaHand.addProduct(Food.BUDDHA_HAND.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.BuddhaHand.setFamily(familyCitrus);
|
||||
ExtraTreeFruitGene.Blackthorn.addProduct(Food.Blackthorn.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Blackthorn.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.CherryPlum.addProduct(Food.CHERRY_PLUM.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.CherryPlum.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Peach.addProduct(Food.PEACH.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Peach.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Nectarine.addProduct(Food.NECTARINE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Nectarine.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Apricot.addProduct(Food.APRICOT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Apricot.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Almond.addProduct(Food.ALMOND.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Almond.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.WildCherry.addProduct(Food.WILD_CHERRY.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.WildCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.SourCherry.addProduct(Food.SOUR_CHERRY.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.SourCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.BlackCherry.addProduct(Food.BLACK_CHERRY.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.BlackCherry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Hazelnut.addProduct(Food.HAZELNUT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Hazelnut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Butternut.addProduct(Food.BUTTERNUT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Butternut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Beechnut.addProduct(Food.BEECHNUT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Beechnut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Pecan.addProduct(Food.PECAN.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pecan.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Banana.addProduct(Food.BANANA.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Banana.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.RedBanana.addProduct(Food.RED_BANANA.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.RedBanana.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Plantain.addProduct(Food.PLANTAIN.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Plantain.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.BrazilNut.addProduct(Food.BRAZIL_NUT.get(4), 1.0f);
|
||||
ExtraTreeFruitGene.BrazilNut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Fig.addProduct(Food.FIG.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Fig.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Acorn.addProduct(Food.ACORN.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Acorn.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Elderberry.addProduct(Food.ELDERBERRY.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Elderberry.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.Olive.addProduct(Food.OLIVE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Olive.setFamily(familyPrune);
|
||||
ExtraTreeFruitGene.GingkoNut.addProduct(Food.GINGKO_NUT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.GingkoNut.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Coffee.addProduct(Food.COFFEE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Coffee.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Pear.addProduct(Food.PEAR.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Pear.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.OsangeOsange.addProduct(Food.OSANGE_ORANGE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.OsangeOsange.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Clove.addProduct(Food.CLOVE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Clove.setFamily(familyNuts);
|
||||
ExtraTreeFruitGene.Blackcurrant.addProduct(Food.BLACKCURRANT.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blackcurrant.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Redcurrant.addProduct(Food.REDCURRANT.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Redcurrant.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Blackberry.addProduct(Food.BLACKBERRY.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blackberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Raspberry.addProduct(Food.RASPBERRY.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Raspberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Blueberry.addProduct(Food.BLUEBERRY.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Blueberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Cranberry.addProduct(Food.CRANBERRY.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Cranberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Juniper.addProduct(Food.JUNIPER.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Juniper.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Gooseberry.addProduct(Food.GOOSEBERRY.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.Gooseberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.GoldenRaspberry.addProduct(Food.GOLDEN_RASPBERRY.get(2), 1.0f);
|
||||
ExtraTreeFruitGene.GoldenRaspberry.setFamily(familyBerry);
|
||||
ExtraTreeFruitGene.Coconut.addProduct(Food.COCONUT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Coconut.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Cashew.addProduct(Food.CASHEW.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Cashew.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Avacado.addProduct(Food.AVACADO.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Avacado.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Nutmeg.addProduct(Food.NUTMEG.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Nutmeg.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Allspice.addProduct(Food.ALLSPICE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Allspice.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Chilli.addProduct(Food.CHILLI.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Chilli.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.StarAnise.addProduct(Food.STAR_ANISE.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.StarAnise.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Mango.addProduct(Food.MANGO.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Mango.setFamily(familyPome);
|
||||
ExtraTreeFruitGene.Starfruit.addProduct(Food.STARFRUIT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Starfruit.setFamily(familyJungle);
|
||||
ExtraTreeFruitGene.Candlenut.addProduct(Food.CANDLENUT.get(1), 1.0f);
|
||||
ExtraTreeFruitGene.Candlenut.setFamily(familyJungle);
|
||||
if (ConfigurationMain.alterLemon) {
|
||||
try {
|
||||
final IAlleleFruit lemon = (IAlleleFruit) AlleleManager.alleleRegistry.getAllele("forestry.fruitLemon");
|
||||
final FruitProviderNone prov = (FruitProviderNone) lemon.getProvider();
|
||||
final Field f = FruitProviderNone.class.getDeclaredField("family");
|
||||
final Field modifiersField = Field.class.getDeclaredField("modifiers");
|
||||
f.setAccessible(true);
|
||||
modifiersField.setAccessible(true);
|
||||
modifiersField.setInt(f, f.getModifiers() & 0xFFFFFFEF);
|
||||
f.set(prov, familyCitrus);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
for (final IAlleleSpecies tree : Binnie.Genetics.treeBreedingSystem.getAllSpecies()) {
|
||||
if (tree instanceof AlleleTreeSpecies && ((IAlleleTreeSpecies) tree).getSuitableFruit().contains(familyPrune)) {
|
||||
((AlleleTreeSpecies) tree).addFruitFamily(familyCitrus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setFamily(final IFruitFamily family) {
|
||||
this.family = family;
|
||||
}
|
||||
|
||||
String uuid;
|
||||
|
||||
private ExtraTreeFruitGene(final String uuid, final int time, final int unripe, final int colour, final FruitSprite index) {
|
||||
this.isRipening = false;
|
||||
this.diffB = 0;
|
||||
this.pod = null;
|
||||
this.ripeningPeriod = 0;
|
||||
this.products = new HashMap<>();
|
||||
this.colour = colour;
|
||||
this.index = index;
|
||||
this.setRipening(time, unripe);
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
private ExtraTreeFruitGene(final String uuid, final String name, final FruitPod pod) {
|
||||
this.isRipening = false;
|
||||
this.diffB = 0;
|
||||
this.pod = null;
|
||||
this.ripeningPeriod = 0;
|
||||
this.products = new HashMap<>();
|
||||
this.pod = pod;
|
||||
this.ripeningPeriod = 2;
|
||||
this.uuid = uuid;
|
||||
}
|
||||
|
||||
public void setRipening(final int time, final int unripe) {
|
||||
this.ripeningPeriod = time;
|
||||
this.colourUnripe = unripe;
|
||||
this.isRipening = true;
|
||||
this.diffR = (this.colour >> 16 & 0xFF) - (unripe >> 16 & 0xFF);
|
||||
this.diffG = (this.colour >> 8 & 0xFF) - (unripe >> 8 & 0xFF);
|
||||
this.diffB = (this.colour & 0xFF) - (unripe & 0xFF);
|
||||
}
|
||||
|
||||
public void addProduct(final ItemStack product, final float chance) {
|
||||
this.products.put(product, chance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extratrees.fruit." + this.uuid.toLowerCase().trim();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFruitProvider getProvider() {
|
||||
return this;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public ItemStack[] getProducts() {
|
||||
// return this.products.keySet().toArray(new ItemStack[0]);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public ItemStack[] getSpecialty() {
|
||||
// return new ItemStack[0];
|
||||
// }
|
||||
|
||||
//TODO implement this
|
||||
@Override
|
||||
public void registerSprites() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
//TODO implement this
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getSprite(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime) {
|
||||
return new ResourceLocation("extratrees:" + this.getUID());
|
||||
}
|
||||
|
||||
//TODO implement this
|
||||
@Override
|
||||
public int compareTo(@Nonnull IAlleleFruit o) {
|
||||
return o == this ? 0 : -1;
|
||||
}
|
||||
|
||||
//TODO implement this
|
||||
@Nonnull
|
||||
@Override
|
||||
public Map<ItemStack, Float> getSpecialty() {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
//TODO implement this
|
||||
@Override
|
||||
public int getDecorativeColor() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
//TODO implement this
|
||||
@Override
|
||||
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, Random rand, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO implement this
|
||||
@Nonnull
|
||||
@Override
|
||||
public List<ItemStack> getFruits(ITreeGenome genome, World world, BlockPos pos, int ripeningTime) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
//TODO implement this
|
||||
@Nullable
|
||||
@Override
|
||||
public String getModelName() {
|
||||
return "extratrees:" + getUID();
|
||||
}
|
||||
|
||||
//TODO implement this
|
||||
@Override
|
||||
public boolean isFruitLeaf(ITreeGenome genome, World world, BlockPos pos) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//TODO implement this
|
||||
@Nonnull
|
||||
@Override
|
||||
public String getModID() {
|
||||
return "extratrees";
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime) {
|
||||
if (!this.isRipening) {
|
||||
return this.colour;
|
||||
}
|
||||
final float stage = this.getRipeningStage(ripeningTime);
|
||||
final int r = (this.colourUnripe >> 16 & 0xFF) + (int) (this.diffR * stage);
|
||||
final int g = (this.colourUnripe >> 8 & 0xFF) + (int) (this.diffG * stage);
|
||||
final int b = (this.colourUnripe & 0xFF) + (int) (this.diffB * stage);
|
||||
return (r & 0xFF) << 16 | (g & 0xFF) << 8 | (b & 0xFF);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraTrees.proxy.localise("item.food." + this.getClass().getTypeName().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFruitFamily getFamily() {
|
||||
return this.family;
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public boolean markAsFruitLeaf(final ITreeGenome genome, final World world, final int x, final int y, final int z) {
|
||||
// return this.pod == null;
|
||||
// }
|
||||
|
||||
@Override
|
||||
public int getRipeningPeriod() {
|
||||
return this.ripeningPeriod;
|
||||
}
|
||||
|
||||
|
||||
//TODO producsts
|
||||
@Nonnull
|
||||
@Override
|
||||
public HashMap<ItemStack, Float> getProducts() {
|
||||
return products;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public ItemStack[] getFruits(final ITreeGenome genome, final World world, final int x, final int y, final int z, final int ripeningTime) {
|
||||
// if (this.pod != null) {
|
||||
// if (ripeningTime >= 2) {
|
||||
// final List<ItemStack> product = new ArrayList<ItemStack>();
|
||||
// for (final Map.Entry<ItemStack, Float> entry : this.products.entrySet()) {
|
||||
// final ItemStack single = entry.getKey().copy();
|
||||
// single.stackSize = 1;
|
||||
// for (int i = 0; i < entry.getKey().stackSize; ++i) {
|
||||
// if (world.rand.nextFloat() <= entry.getValue()) {
|
||||
// product.add(single.copy());
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// return product.toArray(new ItemStack[0]);
|
||||
// }
|
||||
// return new ItemStack[0];
|
||||
// }
|
||||
// else {
|
||||
// final ArrayList<ItemStack> product2 = new ArrayList<ItemStack>();
|
||||
// final float stage = this.getRipeningStage(ripeningTime);
|
||||
// if (stage < 0.5f) {
|
||||
// return new ItemStack[0];
|
||||
// }
|
||||
// final float modeYieldMod = 1.0f;
|
||||
// for (final Map.Entry<ItemStack, Float> entry2 : this.products.entrySet()) {
|
||||
// if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * entry2.getValue() * 5.0f * stage) {
|
||||
// product2.add(entry2.getKey().copy());
|
||||
// }
|
||||
// }
|
||||
// return product2.toArray(new ItemStack[0]);
|
||||
// }
|
||||
// }
|
||||
|
||||
private float getRipeningStage(final int ripeningTime) {
|
||||
if (ripeningTime >= this.ripeningPeriod) {
|
||||
return 1.0f;
|
||||
}
|
||||
return ripeningTime / this.ripeningPeriod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresFruitBlocks() {
|
||||
return this.pod != null;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean trySpawnFruitBlock(final ITreeGenome genome, final World world, final int x, final int y, final int z) {
|
||||
// return this.pod != null && world.rand.nextFloat() <= genome.getSappiness() && Binnie.Genetics.getTreeRoot().setFruitBlock(world, (IAlleleFruit) genome.getActiveAllele(EnumTreeChromosome.FRUITS), genome.getSappiness(), this.pod.getTextures(), x, y, z);
|
||||
// }
|
||||
|
||||
public boolean setFruitBlock(final World world, final IAlleleFruit allele, final float sappiness, final int x, final int y, final int z) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// public static int getDirectionalMetadata(final World world, final int x, final int y, final int z) {
|
||||
// for (int i = 0; i < 4; ++i) {
|
||||
// if (isValidPot(world, x, y, z, i)) {
|
||||
// return i;
|
||||
// }
|
||||
// }
|
||||
// return -1;
|
||||
// }
|
||||
|
||||
// public static boolean isValidPot(final World world, int x, final int y, int z, final int notchDirection) {
|
||||
// x += Direction.offsetX[notchDirection];
|
||||
// z += Direction.offsetZ[notchDirection];
|
||||
// final Block block = world.getBlock(x, y, z);
|
||||
// if (block == Blocks.log || block == Blocks.log2) {
|
||||
// return BlockLog.func_150165_c(world.getBlockMetadata(x, y, z)) == 3;
|
||||
// }
|
||||
// return block != null && block.isWood(world, x, y, z);
|
||||
// }
|
||||
|
||||
// @Override
|
||||
// public short getIconIndex(final ITreeGenome genome, final IBlockAccess world, final int x, final int y, final int z, final int ripeningTime, final boolean fancy) {
|
||||
// return this.index.getIndex();
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(final IIconRegister register) {
|
||||
// if (this.ordinal() == 0) {
|
||||
// for (final FruitSprite sprite : FruitSprite.values()) {
|
||||
// sprite.registerIcons(register);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResourceLocation getDecorativeSprite() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getDescription();
|
||||
}
|
||||
|
||||
public String getNameOfFruit() {
|
||||
if (this == ExtraTreeFruitGene.Apple) {
|
||||
return "Apple";
|
||||
}
|
||||
for (final ItemStack stack : this.products.keySet()) {
|
||||
if (stack.getItem() == ExtraTrees.itemFood) {
|
||||
return Food.values()[stack.getItemDamage()].toString();
|
||||
}
|
||||
}
|
||||
return "NoFruit";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return this.getUID();
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,36 @@
|
||||
package binnie.extratrees.genetics;
|
||||
|
||||
import binnie.core.resource.BinnieIcon;
|
||||
import java.util.Locale;
|
||||
|
||||
public enum FruitSprite //implements IIconProvider
|
||||
{
|
||||
Tiny,
|
||||
Small,
|
||||
Average,
|
||||
Large,
|
||||
Larger,
|
||||
Pear;
|
||||
import binnie.Constants;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
BinnieIcon icon;
|
||||
public enum FruitSprite{
|
||||
TINY,
|
||||
SMALL,
|
||||
AVERAGE,
|
||||
LARGE,
|
||||
LARGER,
|
||||
PEAR;
|
||||
|
||||
public short getIndex() {
|
||||
return (short) (this.ordinal() + 4200);
|
||||
public static final FruitSprite[] VALUES = values();
|
||||
private final ResourceLocation location;
|
||||
|
||||
private FruitSprite() {
|
||||
location = new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, "blocks/fruit/" + name().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public ResourceLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerSprites() {
|
||||
TextureMap map = Proxies.common.getClientInstance().getTextureMapBlocks();
|
||||
map.registerSprite(location);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public IIcon getIcon(final short texUID) {
|
||||
// final int index = texUID - 4200;
|
||||
// if (index >= 0 && index < values().length) {
|
||||
// return values()[index].icon.getIcon();
|
||||
// }
|
||||
// return null;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerIcons(final IIconRegister register) {
|
||||
// this.icon = Binnie.Resource.getBlockIcon(ExtraTrees.instance, "fruit/" + this.toString().toLowerCase());
|
||||
// }
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class ModuleGenetics implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
ExtraTreeFruitGene.init();
|
||||
AlleleETFruit.init();
|
||||
ETTreeDefinition.initTrees();
|
||||
ExtraTreeMutation.init();
|
||||
}
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
package binnie.extratrees.genetics;
|
||||
|
||||
import binnie.extratrees.gen.WorldGenDefault;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.arboriculture.*;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.arboriculture.genetics.Tree;
|
||||
import forestry.arboriculture.tiles.TileLeaves;
|
||||
import forestry.core.genetics.alleles.AlleleBoolean;
|
||||
import forestry.core.tiles.TileUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class TreeGenerator implements ITreeGenerator {
|
||||
Class<? extends WorldGenerator> generator;
|
||||
IWoodType woodType;
|
||||
|
||||
public TreeGenerator(Class<? extends WorldGenerator> generator, @Nullable IWoodType woodType) {
|
||||
this.generator = generator;
|
||||
this.woodType = woodType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldGenerator getWorldGenerator(ITreeGenData tree) {
|
||||
try {
|
||||
return generator.getConstructor(ITree.class).newInstance(tree);
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
return new WorldGenDefault(tree);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setLogBlock(ITreeGenome genome, World world, BlockPos pos, EnumFacing facing) {
|
||||
if (woodType != null) {
|
||||
AlleleBoolean fireproofAllele = (AlleleBoolean) genome.getActiveAllele(EnumTreeChromosome.FIREPROOF);
|
||||
boolean fireproof = fireproofAllele.getValue();
|
||||
return world.setBlockState(pos, TreeManager.woodAccess.getBlock(woodType, WoodBlockKind.LOG, fireproof), 2);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setLeaves(ITreeGenome genome, World world, GameProfile owner, BlockPos pos) {
|
||||
boolean placed = world.setBlockState(pos, PluginArboriculture.blocks.leaves.getDefaultState());
|
||||
if (!placed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
if (PluginArboriculture.blocks.leaves != block) {
|
||||
world.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
|
||||
TileLeaves tileLeaves = TileUtil.getTile(world, pos, TileLeaves.class);
|
||||
if (tileLeaves == null) {
|
||||
world.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
|
||||
tileLeaves.getOwnerHandler().setOwner(owner);
|
||||
tileLeaves.setTree(new Tree(genome));
|
||||
|
||||
world.markBlockRangeForRenderUpdate(pos, pos);
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,7 +4,6 @@ import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.item.ItemMisc;
|
||||
import binnie.core.liquid.ItemFluidContainer;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.EnumExtraTreeLog;
|
||||
@@ -132,9 +131,9 @@ public class ModuleItems implements IInitializable {
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getFluidStack("water", 2000), null, new ItemStack(ExtraTrees.itemDictionary), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotCopper", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getFluidStack("water", 2000), null, new ItemStack(ExtraTrees.itemDictionaryLepi), "X#X", "YEY", "RDR", '#', Blocks.GLASS_PANE, 'X', Items.GOLD_INGOT, 'Y', "ingotBronze", 'R', Items.REDSTONE, 'D', Items.DIAMOND, 'E', Items.EMERALD);
|
||||
RecipeManagers.stillManager.addRecipe(25, ExtraTreeLiquid.Resin.get(5), ExtraTreeLiquid.Turpentine.get(3));
|
||||
RecipeManagers.carpenterManager.addRecipe(25, ExtraTreeLiquid.Turpentine.get(50), null, ((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 4), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
RecipeManagers.carpenterManager.addRecipe(25, ExtraTreeLiquid.Turpentine.get(50), null, ExtraTrees.itemMisc.getStack(ExtraTreeItems.WoodWax, 4), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
if (Binnie.Liquid.getFluidStack("Creosote Oil", 100) != null) {
|
||||
RecipeManagers.carpenterManager.addRecipe(25, Binnie.Liquid.getFluidStack("Creosote Oil", 50), null, ((ItemMisc) ExtraTrees.itemMisc).getStack(ExtraTreeItems.WoodWax, 1), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
RecipeManagers.carpenterManager.addRecipe(25, Binnie.Liquid.getFluidStack("Creosote Oil", 50), null, ExtraTrees.itemMisc.getStack(ExtraTreeItems.WoodWax, 1), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
}
|
||||
for (final FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
|
||||
if (data.fluid.isFluidEqual(Binnie.Liquid.getFluidStack("water", 0)) && data.fluid.amount == 1000) {
|
||||
|
||||
@@ -1,16 +1,7 @@
|
||||
package binnie.extratrees.proxy;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import binnie.core.proxy.BinnieModProxy;
|
||||
import forestry.core.models.BlockModelEntry;
|
||||
import forestry.core.models.ModelEntry;
|
||||
import forestry.core.models.ModelManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
|
||||
public class Proxy extends BinnieModProxy implements IExtraTreeProxy {
|
||||
@Override
|
||||
|
||||
@@ -8,20 +8,9 @@ import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.BlockETDecorativeLeaves;
|
||||
import binnie.extratrees.block.slab.BlockETSlab;
|
||||
import binnie.extratrees.models.ModelETDecorativeLeaves;
|
||||
import forestry.api.arboriculture.EnumPileType;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.arboriculture.blocks.BlockDecorativeLeaves;
|
||||
import forestry.arboriculture.blocks.slab.BlockArbSlab;
|
||||
import forestry.arboriculture.models.ModelDecorativeLeaves;
|
||||
import forestry.arboriculture.models.ModelLeaves;
|
||||
import forestry.arboriculture.models.ModelWoodPile;
|
||||
import forestry.arboriculture.models.WoodModelLoader;
|
||||
import forestry.arboriculture.proxy.ProxyArboricultureClient;
|
||||
import forestry.arboriculture.render.CharcoalPileRenderer;
|
||||
import forestry.arboriculture.tiles.TilePile;
|
||||
import forestry.core.models.BlockModelEntry;
|
||||
import forestry.core.models.ModelEntry;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
@@ -29,8 +18,6 @@ import net.minecraft.client.renderer.block.statemap.StateMapperBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.fml.client.registry.ClientRegistry;
|
||||
|
||||
public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
public static ModelManager modelManager = new ModelManager(Constants.EXTRA_TREES_MOD_ID);
|
||||
@@ -42,7 +29,7 @@ public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
|
||||
@Override
|
||||
public void registerBlockModel(@Nonnull final BlockModelEntry index) {
|
||||
getModelManager().registerCustomBlockModel(index);
|
||||
ModelManager.registerCustomBlockModel(index);
|
||||
if(index.addStateMapper){
|
||||
StateMapperBase ignoreState = new BlockModeStateMapper(index);
|
||||
ModelLoader.setCustomStateMapper(index.block, ignoreState);
|
||||
@@ -51,7 +38,7 @@ public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
|
||||
@Override
|
||||
public void registerModel(@Nonnull ModelEntry index) {
|
||||
getModelManager().registerCustomModel(index);
|
||||
ModelManager.registerCustomModel(index);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-2
@@ -13,7 +13,6 @@ import org.apache.commons.lang3.time.DurationFormatUtils;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.awt.Color;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
@@ -86,7 +85,7 @@ public class InoculatorRecipeWrapper extends BlankRecipeWrapper {
|
||||
}
|
||||
|
||||
// todo: 1.11 use MinecraftForgeClient#getLocale() for integer formatting
|
||||
NumberFormat decimalFormat = DecimalFormat.getIntegerInstance();
|
||||
NumberFormat decimalFormat = NumberFormat.getIntegerInstance();
|
||||
String powerString = decimalFormat.format(power) + " RF";
|
||||
int xPower = 15 + (recipeWidth - minecraft.fontRendererObj.getStringWidth(powerString)) / 2;
|
||||
minecraft.fontRendererObj.drawString(powerString, xPower, 5, Color.gray.getRGB());
|
||||
|
||||
Reference in new issue
Block a user