TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
[1.6.4] [OpenGL] Problem with matrix position after scaling
TheGreyGhost replied to RedEnergy's topic in Modder Support
Hi Try GL11.glTranslatef(deltaX, deltaY, deltaZ); You should be able to figure out the correct values with a couple of trial and error. In general you need to combine scaling and translation to make sure that your shape scales around the correct centrepoint. This image illustrates the problem when doing a rotation, the concept is the same for scaling. http://www.glprogramming.com/red/images/Image52.gif For more info see here http://www.glprogramming.com/red/chapter03.html -TGG -
Multiple entries with same key Intellij crash
TheGreyGhost replied to BleuGamer's topic in Modder Support
Hi To be honest I don't know enough about how it's supposed to work, I did manage to do it and it worked after a minor fix, but IMHO it doesn't really bring much advantage, provided you're happy to execute gradlew build from the command line when you want to publish your project to a jar. If you do want to try importing the build.gradle, just back up the entire folder first. Then say "yes" to "unlinked gradle project", and if necessary run genIntelliJRuns. From memory that did it for me. For git and github I use the inbuilt commands in IntelliJ and leave the gradle commands well alone. -TGG -
Multiple entries with same key Intellij crash
TheGreyGhost replied to BleuGamer's topic in Modder Support
Hi I'm not sure what is causing that, I've never seen it. However my setup is slightly different and it seems to work, so you might give it a try on a separate install. 1) extract zip to a folder 2) run gradlew setupDecompWorkspace from the command line 3) run gradlew idea from the command line 4) Open IntelliJ, then open the project file (*.ipr). When it asks if you want to import the gradle file, say no for now. 5) Add this line to the very end of the build.gradle file: sourceSets { main { output.resourcesDir = output.classesDir } } 6) Use Run-> Debug... --> Minecraft Client Alternatively, if you run the genIntelliJRuns gradle task, that might fix your existing install - perhaps. It adds the Run->Debug..->Minecraft Client task. -TGG -
[1.7.10] What do the four int parameters in placeDoorBlock method
TheGreyGhost replied to Thornack's topic in Modder Support
Hi The fastest way to figure out parameters like this is to see what the caller provides. In this case a search on usage gives ItemDoor.onItemUse: int i1 = MathHelper.floor_double((double)((p_77648_2_.rotationYaw + 180.0F) * 4.0F / 360.0F) - 0.5D) & 3; placeDoorBlock(p_77648_3_, p_77648_4_, p_77648_5_, p_77648_6_, i1, block); So the parameter you are interested in is i1, which looks like the player rotation converted to a quadrant from 0 - 3. In other words, the direction that the player is facing in (north, south, east, west). -TGG -
Hi I'm not sure what you mean by 'clipping' but you might try this: in order to make sure that the second face passes the 'depth test' (i.e. don't get hidden behind the first face), you can try nudging the second face outwards by a tiny amount If you're drawing the faces manually, for example your first face is 1. tessellator.addVertexWithUV(0,0,0,Umax,Vmax); 2. tessellator.addVertexWithUV(0,0,1,Umax,Vmin); 3. tessellator.addVertexWithUV(1,0,1,Umin,Vmin); 4. tessellator.addVertexWithUV(1,0,0,Umin,Vmax); then you could draw your second face at 1. tessellator.addVertexWithUV(0,-0.001,0,Umax,Vmax); 2. tessellator.addVertexWithUV(0,-0.001,1,Umax,Vmin); 3. tessellator.addVertexWithUV(1,-0.001,1,Umin,Vmin); 4. tessellator.addVertexWithUV(1,-0.001,0,Umin,Vmax); Likewise your opposite face at 1. tessellator.addVertexWithUV(0,1,0,Umax,Vmax); 2. tessellator.addVertexWithUV(0,1,1,Umax,Vmin); 3. tessellator.addVertexWithUV(1,1,1,Umin,Vmin); 4. tessellator.addVertexWithUV(1,1,0,Umin,Vmax); could be followed by the second face at 1. tessellator.addVertexWithUV(0,1.001,0,Umax,Vmax); 2. tessellator.addVertexWithUV(0,1.001,1,Umax,Vmin); 3. tessellator.addVertexWithUV(1,1.001,1,Umin,Vmin); 4. tessellator.addVertexWithUV(1,1.001,0,Umin,Vmax); -TGG
-
Something wrong with code please help :(
TheGreyGhost replied to mysticpenguin's topic in Modder Support
Hi This link might help too with some background information http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG -
Hi This line in EntityRenderer.getMouseOver is probably the reason for (int i = 0; i < list.size(); ++i) { Entity entity = (Entity)list.get(i); if (entity.canBeCollidedWith()) // here -> can't collide with EntityItem You might need to copy the code from EntityRenderer.getMouseOver into your own method and alter it. Depending on what you're trying to do, if you want this to work on the server side you probably need to copy the code anyway. -TGG
-
show code?
-
Hi All I'd like to ask for some help from you experienced modders out there. I'm putting together a sample code project to give simple working examples of the important concepts in Minecraft and Forge, to show new modders how the key parts are put together and give them a base to start experimenting from. I have made a modest start (https://github.com/TheGreyGhost/MinecraftByExample) and I'd like to make it much more comprehensive, so I am hoping some of you will help out. What I'm looking for: - ideas for topics / samples - pointers to good examples which already exist in other projects - snippets of self-contained code to illustrate a key concept. - feedback The key features of the samples are that * they must be self-contained, a handful of short classes at most * must be well documented in the source code itself * they must be simple and readable; clarity is much more than important than flexibility, extensibility, or "efficiency" FYI currently I'm planning on adding the following topics over time. It's a long list and half of it I've got no idea about, so it's going to take forever without help... Blocks - simple block modelling more-complicated block modelling blocks with properties / metadata block with display tick block with scheduled update animated texture Items - simple item item with sub-types item with NBT how to control rendering in the different views (1st person, 3rd person, inventory, etc) Recipes variety of recipe types TileEntity simple tile entity with NBT, no renderer simple TileEntitySpecialRenderer Containers furnace-like chest-like Entities basic entity that can be spawned and disappears after a certain time missile entity entity rendering / techne -based / animation entity with basic AI EntityFX simple effect generator Events show some events on different busses GUI customise the standard HUD render elements (crosshairs, etc) create a custom GUI Terrain generation Generate a new dimension Miscellaneous best practice error logging (I could sure use some help on that one!) Thoughts, feedback, suggestions very welcome... -TGG
-
Hi all I have started making a series of posts explaining some of the basic concepts in Minecraft 1.8 and Forge. It's not intended to be step-by-step tutorials, instead it's a short cut to help folks understand what they're seeing when they start reading tutorials and digging through vanilla code. The main contents page is here http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html As a kind of a companion to the blog, I am also creating a MinecraftByExample project on GitHub. The point of the project is to give simple working examples of the important concepts in Minecraft and Forge, to show new modders how the key parts are put together and give them a base to start experimenting from. https://github.com/TheGreyGhost/MinecraftByExample Comments and suggestions very welcome, it's a work in progress. -TGG
-
Hi //Render side 0 (down) 1. tessellator.addVertexWithUV(0,0,0,Umax,Vmax); 2. tessellator.addVertexWithUV(0,0,1,Umax,Vmin); 3. tessellator.addVertexWithUV(1,0,1,Umin,Vmin); 4. tessellator.addVertexWithUV(1,0,0,Umin,Vmax); Your face is pointing the wrong way because your coordinates are anti-clockwise when viewed from the top. They need to be anti-clockwise when viewed from the bottom. Just reverse the order of those statements above, i.e. change them to 4. 3. 2. 1. -TGG
-
Hi This link might help to understand the Tessellator and the icon.getMaxU() etc http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html You can use both an ISBRH and a TESR, for example the BlockBeacon does something similar (renders the base as blocks and the beam in TESR). This can make sense if you have a part which doesn't change / isn't animated (goes in the ISBRH) and a part which is animated (goes in the TESR). Like dieSieben says though, generally it doesn't make sense. If you do want to do this, just define both an ISBRH for the block and add a TileEntity with TESR as well, if you do it right they will both be called. Are your textures "opaque with holes", like glass blocks, or are some coloured see-through, like ice? If the former, you can do everything in an ISBRH easily. Just tessellate the same quad three times with a different icon each time. If the latter, stick with a TESR I reckon. It is hard to do both in an ISBRH because you will have to render in two different passes and the coloured see-through pass always comes second. You will need to learn about alpha blending in OpenGL, if you don't already know how to use it, and remember to restore the OpenGL settings back to what they were before you changed them. -TGG
-
Hi This link might help a bit http://greyminecraftcoder.blogspot.co.at/2014/12/blocks-18.html BlockOldLog is good to look at too, it uses metadata to store two properties. -TGG
-
Hi I don't know of such a program yet. And the json model is very limited compared to techne, because you can only use a very restricted number of rotations of faces (eg 22.5 degrees, 45 degress, etc). Entities models are different to block models, AFAIK they haven't changed and you can still use techne. -TGG
-
Unless enough of us petition Lex to add IItemRenderer back in... @NT I'm working on a tutorial at the moment and I plan to publish it in a couple of days, in the meantime this link is pretty good http://minecraft.gamepedia.com/Block_models MrCrayFish's Furniture mod is also very helpful https://github.com/MrCrayfish/MrCrayfishFurnitureMod I have just started an "MinecraftByExample" tutorial project, it currently has only one example in it which is a simple block, but it might be helpful https://github.com/TheGreyGhost/MinecraftByExample -TGG
-
Not yet I'm planning on making one in a while, haven't gotten to it yet and I don't know of one. The vanilla TESR are not too bad to understand. I have found MrCrayfish's furniture mod very helpful and it has TESR in it https://github.com/MrCrayfish/MrCrayfishFurnitureMod -TGG
-
Hi Are you using IntelliJ 14? If so, there is an issue that it doesn't copy the resources folder to the right place. See here http://www.minecraftforge.net/forum/index.php/topic,21354.0.html -TGG
-
Hi My answer is the same as the last time you asked this question http://www.minecraftforge.net/forum/index.php/topic,25915.msg132281.html#msg132281 Did you not understand what I meant? -TGG
-
Hi Unfortunately that doesn't seem to be true for 1.7, I think you're right that it was possible in 1.6 but it's been eliminated, the renderer only ever performs pass 0 and 1, and it skips pass 1 if getRenderBlockPass() doesn't return >=1. I can only suggest a few things - if you use a TileEntitySpecialRenderer, you can render as many layers as you want. - It also used to be possible to use an ISBRH to stop and restart the tessellator after changing the drawing modes (did it myself in 1.6), but I have heard rumours that leads to errors in 1.7 - haven't tried it myself. - Failing those, you could perhaps add a third rendering layer yourself, perhaps RenderWorldLastEvent would a suitable point, otherwise you would probably need to insert your rendering code using ASM (eg into RenderGlobal.renderSortedRenderers()). This would be pretty challenging I think... -TGG
-
Hi At a guess, your alpha test cutoff is set too high. The darkness decreases smoothly to the cutoff, then suddenly goes fully transparent where the alpha test kicks in at the cutoff value. Depending on what vanilla was previously doing, the cutoff might be 0.5, 0.1, or 0.003. I'd suggest you change it manually (just before your fade/gradient render) to GL11.glAlphaFunc(GL_GREATER, 0.002); or even disable the alpha test entirely GL11.glDisable(GL_ALPHA_TEST); -TGG
-
[1.8]Is there any information about BlockState out there yet?
TheGreyGhost replied to brandon3055's topic in Modder Support
Hi You might find this link useful http://greyminecraftcoder.blogspot.co.at/2014/12/blocks-18.html -TGG -
How does extra utilitie's impossible object render?
TheGreyGhost replied to memcallen's topic in Modder Support
Hi If the mod is open source, you can just look and see what the code does; otherwise you can use a java decompiler eg FernFlower https://github.com/fesh0r/fernflower or JD-gui http://jd.benow.ca/ -TGG -
well I'm out of ideas -TGG
-
Hi Minecraft uses two kinds of transparency - the first is "on/off" transparency - any texels with an alpha less than 0.1 are fully transparent, any texels with an alpha of 0.1 or more are drawn fully opaque. this is the "pass 0 " rendering. Are you sure your png files have the proper alpha channel? the second is alpha-blending transparency, where the texels are drawn according to their alpha level eg 0.6 means 60% opaque, 40% transparent. this is "pass 1". I think you want the on/off kind. If you use alpha values of 0.0 or 1.0 (0 or 255) it should work fine. If you are colouring the overlays afterwards, the png should have white texels - i.e. if your texels are green, and you try to colour them blue when rendering, you will get black. -TGG