Jump to content

[Half-Solved]1.6.4 Forge OBJ Block Texture, and Not Solid


SuperHB

Recommended Posts

[me=Draco18s]cannot locate any code or visualization of the problem.[/me]

[me=Draco18s]determines that he cannot help and leaves.[/me]

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Fine here is my code for the OBJ Block so far and how it looks in-game and how it isn't solid...

 

Block Class:

public class BlockEleventhTardis extends BlockContainer
{

private IModelCustom EleventhTardis;

    public BlockEleventhTardis(int i, Material m)
    {
        super(i, m);
        
        setHardness(3.5F);
        setStepSound(Block.soundStoneFootstep);
        setCreativeTab(DoctorWhoAdventure.tabDoctorWho);
        setResistance(1000.0F);
        setResistance(1000.0F);
        setHardness(1.5F);
        setLightOpacity(0);
        setLightValue(0.0f);
        setTickRandomly(false);
        setUnlocalizedName("dwadventure:EleventhTardis");
        
     // Harvest level for this block. par2 can be pickaxe, axe, or shovel, or
        // a different toolclass. par3 is the minimum level of item required to
        // break it:
        // 0=bare hands, 1=wood, 2=stone, 3=iron, 4=diamond
        //ItemSonicScrewdriver.setBlockHarvestLevel(this, "sonic", 0);
    }
    
    @SideOnly(Side.CLIENT)
    public void registerIcons(IconRegister par1IconRegister)

        {
            blockIcon = par1IconRegister.registerIcon("dwadventures:EleventhTARDIS");
        }
    
    public void Render(TileEntity par1Entity, double x, double y, double z)
{
    GL11.glPushMatrix();
    
    GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F);
    
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("dwadventure", "/textures/blocks/EleventhTARDIS.png"));
    
    EleventhTardis.renderAll();
    
    GL11.glPopMatrix();
}
    
    /**
     * Is this block (a) opaque and (b) a full 1m cube?  This determines whether or not to render the shared face of two
     * adjacent blocks and also whether the player can attach torches, redstone wire, etc to this block.
     */
    
    @Override
    public boolean isOpaqueCube()
    {
        return false;
    }

    /**
     * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc)
     */
  
    public boolean renderAsNormalBlock()
    {
        return false;
    }
    	
    /**
     * Returns Returns true if the given side of this block type should be
     * rendered (if it's solid or not), if the adjacent block is at the given
     * coordinates. Args: blockAccess, x, y, z, side
     */
    @Override
    public boolean isBlockSolid(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
            return true;
    }
    
    /**
     * This method is called on a block after all other blocks gets already
     * created. You can use it to reference and configure something on the block
     * that needs the others ones.
     */
    @Override
    protected void initializeBlock() 
    {
    	
    }
    
    /**
     * Called throughout the code as a replacement for block instanceof
     * BlockContainer Moving this to the Block base class allows for mods that
     * wish
     * to extend vinella blocks, and also want to have a tile entity on that
     * block, may.
     * 
     * Return true from this function to specify this block has a tile entity.
     * 
     * @param metadata
     *            Metadata of the current block
     * @return True if block has a tile entity, false otherwise
     */
    @Override
    public boolean hasTileEntity(int metadata) {
            return true;
    }
    
@Override
public TileEntity createNewTileEntity(World world) {
	return new TileEntityTardis();
}

/**@Override
public TileEntity createTileEntity(World world, int metadata)
{
	return new TileEntityTardis();
}*/
}

 

TESR Class:

public class TardisTESR extends TileEntitySpecialRenderer
{
    private IModelCustom EleventhTardis;
    private ResourceLocation tardisTexture;
    private static Pattern vertexPattern = Pattern.compile("(v( (\\-){0,1}\\d+\\.\\d+){3,4} *\\n)|(v( (\\-){0,1}\\d+\\.\\d+){3,4} *$)");
    
