mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-24 22:14:44 +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
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user