mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-23 21:49:49 +00:00
Minor cleanups (#50)
* Finalize, minor alloc reduction Also enable Jabel and generic injection * Update dependencies.gradle * Clean up Machine a bit * spotless more enhanced instanceof * Update ModuleMachine.java * More clen * WARN: Removed exception catching * Many, many tiny patches + birthday fix * Spotless * Spotless again * Fix getLow and clamp tolerance value * Revert event -> ignored on unused event parameters * Rename instanceof variables * Update Machine.java * Use StringBuilder * Cache getStack() * Oops, Jabel can't handle that * Spotless * Spotless again My IDE was fighting with it * Remove unused elements + scream test success
This commit is contained in:
1 parent
6b4f3eb1c7
commit
f0f14bb278
325 files changed
+1205
-1868
No files matched your search
@@ -4,6 +4,7 @@ import net.minecraft.item.Item;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.Tags;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
@@ -27,7 +28,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
@Mod(
|
||||
modid = "Genetics",
|
||||
name = "Genetics",
|
||||
version = BinnieCore.VERSION,
|
||||
version = Tags.VERSION,
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore")
|
||||
public class Genetics extends AbstractMod {
|
||||
|
||||
@@ -24,8 +24,6 @@ public enum GeneticsPacket implements IPacketID {
|
||||
EntityPlayer player = BinnieCore.proxy.getPlayer();
|
||||
GeneTracker tracker;
|
||||
tracker = GeneTracker.getTracker(BinnieCore.proxy.getWorld(), player.getGameProfile());
|
||||
if (tracker != null) {
|
||||
tracker.readFromNBT(packet.getTagCompound());
|
||||
}
|
||||
tracker.readFromNBT(packet.getTagCompound());
|
||||
}
|
||||
}
|
||||
@@ -25,10 +25,10 @@ public enum GeneticsTexture implements IBinnieTexture {
|
||||
Acclimatiser(ResourceType.Tile, "Acclimatiser"),
|
||||
Splicer(ResourceType.Tile, "Splicer");
|
||||
|
||||
public static BinnieIcon dnaIcon = Binnie.Resource.getItemIcon(Genetics.instance, "dna");
|
||||
public static final BinnieIcon dnaIcon = Binnie.Resource.getItemIcon(Genetics.instance, "dna");
|
||||
|
||||
protected String texture;
|
||||
protected ResourceType type;
|
||||
private final String texture;
|
||||
private final ResourceType type;
|
||||
|
||||
GeneticsTexture(ResourceType base, String texture) {
|
||||
this.texture = texture;
|
||||
|
||||
@@ -70,11 +70,6 @@ public class ControlGene extends Control implements IControlValue<IGene>, IToolt
|
||||
gene = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
if (isMouseOver() && canFill(Window.get(this).getHeldItemStack())) {
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ControlGeneScroll extends Control implements IControlValue<Breeding
|
||||
}
|
||||
}
|
||||
|
||||
if (discovered.size() == 0) {
|
||||
if (discovered.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ public class ControlSplicerProgress extends ControlProgressBase {
|
||||
public ControlSplicerProgress(IWidget parent, float x, float y, float w, float h) {
|
||||
super(parent, x, y, w, h);
|
||||
strength = 0.0f;
|
||||
strength = 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -27,7 +26,6 @@ public class ControlSplicerProgress extends ControlProgressBase {
|
||||
float oy = ooy + ddy * progress;
|
||||
|
||||
for (int i = 0; i < n; ++i) {
|
||||
int seed = 432523;
|
||||
int[] colours = { 0x990000, 0x007700, 0x0000ff, 0x997700 };
|
||||
int c1 = colours[(int) Math.abs(13.0 * Math.sin(i) + 48.0 * Math.cos(i) + 25.0 * Math.sin(7 * i)) % 4];
|
||||
int c2 = colours[(int) Math.abs(23.0 * Math.sin(i) + 28.0 * Math.cos(i) + 15.0 * Math.sin(7 * i)) % 4];
|
||||
|
||||
@@ -78,9 +78,7 @@ public class WindowGeneBank extends WindowMachine {
|
||||
@Override
|
||||
public void initialiseServer() {
|
||||
GeneTracker tracker = GeneTracker.getTracker(getWorld(), getUsername());
|
||||
if (tracker != null) {
|
||||
tracker.synchToPlayer(getPlayer());
|
||||
}
|
||||
tracker.synchToPlayer(getPlayer());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -47,8 +47,8 @@ public class GeneArrayItem implements INBTTagable, IGeneItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getInfo(List tooltip) {
|
||||
List<Object> totalList = new ArrayList<>();
|
||||
public void getInfo(List<String> tooltip) {
|
||||
List<String> totalList = new ArrayList<>();
|
||||
for (IGene gene : genes) {
|
||||
String chromosomeName = getBreedingSystem().getChromosomeName(gene.getChromosome());
|
||||
totalList.add(EnumChatFormatting.GOLD + chromosomeName + EnumChatFormatting.GRAY + ": " + gene.getName());
|
||||
@@ -64,7 +64,7 @@ public class GeneArrayItem implements INBTTagable, IGeneItem {
|
||||
}
|
||||
|
||||
public BreedingSystem getBreedingSystem() {
|
||||
if (genes.size() == 0) {
|
||||
if (genes.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
BreedingSystem system = Binnie.Genetics.getSystem(genes.get(0).getSpeciesRoot().getUID());
|
||||
|
||||
@@ -52,7 +52,7 @@ public class GeneItem implements INBTTagable, IGeneItem {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getInfo(List tooltip) {
|
||||
public void getInfo(List<String> tooltip) {
|
||||
String chromosomeName = getBreedingSystem().getChromosomeName(gene.getChromosome());
|
||||
tooltip.add(EnumChatFormatting.GOLD + chromosomeName + EnumChatFormatting.GRAY + ": " + gene.getName());
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import forestry.api.genetics.ISpeciesRoot;
|
||||
public class GeneTracker extends WorldSavedData {
|
||||
|
||||
GameProfile username;
|
||||
private ArrayList<IGene> discoveredGenes;
|
||||
private final ArrayList<IGene> discoveredGenes;
|
||||
|
||||
public GeneTracker(String s, GameProfile username) {
|
||||
super(s);
|
||||
|
||||
@@ -11,7 +11,7 @@ public interface IGeneItem {
|
||||
|
||||
ISpeciesRoot getSpeciesRoot();
|
||||
|
||||
void getInfo(List tooltip);
|
||||
void getInfo(List<String> tooltip);
|
||||
|
||||
int getColour(int color);
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.item.crafting.ShapedRecipes;
|
||||
import net.minecraft.item.crafting.ShapelessRecipes;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
@@ -43,8 +44,9 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
for (Map.Entry<Object[], Object[]> recipe : RecipeManagers.centrifugeManager.getRecipes().entrySet()) {
|
||||
boolean isRecipe = false;
|
||||
for (Object obj : recipe.getKey()) {
|
||||
if (obj instanceof ItemStack && stack.isItemEqual((ItemStack) obj)) {
|
||||
if (obj instanceof ItemStack i && stack.isItemEqual(i)) {
|
||||
isRecipe = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,8 +66,9 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
for (Map.Entry<Object[], Object[]> recipe : RecipeManagers.squeezerManager.getRecipes().entrySet()) {
|
||||
boolean isRecipe = false;
|
||||
for (Object obj : recipe.getKey()) {
|
||||
if (obj instanceof ItemStack && stack.isItemEqual((ItemStack) obj)) {
|
||||
if (obj instanceof ItemStack i && stack.isItemEqual(i)) {
|
||||
isRecipe = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,73 +85,72 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
|
||||
public Collection<ItemStack> getCrafting(ItemStack stack) {
|
||||
List<ItemStack> products = new ArrayList<>();
|
||||
for (Object recipeO : CraftingManager.getInstance().getRecipeList()) {
|
||||
if (recipeO instanceof ShapelessRecipes) {
|
||||
ShapelessRecipes recipe = (ShapelessRecipes) recipeO;
|
||||
for (IRecipe iRecipe : CraftingManager.getInstance().getRecipeList()) {
|
||||
if (iRecipe instanceof ShapelessRecipes shapeless) {
|
||||
boolean match = true;
|
||||
for (Object rec : recipe.recipeItems) {
|
||||
if (rec != null && (!(rec instanceof ItemStack) || !stack.isItemEqual((ItemStack) rec))) {
|
||||
for (final ItemStack rec : shapeless.recipeItems) {
|
||||
if (rec != null && !stack.isItemEqual(rec)) {
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (match) {
|
||||
products.add(recipe.getRecipeOutput());
|
||||
products.add(shapeless.getRecipeOutput());
|
||||
}
|
||||
}
|
||||
|
||||
if (recipeO instanceof ShapedRecipes) {
|
||||
ShapedRecipes recipe2 = (ShapedRecipes) recipeO;
|
||||
if (iRecipe instanceof ShapedRecipes shaped) {
|
||||
boolean match = true;
|
||||
for (Object rec2 : recipe2.recipeItems) {
|
||||
if (rec2 != null && (!(rec2 instanceof ItemStack) || !stack.isItemEqual((ItemStack) rec2))) {
|
||||
for (final ItemStack rec : shaped.recipeItems) {
|
||||
if (rec != null && !stack.isItemEqual(rec)) {
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (match) {
|
||||
products.add(recipe2.getRecipeOutput());
|
||||
products.add(shaped.getRecipeOutput());
|
||||
}
|
||||
}
|
||||
|
||||
if (recipeO instanceof ShapelessOreRecipe) {
|
||||
ShapelessOreRecipe recipe3 = (ShapelessOreRecipe) recipeO;
|
||||
if (iRecipe instanceof ShapelessOreRecipe shapelessOre) {
|
||||
boolean match = true;
|
||||
for (Object rec : recipe3.getInput()) {
|
||||
if (rec != null && (!(rec instanceof ItemStack) || !stack.isItemEqual((ItemStack) rec))) {
|
||||
for (final Object rec : shapelessOre.getInput()) {
|
||||
if (rec != null && (!(rec instanceof ItemStack i) || !stack.isItemEqual(i))) {
|
||||
match = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!match) {
|
||||
continue;
|
||||
}
|
||||
products.add(recipe3.getRecipeOutput());
|
||||
products.add(shapelessOre.getRecipeOutput());
|
||||
}
|
||||
}
|
||||
return products;
|
||||
}
|
||||
|
||||
public Collection<FluidStack> getAllFluids(ItemStack stack) {
|
||||
List<FluidStack> products = new ArrayList<>();
|
||||
products.addAll(getSqueezerFluid(stack));
|
||||
return products;
|
||||
return new ArrayList<>(getSqueezerFluid(stack));
|
||||
}
|
||||
|
||||
public Collection<FluidStack> getSqueezerFluid(ItemStack stack) {
|
||||
List<FluidStack> products = new ArrayList<>();
|
||||
for (Map.Entry<Object[], Object[]> recipe : RecipeManagers.squeezerManager.getRecipes().entrySet()) {
|
||||
for (final Map.Entry<Object[], Object[]> recipe : RecipeManagers.squeezerManager.getRecipes().entrySet()) {
|
||||
boolean isRecipe = false;
|
||||
for (Object obj : recipe.getKey()) {
|
||||
if (obj instanceof ItemStack && stack.isItemEqual((ItemStack) obj)) {
|
||||
for (final Object obj : recipe.getKey()) {
|
||||
if (obj instanceof ItemStack i && stack.isItemEqual(i)) {
|
||||
isRecipe = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isRecipe) {
|
||||
for (Object obj : recipe.getValue()) {
|
||||
if (obj instanceof FluidStack) {
|
||||
products.add((FluidStack) obj);
|
||||
for (final Object obj : recipe.getValue()) {
|
||||
if (obj instanceof FluidStack f) {
|
||||
products.add(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -156,41 +158,41 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
return products;
|
||||
}
|
||||
|
||||
protected Collection<? extends FluidStack> getAllProducts(FluidStack stack) {
|
||||
protected Collection<? extends FluidStack> getAllProducts() {
|
||||
return new UniqueFluidStackSet();
|
||||
}
|
||||
|
||||
protected Collection<ItemStack> getAllProductsAndFluids(Collection<ItemStack> collection) {
|
||||
Collection<ItemStack> products = new UniqueItemStackSet();
|
||||
for (ItemStack stack : collection) {
|
||||
for (final ItemStack stack : collection) {
|
||||
products.addAll(getAllProducts(stack));
|
||||
}
|
||||
|
||||
Collection<ItemStack> products2 = new UniqueItemStackSet();
|
||||
for (ItemStack stack2 : products) {
|
||||
for (final ItemStack stack2 : products) {
|
||||
products2.addAll(getAllProducts(stack2));
|
||||
}
|
||||
|
||||
Collection<ItemStack> products3 = new UniqueItemStackSet();
|
||||
for (ItemStack stack3 : products2) {
|
||||
for (final ItemStack stack3 : products2) {
|
||||
products3.addAll(getAllProducts(stack3));
|
||||
}
|
||||
|
||||
products.addAll(products2);
|
||||
products.addAll(products3);
|
||||
Collection<FluidStack> allFluids = new UniqueFluidStackSet();
|
||||
for (ItemStack stack4 : collection) {
|
||||
for (final ItemStack stack4 : collection) {
|
||||
allFluids.addAll(getAllFluids(stack4));
|
||||
}
|
||||
|
||||
Collection<FluidStack> fluids2 = new UniqueFluidStackSet();
|
||||
for (FluidStack stack5 : allFluids) {
|
||||
fluids2.addAll(getAllProducts(stack5));
|
||||
for (FluidStack ignored : allFluids) {
|
||||
fluids2.addAll(getAllProducts());
|
||||
}
|
||||
|
||||
Collection<FluidStack> fluids3 = new UniqueFluidStackSet();
|
||||
for (FluidStack stack6 : fluids2) {
|
||||
fluids3.addAll(getAllProducts(stack6));
|
||||
for (FluidStack ignored : fluids2) {
|
||||
fluids3.addAll(getAllProducts());
|
||||
}
|
||||
|
||||
allFluids.addAll(fluids2);
|
||||
|
||||
@@ -134,7 +134,7 @@ public class AnalystPageSoil extends ControlAnalystPage {
|
||||
|
||||
protected void createMoisture(IWidget parent, float x, float y, float w, float h, EnumMoisture value,
|
||||
EnumTolerance tol) {
|
||||
new ControlToleranceBar<EnumMoisture>(parent, x, y, w, h, EnumMoisture.class) {
|
||||
new ControlToleranceBar<>(parent, x, y, w, h, EnumMoisture.class) {
|
||||
|
||||
@Override
|
||||
protected String getName(EnumMoisture value) {
|
||||
@@ -143,14 +143,18 @@ public class AnalystPageSoil extends ControlAnalystPage {
|
||||
|
||||
@Override
|
||||
protected int getColor(EnumMoisture value) {
|
||||
return (new int[] { 0xccffcc, 0x66ccff, 0x3366ff })[value.ordinal()];
|
||||
return switch (value) {
|
||||
case DRY -> 0xccffcc;
|
||||
case NORMAL -> 0x66ccff;
|
||||
case DAMP -> 0x3366ff;
|
||||
};
|
||||
}
|
||||
}.setValues(value, tol);
|
||||
}
|
||||
|
||||
protected void createAcidity(IWidget parent, float x, float y, float w, float h, EnumAcidity value,
|
||||
EnumTolerance tol) {
|
||||
new ControlToleranceBar<EnumAcidity>(parent, x, y, w, h, EnumAcidity.class) {
|
||||
new ControlToleranceBar<>(parent, x, y, w, h, EnumAcidity.class) {
|
||||
|
||||
@Override
|
||||
protected String getName(EnumAcidity value) {
|
||||
@@ -159,7 +163,11 @@ public class AnalystPageSoil extends ControlAnalystPage {
|
||||
|
||||
@Override
|
||||
protected int getColor(EnumAcidity value) {
|
||||
return (new int[] { 0xff0066, 0x00ff00, 0x0066ff })[value.ordinal()];
|
||||
return switch (value) {
|
||||
case ACID -> 0xff0066;
|
||||
case NEUTRAL -> 0x00ff00;
|
||||
case ALKALINE -> 0x0066ff;
|
||||
};
|
||||
}
|
||||
}.setValues(value, tol);
|
||||
}
|
||||
|
||||
@@ -47,15 +47,11 @@ public class AnalystPageWood extends AnalystPageProduce {
|
||||
products.add(stackWood);
|
||||
}
|
||||
|
||||
// for (ItemStack stack :
|
||||
// ind.getGenome().getFruitProvider().getProducts()) {
|
||||
// products.add(stack);
|
||||
// }
|
||||
|
||||
if (products.size() > 0) {
|
||||
if (!products.isEmpty()) {
|
||||
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.wood.logs")).setColor(getColor());
|
||||
y += 10;
|
||||
int w = products.size() * 18 - 2;
|
||||
// TODO: Is this meant to increment i?
|
||||
int i = 0;
|
||||
for (ItemStack stack : products) {
|
||||
ControlItemDisplay d = new ControlItemDisplay(this, (w() - w) / 2.0f + 18 * i, y);
|
||||
@@ -70,12 +66,12 @@ public class AnalystPageWood extends AnalystPageProduce {
|
||||
|
||||
Collection<ItemStack> refinedProducts = new UniqueItemStackSet();
|
||||
refinedProducts.addAll(getAllProductsAndFluids(allProducts));
|
||||
if (refinedProducts.size() > 0) {
|
||||
if (!refinedProducts.isEmpty()) {
|
||||
y = getRefined(I18N.localise("genetics.gui.analyst.wood.products"), y, refinedProducts);
|
||||
y += 8;
|
||||
}
|
||||
|
||||
if (products.size() == 0) {
|
||||
if (products.isEmpty()) {
|
||||
new ControlTextCentered(this, y, I18N.localise("genetics.gui.analyst.wood.noFruits")).setColor(getColor());
|
||||
y += 28;
|
||||
}
|
||||
|
||||
@@ -14,11 +14,6 @@ public abstract class ControlAnalystPage extends Control {
|
||||
hide();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public abstract String getTitle();
|
||||
|
||||
protected String getTimeString(float time) {
|
||||
|
||||
@@ -20,7 +20,7 @@ public abstract class ControlToleranceBar<T extends Enum<T>> extends Control imp
|
||||
|
||||
EnumSet<T> tolerated;
|
||||
EnumSet<T> fullSet;
|
||||
private Class<T> enumClass;
|
||||
private final Class<T> enumClass;
|
||||
|
||||
public ControlToleranceBar(IWidget parent, float x, float y, float width, float height, Class<T> clss) {
|
||||
super(parent, x, y, width, height);
|
||||
|
||||
@@ -315,7 +315,7 @@ public class WindowAnalyst extends Window {
|
||||
|
||||
ControlAnalystPage databasePage = null;
|
||||
if (isDatabase && !systemChange) {
|
||||
databasePage = ((analystPages.size() > 0) ? analystPages.get(0) : null);
|
||||
databasePage = ((!analystPages.isEmpty()) ? analystPages.get(0) : null);
|
||||
}
|
||||
|
||||
analystPages.clear();
|
||||
@@ -419,8 +419,8 @@ public class WindowAnalyst extends Window {
|
||||
x += width;
|
||||
}
|
||||
|
||||
if (analystPages.size() > 0) {
|
||||
setPage(leftPage, analystPages.get((oldLeft >= 0) ? oldLeft : 0));
|
||||
if (!analystPages.isEmpty()) {
|
||||
setPage(leftPage, analystPages.get(Math.max(oldLeft, 0)));
|
||||
}
|
||||
if (analystPages.size() > 1) {
|
||||
setPage(rightPage, analystPages.get((oldRight >= 0) ? oldRight : 1));
|
||||
|
||||
@@ -18,17 +18,15 @@ public enum GeneticLiquid implements IFluidType {
|
||||
RawDNA("dna.raw", 0xe63de9),
|
||||
BacteriaVector("bacteriaVector", 0xf38b7e);
|
||||
|
||||
protected String name;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int color;
|
||||
protected float transparency;
|
||||
private final String name;
|
||||
private final String ident;
|
||||
private IIcon icon;
|
||||
private final int color;
|
||||
|
||||
GeneticLiquid(String name, int color) {
|
||||
this.name = name;
|
||||
this.ident = name;
|
||||
this.color = color;
|
||||
transparency = 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,9 +25,9 @@ public enum GeneticsItems implements IItemMisc {
|
||||
IntegratedCPU("integratedCPU"),
|
||||
IntegratedCasing("casingCircuit");
|
||||
|
||||
protected IIcon icon;
|
||||
protected String name;
|
||||
protected String iconPath;
|
||||
private IIcon icon;
|
||||
private final String name;
|
||||
private final String iconPath;
|
||||
|
||||
GeneticsItems(String name) {
|
||||
this.name = name;
|
||||
@@ -45,7 +45,7 @@ public enum GeneticsItems implements IItemMisc {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(List data) {
|
||||
public void addInformation(List<String> data) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
|
||||
@@ -42,13 +42,13 @@ public class ItemDatabase extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ public class ItemFieldKit extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
int i = getMaxDamage() - itemStack.getItemDamage();
|
||||
if (i == 0) {
|
||||
tooltip.add(I18N.localise("genetics.item.fieldKit.tooltip.noPaper"));
|
||||
|
||||
@@ -34,11 +34,6 @@ public abstract class ItemGene extends Item {
|
||||
return icons[pass];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getShareTag() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
return false;
|
||||
@@ -73,7 +68,7 @@ public abstract class ItemGene extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
int damage = getMaxDamage() - stack.getItemDamage();
|
||||
if (damage == 0) {
|
||||
@@ -92,7 +87,7 @@ public abstract class ItemGene extends Item {
|
||||
public abstract String getItemStackDisplayName(ItemStack stack);
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> itemList) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ItemSequence extends Item implements IItemAnalysable, IItemChargabl
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
tooltip.add(I18N.localise("genetics.item.sequence." + (5 - stack.getItemDamage() % 6)));
|
||||
SequencerItem gene = new SequencerItem(stack);
|
||||
@@ -87,7 +87,7 @@ public class ItemSequence extends Item implements IItemAnalysable, IItemChargabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
IAlleleBeeSpecies species = (IAlleleBeeSpecies) AlleleManager.alleleRegistry
|
||||
.getAllele("forestry.speciesMeadows");
|
||||
list.add(create(new Gene(species, EnumBeeChromosome.SPECIES, Binnie.Genetics.getBeeRoot()), false));
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
|
||||
Map<IChromosomeType, List<IAllele>> chromosomeMap = Binnie.Genetics.getChromosomeMap(root);
|
||||
for (Map.Entry<IChromosomeType, List<IAllele>> entry : chromosomeMap.entrySet()) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
for (ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
|
||||
for (IIndividual template : root.getIndividualTemplates()) {
|
||||
if (template.getGenome().getPrimary().isSecret()) {
|
||||
|
||||
@@ -12,7 +12,7 @@ public enum AdvGeneticMachine implements IMachineType {
|
||||
|
||||
Splicer(SplicerPackage.class);
|
||||
|
||||
protected Class<? extends MachinePackage> cls;
|
||||
private final Class<? extends MachinePackage> cls;
|
||||
|
||||
AdvGeneticMachine(Class<? extends MachinePackage> cls) {
|
||||
this.cls = cls;
|
||||
|
||||
@@ -17,7 +17,7 @@ public enum GeneticMachine implements IMachineType {
|
||||
Polymeriser(PolymeriserPackage.class),
|
||||
Inoculator(InoculatorPackage.class);
|
||||
|
||||
protected Class<? extends MachinePackage> clss;
|
||||
private final Class<? extends MachinePackage> clss;
|
||||
|
||||
GeneticMachine(Class<? extends MachinePackage> clss) {
|
||||
this.clss = clss;
|
||||
|
||||
@@ -19,7 +19,7 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
Genepool(GenepoolPackage.class),
|
||||
Acclimatiser(AcclimatiserPackage.class);
|
||||
|
||||
private Class<? extends MachinePackage> clss;
|
||||
private final Class<? extends MachinePackage> clss;
|
||||
|
||||
LaboratoryMachine(Class<? extends MachinePackage> clss) {
|
||||
this.clss = clss;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class MachineRendererGenetics {
|
||||
|
||||
public RenderItem customRenderItem;
|
||||
|
||||
private ModelMachine model;
|
||||
private final ModelMachine model;
|
||||
|
||||
public MachineRendererGenetics() {
|
||||
model = new ModelMachine();
|
||||
@@ -39,8 +39,7 @@ public class MachineRendererGenetics {
|
||||
customRenderItem.setRenderManager(RenderManager.instance);
|
||||
}
|
||||
|
||||
public void renderMachine(Machine machine, int colour, BinnieResource texture, double x, double y, double z,
|
||||
float var8) {
|
||||
public void renderMachine(Machine machine, BinnieResource texture, double x, double y, double z) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
|
||||
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
|
||||
|
||||
@@ -21,11 +21,11 @@ public class MachineRendererLab {
|
||||
|
||||
public static MachineRendererLab instance = new MachineRendererLab();
|
||||
|
||||
private EntityItem dummyEntityItem;
|
||||
private EntityItem[] itemSides;
|
||||
private RenderItem customRenderItem;
|
||||
private final EntityItem dummyEntityItem;
|
||||
private final EntityItem[] itemSides;
|
||||
private final RenderItem customRenderItem;
|
||||
private long lastTick;
|
||||
private ModelMachine model;
|
||||
private final ModelMachine model;
|
||||
|
||||
public MachineRendererLab() {
|
||||
dummyEntityItem = new EntityItem(null);
|
||||
@@ -46,8 +46,7 @@ public class MachineRendererLab {
|
||||
}).setRenderManager(RenderManager.instance);
|
||||
}
|
||||
|
||||
public void renderMachine(Machine machine, int colour, BinnieResource texture, double x, double y, double z,
|
||||
float var8) {
|
||||
public void renderMachine(Machine machine, BinnieResource texture, double x, double y, double z) {
|
||||
GL11.glPushMatrix();
|
||||
int ix = machine.getTileEntity().xCoord;
|
||||
int iz = machine.getTileEntity().zCoord;
|
||||
|
||||
@@ -5,13 +5,13 @@ import net.minecraft.client.model.ModelRenderer;
|
||||
|
||||
public class ModelMachine extends ModelBase {
|
||||
|
||||
private ModelRenderer base;
|
||||
private ModelRenderer body;
|
||||
private ModelRenderer arm1;
|
||||
private ModelRenderer arm2;
|
||||
private ModelRenderer arm3;
|
||||
private ModelRenderer arm4;
|
||||
private ModelRenderer top;
|
||||
private final ModelRenderer base;
|
||||
private final ModelRenderer body;
|
||||
private final ModelRenderer arm1;
|
||||
private final ModelRenderer arm2;
|
||||
private final ModelRenderer arm3;
|
||||
private final ModelRenderer arm4;
|
||||
private final ModelRenderer top;
|
||||
|
||||
public ModelMachine() {
|
||||
textureWidth = 64;
|
||||
@@ -79,6 +79,7 @@ public class ModelMachine extends ModelBase {
|
||||
top.render(f5);
|
||||
}
|
||||
|
||||
@SuppressWarnings("SameParameterValue")
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
|
||||
@@ -27,6 +27,6 @@ public abstract class PackageGeneticBase extends MachinePackage {
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||
MachineRendererGenetics.instance.renderMachine(machine, color, renderTexture, x, y, z, partialTick);
|
||||
MachineRendererGenetics.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@ import binnie.core.Mods;
|
||||
import binnie.core.genetics.Tolerance;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.lepidopterology.EnumButterflyChromosome;
|
||||
@@ -32,7 +31,7 @@ public class Acclimatiser {
|
||||
public static Map<ItemStack, Float> temperatureItems = new HashMap<>();
|
||||
public static Map<ItemStack, Float> humidityItems = new HashMap<>();
|
||||
|
||||
private static List<ToleranceSystem> toleranceSystems = new ArrayList<>();
|
||||
private static final List<ToleranceSystem> toleranceSystems = new ArrayList<>();
|
||||
|
||||
private static ToleranceSystem getToleranceSystem(ItemStack stack, ItemStack acclim) {
|
||||
ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(stack);
|
||||
@@ -158,35 +157,17 @@ public class Acclimatiser {
|
||||
|
||||
public static Tolerance alterTolerance(Tolerance tol, float effect) {
|
||||
int[] is = tol.getBounds();
|
||||
int[] range;
|
||||
if (effect < 0.0f) {
|
||||
range = new int[] { is[0] - 1, is[1] };
|
||||
} else {
|
||||
range = new int[] { is[0], is[1] + 1 };
|
||||
int low = Math.max(effect < 0.0f ? is[0] - 1 : is[0], -5);
|
||||
int high = Math.min(effect < 0.0f ? is[1] : is[1] + 1, 5);
|
||||
|
||||
if (low == 0) {
|
||||
return Tolerance.getHigh(high);
|
||||
}
|
||||
if (high == 0) {
|
||||
return Tolerance.getLow(low);
|
||||
}
|
||||
|
||||
if (range[0] < -5) {
|
||||
range[0] = -5;
|
||||
}
|
||||
if (range[1] > 5) {
|
||||
range[1] = 5;
|
||||
}
|
||||
|
||||
EnumTolerance[] up = { EnumTolerance.NONE, EnumTolerance.UP_1, EnumTolerance.UP_2, EnumTolerance.UP_3,
|
||||
EnumTolerance.UP_4, EnumTolerance.UP_5 };
|
||||
EnumTolerance[] down = { EnumTolerance.NONE, EnumTolerance.DOWN_1, EnumTolerance.DOWN_2, EnumTolerance.DOWN_3,
|
||||
EnumTolerance.DOWN_4, EnumTolerance.DOWN_5 };
|
||||
EnumTolerance[] both = { EnumTolerance.NONE, EnumTolerance.BOTH_1, EnumTolerance.BOTH_2, EnumTolerance.BOTH_3,
|
||||
EnumTolerance.BOTH_4, EnumTolerance.BOTH_5 };
|
||||
|
||||
if (range[0] == 0) {
|
||||
return Tolerance.get(up[range[1]]);
|
||||
}
|
||||
if (range[1] == 0) {
|
||||
return Tolerance.get(down[-range[0]]);
|
||||
}
|
||||
|
||||
int avg = (int) ((-range[0] + range[1]) / 2.0f + 0.6f);
|
||||
return Tolerance.get(both[avg]);
|
||||
int avg = (int) ((-low + high) / 2.0f + 0.6f);
|
||||
return Tolerance.getBoth(avg);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
package binnie.genetics.machine.acclimatiser;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
@@ -63,9 +61,4 @@ public class AcclimatiserPackage extends PackageGeneticBase implements IMachineI
|
||||
new ComponentPowerReceptor(machine, 5000);
|
||||
new AcclimatiserComponentLogic(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -42,11 +42,10 @@ public class ToleranceSystem {
|
||||
return stack;
|
||||
}
|
||||
|
||||
IIndividual member = AlleleManager.alleleRegistry.getIndividual(stack);
|
||||
IGenome genome = member.getGenome();
|
||||
IAlleleTolerance tolAllele = (IAlleleTolerance) genome.getActiveAllele(chromosomeOrdinal);
|
||||
Tolerance tol = Tolerance.get(tolAllele.getValue());
|
||||
Tolerance newTol = Acclimatiser.alterTolerance(tol, effect);
|
||||
final IGenome genome = AlleleManager.alleleRegistry.getIndividual(stack).getGenome();
|
||||
final IAlleleTolerance tolAllele = (IAlleleTolerance) genome.getActiveAllele(chromosomeOrdinal);
|
||||
final Tolerance tol = Tolerance.get(tolAllele.getValue());
|
||||
final Tolerance newTol = Acclimatiser.alterTolerance(tol, effect);
|
||||
if (rand.nextFloat() > 1.0f / (-newTol.getBounds()[0] + newTol.getBounds()[1])) {
|
||||
return stack;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Random;
|
||||
import net.minecraft.client.particle.EntityFX;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@@ -24,7 +23,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class AnalyserComponentFX extends MachineComponent
|
||||
implements IRender.RandomDisplayTick, IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
|
||||
|
||||
private EntityItem dummyEntityItem;
|
||||
private final EntityItem dummyEntityItem;
|
||||
|
||||
public AnalyserComponentFX(IMachine machine) {
|
||||
super(machine);
|
||||
@@ -40,7 +39,7 @@ public class AnalyserComponentFX extends MachineComponent
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void onDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if (rand.nextFloat() < 1.0f && getUtil().getProcess().isInProgress()) {
|
||||
if (getUtil().getProcess().isInProgress()) {
|
||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer
|
||||
.addEffect(new EntityFX(world, x + 0.5, y + 1.3 + rand.nextDouble() * 0.2, z + 0.5, 0.0, 0.0, 0.0) {
|
||||
|
||||
@@ -66,11 +65,6 @@ public class AnalyserComponentFX extends MachineComponent
|
||||
super.onUpdate();
|
||||
setAlphaF((float) Math.cos(1.57 * particleAge / particleMaxAge));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -92,10 +86,6 @@ public class AnalyserComponentFX extends MachineComponent
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = BinnieCore.proxy.getPlayer();
|
||||
double dx = x + 0.5 - player.lastTickPosX;
|
||||
double dz = z + 0.5 - player.lastTickPosZ;
|
||||
double t = Math.atan2(dz, dx) * 180.0 / 3.1415;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
|
||||
GL11.glTranslatef(0.0f, -0.2f, 0.0f);
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package binnie.genetics.machine.analyser;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
@@ -62,9 +60,4 @@ public class AnalyserPackage extends PackageGeneticBase implements IMachineInfor
|
||||
new AnalyserComponentLogic(machine);
|
||||
new AnalyserComponentFX(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class GenepoolComponentFX extends MachineComponent implements IRender.Ran
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void onDisplayTick(World world, int x, int y, int z, Random rand) {
|
||||
if (rand.nextFloat() >= 1.0f || !getUtil().getProcess().isInProgress()) {
|
||||
if (!getUtil().getProcess().isInProgress()) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -41,14 +41,7 @@ public class GenepoolComponentFX extends MachineComponent implements IRender.Ran
|
||||
0.0,
|
||||
0.0) {
|
||||
|
||||
double axisX = posX;
|
||||
double axisZ = posZ;
|
||||
double angle = rand.nextDouble() * 2.0 * 3.1415;
|
||||
|
||||
{
|
||||
axisX = 0.0;
|
||||
axisZ = 0.0;
|
||||
angle = 0.0;
|
||||
motionX = 0.0;
|
||||
motionZ = 0.0;
|
||||
motionY = rand.nextFloat() * 0.01;
|
||||
@@ -66,11 +59,6 @@ public class GenepoolComponentFX extends MachineComponent implements IRender.Ran
|
||||
super.onUpdate();
|
||||
setAlphaF((float) Math.cos(1.57 * particleAge / particleMaxAge));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
package binnie.genetics.machine.genepool;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
@@ -61,9 +58,4 @@ public class GenepoolPackage extends PackageGeneticBase implements IMachineInfor
|
||||
chargedSlots.addCharge(Genepool.SLOT_ENZYME);
|
||||
new GenepoolComponentFX(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,7 @@
|
||||
package binnie.genetics.machine.incubator;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentTankContainer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
@@ -45,9 +42,4 @@ public class IncubatorPackage extends PackageGeneticBase implements IMachineInfo
|
||||
tanks.addTank(Incubator.TANK_OUTPUT, "output", Incubator.OUTPU_TANK_CAPACITY).setReadOnly();
|
||||
new IncubatorComponentLogic(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class InoculatorComponentFX extends MachineComponent
|
||||
implements IRender.RandomDisplayTick, IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
|
||||
|
||||
private EntityItem dummyEntityItem;
|
||||
private final EntityItem dummyEntityItem;
|
||||
|
||||
public InoculatorComponentFX(IMachine machine) {
|
||||
super(machine);
|
||||
@@ -78,11 +78,6 @@ public class InoculatorComponentFX extends MachineComponent
|
||||
particleBlue + (0.0f - particleBlue) / 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
package binnie.genetics.machine.inoculator;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.ComponentTankContainer;
|
||||
@@ -94,9 +92,4 @@ public class InoculatorPackage extends PackageGeneticBase implements IMachineInf
|
||||
new ComponentTankContainer(machine).addTank(Inoculator.TANK_VECTOR, "input", Inoculator.TANK_CAPACITY)
|
||||
.setValidator(new BacteriaVectorValidator());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -53,11 +53,6 @@ public class IsolatorComponentFX extends MachineComponent implements IRender.Ran
|
||||
angle += 0.06;
|
||||
setAlphaF((float) Math.sin(3.14 * particleAge / particleMaxAge));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,14 +67,11 @@ public class IsolatorComponentFX extends MachineComponent implements IRender.Ran
|
||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer
|
||||
.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.5, 0.0, 0.0, 0.0) {
|
||||
|
||||
double axisX = posX;
|
||||
double axisZ = posZ;
|
||||
double angle = 0.7 + (int) (worldObj.getTotalWorldTime() % 2L) * 3.1415;
|
||||
final double axisX = 0.0;
|
||||
final double axisZ = 0.0;
|
||||
double angle = 0.0;
|
||||
|
||||
{
|
||||
axisX = 0.0;
|
||||
axisZ = 0.0;
|
||||
angle = 0.0;
|
||||
motionX = 0.0;
|
||||
motionZ = 0.0;
|
||||
motionY = 0.012;
|
||||
@@ -96,11 +88,6 @@ public class IsolatorComponentFX extends MachineComponent implements IRender.Ran
|
||||
setPosition(axisX + 0.26 * Math.sin(angle), posY, axisZ + 0.26 * Math.cos(angle));
|
||||
setAlphaF((float) Math.cos(1.57 * particleAge / particleMaxAge));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -77,21 +77,11 @@ public class IsolatorComponentLogic extends ComponentProcessSetCost implements I
|
||||
return;
|
||||
}
|
||||
|
||||
IAllele allele;
|
||||
IChromosomeType chromosome;
|
||||
Gene gene = null;
|
||||
if (getMachine().getWorld().rand.nextFloat() < 2.0f) {
|
||||
while (gene == null) {
|
||||
try {
|
||||
chromosome = root.getKaryotype()[rand.nextInt(root.getKaryotype().length)];
|
||||
allele = rand.nextBoolean() ? individual.getGenome().getActiveAllele(chromosome)
|
||||
: individual.getGenome().getInactiveAllele(chromosome);
|
||||
gene = Gene.create(allele, chromosome, root);
|
||||
} catch (Exception e) {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
}
|
||||
final IChromosomeType[] karyo = root.getKaryotype();
|
||||
final IChromosomeType chromosome = karyo[rand.nextInt(karyo.length)];
|
||||
final IAllele allele = rand.nextBoolean() ? individual.getGenome().getActiveAllele(chromosome)
|
||||
: individual.getGenome().getInactiveAllele(chromosome);
|
||||
final Gene gene = new Gene(allele, chromosome, root);
|
||||
|
||||
ItemStack serum = ItemSequence.create(gene);
|
||||
getUtil().setStack(Isolator.SLOT_RESULT, serum);
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package binnie.genetics.machine.isolator;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
@@ -72,9 +69,4 @@ public class IsolatorPackage extends PackageGeneticBase implements IMachineInfor
|
||||
new IsolatorComponentLogic(machine);
|
||||
new IsolatorComponentFX(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,6 @@ public class LabMachinePackage extends PackageGeneticBase {
|
||||
|
||||
@Override
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||
MachineRendererLab.instance.renderMachine(machine, color, renderTexture, x, y, z, partialTick);
|
||||
MachineRendererLab.instance.renderMachine(machine, renderTexture, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -74,11 +74,6 @@ public class PolymeriserComponentFX extends MachineComponent implements IRender.
|
||||
particleBlue + (1.0f - particleBlue) / 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import binnie.genetics.genetics.Engineering;
|
||||
|
||||
public class PolymeriserComponentLogic extends ComponentProcessSetCost implements IProcess {
|
||||
|
||||
private static float chargePerProcess = 0.4f;
|
||||
private static final float chargePerProcess = 0.4f;
|
||||
|
||||
private float dnaDrain = 0.0f;
|
||||
private float bacteriaDrain = 0.0f;
|
||||
|
||||
@@ -2,11 +2,9 @@ package binnie.genetics.machine.polymeriser;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
@@ -73,9 +71,4 @@ public class PolymeriserPackage extends PackageGeneticBase implements IMachineIn
|
||||
new PolymeriserComponentLogic(machine);
|
||||
new PolymeriserComponentFX(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -54,11 +54,6 @@ public class SequencerComponentFX extends MachineComponent implements IRender.Ra
|
||||
motionY = 0.0;
|
||||
setAlphaF((float) Math.sin(3.14 * particleAge / particleMaxAge));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
package binnie.genetics.machine.sequencer;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentChargedSlots;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
@@ -63,9 +60,4 @@ public class SequencerPackage extends PackageGeneticBase implements IMachineInfo
|
||||
SequencerComponentLogic logic = new SequencerComponentLogic(machine);
|
||||
transfer.setTransferListener(logic);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
public class SplicerComponentFX extends MachineComponent
|
||||
implements IRender.RandomDisplayTick, IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
|
||||
|
||||
private EntityItem dummyEntityItem;
|
||||
private final EntityItem dummyEntityItem;
|
||||
|
||||
public SplicerComponentFX(IMachine machine) {
|
||||
super(machine);
|
||||
@@ -70,11 +70,6 @@ public class SplicerComponentFX extends MachineComponent
|
||||
setPosition(axisX + dist * Math.sin(angle), posY, axisZ + dist * Math.cos(angle));
|
||||
setAlphaF((float) Math.cos(1.57 * particleAge / particleMaxAge));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFXLayer() {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public class SplicerComponentLogic extends ComponentProcessSetCost implements IP
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return (i < 1) ? 1 : i;
|
||||
return Math.max(i, 1);
|
||||
}
|
||||
|
||||
private int getFullNumberOfGenes() {
|
||||
@@ -191,9 +191,4 @@ public class SplicerComponentLogic extends ComponentProcessSetCost implements IP
|
||||
}
|
||||
getUtil().damageItem(Splicer.SLOT_SERUM_VIAL, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTickTask() {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,9 @@
|
||||
package binnie.genetics.machine.splicer;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.ComponentInventoryTransfer;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
@@ -90,9 +88,4 @@ public class SplicerPackage extends AdvGeneticMachine.PackageAdvGeneticBase impl
|
||||
new SplicerComponentLogic(machine);
|
||||
new SplicerComponentFX(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileEntityMachine(this);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package binnie.genetics.nei;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.Tags;
|
||||
import binnie.core.nei.RecipeHandlerBase;
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
@@ -34,6 +34,6 @@ public class NEIGeneticsConfig implements IConfigureNEI {
|
||||
|
||||
@Override
|
||||
public String getVersion() {
|
||||
return BinnieCore.VERSION;
|
||||
return Tags.VERSION;
|
||||
}
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class SplicerRecipeHandler extends RecipeHandlerBase {
|
||||
|
||||
private static final List<SplicerRecipe> recipes = new ArrayList<>();
|
||||
|
||||
private void createInoculatorRecipeForNEI(ItemStack dnaManipulable) {
|
||||
private void createSplicerRecipeForNEI(ItemStack dnaManipulable) {
|
||||
recipes.add(
|
||||
new SplicerRecipe(dnaManipulable, new ItemStack(Genetics.itemSerum, 1, OreDictionary.WILDCARD_VALUE)));
|
||||
recipes.add(
|
||||
@@ -39,13 +39,13 @@ public class SplicerRecipeHandler extends RecipeHandlerBase {
|
||||
@Override
|
||||
public void prepare() {
|
||||
if (BinnieCore.isApicultureActive())
|
||||
createInoculatorRecipeForNEI(Mods.forestry.stack("beeLarvaeGE", 1, OreDictionary.WILDCARD_VALUE));
|
||||
createSplicerRecipeForNEI(Mods.forestry.stack("beeLarvaeGE", 1, OreDictionary.WILDCARD_VALUE));
|
||||
if (BinnieCore.isArboricultureActive())
|
||||
createInoculatorRecipeForNEI(Mods.forestry.stack("pollenFertile", 1, OreDictionary.WILDCARD_VALUE));
|
||||
createSplicerRecipeForNEI(Mods.forestry.stack("pollenFertile", 1, OreDictionary.WILDCARD_VALUE));
|
||||
if (BinnieCore.isLepidopteryActive())
|
||||
createInoculatorRecipeForNEI(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE));
|
||||
createSplicerRecipeForNEI(Mods.forestry.stack("serumGE", 1, OreDictionary.WILDCARD_VALUE));
|
||||
if (BinnieCore.isBotanyActive())
|
||||
createInoculatorRecipeForNEI(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
|
||||
createSplicerRecipeForNEI(new ItemStack(Botany.pollen, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -112,7 +112,7 @@ public class SplicerRecipeHandler extends RecipeHandlerBase {
|
||||
}
|
||||
}
|
||||
|
||||
private static class SplicerRecipe {
|
||||
public static class SplicerRecipe {
|
||||
|
||||
private final ItemStack dnaManipulable;
|
||||
private final ItemStack serum;
|
||||
|
||||
Reference in new issue
Block a user