    public TardisTESR()
    {   
    	//EleventhTardis = AdvancedModelLoader.loadModel("/assets/dwadventures/OBJ/Tardis/Model11thDoctorMattSmithTardis.obj");  
    	EleventhTardis = AdvancedModelLoader.loadModel("/assets/dwadventures/OBJ/Tardis/ModelTardis.obj"); 
        tardisTexture = new ResourceLocation("/assets/dwadventures/OBJ/Tardis/tex/tardisTexture.png");
    }

@Override
public void renderTileEntityAt(TileEntity tileentity, double dx, double dy, double dz, float f) 
{	
	GL11.glTranslatef((float)dx, (float)dy, (float)dz);

	Minecraft.getMinecraft().renderEngine.getTexture(tardisTexture);// dont create them here, create them in your constructor and save a reference as a member variable please

	FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("dwadventure", "/textures/blocks/EleventhTARDIS.png"));

	EleventhTardis.renderAll();
}

    public void Render(TileEntity par1Entity, double x, double y, double z)
{
    GL11.glPushMatrix();
    
    GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F);
    
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("dwadventure", "/textures/blocks/tardisTextureRemake.png"));
    
    EleventhTardis.renderAll();
    
    GL11.glPopMatrix();
}
} 

 

TileEntity Class:

public class TileEntityTardis extends TileEntity 
{
public int tardis;

@Override
public void writeToNBT(NBTTagCompound par1)
{
	super.writeToNBT(par1);
	par1.setInteger("tardis", tardis);
}

@Override
public void readFromNBT(NBTTagCompound par1)
{
	super.readFromNBT(par1);
	this.tardis = par1.getInteger("tardis");
}
}

 

Here how it looks like ingame:

http://i.imgur.com/bcJM4ik.png

 

Here is me showing how it isn't solid, when I set it as solid:

http://i.imgur.com/HN7E9MU.png

 

 

Link to comment
Share on other sites

Remove this from your block.  You don't need it.  If you think you do, you don't, and remove all references to it.  It will only cause problems:

 

    public void Render(TileEntity par1Entity, double x, double y, double z)
{
    GL11.glPushMatrix();
    
    GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F);
    
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("dwadventure", "/textures/blocks/EleventhTARDIS.png"));
    
    EleventhTardis.renderAll();
    
    GL11.glPopMatrix();
}

 

As for its nonsolidity:

 

Your problem is because Minecraft will not let you create block bounds that extend past a full block in any direction except Y.

 

As for your texture:

 

		Minecraft.getMinecraft().renderEngine.getTexture(tardisTexture);// dont create them here, create them in your constructor and save a reference as a member variable please

	FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("dwadventure", "/textures/blocks/EleventhTARDIS.png"));[/quote]

"Don't create a texture here" just prior to a line creating a new resource location instead of using the saved one.  Lawl.
Have you checked that it's actually able to find your texture?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Remove this from your block.  You don't need it.  If you think you do, you don't, and remove all references to it.  It will only cause problems:

 

    public void Render(TileEntity par1Entity, double x, double y, double z)
{
    GL11.glPushMatrix();
    
    GL11.glTranslatef((float)x + 0.5F, (float)y + 0.5F, (float)z + 0.5F);
    
    FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("dwadventure", "/textures/blocks/EleventhTARDIS.png"));
    
    EleventhTardis.renderAll();
    
    GL11.glPopMatrix();
}

 

As for its nonsolidity:

 

Your problem is because Minecraft will not let you create block bounds that extend past a full block in any direction except Y.

 

As for your texture:

 

		Minecraft.getMinecraft().renderEngine.getTexture(tardisTexture);// dont create them here, create them in your constructor and save a reference as a member variable please

	FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("dwadventure", "/textures/blocks/EleventhTARDIS.png"));[/quote]

"Don't create a texture here" just prior to a line creating a new resource location instead of using the saved one.  Lawl.
Have you checked that it's actually able to find your texture?

 

