mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-28 07:35:47 +00:00
Fix #1216 Portable Alyzer issues
This commit is contained in:
1 parent
2155f9eac9
commit
a30ff61c9a
27 files changed
+406
-519
No files matched your search
@@ -9,7 +9,7 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
/**
|
||||
* Holds a static reference to the {@link IAlleleRegistry}.
|
||||
@@ -28,7 +28,7 @@ public class AlleleManager {
|
||||
/**
|
||||
* Translates plain saplings into genetic data. Used by the treealyzer and the farm to convert foreign saplings.
|
||||
*/
|
||||
public static Map<ItemStack, IIndividual> saplingTranslation = new HashMap<>();
|
||||
public static Map<Item, ISaplingTranslator> saplingTranslation = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Queryable instance of an {@link IClimateHelper} for easier implementation.
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IAlyzer<II extends IIndividual, T extends ISpeciesType, G extends IGuiAlyzer, I extends IInventory> {
|
||||
|
||||
ISpeciesRoot getSpeciesRoot();
|
||||
|
||||
Map<String, ItemStack> getIconStacks();
|
||||
|
||||
ResourceLocation getGuiTexture();
|
||||
|
||||
boolean canSlotAccept(I inventory, int slotIndex, ItemStack itemStack);
|
||||
|
||||
void onSlotClick(I inventory, int slotIndex, EntityPlayer player);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPage1(G gui, II individual, T type);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPage2(G gui, II individual, T type);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPage3(G gui, II individual, T type);
|
||||
|
||||
boolean isAlyzingFuel(ItemStack itemstack);
|
||||
|
||||
T getDefaultType();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.core.gui.GuiAlyzer;
|
||||
|
||||
public interface IAlyzerPlugin {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPage1(GuiAlyzer gui, ItemStack itemStack);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPage2(GuiAlyzer gui, ItemStack itemStack);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPage3(GuiAlyzer gui, ItemStack itemStack);
|
||||
|
||||
List<String> getHints();
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public interface IGuiAlyzer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
int getColorCoding(boolean dominant);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawLine(String text, int x, IIndividual individual, IChromosomeType chromosome, boolean inactive);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawSplitLine(String text, int x, int maxWidth, IIndividual individual, IChromosomeType chromosome, boolean inactive);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawRow(String text0, String text1, String text2, IIndividual individual, IChromosomeType chromosome);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawChromosomeRow(String chromosomeName, IIndividual individual, IChromosomeType chromosome);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawSpeciesRow(String text0, IIndividual individual, IChromosomeType chromosome, String customPrimaryName, String customSecondaryName);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsOverview();
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPageClassification(IIndividual individual);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawAnalyticsPageMutations(IIndividual individual);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawMutationInfo(IMutation combination, IAllele species, int x);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawToleranceInfo(IAlleleTolerance toleranceAllele, int x);
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
void drawFertilityInfo(int fertility, int x, int textColor, int texOffset);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package forestry.api.genetics;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.arboriculture.ITree;
|
||||
|
||||
public interface ISaplingTranslator {
|
||||
@Nullable
|
||||
ITree getTreeFromSapling(ItemStack sapling);
|
||||
}
|
||||
@@ -179,5 +179,8 @@ public interface ISpeciesRoot {
|
||||
*/
|
||||
IChromosomeType getKaryotypeKey();
|
||||
|
||||
IAlyzer getAlyzer();
|
||||
/**
|
||||
* Plugin to add information for the handheld genetic analyzer.
|
||||
*/
|
||||
IAlyzerPlugin getAlyzerPlugin();
|
||||
}
|
||||
Reference in new issue
Block a user