Everything posted by TheGreyGhost
-
[SOLVED]Armor detecting entities within a radius crashing
Hi You might find these links helpful http://www.terryanderson.ca/debugging/run.html http://www.vogella.com/tutorials/EclipseDebugging/article.html Without the crash report we can't really help you much further. -TGG
-
Custom door block, having trouble with texturing [SOLVED]
Hi At a guess, your placement code for the door is not setting the top/bottom flag correctly. System.out.println() or a breakpoint should show this up. Have you seen this? http://minecraft.gamepedia.com/Data_values#Starting_at_Minecraft_1.2_.28from_weekly_snapshot_12w06a.29 BTW your code would be a lot easier to understand if you renamed the variables, eg p_149673_2_ -> x, flag2 -> isUpperPanel, etc -TGG
-
Textures wont load in 1.7.2 [SOLVED]
Also, be very careful with capitalisation. It can lead to all sorts of subtle problems because some methods are case-sensitive and others aren't. What's worse, if you're using GitHub it can be rather painful to change the capitalisation of files and folders once you've comitted them. I would suggest changing your MODID to "farmersdream" instead of "FarmersDream" -TGG
-
how to detect if a class implements an interface
OK. So what is the reason you haven't added a breakpoint to this line TileEntity te = world.getTileEntity(x,y-1,z); and discovered what kind of TileEntity you actually get in te? -TGG
-
how to detect if a class implements an interface
Hi Instance of should work fine for your code. Your te is almost certainly null. http://stackoverflow.com/questions/496928/what-is-the-difference-between-instanceof-and-class-isassignablefrom Do you know how to use the debugger? If not, I reckon you should spend a bit of time learning how, because it'll make your life a whole lot easier, you'll wonder how you ever managed without it. For example http://www.vogella.com/tutorials/EclipseDebugging/article.html In this case, I'd suggest you put a breakpoint on this line TileEntity te = world.getTileEntity(x,y-1,z); and it will show you in 30 seconds flat what type of TileEntity you have found (if any). -TGG
-
Detect chunk unload of adjacent tile
Hi I'm not sure why TileEntity.onChunkUnload() doesn't work for you. If you have two linked blocks, A and B, then when B is unloaded, in b.onChunkUnload(), you need to call a.unlink(b); -TGG
-
Direct rotation (not "smooth" and prettier 359 -> 0)
Hi To be honest I have no idea what you're talking about, could you post a video perhaps? -TGG
-
[SOLVED] Giving Items Right Click Abilities
Hi Here is a working example from vanilla code, like what shieldbug said ItemStack itemstack = player.inventory.getCurrentItem(); if (itemstack == null) { return true; } else { if (itemstack.getItem() == Items.water_bucket) { // do your stuff } } -TGG
-
render block/item on side another block.
Hi You might find some of the topics in this link useful http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html Look at the Block Rendering sections. There are also quite a few tutorials around on ISimpleBlockRenderingHandlers that are better than the one you linked. -TGG
-
[1.7.10][SOLVED] Custom Item Renderer Issues
Hi Based on this diagram (1.6.4 but probably still correct): http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-inventory-items.html .. I'd guess that you are missing some of the important setup steps from renderItemIntoGUI. Perhaps you could call renderItemIntoGUI() instead of renderIcon? -TGG
-
How can I texture a bow with the animations?
Hi Look at ItemBow, it shows you how this can be done like DieSieben said- bowPullIconNameArray getItemIconForUseDuration etc -TGG
-
Held item dependent rendering
Hi I'd suggest to make your utility block a TileEntity, and render it in TileEntitySpecialRenderer (invisible if the player is not holding the item) Some background info here might be useful - see the "The most important minecraft classes" topics and the Block Rendering topics. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html If you want to remove the visible "hitbox" around the block when it's invisible, you could try overriding collisionRayTrace() setBlockBoundsBasedOnState() in the block to change the block's bounds; see BlockDoor for example. BTW your code line will crash if the player isn't holding an item, you need to check getHeldItem() == null. And you should compare the item, not the itemID. If you're new to Java but experienced in (say) C++ it shouldn't take you long to get up to speed. Some of the things in this link might be helpful background info. http://www.minecraftforge.net/forum/index.php/topic,16784.msg84954.html#msg84954 -TGG
-
[1.7.10][SOLVED] Custom Item Renderer Issues
Hi The Item Rendering topics on this page might give useful clues. http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html I think the easiest way is probably 1) make an ItemStack of the disabled Item 2) copy the vanilla code that prepares and calls the Item renderer, and use it to call the renderer methods of the disabled Item. The hardest part will be getting your renderer to execute at the right time for multi-pass renderers; eg you might need to use one of the post-render events (eg RenderGameOverlayEvent, RenderWorldLastEvent) to render your stuff last; might need to experiment a bit. -TGG
-
Checking if jukebox sound is done
Hi A guess - SoundHandler.isSoundPlaying() or SoundManager.isSoundPlaying() ? -TGG
-
How can I texture a bow with the animations?
Hi This link might help with background understanding. http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-items.html There are lots of tutorials around about rendering items. -TGG
-
[1.7.10] problem with UnlocalizedName name subitems
Hi ItemCloth shows you what you need to do. -TGG
-
Trigger a search down a line of blocks (cables) [UNSOLVED] [1.7.10]
Hi I don't think it's a good idea to have each block remember the coordinates of all other blocks in the network. This will very quickly lead to huge memory requirements and become very slow to update. For example - if your network has 100 blocks, each one has to remember 99 coordinates, so that's 9900 coordinates. You're effectively storing the same information 100 times. If your network has 200 blocks, that's 39800 coordinates to remember. 1000 blocks becomes 999,000 coordinates. Use a collection of Graphs instead, one Graph per network, and use your A star algorithm on those. You might need to add a game mechanic to make sure the networks stay a reasonable size (for example - maximum of 100 blocks per network, or a block can't below to a network if it is more than 64 blocks from the far side). You can store the networks anywhere you like, i.e. in one of your own classes, so long as you save them and reload them with the world. You can use your own custom save files for that or alternatively in a TileEntity NBT (for example - if you add the rule that a network can have at most one power source) or in per-world storage (see this link for more ideas... (assuming it's still the same for 1.7.10) http://www.minecraftforge.net/forum/index.php?topic=8520.0) -TGG
-
Get Block Brightness?
Hi You might find this link useful http://greyminecraftcoder.blogspot.com.au/2013/08/lighting.html -TGG
-
[SOLVED] ISound crash server
Hi It's not enough to avoid calling ISound. If you have a class which has any ISound in it at all, even if you never directly call those methods, and you create that class on the server side, then you will get this error. The golden rule is - any mod classes which are accessed on the server side should never refer to vanilla client-side-only classes or methods. It doesn't matter if the code is never called (eg by wrapping it in .isRemote checks), the mere act of loading the server-side class will trigger this error. Vanilla client-side-only classes should only be referred to by mod client-side-only classes. I suggest you move everything related to ISound out of your ItemAudioLog, into a separate class (say ItemAudioLogSound). When your item wants to play a sound client side (eg after checking isRemote), it calls the appropriate ItemAudioLogSound method. -TGG
-
Trigger a search down a line of blocks (cables) [UNSOLVED] [1.7.10]
Hi I'd suggest you have basically two reasonable choices 1) Process your nodes and cables into a Graph structure, and update it every time a cable or node is added or deleted. Graphs are a well-studied area in maths and programming and there are many algorithms which will give you the behaviour you want. For some intro information about graphs see here. Warning - it is quite complex. http://introcs.cs.princeton.edu/java/45graph/ 2) Your method #3. Either - make the distance it can travel infinite (so you don't need to worry about the limited metadata), or use tricks to extend the metadata range. eg each cable has an internal "buffer" which tells how far the nearest emitter is, i.e the block stores the number of "steps" to the nearest emitter- the first cable next to the emitter stores 1, the one adjacent to that stores 2, etc. Every few ticks, each cable checks the metadata of the adjacent cables and sets itself to the lowest, plus one. If you want to have a "maximum travel" of (say) 60 blocks, you can use multiple block IDs for your cables (eg 4 block IDs * 16 metadata -> 64 levels) I think both of them would work provided that you don't have a ridiculous number of cables. -TGG
-
How can I have my custom ItemRenderer color "parts" of my items
Hi I guess you are using the Tessellator for this? The basic idea is start drawing quads tessellator.setColorRGBA(r,g,b,a) or tessellator.setColorOpaque(r,g,b) tessellator.addVertexWithUV x4 for your icon tessellator.draw Your icon should be white (or grey scale). You can then make it any colour you choose by varying the r,g,b in your setColor call -TGG
-
[1.7.10] Changing textures in real-time
Hi You might find this link useful http://www.minecraftforge.net/forum/index.php/topic,20550.msg103855.html#msg103855 -TGG
-
[SOLVED] ISound crash server
Hi Line 130 appears to be this public static Item AudiologAudioDiary = new ItemAudioLog(true).setUnlocalizedName("audiologAudioDiary").setTextureName("bioshock:audiolog_audio_diary"); Does your ItemAudioLog use ISound? -TGG
-
[SOLVED] How are rendering parameters determined?
Hi Some guesses from me- Maybe yaw is no longer used (and the name might be wrong/misleading too) Have you looked at renderYawOffset instead of just rotationYaw? Vanilla seems to use it for setting model rotations. -TGG
-
Rendering transparency in an IItemRenderer?
Hi You mean partially transparent? Yes it is possible. Show your code? -TGG
IPS spam blocked by CleanTalk.