Work on things

This commit is contained in:
Nedelosk committed 2016-10-27 16:05:15 +02:00
1 parent 5bb4b5d9a5
commit 3bf37f8838
31 files changed
+519 -762

No files matched your search

@@ -5,6 +5,7 @@ import binnie.botany.CreativeTabBotany;
import binnie.botany.api.EnumAcidity;
import binnie.botany.api.EnumMoisture;
import binnie.botany.api.gardening.IBlockSoil;
import binnie.botany.genetics.EnumFlowerType;
import binnie.core.BinnieCore;
import forestry.api.core.IItemModelRegister;
import forestry.api.core.IModelManager;
@@ -45,6 +46,10 @@ public class ItemSoilMeter extends Item implements IItemModelRegister {
pos = pos.down();
block = world.getBlockState(pos).getBlock();
}
if (!Gardening.isSoil(block)) {
pos = pos.down();
block = world.getBlockState(pos).getBlock();
}
if (Gardening.isSoil(block) && !BinnieCore.proxy.isSimulating(world)) {
IBlockSoil soil = (IBlockSoil) block;
String info = Binnie.Language.localise("botany.soil.type") + ": ";
@@ -56,7 +61,7 @@ public class ItemSoilMeter extends Item implements IItemModelRegister {
ITextComponent chat = new TextComponentString(info);
player.addChatMessage(chat);
}
return super.onItemUse(stack, player, world, pos, hand, facing, hitX, hitY, hitZ);
return EnumActionResult.SUCCESS;
}
public static String getPH(ItemStack stack, boolean withColor, boolean byNeutralNone) {
@@ -13,16 +13,6 @@ public class BotanistTracker extends BreedingTracker implements IBotanistTracker
super(s);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
}
@Override
public NBTTagCompound writeToNBT(NBTTagCompound compound) {
return compound;
}
@Override
public void registerPickup(final IIndividual individual) {
}
@@ -1,6 +1,7 @@
package binnie.core.machines;
import binnie.core.BinnieCore;
import binnie.core.machines.component.IRender;
import binnie.core.util.TileUtil;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -19,16 +20,19 @@ import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
class BlockMachine extends BlockContainer implements IBlockMachine {
private MachineGroup group;
public static final PropertyInteger MACHINE_TYPE = PropertyInteger.create("machine_type", 0, 15);
public BlockMachine(final MachineGroup group, final String blockName) {
public BlockMachine(MachineGroup group, String blockName) {
super(Material.IRON);
this.group = group;
this.setHardness(1.5f);
@@ -43,22 +47,7 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
}
}
}
// @Override
// public boolean isOpaqueCube() {
// return false;
// }
//
// @Override
// public boolean renderAsNormalBlock() {
// return !this.group.customRenderer;
// }
//
// @Override
// public int getRenderType() {
// return Binnie.Machine.getMachineRenderID();
// }
//
@Override
public boolean isOpaqueCube(IBlockState state) {
return false;
@@ -112,7 +101,6 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
return this.group.getPackage(meta).createTileEntity();
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
if (!BinnieCore.proxy.isSimulating(world)) {
@@ -143,15 +131,6 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
}
}
// @Override
// public IIcon getIcon(final IBlockAccess world, final int x, final int y, final int z, final int side) {
// final TileEntity entity = world.getTileEntity(x, y, z);
// if (entity instanceof TileEntityMachine && ((TileEntityMachine) entity).getMachine().hasInterface(IMachineTexturedFaces.class)) {
// return ((TileEntityMachine) entity).getMachine().getInterface(IMachineTexturedFaces.class).getIcon(side);
// }
// return Blocks.dirt.getIcon(0, 0);
// }
@Override
public void breakBlock(World world, BlockPos pos, IBlockState state) {
final TileEntityMachine entity = TileUtil.getTile(world, pos, TileEntityMachine.class);
@@ -161,22 +140,16 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
super.breakBlock(world, pos, state);
}
// @Override
// @SideOnly(Side.CLIENT)
// public void registerBlockIcons(final IIconRegister register) {
// }
//
// @Override
// @SideOnly(Side.CLIENT)
// public void randomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// final IMachine machine = Machine.getMachine(world.getTileEntity(x, y, z));
// if (machine != null) {
// for (final IRender.RandomDisplayTick renders : machine.getInterfaces(IRender.RandomDisplayTick.class)) {
// renders.onRandomDisplayTick(world, x, y, z, rand);
// }
// }
// }
@Override
@SideOnly(Side.CLIENT)
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
IMachine machine = Machine.getMachine(world.getTileEntity(pos));
if (machine != null) {
for (IRender.RandomDisplayTick renders : machine.getInterfaces(IRender.RandomDisplayTick.class)) {
renders.onRandomDisplayTick(world, pos, rand);
}
}
}
@Override
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
@@ -192,9 +165,4 @@ class BlockMachine extends BlockContainer implements IBlockMachine {
}
return world.setBlockToAir(pos);
}
public interface IMachineTexturedFaces {
//IIcon getIcon(final int p0);
}
}
@@ -6,11 +6,11 @@ import net.minecraft.world.World;
import java.util.Collection;
public interface IMachine extends IOwnable {
void addComponent(final MachineComponent p0);
void addComponent(MachineComponent component);
MachineUtil getMachineUtil();
<T> T getInterface(final Class<T> p0);
<T> T getInterface(Class<T> Interface);
void markDirty();
@@ -18,7 +18,7 @@ public interface IMachine extends IOwnable {
TileEntity getTileEntity();
<T> Collection<T> getInterfaces(final Class<T> p0);
<T> Collection<T> getInterfaces(Class<T> Interface);
MachinePackage getPackage();
}
@@ -160,8 +160,8 @@ public class Machine implements INetworkedEntity, INbtReadable, INbtWritable, IN
component.onUpdate();
}
} else {
for (final IRender.DisplayTick renders : this.getInterfaces(IRender.DisplayTick.class)) {
renders.onDisplayTick(this.getWorld(), this.getTileEntity().getPos().getX(), this.getTileEntity().getPos().getY(), this.getTileEntity().getPos().getZ(), this.getWorld().rand);
for (IRender.DisplayTick renders : this.getInterfaces(IRender.DisplayTick.class)) {
renders.onDisplayTick(this.getWorld(), this.getTileEntity().getPos(), this.getWorld().rand);
}
}
if (this.queuedInventoryUpdate) {
@@ -46,8 +46,8 @@ public class MachineGroup {
}
Binnie.Machine.registerMachineGroup(this);
this.block = new BlockMachine(this, blockName);
GameRegistry.register(this.block);
Item i = GameRegistry.register(new ItemMachine(this.block));
mod.getProxy().registerBlock(this.block);
Item i = mod.getProxy().registerItem(new ItemMachine(this.block));
for (int j = 0; j < types.length; j++) {
BinnieCore.proxy.registermodel(i, j, new ModelResourceLocation(i.getRegistryName(), "machine_type=" + j));
}
@@ -27,6 +27,8 @@ public abstract class MachinePackage {
public abstract TileEntity createTileEntity();
public abstract void register();
public abstract void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage);//, final RenderBlocks p5);
public final String getDisplayName() {
return Binnie.Language.localise(this.group.getMod(), "machine." + this.group.getShortUID() + "." + this.getUID());
@@ -48,8 +50,6 @@ public abstract class MachinePackage {
this.group = group;
}
public abstract void renderMachine(final Machine p0, final double p1, final double p2, final double p3, final float p4);//, final RenderBlocks p5);
public boolean isActive() {
return this.active;
}
@@ -19,7 +19,6 @@ public class ManagerMachine extends ManagerBase {
private Map<Integer, Class<?>> networkIDToComponent;
private Map<Class<?>, Integer> componentToNetworkID;
private int nextNetworkID;
private int machineRenderID;
public ManagerMachine() {
this.componentInterfaceMap = new HashMap<>();
@@ -69,14 +68,9 @@ public class ManagerMachine extends ManagerBase {
return this.networkIDToComponent.get(networkID);
}
public int getMachineRenderID() {
return this.machineRenderID;
}
@Override
public void init() {
//TODO renderupdate
//this.machineRenderID = BinnieCore.proxy.getUniqueRenderID();
SlotValidator.IconBee = new ValidatorIcon(BinnieCore.instance, "validator/bee.0", "validator/bee.1");
SlotValidator.IconFrame = new ValidatorIcon(BinnieCore.instance, "validator/frame.0", "validator/frame.1");
SlotValidator.IconCircuit = new ValidatorIcon(BinnieCore.instance, "validator/circuit.0", "validator/circuit.1");
@@ -85,8 +79,7 @@ public class ManagerMachine extends ManagerBase {
@Override
public void postInit() {
//BinnieCore.proxy.registerBlockRenderer(BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
//BinnieCore.proxy.registerTileEntity(TileEntityMachine.class, "binnie.tile.machine", BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
BinnieCore.proxy.registerTileEntity(TileEntityMachine.class, "binnie.tile.machine", BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
}
public Class<?>[] getComponentInterfaces(final Class<? extends MachineComponent> clss) {
@@ -1,72 +0,0 @@
package binnie.core.machines;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
public class RendererMachine extends TileEntitySpecialRenderer<TileEntityMachine> //implements ISimpleBlockRenderingHandler
{
@Override
public void renderTileEntityFast(TileEntityMachine te, double x, double y, double z, float partialTicks, int destroyStage, VertexBuffer VertexBuffer) {
}
@Override
public void renderTileEntityAt(TileEntityMachine te, double x, double y, double z, float partialTicks, int destroyStage) {
if (te != null && te.getMachine() != null) {
final MachinePackage machinePackage = te.getMachine().getPackage();
//machinePackage.renderMachine(te.getMachine(), x, y, z, partialTicks);
}
}
// RenderBlocks blockRenderer;
//
// @Override
// public void renderTileEntityAt(final TileEntity entity, final double x, final double y, final double z, final float var8) {
// this.renderTileEntity((TileEntityMachine) entity, x, y, z, var8, this.blockRenderer);
// }
//
// public void renderTileEntity(final TileEntityMachine entity, final double x, final double y, final double z, final float var8, final RenderBlocks renderer) {
// if (entity != null && entity.getMachine() != null) {
// final MachinePackage machinePackage = entity.getMachine().getPackage();
// machinePackage.renderMachine(entity.getMachine(), x, y, z, var8, renderer);
// }
// }
//
// public void renderInvBlock(final RenderBlocks renderblocks, final Block block, final int i, final int j) {
// final TileEntity entity = block.createTileEntity((World) null, i);
// this.renderTileEntity((TileEntityMachine) entity, 0.0, -0.1, 0.0, 0.0625f, renderblocks);
// }
//
// @Override
// public void renderInventoryBlock(final Block block, final int metadata, final int modelID, final RenderBlocks renderer) {
// if (modelID == Binnie.Machine.getMachineRenderID()) {
// this.renderInvBlock(renderer, block, metadata, modelID);
// }
// }
//
// @Override
// public boolean renderWorldBlock(final IBlockAccess world, final int x, final int y, final int z, final Block block, final int modelId, final RenderBlocks renderer) {
// final TileEntityMachine tile = (TileEntityMachine) world.getTileEntity(x, y, z);
// if (tile != null && tile.getMachine() != null && tile.getMachine().getPackage() != null && tile.getMachine().getPackage().getGroup() != null && !tile.getMachine().getPackage().getGroup().customRenderer) {
// this.renderTileEntity(tile, x, y, z, 1.0f, renderer);
// }
// return true;
// }
//
// @Override
// public boolean shouldRender3DInInventory(final int i) {
// return true;
// }
//
// @Override
// public int getRenderId() {
// return Binnie.Machine.getMachineRenderID();
// }
//
// @Override
// public void func_147496_a(final World par1World) {
// this.blockRenderer = new RenderBlocks(par1World);
// }
}
@@ -0,0 +1,14 @@
package binnie.core.machines;
import net.minecraft.client.renderer.VertexBuffer;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
public class TileEntityMachineRenderer extends TileEntitySpecialRenderer<TileEntityMachine> {
@Override
public void renderTileEntityAt(TileEntityMachine te, double x, double y, double z, float partialTicks, int destroyStage) {
if (te != null && te.getMachine() != null) {
te.getMachine().getPackage().renderMachine(te.getMachine(), x, y, z, partialTicks, destroyStage);
}
}
}
@@ -1,6 +1,7 @@
package binnie.core.machines.component;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -10,16 +11,16 @@ import java.util.Random;
public interface IRender {
interface DisplayTick {
@SideOnly(Side.CLIENT)
void onDisplayTick(final World p0, final int p1, final int p2, final int p3, final Random p4);
void onDisplayTick(World world, BlockPos pos, Random rand);
}
interface RandomDisplayTick {
@SideOnly(Side.CLIENT)
void onRandomDisplayTick(final World p0, final int p1, final int p2, final int p3, final Random p4);
void onRandomDisplayTick(World world, BlockPos pos, Random rand);
}
interface Render {
@SideOnly(Side.CLIENT)
void renderInWorld(final RenderItem p0, final double p1, final double p2, final double p3);
void renderInWorld(double xPos, double yPos, double zPos);
}
}
@@ -56,8 +56,8 @@ enum Compartment implements IMachineType {
}
@Override
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8) {
MachineRendererCompartment.instance.renderMachine(machine, 16777215, this.renderTexture, x, y, z, var8);
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
MachineRendererCompartment.instance.renderMachine(machine, 16777215, renderTexture, x, y, z, partialTicks);
}
}
}
@@ -61,8 +61,8 @@ public enum AlvearyMachine implements IMachineType {
}
@Override
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8) {
MachineRendererBlock.instance.renderMachine(this.machineTexture, x, y, z, var8);
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
MachineRendererBlock.instance.renderMachine(this.machineTexture, x, y, z, partialTicks);
}
}
}
@@ -57,10 +57,10 @@ public enum KitchenMachine implements IMachineType {
@Override
public void register() {
}
@Override
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8) {
MachineRendererKitchen.instance.renderMachine(machine, this.textureName, x, y, z, var8);
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
MachineRendererKitchen.instance.renderMachine(machine, textureName, x, y, z, partialTicks);
}
}
}
@@ -88,10 +88,10 @@ public enum ExtraTreeMachine implements IMachineType {
@Override
public void register() {
}
@Override
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8) {
MachineRendererForestry.renderMachine(this.textureName.getShortPath(), x, y, z, var8);
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
MachineRendererForestry.renderMachine(this.textureName.getShortPath(), x, y, z, partialTicks);
}
}
}
@@ -11,6 +11,7 @@ import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.text.TextFormatting;
import java.util.ArrayList;
import java.util.List;
@@ -46,16 +47,16 @@ public class GeneArrayItem implements INbtReadable, INbtWritable, IGeneItem {
@Override
public void getInfo(final List list) {
final List<Object> totalList = new ArrayList<>();
for (final IGene gene : this.genes) {
for (IGene gene : this.genes) {
final String chromosomeName = this.getBreedingSystem().getChromosomeName(gene.getChromosome());
totalList.add("§6" + chromosomeName + "§7: " + gene.getName());
totalList.add(TextFormatting.GOLD + chromosomeName + TextFormatting.GRAY + ": " + gene.getName());
}
if (totalList.size() < 4 || BinnieCore.proxy.isShiftDown()) {
list.addAll(totalList);
} else {
list.add(totalList.get(0));
list.add(totalList.get(1));
list.add(totalList.size() - 2 + " more genes. Hold shift to display.");
list.add(totalList.size() - 2 + " " + Binnie.Language.localise("genetic.item.gene.more.genes"));
}
}
@@ -9,6 +9,7 @@ import forestry.api.core.INbtWritable;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.text.TextFormatting;
import java.util.List;
@@ -51,7 +52,7 @@ public class GeneItem implements INbtReadable, INbtWritable, IGeneItem {
@Override
public void getInfo(final List list) {
final String chromosomeName = this.getBreedingSystem().getChromosomeName(this.gene.getChromosome());
list.add("§6" + chromosomeName + "§7: " + this.gene.getName());
list.add(TextFormatting.GOLD +chromosomeName + TextFormatting.GRAY + ": " + this.gene.getName());
}
public BreedingSystem getBreedingSystem() {
@@ -1,5 +1,7 @@
package binnie.genetics.item;
import binnie.Binnie;
import binnie.core.BinnieCore;
import binnie.core.item.ItemCore;
import binnie.genetics.CreativeTabGenetics;
import binnie.genetics.genetics.IGeneItem;
@@ -14,15 +16,6 @@ import java.util.List;
public abstract class ItemGene extends ItemCore {
// IIcon[] icons;
//
// @Override
// @SideOnly(Side.CLIENT)
// public IIcon getIconFromDamageForRenderPass(final int damage, final int pass) {
// return this.icons[pass];
// }
@Override
public boolean getShareTag() {
return true;
@@ -33,34 +26,13 @@ public abstract class ItemGene extends ItemCore {
return false;
}
// @Override
// @SideOnly(Side.CLIENT)
// public void registerIcons(final IIconRegister register) {
// this.icons[0] = Genetics.proxy.getIcon(register, "machines/serum.glass");
// this.icons[1] = Genetics.proxy.getIcon(register, "machines/serum.cap");
// this.icons[2] = Genetics.proxy.getIcon(register, "machines/serum.edges");
// this.icons[3] = Genetics.proxy.getIcon(register, "machines/serum.dna");
// }
//
// @Override
// public int getRenderPasses(final int metadata) {
// return 4;
// }
public ItemGene(final String unlocName) {
super(unlocName);
// this.icons = new IIcon[4];
this.setMaxStackSize(1);
this.setMaxDamage(16);
this.setUnlocalizedName(unlocName);
this.setCreativeTab(CreativeTabGenetics.instance);
}
//
// @Override
// public int getColorFromItemStack(final ItemStack itemstack, final int j) {
// final IGeneItem gene = this.getGeneItem(itemstack);
// return gene.getColour(j);
// }
public int getCharges(final ItemStack stack) {
return (stack == null) ? 0 : (stack.getItem().getMaxDamage() - stack.getItemDamage());
@@ -72,11 +44,11 @@ public abstract class ItemGene extends ItemCore {
super.addInformation(itemstack, entityPlayer, list, advanced);
final int damage = this.getMaxDamage() - itemstack.getItemDamage();
if (damage == 0) {
list.add("Empty");
list.add(Binnie.Language.localise("genetic.item.gene.empty"));
} else if (damage == 1) {
list.add("1 Charge");
list.add("1 " + Binnie.Language.localise("genetic.item.gene.charge"));
} else {
list.add(damage + " Charges");
list.add(damage + " " + Binnie.Language.localise("genetic.item.gene.charges"));
}
final IGeneItem gene = this.getGeneItem(itemstack);
gene.getInfo(list);
@@ -89,10 +61,5 @@ public abstract class ItemGene extends ItemCore {
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
}
// @Override
// public boolean requiresMultipleRenderPasses() {
// return true;
// }
public abstract IGeneItem getGeneItem(final ItemStack p0);
}
@@ -82,8 +82,8 @@ public class ItemSerum extends ItemGene implements IItemSerum {
public String getItemStackDisplayName(final ItemStack itemstack) {
final GeneItem gene = this.getGeneItem(itemstack);
if (!gene.isCorrupted())
return Binnie.Genetics.getSystem(gene.getSpeciesRoot()).getDescriptor() + " Serum";
return "Corrupted Serum";
return Binnie.Genetics.getSystem(gene.getSpeciesRoot()).getDescriptor() + " " + Binnie.Language.localise("genetic.item.gene.serum");
return Binnie.Language.localise("genetic.item.gene.corrupted.serum");
}
@Override
@@ -25,6 +25,7 @@ import binnie.genetics.item.GeneticsItems;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.entity.item.EntityItem;
@@ -32,6 +33,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -195,7 +197,7 @@ public class Analyser {
}
}
public static class ComponentAnalyserFX extends MachineComponent implements IRender.RandomDisplayTick, IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
public static class ComponentAnalyserFX extends MachineComponent implements IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
private final EntityItem dummyEntityItem;
public ComponentAnalyserFX(final IMachine machine) {
@@ -205,48 +207,43 @@ public class Analyser {
@SideOnly(Side.CLIENT)
@Override
public void onRandomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
public void onDisplayTick(World world, BlockPos pos, Random rand) {
if (rand.nextFloat() < 1.0f && this.getUtil().getProcess().isInProgress()) {
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1.3 + rand.nextDouble() * 0.2, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
double axisX = this.posX;
double axisZ = this.posZ;
double angle = this.rand.nextDouble() * 2.0 * 3.1415;
{
this.axisX = 0.0;
this.axisZ = 0.0;
this.angle = 0.0;
this.motionX = 0.05 * (this.rand.nextDouble() - 0.5);
this.motionZ = 0.05 * (this.rand.nextDouble() - 0.5);
this.motionY = 0.0;
this.particleMaxAge = 25;
this.particleGravity = 0.05f;
this.field_190017_n = true;
this.setRBGColorF(0.6f, 0.0f, 1.0f);
}
@Override
public void onUpdate() {
super.onUpdate();
this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
}
@Override
public int getFXLayer() {
return 0;
}
});
}
}
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// if (rand.nextFloat() < 1.0f && this.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) {
// double axisX = this.posX;
// double axisZ = this.posZ;
// double angle = this.rand.nextDouble() * 2.0 * 3.1415;
//
// {
// this.axisX = 0.0;
// this.axisZ = 0.0;
// this.angle = 0.0;
// this.motionX = 0.05 * (this.rand.nextDouble() - 0.5);
// this.motionZ = 0.05 * (this.rand.nextDouble() - 0.5);
// this.motionY = 0.0;
// this.particleMaxAge = 25;
// this.particleGravity = 0.05f;
// this.noClip = true;
// this.setRBGColorF(0.6f, 0.0f, 1.0f);
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
// }
//
// @Override
// public int getFXLayer() {
// return 0;
// }
// });
// }
}
@SideOnly(Side.CLIENT)
@Override
public void renderInWorld(final RenderItem customRenderItem, final double x, final double y, final double z) {
public void renderInWorld(final double x, final double y, final double z) {
if (!this.getUtil().getProcess().isInProgress()) {
return;
}
@@ -266,7 +263,7 @@ public class Analyser {
GL11.glPushMatrix();
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
GL11.glTranslatef(0.0f, -0.2f, 0.0f);
customRenderItem.renderItem(dummyEntityItem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);//doRender(this.dummyEntityItem.getEntityItem(), 0.0, 0.0, 0.0, 0.0f, 0.0f);
BinnieCore.proxy.getMinecraftInstance().getRenderItem().renderItem(dummyEntityItem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);//doRender(this.dummyEntityItem.getEntityItem(), 0.0, 0.0, 0.0, 0.0f, 0.0f);
GL11.glPopMatrix();
}
@@ -1,6 +1,7 @@
package binnie.genetics.machine;
import binnie.Binnie;
import binnie.core.BinnieCore;
import binnie.core.machines.IMachine;
import binnie.core.machines.Machine;
import binnie.core.machines.MachineComponent;
@@ -25,8 +26,10 @@ import binnie.genetics.item.GeneticLiquid;
import binnie.genetics.item.GeneticsItems;
import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.client.particle.Particle;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -167,50 +170,45 @@ public class Genepool {
}
}
public static class ComponentGenepoolFX extends MachineComponent implements IRender.RandomDisplayTick, IRender.DisplayTick {
public static class ComponentGenepoolFX extends MachineComponent implements IRender.DisplayTick {
public ComponentGenepoolFX(final IMachine machine) {
super(machine);
}
@SideOnly(Side.CLIENT)
@Override
public void onRandomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
}
public void onDisplayTick(World world, BlockPos pos, Random rand) {
if (rand.nextFloat() < 1.0f && this.getUtil().getProcess().isInProgress()) {
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.3 + rand.nextDouble() * 0.4, pos.getY() + 1, pos.getZ() + 0.3 + rand.nextDouble() * 0.4, 0.0, 0.0, 0.0) {
double axisX = this.posX;
double axisZ = this.posZ;
double angle = this.rand.nextDouble() * 2.0 * 3.1415;
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// if (rand.nextFloat() < 1.0f && this.getUtil().getProcess().isInProgress()) {
// BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.3 + rand.nextDouble() * 0.4, y + 1, z + 0.3 + rand.nextDouble() * 0.4, 0.0, 0.0, 0.0) {
// double axisX = this.posX;
// double axisZ = this.posZ;
// double angle = this.rand.nextDouble() * 2.0 * 3.1415;
//
// {
// this.axisX = 0.0;
// this.axisZ = 0.0;
// this.angle = 0.0;
// this.motionX = 0.0;
// this.motionZ = 0.0;
// this.motionY = this.rand.nextFloat() * 0.01;
// this.particleMaxAge = 25;
// this.particleGravity = 0.0f;
// this.noClip = true;
// this.setRBGColorF(0.4f + 0.6f * this.rand.nextFloat(), 0.6f * this.rand.nextFloat(), 0.6f + 0.4f * this.rand.nextFloat());
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
// }
//
// @Override
// public int getFXLayer() {
// return 0;
// }
// });
// }
{
this.axisX = 0.0;
this.axisZ = 0.0;
this.angle = 0.0;
this.motionX = 0.0;
this.motionZ = 0.0;
this.motionY = this.rand.nextFloat() * 0.01;
this.particleMaxAge = 25;
this.particleGravity = 0.0f;
this.field_190017_n = true;
this.setRBGColorF(0.4f + 0.6f * this.rand.nextFloat(), 0.6f * this.rand.nextFloat(), 0.6f + 0.4f * this.rand.nextFloat());
}
@Override
public void onUpdate() {
super.onUpdate();
this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
}
@Override
public int getFXLayer() {
return 0;
}
});
}
}
}
}
@@ -56,8 +56,8 @@ public enum GeneticMachine implements IMachineType {
}
@Override
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8) {
MachineRendererGenetics.instance.renderMachine(machine, this.colour, this.renderTexture, x, y, z, var8);
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
MachineRendererGenetics.instance.renderMachine(machine, x, y, z, partialTicks, destroyStage);
}
}
}
@@ -31,6 +31,7 @@ import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.entity.item.EntityItem;
@@ -39,6 +40,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -275,7 +277,7 @@ public class Inoculator {
}
}
public static class ComponentInoculatorFX extends MachineComponent implements IRender.RandomDisplayTick, IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
public static class ComponentInoculatorFX extends MachineComponent implements IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
private final EntityItem dummyEntityItem;
public ComponentInoculatorFX(final IMachine machine) {
@@ -285,59 +287,54 @@ public class Inoculator {
@SideOnly(Side.CLIENT)
@Override
public void onRandomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
public void onDisplayTick(World world, BlockPos pos, Random rand) {
final int tick = (int) (world.getTotalWorldTime() % 3L);
if (tick == 0 && this.getUtil().getProcess().isInProgress()) {
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 0.92, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
double axisX = this.posX;
double axisZ = this.posZ;
double angle = (int) (this.worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
{
this.axisX = 0.0;
this.axisZ = 0.0;
this.angle = 0.0;
this.motionX = 0.0;
this.motionZ = 0.0;
this.motionY = 0.007 + this.rand.nextDouble() * 0.002;
this.particleMaxAge = 240;
this.particleGravity = 0.0f;
this.field_190017_n = true;
this.setRBGColorF(0.8f, 0.0f, 1.0f);
}
@Override
public void onUpdate() {
super.onUpdate();
double speed = 5.0E-4;
if (this.particleAge > 60) {
speed += (this.particleAge - 60) / 4000.0f;
}
this.angle += speed;
final double dist = 0.27;
this.setPosition(this.axisX + dist * Math.sin(this.angle), this.posY, this.axisZ + dist * Math.cos(this.angle));
this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
if (this.particleAge > 40) {
this.setRBGColorF(this.particleRed + (1.0f - this.particleRed) / 10.0f, this.particleGreen + (0.0f - this.particleGreen) / 10.0f, this.particleBlue + (0.0f - this.particleBlue) / 10.0f);
}
}
@Override
public int getFXLayer() {
return 0;
}
});
}
}
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// final int tick = (int) (world.getTotalWorldTime() % 3L);
// if (tick == 0 && this.getUtil().getProcess().isInProgress()) {
// BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 0.92, z + 0.5, 0.0, 0.0, 0.0) {
// double axisX = this.posX;
// double axisZ = this.posZ;
// double angle = (int) (this.worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
//
// {
// this.axisX = 0.0;
// this.axisZ = 0.0;
// this.angle = 0.0;
// this.motionX = 0.0;
// this.motionZ = 0.0;
// this.motionY = 0.007 + this.rand.nextDouble() * 0.002;
// this.particleMaxAge = 240;
// this.particleGravity = 0.0f;
// this.noClip = true;
// this.setRBGColorF(0.8f, 0.0f, 1.0f);
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// double speed = 5.0E-4;
// if (this.particleAge > 60) {
// speed += (this.particleAge - 60) / 4000.0f;
// }
// this.angle += speed;
// final double dist = 0.27;
// this.setPosition(this.axisX + dist * Math.sin(this.angle), this.posY, this.axisZ + dist * Math.cos(this.angle));
// this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
// if (this.particleAge > 40) {
// this.setRBGColorF(this.particleRed + (1.0f - this.particleRed) / 10.0f, this.particleGreen + (0.0f - this.particleGreen) / 10.0f, this.particleBlue + (0.0f - this.particleBlue) / 10.0f);
// }
// }
//
// @Override
// public int getFXLayer() {
// return 0;
// }
// });
// }
}
@SideOnly(Side.CLIENT)
@Override
public void renderInWorld(final RenderItem customRenderItem, final double x, final double y, final double z) {
public void renderInWorld(final double x, final double y, final double z) {
if (!this.getUtil().getProcess().isInProgress()) {
return;
}
@@ -357,7 +354,7 @@ public class Inoculator {
GL11.glPushMatrix();
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
GL11.glTranslatef(0.0f, -0.25f, 0.0f);
customRenderItem.renderItem(this.dummyEntityItem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED); //, 0.0, 0.0, 0.0, 0.0f, 0.0f);
BinnieCore.proxy.getMinecraftInstance().getRenderItem().renderItem(this.dummyEntityItem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED); //, 0.0, 0.0, 0.0, 0.0f, 0.0f);
GL11.glPopMatrix();
}
@@ -1,5 +1,6 @@
package binnie.genetics.machine;
import binnie.core.BinnieCore;
import binnie.core.genetics.Gene;
import binnie.core.machines.IMachine;
import binnie.core.machines.Machine;
@@ -28,8 +29,10 @@ import forestry.api.genetics.IAllele;
import forestry.api.genetics.IChromosomeType;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.client.particle.Particle;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -194,76 +197,76 @@ public class Isolator {
@SideOnly(Side.CLIENT)
@Override
public void onRandomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// if (!this.getUtil().getProcess().isInProgress()) {
// return;
// }
// BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.4 + 0.2 * rand.nextDouble(), y + 1.6, z + 0.4 + rand.nextDouble() * 0.2, 0.0, 0.0, 0.0) {
// double axisX = 0.0;
// double axisZ = 0.0;
// double angle = 0.0;
//
// {
// this.motionX = 0.0;
// this.motionZ = 0.0;
// this.motionY = -0.012;
// this.particleMaxAge = 100;
// this.particleGravity = 0.0f;
// this.noClip = true;
// this.setRBGColorF(0.8f, 0.4f, 0.0f);
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// this.angle += 0.06;
// this.setAlphaF((float) Math.sin(3.14 * this.particleAge / this.particleMaxAge));
// }
//
// @Override
// public int getFXLayer() {
// return 0;
// }
// });
public void onRandomDisplayTick(World world, BlockPos pos, Random rand) {
if (!this.getUtil().getProcess().isInProgress()) {
return;
}
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.4 + 0.2 * rand.nextDouble(), pos.getY() + 1.6, pos.getZ() + 0.4 + rand.nextDouble() * 0.2, 0.0, 0.0, 0.0) {
double axisX = 0.0;
double axisZ = 0.0;
double angle = 0.0;
{
this.motionX = 0.0;
this.motionZ = 0.0;
this.motionY = -0.012;
this.particleMaxAge = 100;
this.particleGravity = 0.0f;
this.field_190017_n = true;
this.setRBGColorF(0.8f, 0.4f, 0.0f);
}
@Override
public void onUpdate() {
super.onUpdate();
this.angle += 0.06;
this.setAlphaF((float) Math.sin(3.14 * this.particleAge / this.particleMaxAge));
}
@Override
public int getFXLayer() {
return 0;
}
});
}
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// final int tick = (int) (world.getTotalWorldTime() % 6L);
// if ((tick == 0 || tick == 5) && this.getUtil().getProcess().isInProgress()) {
// BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.5, 0.0, 0.0, 0.0) {
// double axisX = this.posX;
// double axisZ = this.posZ;
// double angle = 0.7 + (int) (this.worldObj.getTotalWorldTime() % 2L) * 3.1415;
//
// {
// this.axisX = 0.0;
// this.axisZ = 0.0;
// this.angle = 0.0;
// this.motionX = 0.0;
// this.motionZ = 0.0;
// this.motionY = 0.012;
// this.particleMaxAge = 100;
// this.particleGravity = 0.0f;
// this.noClip = true;
// this.setRBGColorF(0.8f, 0.0f, 1.0f);
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// this.angle += 0.06;
// this.setPosition(this.axisX + 0.26 * Math.sin(this.angle), this.posY, this.axisZ + 0.26 * Math.cos(this.angle));
// this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
// }
//
// @Override
// public int getFXLayer() {
// return 0;
// }
// });
// }
public void onDisplayTick(World world, BlockPos pos, Random rand) {
final int tick = (int) (world.getTotalWorldTime() % 6L);
if ((tick == 0 || tick == 5) && this.getUtil().getProcess().isInProgress()) {
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
double axisX = this.posX;
double axisZ = this.posZ;
double angle = 0.7 + (int) (this.worldObj.getTotalWorldTime() % 2L) * 3.1415;
{
this.axisX = 0.0;
this.axisZ = 0.0;
this.angle = 0.0;
this.motionX = 0.0;
this.motionZ = 0.0;
this.motionY = 0.012;
this.particleMaxAge = 100;
this.particleGravity = 0.0f;
this.field_190017_n = true;
this.setRBGColorF(0.8f, 0.0f, 1.0f);
}
@Override
public void onUpdate() {
super.onUpdate();
this.angle += 0.06;
this.setPosition(this.axisX + 0.26 * Math.sin(this.angle), this.posY, this.axisZ + 0.26 * Math.cos(this.angle));
this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
}
@Override
public int getFXLayer() {
return 0;
}
});
}
}
}
}
@@ -6,6 +6,7 @@ import binnie.core.machines.component.IRender;
import binnie.core.resource.BinnieResource;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import org.lwjgl.opengl.GL11;
@@ -13,49 +14,25 @@ import org.lwjgl.opengl.GL11;
@SideOnly(Side.CLIENT)
public class MachineRendererGenetics {
public static MachineRendererGenetics instance = new MachineRendererGenetics();
public final RenderItem customRenderItem;
private ModelMachine model;
public MachineRendererGenetics() {
this.model = new ModelMachine();
this.customRenderItem = Minecraft.getMinecraft().getRenderItem(); //new RenderItem(Minecraft.getMinecraft().getTextureManager(),) {
// @Override
// public boolean shouldBob() {
// return false;
// }
//
// @Override
// public boolean shouldSpreadItems() {
// return false;
// }
//});//.setRenderManager(RenderManager.instance);
}
public void renderMachine(final Machine machine, final int colour, final BinnieResource texture, final double x, final double y, final double z, final float var8) {
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
GL11.glPushMatrix();
int i1 = 0;
final int ix = machine.getTileEntity().getPos().getX();
final int iy = machine.getTileEntity().getPos().getY();
final int iz = machine.getTileEntity().getPos().getZ();
BlockPos pos = machine.getTileEntity().getPos();
final int ix = pos.getX();
final int iy = pos.getY();
final int iz = pos.getZ();
if (machine.getTileEntity() != null) {
i1 = ix * iy * iz + ix * iy - ix * iz + iy * iz - ix + iy - iz;
}
final float phase = (float) Math.max(0.0, Math.sin((System.currentTimeMillis() + i1) * 0.003));
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
BinnieCore.proxy.bindTexture(texture);
GL11.glPushMatrix();
//TODO remove
//this.model.render((float) x, (float) y, (float) z, 0.0625f, 0.0625f, 0.0625f);
GL11.glPopMatrix();
GL11.glPushMatrix();
BinnieCore.proxy.getMinecraftInstance();
if (Minecraft.isFancyGraphicsEnabled()) {
for (final IRender.Render render : machine.getInterfaces(IRender.Render.class)) {
render.renderInWorld(this.customRenderItem, x, y, z);
for (IRender.Render render : machine.getInterfaces(IRender.Render.class)) {
render.renderInWorld(x, y, z);
}
}
GL11.glPopMatrix();
@@ -1,9 +1,18 @@
package binnie.genetics.machine;
import org.lwjgl.opengl.GL11;
import binnie.Binnie;
import binnie.core.BinnieCore;
import binnie.core.machines.Machine;
import binnie.core.resource.BinnieResource;
import binnie.genetics.Genetics;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -13,97 +22,77 @@ public class MachineRendererLab {
public static MachineRendererLab instance = new MachineRendererLab();
private final EntityItem dummyEntityItem;
private final EntityItem[] itemSides;
// private final RenderItem customRenderItem;
private long lastTick;
private ModelMachine model;
public MachineRendererLab() {
World world = Minecraft.getMinecraft().theWorld;
this.dummyEntityItem = new EntityItem(world);
this.itemSides = new EntityItem[]{new EntityItem(world), new EntityItem(world), new EntityItem(world), new EntityItem(world)};
this.model = new ModelMachine();
// (this.customRenderItem = new RenderItem() {
// @Override
// public boolean shouldBob() {
// return false;
// }
//
// @Override
// public boolean shouldSpreadItems() {
// return false;
// }
// }).setRenderManager(RenderManager.instance);
}
public void renderMachine(final Machine machine, final int colour, final BinnieResource texture, final double x, final double y, final double z, final float var8) {
// GL11.glPushMatrix();
// int i1 = 0;
// final int ix = machine.getTileEntity().xCoord;
// final int iy = machine.getTileEntity().yCoord;
// final int iz = machine.getTileEntity().zCoord;
// if (machine.getTileEntity() != null) {
// i1 = ix * iy * iz + ix * iy - ix * iz + iy * iz - ix + iy - iz;
// }
// final float phase = (float) Math.max(0.0, Math.sin((System.currentTimeMillis() + i1) * 0.003));
// GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
// GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
// BinnieCore.proxy.bindTexture(texture);
// GL11.glPushMatrix();
// this.model.render((float) x, (float) y, (float) z, 0.0625f, 0.0625f, 0.0625f);
// GL11.glPopMatrix();
// final World world = machine.getWorld();
// final LaboratoryMachine.ComponentGUIHolder holder = Machine.getInterface(LaboratoryMachine.ComponentGUIHolder.class, machine);
// Label_0591: {
// if (world != null && holder != null && holder.getStack() != null) {
// BinnieCore.proxy.getMinecraftInstance();
// if (Minecraft.isFancyGraphicsEnabled()) {
// final ItemStack stack = holder.getStack();
// this.dummyEntityItem.worldObj = world;
// this.dummyEntityItem.setEntityItemStack(stack);
// if (world.getTotalWorldTime() != this.lastTick) {
// this.lastTick = world.getTotalWorldTime();
// this.dummyEntityItem.onUpdate();
// }
// this.dummyEntityItem.age = 0;
// this.dummyEntityItem.hoverStart = 0.0f;
// GL11.glPushMatrix();
// final EntityPlayer player = BinnieCore.proxy.getPlayer();
// final double dx = ix + 0.5 - player.lastTickPosX;
// final double dz = iz + 0.5 - player.lastTickPosZ;
// final double t = Math.atan2(dz, dx) * 180.0 / 3.1415;
// GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
// GL11.glTranslatef(0.0f, 0.0f, -0.55f);
// GL11.glRotatef(90.0f + (float) (-t), 0.0f, 0.0f, 1.0f);
// GL11.glTranslatef(0.0f, -0.125f, 0.0f);
// GL11.glScalef(1.2f, 1.2f, 1.2f);
// GL11.glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
// GL11.glTranslatef(0.0f, 0.1f, 0.1f);
// this.customRenderItem.doRender(this.dummyEntityItem, 0.0, 0.0, 0.0, 0.0f, 0.0f);
// GL11.glPopMatrix();
// int rot = 0;
// for (final EntityItem item : this.itemSides) {
// GL11.glPushMatrix();
// item.worldObj = world;
// item.setEntityItemStack(stack);
// item.age = 0;
// item.hoverStart = 0.0f;
// GL11.glRotatef(rot, 0.0f, 1.0f, 0.0f);
// GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f);
// GL11.glTranslated(0.0, -1.13, 0.4);
// GL11.glScalef(0.8f, 0.8f, 0.8f);
// this.customRenderItem.doRender(item, 0.0, 0.0, 0.0, 0.0f, 0.0f);
// rot += 90;
// GL11.glPopMatrix();
// }
// break Label_0591;
// }
// }
// this.dummyEntityItem.setEntityItemStack((ItemStack) null);
// for (final EntityItem item2 : this.itemSides) {
// item2.setEntityItemStack((ItemStack) null);
// }
// }
// GL11.glPopMatrix();
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
GL11.glPushMatrix();
int i1 = 0;
BlockPos pos = machine.getTileEntity().getPos();
int ix = pos.getX();
int iy = pos.getY();
int iz = pos.getZ();
if (machine.getTileEntity() != null) {
i1 = ix * iy * iz + ix * iy - ix * iz + iy * iz - ix + iy - iz;
}
float phase = (float) Math.max(0.0, Math.sin((System.currentTimeMillis() + i1) * 0.003));
GL11.glTranslated(x + 0.5, y + 1.5, z + 0.5);
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
World world = machine.getWorld();
LaboratoryMachine.ComponentGUIHolder holder = Machine.getInterface(LaboratoryMachine.ComponentGUIHolder.class, machine);
Label_0591: {
if (world != null && holder != null && holder.getStack() != null) {
BinnieCore.proxy.getMinecraftInstance();
if (Minecraft.isFancyGraphicsEnabled()) {
final ItemStack stack = holder.getStack();
this.dummyEntityItem.worldObj = world;
this.dummyEntityItem.setEntityItemStack(stack);
if (world.getTotalWorldTime() != this.lastTick) {
this.lastTick = world.getTotalWorldTime();
this.dummyEntityItem.onUpdate();
}
GL11.glPushMatrix();
final EntityPlayer player = BinnieCore.proxy.getPlayer();
final double dx = ix + 0.5 - player.lastTickPosX;
final double dz = iz + 0.5 - player.lastTickPosZ;
final double t = Math.atan2(dz, dx) * 180.0 / 3.1415;
GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f);
GL11.glTranslatef(0.0f, 0.0f, -0.55f);
GL11.glRotatef(90.0f + (float) (-t), 0.0f, 0.0f, 1.0f);
GL11.glTranslatef(0.0f, -0.125f, 0.0f);
GL11.glScalef(1.2f, 1.2f, 1.2f);
GL11.glRotatef(45.0f, 1.0f, 0.0f, 0.0f);
GL11.glTranslatef(0.0f, 0.1f, 0.1f);
RenderManager renderManager = BinnieCore.proxy.getMinecraftInstance().getRenderManager();
renderManager.doRenderEntity(this.dummyEntityItem, 0.0, 0.0, 0.0, 0.0f, 0.0f, false);
GL11.glPopMatrix();
int rot = 0;
for (EntityItem item : this.itemSides) {
GL11.glPushMatrix();
item.worldObj = world;
item.setEntityItemStack(stack);
GL11.glRotatef(rot, 0.0f, 1.0f, 0.0f);
GL11.glRotatef(180.0f, 1.0f, 0.0f, 0.0f);
GL11.glTranslated(0.0, -1.13, 0.4);
GL11.glScalef(0.8f, 0.8f, 0.8f);
renderManager.doRenderEntity(item, 0.0, 0.0, 0.0, 0.0f, 0.0f, false);
rot += 90;
GL11.glPopMatrix();
}
break Label_0591;
}
}
this.dummyEntityItem.setEntityItemStack((ItemStack) null);
for (final EntityItem item2 : this.itemSides) {
item2.setEntityItemStack((ItemStack) null);
}
}
GL11.glPopMatrix();
}
}
@@ -1,76 +0,0 @@
package binnie.genetics.machine;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
public class ModelMachine extends ModelBase {
ModelRenderer Base;
ModelRenderer Body;
ModelRenderer Arm1;
ModelRenderer Arm2;
ModelRenderer Arm3;
ModelRenderer Arm4;
ModelRenderer Top;
public ModelMachine() {
this.textureWidth = 64;
this.textureHeight = 64;
(this.Base = new ModelRenderer(this, 0, 18)).addBox(0.0f, 0.0f, 0.0f, 16, 4, 16);
this.Base.setRotationPoint(-8.0f, 20.0f, -8.0f);
this.Base.setTextureSize(64, 64);
this.Base.mirror = true;
this.setRotation(this.Base, 0.0f, 0.0f, 0.0f);
(this.Body = new ModelRenderer(this, 0, 26)).addBox(0.0f, 0.0f, 0.0f, 12, 7, 12);
this.Body.setRotationPoint(-6.0f, 13.0f, -6.0f);
this.Body.setTextureSize(64, 64);
this.Body.mirror = true;
this.setRotation(this.Body, 0.0f, 0.0f, 0.0f);
(this.Arm1 = new ModelRenderer(this, 0, 0)).addBox(0.0f, 0.0f, 0.0f, 3, 6, 3);
this.Arm1.setRotationPoint(5.0f, 8.0f, 5.0f);
this.Arm1.setTextureSize(64, 64);
this.Arm1.mirror = true;
this.setRotation(this.Arm1, 0.0f, 0.0f, 0.0f);
(this.Arm2 = new ModelRenderer(this, 0, 0)).addBox(0.0f, 0.0f, 0.0f, 3, 6, 3);
this.Arm2.setRotationPoint(-5.0f, 8.0f, 5.0f);
this.Arm2.setTextureSize(64, 64);
this.Arm2.mirror = true;
this.setRotation(this.Arm2, 0.0f, -1.57075f, 0.0f);
(this.Arm3 = new ModelRenderer(this, 0, 0)).addBox(0.0f, 0.0f, 0.0f, 3, 6, 3);
this.Arm3.setRotationPoint(-5.0f, 8.0f, -5.0f);
this.Arm3.setTextureSize(64, 64);
this.Arm3.mirror = true;
this.setRotation(this.Arm3, 0.0f, -3.1415f, 0.0f);
(this.Arm4 = new ModelRenderer(this, 0, 0)).addBox(0.0f, 0.0f, 0.0f, 3, 6, 3);
this.Arm4.setRotationPoint(5.0f, 8.0f, -5.0f);
this.Arm4.setTextureSize(64, 64);
this.Arm4.mirror = true;
this.setRotation(this.Arm4, 0.0f, -4.7122498f, 0.0f);
(this.Top = new ModelRenderer(this, 0, 0)).addBox(0.0f, 0.0f, 0.0f, 14, 4, 14);
this.Top.setRotationPoint(-7.0f, 9.0f, -7.0f);
this.Top.setTextureSize(64, 64);
this.Top.mirror = true;
this.setRotation(this.Top, 0.0f, 0.0f, 0.0f);
}
// public void render(final float f, final float f1, final float f2, final float f3, final float f4, final float f5) {
// super.render((Entity) null, f, f1, f2, f3, f4, f5);
// this.setRotationAngles(f, f1, f2, f3, f4, f5);
// this.Base.render(f5);
// this.Body.render(f5);
// this.Arm1.render(f5);
// this.Arm2.render(f5);
// this.Arm3.render(f5);
// this.Arm4.render(f5);
// this.Top.render(f5);
// }
private void setRotation(final ModelRenderer model, final float x, final float y, final float z) {
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, final float f5) {
super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
}
}
@@ -1,5 +1,6 @@
package binnie.genetics.machine;
import binnie.core.BinnieCore;
import binnie.core.machines.IMachine;
import binnie.core.machines.Machine;
import binnie.core.machines.MachineComponent;
@@ -22,9 +23,11 @@ import binnie.genetics.core.GeneticsGUI;
import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.genetics.Engineering;
import binnie.genetics.item.GeneticLiquid;
import net.minecraft.client.particle.Particle;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.relauncher.Side;
@@ -216,68 +219,63 @@ public class Polymeriser {
}
}
public static class ComponentPolymeriserFX extends MachineComponent implements IRender.RandomDisplayTick, IRender.DisplayTick {
public static class ComponentPolymeriserFX extends MachineComponent implements IRender.DisplayTick {
public ComponentPolymeriserFX(final IMachine machine) {
super(machine);
}
@SideOnly(Side.CLIENT)
@Override
public void onRandomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
}
public void onDisplayTick(World world, BlockPos pos, Random rand) {
final int tick = (int) (world.getTotalWorldTime() % 8L);
if ((tick == 0 || tick == 3) && this.getUtil().getProcess().isInProgress()) {
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1.8, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
double axisX = this.posX;
double axisZ = this.posZ;
double angle = 0.7 + (int) (this.worldObj.getTotalWorldTime() % 2L) * 3.1415;
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// final int tick = (int) (world.getTotalWorldTime() % 8L);
// if ((tick == 0 || tick == 3) && this.getUtil().getProcess().isInProgress()) {
// BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 1.8, z + 0.5, 0.0, 0.0, 0.0) {
// double axisX = this.posX;
// double axisZ = this.posZ;
// double angle = 0.7 + (int) (this.worldObj.getTotalWorldTime() % 2L) * 3.1415;
//
// {
// this.axisX = 0.0;
// this.axisZ = 0.0;
// this.angle = 0.0;
// this.motionX = 0.0;
// this.motionZ = 0.0;
// this.motionY = -0.006;
// this.particleMaxAge = 140;
// this.particleGravity = 0.0f;
// this.noClip = true;
// this.setRBGColorF(0.8f, 0.0f, 1.0f);
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// this.angle += 0.1;
// this.motionY = -0.006;
// double dist = 0.2;
// if (this.particleAge > 60) {
// if (this.particleAge > 120) {
// dist = 0.1;
// }
// else {
// dist = 0.2 - 0.1 * ((this.particleAge - 60.0f) / 60.0f);
// }
// }
// this.setPosition(this.axisX + dist * Math.sin(this.angle), this.posY, this.axisZ + dist * Math.cos(this.angle));
// if (this.particleAge <= 40) {
// this.setAlphaF(this.particleAge / 40.0f);
// }
// if (this.particleAge > 80) {
// this.setRBGColorF(this.particleRed + (0.0f - this.particleRed) / 10.0f, this.particleGreen + (1.0f - this.particleGreen) / 10.0f, this.particleBlue + (1.0f - this.particleBlue) / 10.0f);
// }
// }
//
// @Override
// public int getFXLayer() {
// return 0;
// }
// });
// }
{
this.axisX = 0.0;
this.axisZ = 0.0;
this.angle = 0.0;
this.motionX = 0.0;
this.motionZ = 0.0;
this.motionY = -0.006;
this.particleMaxAge = 140;
this.particleGravity = 0.0f;
this.field_190017_n = true;
this.setRBGColorF(0.8f, 0.0f, 1.0f);
}
@Override
public void onUpdate() {
super.onUpdate();
this.angle += 0.1;
this.motionY = -0.006;
double dist = 0.2;
if (this.particleAge > 60) {
if (this.particleAge > 120) {
dist = 0.1;
}
else {
dist = 0.2 - 0.1 * ((this.particleAge - 60.0f) / 60.0f);
}
}
this.setPosition(this.axisX + dist * Math.sin(this.angle), this.posY, this.axisZ + dist * Math.cos(this.angle));
if (this.particleAge <= 40) {
this.setAlphaF(this.particleAge / 40.0f);
}
if (this.particleAge > 80) {
this.setRBGColorF(this.particleRed + (0.0f - this.particleRed) / 10.0f, this.particleGreen + (1.0f - this.particleGreen) / 10.0f, this.particleBlue + (1.0f - this.particleBlue) / 10.0f);
}
}
@Override
public int getFXLayer() {
return 0;
}
});
}
}
}
}
@@ -1,6 +1,7 @@
package binnie.genetics.machine;
import binnie.Binnie;
import binnie.core.BinnieCore;
import binnie.core.machines.IMachine;
import binnie.core.machines.Machine;
import binnie.core.machines.MachineComponent;
@@ -23,8 +24,10 @@ import binnie.genetics.core.GeneticsTexture;
import binnie.genetics.genetics.GeneTracker;
import binnie.genetics.genetics.SequencerItem;
import binnie.genetics.item.GeneticsItems;
import net.minecraft.client.particle.Particle;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -182,80 +185,81 @@ public class Sequencer {
@SideOnly(Side.CLIENT)
@Override
public void onRandomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// if (!this.getUtil().getProcess().isInProgress()) {
// return;
// }
// BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 1.2 + rand.nextDouble() * 0.2, z + 0.5, 0.0, 0.0, 0.0) {
// double axisX = this.posX;
// double axisZ = this.posZ;
// double angle = this.rand.nextDouble() * 2.0 * 3.1415;
//
// {
// this.axisX = 0.0;
// this.axisZ = 0.0;
// this.angle = 0.0;
// this.motionX = 0.0;
// this.motionZ = 0.0;
// this.motionY = 0.0;
// this.particleMaxAge = 200;
// this.particleGravity = 0.0f;
// this.noClip = true;
// this.setRBGColorF(0.6f + this.rand.nextFloat() * 0.2f, 1.0f, 0.8f * this.rand.nextFloat() * 0.2f);
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// this.angle += 0.03;
// this.setPosition(this.axisX + 0.4 * Math.sin(this.angle), this.posY, this.axisZ + 0.4 * Math.cos(this.angle));
// this.motionY = 0.0;
// this.setAlphaF((float) Math.sin(3.14 * this.particleAge / this.particleMaxAge));
// }
//
// @Override
// public int getFXLayer() {
// return 0;
// }
// });
public void onRandomDisplayTick(World world, BlockPos pos, Random rand) {
if (!this.getUtil().getProcess().isInProgress()) {
return;
}
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1.2 + rand.nextDouble() * 0.2, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
double axisX = this.posX;
double axisZ = this.posZ;
double angle = this.rand.nextDouble() * 2.0 * 3.1415;
{
this.axisX = 0.0;
this.axisZ = 0.0;
this.angle = 0.0;
this.motionX = 0.0;
this.motionZ = 0.0;
this.motionY = 0.0;
this.particleMaxAge = 200;
this.particleGravity = 0.0f;
this.field_190017_n = true;
this.setRBGColorF(0.6f + this.rand.nextFloat() * 0.2f, 1.0f, 0.8f * this.rand.nextFloat() * 0.2f);
}
@Override
public void onUpdate() {
super.onUpdate();
this.angle += 0.03;
this.setPosition(this.axisX + 0.4 * Math.sin(this.angle), this.posY, this.axisZ + 0.4 * Math.cos(this.angle));
this.motionY = 0.0;
this.setAlphaF((float) Math.sin(3.14 * this.particleAge / this.particleMaxAge));
}
@Override
public int getFXLayer() {
return 0;
}
});
}
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// final int ticks = (int) (world.getTotalWorldTime() % 16L);
// if (ticks == 0 && this.getUtil().getProcess().isInProgress()) {
// BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 1, z + 0.5, 0.0, 0.0, 0.0) {
// double axisX = 0.0;
// double axisZ = 0.0;
// double angle = 0.0;
//
// {
// this.motionX = 0.0;
// this.motionZ = 0.0;
// this.motionY = 0.012;
// this.particleMaxAge = 50;
// this.particleGravity = 0.0f;
// this.noClip = true;
// this.particleScale = 2.0f;
// this.setParticleIcon((new BinnieIcon[] { Sequencer.fxSeqA, Sequencer.fxSeqG, Sequencer.fxSeqC, Sequencer.fxSeqT })[this.rand.nextInt(4)].getIcon());
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// this.motionY = 0.012;
// if (this.particleAge > 40) {
// this.setAlphaF((50 - this.particleAge) / 10.0f);
// }
// }
//
// @Override
// public int getFXLayer() {
// return 1;
// }
// });
// }
public void onDisplayTick(World world, BlockPos pos, Random rand) {
final int ticks = (int) (world.getTotalWorldTime() % 16L);
if (ticks == 0 && this.getUtil().getProcess().isInProgress()) {
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
double axisX = 0.0;
double axisZ = 0.0;
double angle = 0.0;
{
this.motionX = 0.0;
this.motionZ = 0.0;
this.motionY = 0.012;
this.particleMaxAge = 50;
this.particleGravity = 0.0f;
this.field_190017_n = true;
this.particleScale = 2.0f;
//TODO: Add sprites
//this.setParticleIcon((new BinnieIcon[] { Sequencer.fxSeqA, Sequencer.fxSeqG, Sequencer.fxSeqC, Sequencer.fxSeqT })[this.rand.nextInt(4)].getIcon());
}
@Override
public void onUpdate() {
super.onUpdate();
this.motionY = 0.012;
if (this.particleAge > 40) {
this.setAlphaF((50 - this.particleAge) / 10.0f);
}
}
@Override
public int getFXLayer() {
return 1;
}
});
}
}
}
@@ -28,6 +28,7 @@ import forestry.api.genetics.AlleleManager;
import forestry.api.genetics.IAllele;
import forestry.api.genetics.IIndividual;
import forestry.api.genetics.ISpeciesRoot;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.entity.item.EntityItem;
@@ -36,6 +37,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -295,7 +297,7 @@ public class Splicer {
}
}
public static class ComponentSplicerFX extends MachineComponent implements IRender.RandomDisplayTick, IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
public static class ComponentSplicerFX extends MachineComponent implements IRender.DisplayTick, IRender.Render, INetwork.TilePacketSync {
private final EntityItem dummyEntityItem;
public ComponentSplicerFX(final IMachine machine) {
@@ -305,53 +307,48 @@ public class Splicer {
@SideOnly(Side.CLIENT)
@Override
public void onRandomDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
public void onDisplayTick(World world, BlockPos pos, Random rand) {
final int tick = (int) (world.getTotalWorldTime() % 3L);
if (tick == 0 && this.getUtil().getProcess().isInProgress()) {
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
double axisX = this.posX;
double axisZ = this.posZ;
double angle = (int) (this.worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
{
this.axisX = 0.0;
this.axisZ = 0.0;
this.angle = 0.0;
this.motionX = 0.0;
this.motionZ = 0.0;
this.motionY = (this.rand.nextDouble() - 0.5) * 0.02;
this.particleMaxAge = 240;
this.particleGravity = 0.0f;
this.field_190017_n = true;
this.setRBGColorF(0.3f + this.rand.nextFloat() * 0.5f, 0.3f + this.rand.nextFloat() * 0.5f, 0.0f);
}
@Override
public void onUpdate() {
super.onUpdate();
final double speed = 0.04;
this.angle -= speed;
final double dist = 0.25 + 0.2 * Math.sin(this.particleAge / 50.0f);
this.setPosition(this.axisX + dist * Math.sin(this.angle), this.posY, this.axisZ + dist * Math.cos(this.angle));
this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
}
@Override
public int getFXLayer() {
return 0;
}
});
}
}
@SideOnly(Side.CLIENT)
@Override
public void onDisplayTick(final World world, final int x, final int y, final int z, final Random rand) {
// final int tick = (int) (world.getTotalWorldTime() % 3L);
// if (tick == 0 && this.getUtil().getProcess().isInProgress()) {
// BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 1.5, z + 0.5, 0.0, 0.0, 0.0) {
// double axisX = this.posX;
// double axisZ = this.posZ;
// double angle = (int) (this.worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
//
// {
// this.axisX = 0.0;
// this.axisZ = 0.0;
// this.angle = 0.0;
// this.motionX = 0.0;
// this.motionZ = 0.0;
// this.motionY = (this.rand.nextDouble() - 0.5) * 0.02;
// this.particleMaxAge = 240;
// this.particleGravity = 0.0f;
// this.noClip = true;
// this.setRBGColorF(0.3f + this.rand.nextFloat() * 0.5f, 0.3f + this.rand.nextFloat() * 0.5f, 0.0f);
// }
//
// @Override
// public void onUpdate() {
// super.onUpdate();
// final double speed = 0.04;
// this.angle -= speed;
// final double dist = 0.25 + 0.2 * Math.sin(this.particleAge / 50.0f);
// this.setPosition(this.axisX + dist * Math.sin(this.angle), this.posY, this.axisZ + dist * Math.cos(this.angle));
// this.setAlphaF((float) Math.cos(1.57 * this.particleAge / this.particleMaxAge));
// }
//
// @Override
// public int getFXLayer() {
// return 0;
// }
// });
// }
}
@SideOnly(Side.CLIENT)
@Override
public void renderInWorld(final RenderItem customRenderItem, final double x, final double y, final double z) {
public void renderInWorld(double x, final double y, final double z) {
if (!this.getUtil().getProcess().isInProgress()) {
return;
}
@@ -371,7 +368,7 @@ public class Splicer {
GL11.glPushMatrix();
GL11.glRotatef(180.0f, 0.0f, 0.0f, 1.0f);
GL11.glTranslatef(0.0f, -0.25f, 0.0f);
customRenderItem.renderItem(dummyEntityItem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);//doRender(this.dummyEntityItem, 0.0, 0.0, 0.0, 0.0f, 0.0f);
BinnieCore.proxy.getMinecraftInstance().getRenderItem().renderItem(dummyEntityItem.getEntityItem(), ItemCameraTransforms.TransformType.FIXED);//doRender(this.dummyEntityItem, 0.0, 0.0, 0.0, 0.0f, 0.0f);
GL11.glPopMatrix();
}
@@ -30,7 +30,12 @@ genetics.machine.labMachine.acclimatiser=Acclimatiser
genetics.machine.advMachine.splicer=Splicer
genetics.machine.advMachine.splicer.info=The Splicer is an incredibly powerful machine that is used to insert genes into individuals. This process is fast, but requires monumental amounts of power.
genetic.item.gene.empty=Empty
genetic.item.gene.charge=Charge
genetic.item.gene.charges=Charges
genetic.item.gene.serum=Serum
genetic.item.gene.serum.corrupted=Corrupted Serum
genetic.item.gene.more.genes=more genes. Hold shift to display.
genetics.item.sequence=DNA Sequence