SuperHB Posted January 31, 2014 Share Posted January 31, 2014 Okay, so I was making an OBJ Model and I got everything working. Now all I have to do now is get the texture and make it solid. I put the code to make it solid in the Block class but it doesn't work and for the texture I don't know what to do. Please Help! Thanks, SuperHB Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted January 31, 2014 Share Posted January 31, 2014 [me=Draco18s]cannot locate any code or visualization of the problem.[/me] [me=Draco18s]determines that he cannot help and leaves.[/me] Quote 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 More sharing options...
SuperHB Posted February 1, 2014 Author Share Posted February 1, 2014 [me=Draco18s]cannot locate any code or visualization of the problem.[/me] [me=Draco18s]determines that he cannot help and leaves.[/me] It's not really a visual issue.... I don't know how to set up the textures for an OBJ block Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
skullywag Posted February 1, 2014 Share Posted February 1, 2014 Think it was a (not so) subtle hint, asking you to post your code so far. Quote Link to comment Share on other sites More sharing options...
SuperHB Posted February 1, 2014 Author Share Posted February 1, 2014 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 Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 1, 2014 Share Posted February 1, 2014 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? Quote 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 More sharing options...
SuperHB Posted February 1, 2014 Author Share Posted February 1, 2014 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) Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 1, 2014 Share Posted February 1, 2014 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 //?) Quote 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 More sharing options...
SuperHB Posted February 1, 2014 Author Share Posted February 1, 2014 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) Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 1, 2014 Share Posted February 1, 2014 Make sure your directory and file names are EXACT including upPer And loWeR casE. Quote 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 More sharing options...
SuperHB Posted February 2, 2014 Author Share Posted February 2, 2014 Make sure your directory and file names are EXACT including upPer And loWeR casE. It is exactly as the directory Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 2, 2014 Share Posted February 2, 2014 Screenshot Quote 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 More sharing options...
SuperHB Posted February 2, 2014 Author Share Posted February 2, 2014 Screenshot Here is the directory of the image: http://i.imgur.com/mWwzdsM.png Here is the directory code in Eclipse: http://i.imgur.com/29dQBVX.png Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
SuperHB Posted February 2, 2014 Author Share Posted February 2, 2014 dwadventures != dwadventure oh.... my.... god.... -.- *facepalm* THANK YOU! Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
SuperHB Posted February 3, 2014 Author Share Posted February 3, 2014 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? Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 3, 2014 Share Posted February 3, 2014 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. Quote 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 More sharing options...
SuperHB Posted February 3, 2014 Author Share Posted February 3, 2014 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? Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 3, 2014 Share Posted February 3, 2014 Yes. If you know a little programming. Quote 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 More sharing options...
SuperHB Posted February 3, 2014 Author Share Posted February 3, 2014 Yes. If you know a little programming. Is there a tutorial somewhere on how to do it? EDIT: Also when I walk into the custom block there is a regular block inside it. how do I get rid of it? Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 4, 2014 Share Posted February 4, 2014 Open Block.java ctrl-f collision Quote 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 More sharing options...
SuperHB Posted February 4, 2014 Author Share Posted February 4, 2014 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); Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 4, 2014 Share Posted February 4, 2014 Do you know what an AxisAlignedBoundingBox is? Quote 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 More sharing options...
SuperHB Posted February 4, 2014 Author Share Posted February 4, 2014 Do you know what an AxisAlignedBoundingBox is? no Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Draco18s Posted February 4, 2014 Share Posted February 4, 2014 Well then. Research time. Quote 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 More sharing options...
SuperHB Posted February 4, 2014 Author Share Posted February 4, 2014 Well then. Research time. okay so I found a video about AABB Collision Detection and it was for a 2D Indie Game. Not sure if it is the same but I'll try it, but I don't understand it much. Quote MobDrops http://www.planetminecraft.com/mod/125-mobdrops/ Link to comment Share on other sites More sharing options...
Recommended Posts
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.