Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi The vanilla CraftingManager has a function to remove the items (in conjunction with SlotCrafting.onPickupFromSlot()) func_180303_b Your crafting manager doesn't appear to have any code which does the same thing. Are you using a SlotCrafting equivalent in your container? Perhaps responsibility for removing the items has moved during the upgrade from 1.7.10 to 1.8? -TGG
  2. Hi It's hard going because of all the obfuscated names, but if you trace it through (perhaps with your debugger) you should be able to figure it out. For example in public void renderItemInFirstPerson(float p_78440_1_) { float f1 = 1.0F - (this.prevEquippedProgress + (this.equippedProgress - this.prevEquippedProgress) * p_78440_1_); EntityPlayerSP entityplayersp = this.mc.thePlayer; float f2 = entityplayersp.getSwingProgress(p_78440_1_); float f3 = entityplayersp.prevRotationPitch + (entityplayersp.rotationPitch - entityplayersp.prevRotationPitch) * p_78440_1_; float f4 = entityplayersp.prevRotationYaw + (entityplayersp.rotationYaw - entityplayersp.prevRotationYaw) * p_78440_1_; this.func_178101_a(f3, f4); this.func_178109_a(entityplayersp); this.func_178110_a((EntityPlayerSP)entityplayersp, p_78440_1_); GlStateManager.enableRescaleNormal(); GlStateManager.pushMatrix(); if (this.itemToRender != null) // is player holding an item? { // yes if (this.itemToRender.getItem() == Items.filled_map) { this.func_178097_a(entityplayersp, f3, f1, f2); } else if (entityplayersp.getItemInUseCount() > 0) // ... etc ... } else if (!entityplayersp.isInvisible()) // player isn't holding an item; check if invisible { this.func_178095_a(entityplayersp, f1, f2); // draw arm without item } To be honest I'm not sure what the best way to hijack the first person rendering would be. The first thing I would check is whether there are any Forge hooks or events in the code as you are looking through it. If not, you could perhaps stop the first person arm rendering (eg by making the player invisible immediately before the arm render, and the restoring the visible flag immediately after), then rendering your own arms. You might be able to create your own MyRenderPlayer which overrides RenderPlayer, and replace the vanilla RenderPlayer with yours. As a last resort you could use ASM+Reflection to insert your code into the vanilla code. (This is tricky to get right). You could also consider looking at other mods (Last Days for example) to see how they do it. Even if it's not open source, you can use a decompiler (eg IntelliJ IDEA has one built in) to look through. -TGG
  3. So it doesn't actually crash with an error, it just freezes up? What happens if you pause it in your debugger? What is the code doing? -TGG
  4. ah, oops... sorry dude http://greyminecraftcoder.blogspot.com.au/2015/01/gui-containers.html -TGG
  5. There are still regular releases, so I guess yes, for now. Upgrade to 1.8 I reckon. It's not that bad if you use other folks' working code as a starting point to show you what you need to know. -TGG
  6. Hi The Forge documentation is in the sourcecode, it's a bit patchy and generally lacks an overview telling the proper way to use the methods, preconditions/assumptions, typical use case examples etc, so you'll often have to inspect the source code implementation to figure it out. There are quite a few other tutorials around which can help fill the gaps, many of them are here: http://www.minecraftforge.net/forum/index.php/board,120.0.html Wuppy29's stuff is really good, for specialist topics dieSieben, coolAlias, and jabelar have also got some really helpful posts & blogs. If you used to do Forge before, the newest things to know about are the ForgeGradle workspace and building (which are massive improvments), Block and Item Models in place of all the old rendering stuff, network packets are totally different (and multithreaded), a lot of changes to Events, and the more-or-less-complete integration of FML into Forge. A lot of the rest is still similar. -TGG
  7. Hi This is for 1.8 but 1.7.10 is almost identical. -TGG
  8. Hi This background info and example code is for 1.8 but the concepts are exactly the same and might help you understand how it should work. http://greyminecraftcoder.blogspot.com.au/2015/01/gui-containers.html https://github.com/TheGreyGhost/MinecraftByExample (MBE30, MBE31) My main comment on your code is that it's got too many "magic numbers" in it for slots indices so it's very hard to tell where the problem is. -TGG
  9. Hi Just make a block which returns a blank texture for the five non-bottom faces http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-standard-blocks-cubes.html If you want see the bottom texture from the top, just make your block extremely thin (max Y = minY) and return a top texture as well Alternatively, you could use ISimpleBlockRenderingHandler like you suggested. http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html -TGG
  10. Hi The vanilla code for this is in ItemRenderer.renderItemInFirstPerson() I think. eg func_178095_a() for when the player is not holding an item --> RenderPlayer.func_177138_b() This might give you some clues on how to modify it. -TGG
  11. At a wild guess - your initItems is being called before initBlocks, so tomato_plant is null. You might find these general debugging links helpful, they are very useful to track down this kind of error very quickly. http://www.terryanderson.ca/debugging/run.html http://www.vogella.com/tutorials/EclipseDebugging/article.html -TGG
  12. HI This tutorial project has a simple example https://github.com/TheGreyGhost/MinecraftByExample see MBE01. -TGG
  13. Hi Just a quick comment, will look more later: partialTicks (not particleTicks) is used to smooth out animations between ticks i.e. a tick happens every 50 microseconds (20 times/second), but if you have a reasonably fast machine, you can render frames much more frequently than that. partialTicks is fractions of a tick. So for example, if my rendering routine is running at 80 frames per second, that is four calls per tick, so your renderer will see: tickCount = 0, partialTicks = 0 tickCount = 0, partialTicks = 0.25 tickCount = 0, partialTicks = 0.5 tickCount = 0, partialTicks = 0.75 tickCount = 1, partialTicks = 0 etc partialTicks is used to smooth out the animations by linearly interpolating between (say) the X value at the previous tick and the X value at the current tick. -TGG
  14. Hi It's a bit late perhaps, but this tutorial project might be useful (MBE30, MBE31) https://github.com/TheGreyGhost/MinecraftByExample and background info http://greyminecraftcoder.blogspot.com.au/2015/01/gui-containers.html If you have any extra hints I'll modify the project and/or blog page to include them... -TGG
  15. Yep. void myfunction(string astring) passes a copy of the string void myfunction(string &astring) passes a reference to the string, so if you modify astring within myfunction, the caller's string parameter gets modified void myfunction(const string &astring) passes a reference to the string and doesn't let myfunction modify the caller's string parameter. It makes good sense once you get used to it. Const is very helpful to stop these "oops I modified the object by mistake" errors. Going to Java from C++ is a bit confusing because the behaviour is different for primitives void myfunction(int a) // can't modify caller's parameter vs void myfunction(MyClass myClass) // can modify caller's parameter I rather miss C++'s good control of lifetime especially constructors and destructors for releasing resources. But I sure don't miss having to worry about memory allocation all the time. -TGG
  16. Hi This tutorial project has a working example of that https://github.com/TheGreyGhost/MinecraftByExample (see MBE31) https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe31_inventory_furnace/Notes.txt icrafting.sendProgressBarUpdate() and icrafting.updateProgressBar() is probably what you need. also this background info http://greyminecraftcoder.blogspot.com.au/2015/01/gui-containers.html -TGG
  17. Hi I think your best bet is the System.out.println("renderParticle:" + this + " at [" + x + ", " + y + ", " + z + "]"); in the renderParticle method and the same for f11, f12, f13, interpX etc That should show you pretty quickly what is happening and where to look next. -TGG
  18. Hi Having a member variable 'focus' in your Item class won't work for two reasons: 1) There is only one instance of ItemInlayArmor, so if you have more than one of these (eg two players both have the armour) it will overwrite. 2) You haven't written any load / save code for focus. You need to store this information in ItemStack NBT instead. It might help to read up on this background info about ItemStacks http://greyminecraftcoder.blogspot.com.au/2013/12/items.html This tutorial project has an example of an item which stores NBT information, which is what you need to do. https://github.com/TheGreyGhost/MinecraftByExample see MBE12 https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe12_item_nbt_animate/Notes.txt -TGG
  19. Hi This troubleshooting guide might help http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html -TGG
  20. Hi There's a working example (with some explanations) of transferStackInSlot() in this tuturial project (see MBE30) https://github.com/TheGreyGhost/MinecraftByExample and in particular https://github.com/TheGreyGhost/MinecraftByExample/blob/master/src/main/java/minecraftbyexample/mbe30_inventory_basic/ContainerBasic.java -TGG
  21. Hi Like Lex says, all vanilla recipes are mirrored automatically. Normally you have to register your recipe in a special way if you don't want them to be mirrored http://greyminecraftcoder.blogspot.com.au/2015/02/recipes.html -TGG
  22. Hi There was a thread a while back showing how you can use the dispatcher. It was a bit hacky and appears to have been deleted by the model rendering police -TGG
  23. Hi Yes it's possible. And for an expert it wouldn't be very difficult, just fiddly. But for someone just starting out it would be a nightmare -TGG
  24. Hi You might find these links helpful to track down your bug http://www.terryanderson.ca/debugging/run.html http://www.vogella.com/tutorials/EclipseDebugging/article.html In this case - at com.Babuska.init.TutorialBlocks.recipe(TutorialBlocks.java:63) your items or blocks probably aren't initialised which you call addRecipe (they are still null) -TGG
  25. You might also find this useful http://greyminecraftcoder.blogspot.com.au/2015/01/tileentity.html There is a working example here (MBE20 and MBE21) https://github.com/TheGreyGhost/MinecraftByExample -TGG
×
×
  • Create New...

Important Information

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