TheGreyGhost
Members-
Posts
3280 -
Joined
-
Last visited
-
Days Won
8
Everything posted by TheGreyGhost
-
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
-
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
-
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
-
ah, oops... sorry dude http://greyminecraftcoder.blogspot.com.au/2015/01/gui-containers.html -TGG
-
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
-
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
-
Hi This is for 1.8 but 1.7.10 is almost identical. -TGG
-
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
-
[1.7.0] Have no textures on a block except for the bottom?
TheGreyGhost replied to a topic in Modder Support
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 -
[1.8][SOLVED] Custom Crop crashes when trying to place
TheGreyGhost replied to Jedispencer21's topic in Modder Support
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 -
HI This tutorial project has a simple example https://github.com/TheGreyGhost/MinecraftByExample see MBE01. -TGG
-
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
-
1.8 help with custom crafting table
TheGreyGhost replied to razielredeemer's topic in Modder Support
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 -
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
-
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
-
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
-
[1.8] [SOLVED] Item object resets when the game is reloaded
TheGreyGhost replied to Ferrettomato's topic in Modder Support
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 -
[1.8] [SOLVED] Custom Glass Pane Not Rendering
TheGreyGhost replied to cclloyd9785's topic in Modder Support
Hi This troubleshooting guide might help http://greyminecraftcoder.blogspot.com.au/2015/03/troubleshooting-block-and-item-rendering.html -TGG -
How does transferStackInSlot() work in containers?
TheGreyGhost replied to austinv11's topic in Modder Support
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 -
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
-
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
-
Changing what drops when i break a block doesn't work (1.8).
TheGreyGhost replied to Wooden_Brick's topic in Modder Support
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 -
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