Jump to content

ss7

Forge Modder
  • Posts

    189
  • Joined

  • Last visited

Everything posted by ss7

  1. Hello, I have got to a point where i would like to make a config file. I found a tutorial in the wiki section. First i'm going to show you how i create my blocks and items in my main mod file: public static final Block test = new Test(Config.ids.get(0), Material.ground).setUnlocalizedName("test"); In my Config file i have this (the var called ids is a ArrayList<Integer> where i save all my ids): The LoadConfig() function is called in the FMLPreInitializationEvent like this: Config.LoadConfig(new Configuration(event.getSuggestedConfigurationFile())); Unfortunately this won't work, cause the block is created before the Config.ids list gets his ids, so it throws a NPE. So i solved that problem like this: In my mod file: public static Block test; And in the FMLInitializationEvent: test = new Test(Config.ids.get(0), Material.ground).setUnlocalizedName("test"); But that also doesn't work, because some of my mod files need access to the Test.blockID before the mod is initialized. So i have no idea what i should do to fix this problem. I hope you can help! Thanks in advance! ss7
  2. Hello, OK, i think i can't do that because i can't change the block id after i registered the block. But anyways: Here is the code to get only blocks of a mod: ss7
  3. Hello, I'm trying to make a config file for my block and item id's. But unfortunately then i would need to make a var for each of my blocks containing the config id. And then i had to make this line of this code for each block: config.get(Configuration.CATEGORY_BLOCKS, "test", 0); And i thought: Why can't i just get all the blocks and items of my mod and iterate through all of them? I found out that all blocks are added to a private Multimap in GameRegistry and i could access that map with reflection. But i don't think that's a good way of doing this. Do you guys have ideas how to do this? Thanks in advance! ss7
  4. Hello, Thank you very much, it works now! I had that isProvidingWeakPower before, but i just had a println and a return 0 in there and never had the idea to return 15 there This is now SOLVED ss7
  5. Hello, I'm trying to make a camera and a monitor and on that monitor you can see what you would see if you would stay at the same position as the camera. Unfortunately i don't even know how to render a player's view on a face of a block. Any help is greatly appreciated! Thank you in advance! ss7
  6. Hello, I'm trying to make a block that provides strong redstone power. In my block class i have this: @Override public int isProvidingStrongPower(IBlockAccess par1iBlockAccess, int par2, int par3, int par4, int par5) { return 5; //Just as a test } But unfortunately that doesn't seem to work. But when i place a cobblestone or some block next to my block and place redstone wire near this cobblestone then it works. I have also overridden canProvidePower() but that only makes that so redstone connects to this block. I have no idea why this is not working. Thank you in advance! ss7
  7. Hello, You could try to override colorMultiplier in your item class. ss7
  8. Hello, Thank you very much, now it works! ss7
  9. Hello, OK, thank you! I've now got this code in a TileEntity class to get all entities nearby: And the canSee() method looks like this (i inverted the order of the arguments, like TheGreyGhost said): But it always prints out null. I don't know what is wrong with my code. ss7
  10. Hello, I'm trying to implement i CCTV camera into my mod. So i need a function that checks if a block can see a entity. I've been looking through the code of EntityLivingBase and found a method called canEntityBeSeen(Entity par1Entity) . So i copied what was in the method and customized it a little bit: return worldObj.clip(worldObj.getWorldVec3Pool().getVecFromPool(xCoord, yCoord, zCoord), worldObj.getWorldVec3Pool().getVecFromPool(entity.posX, entity.posY + (double)entity.getEyeHeight(), entity.posZ)) == null; I have that code in a TileEntity class. But when i call that function and print out the return value it always says false . So i think i have to create a entity that spawns when my block is created, with that i can check if the block can see a entity nearby. But before i do that i wanted to ask if there is a better method with that i can check if the block can see a entity nearby. (I don't wan't to get all the entity's nearby, i wan't all the entity's that the block can see). Thank you in advance. ss7
  11. Hello, I'm rendering a OBJ, but in Minecraft it looks like one side of my cube is open. Here is a image of what i mean: http://i.imagebanana.com/img/3lsb25ny/20131012_20.46.27.png[/img] It doesn't matter from which side i'm looking at the block, it's always the same. Thank you in advance! ss7
  12. Hello, When i bind no texture to it and try opening the GUI of my block and taking out the item that was in there, it's rendering another image. http://i.imagebanana.com/img/2vaf9tav/20131012_12.19.45.png[/img] When i bind a texture to it it looks like this: http://youtu.be/qT0IOXn5__E EDIT: OH MAN!!! That was just the wrong block that i was looking at! Sorry! This is now SOLVED ss7
  13. Hello, I've tried to render a rectangle with the Tesselator but even that doesn't worked. Here is my code: Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(x + 0, y + height, zLevel, 0,1); tessellator.addVertexWithUV(x + width, y + height, zLevel, 1, 1); tessellator.addVertexWithUV(x + width, y + 0, zLevel, 1,0); tessellator.addVertexWithUV(x + 0, y + 0, zLevel, 0, 0); tessellator.draw(); Maybe i'm doing something wrong there, because i'm new to rendering. ss7
  14. Hello, It doesn't work either. But why should i do this? I've done it like this in ALL of my Blocks and it worked in ALL of my Blocks. So why should i do this? My method is faster. ss7
  15. Hello, Here is my rendering code: MODEL: 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("brickcraft", "/textures/test.png")); model.renderAll(); GL11.glPopMatrix(); } TESR: @Override public void renderTileEntityAt(TileEntity tileentity, double d0, double d1, double d2, float f) { new TestModel().Render(tileentity, d0, d1, d2); } ss7
  16. Hello, I'm trying to bind a texture to a face of a obj model with UV Mapping (Blender). So, it works in Blender and i exported the model to an obj. In Minecraft i'm binding the texture like this: FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation("brickcraft", "/textures/test.png")); But when i open Minecraft my block looks like this (what actually looks kinda cool ): http://i.imagebanana.com/img/enn8yv30/20131011_18.12.17.png[/img] It looks the same even if i don't bind a texture to it. The console doesn't say that it can't find the texture. I'm guessing i'm doing something wrong in Blender. Thanks in advance! ss7
  17. Hello, Thank you very much, i just removed the dot, and now it's working! BTW: I'm using Blender. This is now SOLVED ss7
  18. Hello, You can get the normal ray-trace by returning this: return super.collisionRayTrace(par1World, par2, par3, par4, par5Vec3, par6Vec3); That should give it the behaviour of a normal block. Is it that what you want?: ss7
  19. Hello, I've got my obj render code to work, and i created a nice model that looks like this: But when i try to render it in Minecraft i get a error like this: net.minecraftforge.client.model.ModelFormatException: Error parsing entry ('o Cube.001', line 4) in file '/assets/brickcraft/textures/test.obj' - Incorrect format I don't know why i get this error. Here is my OBJ File: https://mega.co.nz/#!4FsWQSyZ!FSG9FA0ivw6jcIGgF3nIlkh-Emx902ofyeZhDlCsHSs I hope you can help! ss7
  20. Hello, I tried it with Triangulate Faces, but the issue is still there. Yes, i registered the renderer and no there is no output in the console during launch or placement of my block. ss7
  21. Hello, I'm having problems with rendering a .obj. It's being rendered, but not correctly. Here is a screenshot of what i mean (the funny thing is that the block doesn't even render after i take a screenshot): http://i.imagebanana.com/img/5zvdynpm/20131008_16.39.52.png[/img] I've just created a new project in blender and directly exported it to obj with this settings (someone posted this settings on the forum here): Selection Only [ ] Animation [ ] Apply Modifiers [X] Include Edges [X] Smooth Groups [ ] Include Normals [ ] Include UVs [X] Write Materials [X] Triangulate Faces [ ] Write Nurbs [ ] Polygroups [ ] Objects as OBJ Objects [X] Objects as OBJ Groups [ ] Material Groups [ ] Keep Vertex Order [ ] Here is my model class: Unfortunly the site of Minalien is under construction and i can't find the old blog post. At the TESR i'm just using: to render the model. And my block class has this in it: I hope you can help me! ss7
  22. Thank you very much! ss7
  23. Hello, I can show you the code of the chest to dispense it items when it breaks, maybe that helps you a little bit. ss7
  24. Hello, Yes i did that, as i updated to 1.6.4. I reinstalled forge and moved my src folder. ss7
  25. Hello, Should i change the item's age only on the server side or client side or both? ss7
×
×
  • Create New...

Important Information

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