It says failed to load... but I have the texture in that location and named like that and everything. here is the error message I get.

 

2014-02-01 11:45:50 [WARNING] [Minecraft-Client] Failed to load texture: dwadventure:/textures/blocks/EleventhTARDIS.png
java.io.FileNotFoundException: dwadventure:/textures/blocks/EleventhTARDIS.png
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67)
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:31)
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84)
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:41)
at net.DoctorWhoAdventures.superhb.mod.TESR.TardisTESR.renderTileEntityAt(TardisTESR.java:38)
at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172)
at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:536)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1160)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946)
at net.minecraft.client.Minecraft.run(Minecraft.java:838)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

Link to comment
Share on other sites

dwadventure:/textures

 

Colons are automatically converted to slashes when it loads textures.

 

It's looking in "assets/dwadventure//textures" which doesn't exist (see the //?)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

dwadventure:/textures

 

Colons are automatically converted to slashes when it loads textures.

 

It's looking in "assets/dwadventure//textures" which doesn't exist (see the //?)

 

still doesn't work... here is the log....

2014-02-01 18:34:05 [WARNING] [Minecraft-Client] Failed to load texture: dwadventure:textures/blocks/tardisTextureRemake.png
java.io.FileNotFoundException: dwadventure:textures/blocks/tardisTextureRemake.png
at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67)
at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:31)
at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84)
at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:41)
at net.DoctorWhoAdventures.superhb.mod.TESR.TardisTESR.renderTileEntityAt(TardisTESR.java:36)
at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntityAt(TileEntityRenderer.java:172)
at net.minecraft.client.renderer.tileentity.TileEntityRenderer.renderTileEntity(TileEntityRenderer.java:157)
at net.minecraft.client.renderer.RenderGlobal.renderEntities(RenderGlobal.java:536)
at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1160)
at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1006)
at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946)
at net.minecraft.client.Minecraft.run(Minecraft.java:838)
at net.minecraft.client.main.Main.main(Main.java:93)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:131)
at net.minecraft.launchwrapper.Launch.main(Launch.java:27)

Link to comment
Share on other sites

Make sure your directory and file names are EXACT including upPer And loWeR casE.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Screenshot

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

 

As for its nonsolidity:

 

Your problem is because Minecraft will not let you create block bounds that extend past a full block in any direction except Y.

 

That's not true? I've seen mods that have items that are larger than 3 blocks wide. that are solid, or is that only for techne blocks?

Link to comment
Share on other sites

That's not true? I've seen mods that have items that are larger than 3 blocks wide. that are solid, or is that only for techne blocks?

 

They have fake blocks providing the colliders.  When any one of the blocks involved in the multi-tile object are broken, they're all broken.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

That's not true? I've seen mods that have items that are larger than 3 blocks wide. that are solid, or is that only for techne blocks?

 

They have fake blocks providing the colliders.  When any one of the blocks involved in the multi-tile object are broken, they're all broken.

 

so would I be able to do that for my block?

 

Link to comment
Share on other sites

Yes.  If you know a little programming.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Open Block.java

ctrl-f

collision

 

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Open Block.java

ctrl-f

collision

 

Okay so I saw the code and I am completely lost... can you give me an example of how to use the code?

 

this is what I found:

/**
     * Adds all intersecting collision boxes to a list. (Be sure to only add boxes to the list if they intersect the
     * mask.) Parameters: World, X, Y, Z, mask, list, colliding entity
     */
    public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity)
    {
        AxisAlignedBB axisalignedbb1 = this.getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);

        if (axisalignedbb1 != null && par5AxisAlignedBB.intersectsWith(axisalignedbb1))
        {
            par6List.add(axisalignedbb1);
        }
    }

 

and

 

this is code to set it:

getCollisionBoundingBoxFromPool(par1World, par2, par3, par4);

Link to comment
Share on other sites

Do you know what an AxisAlignedBoundingBox is?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Well then.

 

Research time.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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