TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
Hi RecipeRepairItem and RecipeBookCloning are good vanilla examples of how to write an IRecipe. -TGG
-
[1.8] NullPointerException: Initializing game
TheGreyGhost replied to Nicholas1010's topic in Modder Support
Hi You might find this link on debugging null pointer exceptions useful http://www.terryanderson.ca/debugging/run.html and perhaps this one too http://www.vogella.com/tutorials/EclipseDebugging/article.html I'm guessing cheese is probably null at the call to registerRender(). -TGG -
Ah ok. I think you will need to implement a custom IRecipe for that. GameRegister.addRecipe(myRecipe implements IRecipe); -->Your myRecipe can match diamond sword plus lapis and return an iron sword with the damage copied from the diamond sword. -TGG
-
Sorry dude I have absolutely no idea what you mean Have you solved your own question? -TGG
-
What is this recipe supposed to do? Normally damage is used either for damage or as metadata. How is your aluminiumtooltest expected to change colour? -TGG
-
[1.8] Problem loading models for items with metadata
TheGreyGhost replied to zlotnleo's topic in Modder Support
yeah, that's how it is supposed to work, it's a technique called a 'function object'. Every time minecraft wants to know what ModelResourceLocation to use for your itemstack, it calls the getModelLocation() you have given it. So if you put a println in there, it will print every time it's called, which is a lot. The solution is not to put a println in there. Or, adding every single variant (like you have done) works too, since there aren't very many. -TGG -
Take on all attributes of another block
TheGreyGhost replied to superzanti's topic in Modder Support
Hi Could you describe a bit more exactly what you want to do? The best approach depends a lot on that. For example - changing the colour of all blocks of a particular type (eg all sand blocks) or - changing the colour of one block at one [x,y,z] location only, for any type of block or - changing the colour of one block at one [x,y,z] location only, for a few (say ten) different types of block, eg grass or wood or similar None of them are particularly easy and I think it will be a steep learning curve with no guarantee it will work how you want. -TGG -
Gee thanks dude
-
The only way I can think of is to do the matrix calculations yourself on the vertices [x,y,z] of each quad. Translation is easy, rotation a bit harder, but not too difficult if you know a bit about matrix calculations or are willing to spend a couple of hours researching... The format of the BakedQuad vertex might be a bit clearer if you look at the code fragment below (vertexToInts() )
-
Yes, if you choose your models so they overlap nicely, you can merge them by concatenating together lists of quads. The trickiest bit is if you need to rotate or translate (say) the arrow quads to match the orientation of the bow. A bit similar to this: https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe05_block_smartblockmodel2/CompositeModel.java except that you use handleItemState() to choose the correct models to be combined, instead of handleBlockState(). Alternatively, your Item.getModel() could construct the CompositeModel giving it the appropriate arrow and bow models, and not use the ISmartItemModel at all. -TGG
-
Hi you might find this working example of network messages helpful https://github.com/TheGreyGhost/MinecraftByExample i.e. MBE60 https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe60_network_messages/Notes.txt -TGG
-
[1.8] Problem loading models for items with metadata
TheGreyGhost replied to zlotnleo's topic in Modder Support
Hi This link might be useful http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html here in particular http://greyminecraftcoder.blogspot.com.au/2015/05/common-mistakes-with-item-models.html I think your problem is that you need ModelBakery. -TGG -
Hi These links will tell you more about mining speed of blocks than you ever knew you didn't want to know. http://greyminecraftcoder.blogspot.ch/2015/01/mining-blocks-with-tools.html http://greyminecraftcoder.blogspot.ch/2015/01/summary-of-logic-flow-when-mining-blocks.html http://greyminecraftcoder.blogspot.ch/2015/01/calculating-rate-of-damage-when-mining.html -TGG
-
Hi I think your textures are probably just too large. Minecraft puts all block and item textures into one texture sheet, which is a limited size. Do you get any error messages in the console? You could try putting a breakpoint into here TextureMap:: public void loadTextureAtlas(IResourceManager resourceManager) { int i = Minecraft.getGLMaximumTextureSize(); Stitcher stitcher = new Stitcher(i, i, true, 0, this.mipmapLevels); this.mapUploadedSprites.clear(); this.listAnimatedSprites.clear(); {etc} and seeing whether that's actually the problem. If it is, I don't know how you can fix it. In 1.7.10 with IItemRenderer, you could perhaps have bound to a different texture sheet that you created yourself, but that's not possible for item rendering now, unless you use ASM+Reflection to insert a method call at the appropriate location. -TGG
-
Yeah that's true, what I meant was "in use by the player". I'm pretty sure Entities holding the item don't call getModel. If your item is only ever wielded by the player, or you only care about altering the model in first person (inventory + 3rd person can be the same) then that should work fine. -TGG
-
I think you would probably have to store that information in the ItemStack NBT, using some other event to pull the relevant entity info into the item. Rainwarrior seems to be the driving force behind the development of the new rendering code; you could try reaching him. DieSieben's suggestion is good for when the item is in use. -TGG
-
I think coolAlias' suggestion is the most practical, so long as you don't have too many of your mobs, and you limit your search to (say) 100 randomly chosen blocks in the radius, i.e. your mob doesn't have to be perfect. Otherwise, you could maintain a parallel data structure to store the positions of ores and search it more efficiently. For example - for each chunk, you maintain a list of all [x,y,z] of all ores in that chunk, sorted in ascending y order. Every (say) 2 seconds, your mob stops, searches the four adjacent chunks and checks all entries in the list between y-16 to y+16 to see if they are close and visible. If your ore is rare, this is much faster than having to search every block within a 16 block radius. But you have to be careful to keep it synch with the world data. There are chunk load and unload events which can help you do this. -TGG
-
Hi All I'm trying to make some changes to SimpleNetworkWrapper in my fork of MinecraftForge, but I'm having trouble getting it to commit & track my changes properly. For some reason (legacy issue from FML being a submodule?) the FML package is located in two places C:\Users\TGG\EclipseProjects\MinecraftForge\eclipse\Forge\src\main\java\net\minecraftforge\fml (compiled into the project) and C:\Users\TGG\EclipseProjects\MinecraftForge\fml (synced with the repo) I can make changes to the project location, but if I want them to be committed and pushed to GitHub, then I need to copy the files over to the "repo" location. Vica versa for updating from the GitHub repo. If I keep doing it like this, guaranteed I'm eventually going to copy the wrong way and destroy an evening's work. Is there a better way? What am I missing (not really up to speed with Eclipse yet; since IntelliJ seems to break in strange ways with this project)? -TGG
-
Dude! GL11.glPopMatrix(); t.draw(); should be t.draw(); GL11.glPopMatrix(); Your pop before draw undoes the translate and rotate before OpenGL gets a chance to see it. The rendering commands aren't sent to OpenGL until you call t.draw(). -TGG
-
Lighting is not updated every tick because it is too much work and would slow the game down too much. You need to trigger a relighting check manually (like we said in your other post a few days ago) http://www.minecraftforge.net/forum/index.php/topic,30574.msg158789.html#msg158789. Don't put it in getLightValue because that will probably cause recursion and a crash. Some background info on lighting http://greyminecraftcoder.blogspot.com.au/2014/12/lighting-18.html -TGG
-
Fixed+updated now. Try it out for me? (Planet Minecraft http://www.planetminecraft.com/mod/item-transform-helper---interactively-rotate-scale-translate/) Sorry again for the head damage. Ironically it was a regression which caused several of the MBE examples to break as well. BTW IFlexibleBakedModel.Wrapper isn't mine, that's Forge at work. -TGG
-
Hi I'm guessing you might need to force a blocklight recalculation. Try putting something like this into your tileentity update method // when the number of burning slots changes, we need to force the block to re-render, otherwise the change in // state will not be visible. Likewise, we need to force a lighting recalculation. // The block update (for renderer) is only required on client side, but the lighting is required on both, since // the client needs it for rendering and the server needs it for crop growth etc int numberBurning = numberOfBurningFuelSlots(); if (cachedNumberOfBurningSlots != numberBurning) { cachedNumberOfBurningSlots = numberBurning; if (worldObj.isRemote) { worldObj.markBlockForUpdate(pos); } worldObj.checkLightFor(EnumSkyBlock.BLOCK, pos); } -TGG