Jump to content

Bamse5b

Members
  • Posts

    17
  • Joined

  • Last visited

Posts posted by Bamse5b

  1. Forget it, found out how... This was a little useless  :'(

    Yeah.. you could just read the code on how UE is doing it, or said you wanted to do it like UE, or in general be more clear about what you wanted to achieve. As far as I can tell the problem you stated would be solvable by my suggestion of getting the block or te from the location to the left of the cable.. So I still don't see you're problem nor any reason for your anger.

    Bevause you could explain it good enogh for a guy thats not english -.-

  2. I want it to connect to another cable!

    1. Yes that's the answer, there needs to be another cable there!

     

    WITHOUT changing false to true!

     

    If you never will change the value false to true, what's the point of having them at all?

    If the value can't change from true to false and back to true depending on it's connection status what's the point of the variable then? :P

    Do you understand that at all?! The variables are there so the code will CHANGE THEM when it detects another cable!! But im asking HOW TO DETECT IF THERE IS ANOTHER CABLE NEARBY!!!  >:(

  3. Correct, but I only got this part working :P

    package CCTV;
    
    import net.minecraft.tileentity.TileEntity;
    
    public class TileEntityFineWire extends TileEntity{
    
    public boolean[] isConnected = { false, false, false, false, false, false };
    
    public TileEntityFineWire()
    {
    }
    }

  4. I didnt copy it, i just looked how other people did it and found out its the tile entity thats going to check if theres any other cables next to it. But I dont know how to check it, right now i can make a part visible if I change a false to true..

  5. BTW, Heres my render code:

    package CCTV;
    
    import net.minecraft.client.gui.FontRenderer;
    import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
    import net.minecraft.tileentity.TileEntity;
    import org.lwjgl.opengl.GL11;
    import java.io.IOException;
    import java.io.InputStream;
    
    public class RenderFineWire extends TileEntitySpecialRenderer{
    
    public RenderFineWire(){
    model = new ModelFineWire();
    }
    
    public void renderAModelAt(TileEntityFineWire tileEntity, double d, double d1, double d2, float f) {
    
    int rotation = 0;
    if(tileEntity.worldObj != null)
    {
    rotation = tileEntity.getBlockMetadata();
    }
    bindTextureByName("/mods/CCTV/textures/customBlocks/CameraTable.png"); //texture
    GL11.glPushMatrix();
    GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F);
    
    if (tileEntity.isConnected[0] != false)
    {
    model.renderBottom();
    }
    if (tileEntity.isConnected[1] != false)
    {
    model.renderTop();
    }
    if (tileEntity.isConnected[2] != false)
    {
    model.renderFront();
    }
    if (tileEntity.isConnected[3] != false)
    {
    model.renderBack();
    }
    if (tileEntity.isConnected[4] != false)
    {
    model.renderRight();
    }
    if (tileEntity.isConnected[5] != false)
    {
    model.renderLeft();
    }
    
    model.renderMiddle();
    GL11.glPopMatrix();
    }
    
    private ModelFineWire model;
    
    public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
    {
    this.renderAModelAt((TileEntityFineWire)par1TileEntity, par2, par4, par6, par8);
    }
    }

  6. BTW, Heres my render code:

    package CCTV;
    
    import net.minecraft.client.gui.FontRenderer;
    import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
    import net.minecraft.tileentity.TileEntity;
    import org.lwjgl.opengl.GL11;
    import java.io.IOException;
    import java.io.InputStream;
    
    public class RenderFineWire extends TileEntitySpecialRenderer{
    
    public RenderFineWire(){
    model = new ModelFineWire();
    }
    
    public void renderAModelAt(TileEntityFineWire tileEntity, double d, double d1, double d2, float f) {
    
    int rotation = 0;
    if(tileEntity.worldObj != null)
    {
    rotation = tileEntity.getBlockMetadata();
    }
    bindTextureByName("/mods/CCTV/textures/customBlocks/CameraTable.png"); //texture
    GL11.glPushMatrix();
    GL11.glTranslatef((float)d + 0.5F, (float)d1 + 1.5F, (float)d2 + 0.5F);
    GL11.glScalef(1.0F, -1F, -1F);
    GL11.glRotatef(rotation*90, 0.0F, 1.0F, 0.0F);
    
    if (tileEntity.isConnected[0] != false)
    {
    model.renderBottom();
    }
    if (tileEntity.isConnected[1] != false)
    {
    model.renderTop();
    }
    if (tileEntity.isConnected[2] != false)
    {
    model.renderFront();
    }
    if (tileEntity.isConnected[3] != false)
    {
    model.renderBack();
    }
    if (tileEntity.isConnected[4] != false)
    {
    model.renderRight();
    }
    if (tileEntity.isConnected[5] != false)
    {
    model.renderLeft();
    }
    
    model.renderMiddle();
    GL11.glPopMatrix();
    }
    
    private ModelFineWire model;
    
    public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8)
    {
    this.renderAModelAt((TileEntityFineWire)par1TileEntity, par2, par4, par6, par8);
    }
    }

  7. Hey! I wanted to make a cable and tried some codes, but it didnt work. So Im wondering how its passible to make you're model "connect" to blocks and other cables. I hope somebody can help me, thanks in advance!

  8. Hey! I wanted to make a cable and tried some codes, but it didnt work. So Im wondering how its passible to make you're model "connect" to blocks and other cables. I hope somebody can help me, thanks in advance!

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.