Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. Hi Perhaps you could apply your "fire-starter-adjacency" delay in a different way, i.e. add a check to ensure that no more than one (or a few) veins catch fire within any given time period - or perhaps only veins which are within a certain radius of the player. Alternatively you could suspend fire-starter-adjacency until your code (eg in a tick handler, or the first time the gas is checked for spreading) has a chance to sweep through the generated areas and eliminate undesirable "leaks", perhaps by solidifying the blocks of the gas exposed to the air (maybe it slowly polymerises?) -TGG
  2. Hi You probably haven't registered your variants properly or there is a subtle mismatch between the name of your files You might find this link useful http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html (see the Block Rendering topics) also this example project which has a working example of variants (example 3) https://github.com/TheGreyGhost/MinecraftByExample (Edit: brainfade suggestion removed - sorry) You could try searching the vanilla code for the text message "Unable to load definition ", putting a breakpoint there, and inspecting the name and the registry to see what has been registered compared with what the code expects to find. -TGG
  3. Try looking in the fml-client-*.log file. It has a lot of information which will probably tell you where exactly forge is finding your mod copies, eg [21:14:25] [Client thread/INFO] [FML/]: Searching C:\Users\TGG\Documents\JavaSources\BuildFasterV2\eclipse\mods for mods [21:14:25] [Client thread/DEBUG] [FML/]: Found a minecraft related directory at C:\Users\TGG\Documents\JavaSources\BuildFasterV2\out\production\BuildFasterV2, examining for mod candidates [21:14:30] [Client thread/DEBUG] [FML/]: Examining directory BuildFasterV2 for potential mods [21:14:30] [Client thread/DEBUG] [FML/]: Found an mcmod.info file in directory BuildFasterV2 [21:14:32] [Client thread/DEBUG] [FML/]: Identified a mod of type Lcpw/mods/fml/common/Mod; (speedytools.SpeedyToolsMod) - loading -TGG
  4. Hi Bad news, I'm afraid... If you want that robustly, I suggest you migrate to 1.8 which uses BlockStates and facing to let you do this properly. There is an inbuilt forge method in 1.7.10 (Block.rotateBlock()) but it's only good for rotating in place, it's useless for rotating metadata values. I needed to do this for a mod of mine and in the end I copied the helper class from WorldEdit (on GitHub) which manually coded the values for every single block. -TGG
  5. Hi >Config File - From what I've read it's mostly for Block and Item ID's. Not anymore Block and Item IDs went out the window around 1.6 I think the key is - if you want the storage to be local on the client's machine, completely independent of the server, and to carry over from one world to another, then use a config file. Otherwise - I'd suggest to store it on the server using per-player storage, with NBT. Never had to do that, but I have heard talk of IExtendedEntityProperties. http://www.minecraftforge.net/forum/index.php?topic=6999.0 Much easier than trying to roll your own. -TGG
  6. If air is in the slot, you draw nothing for that slot? I don't understand what you mean. If you show your code it might help -TGG
  7. It looks to me like your mod is installed twice Perhaps try a gradle clean to delete the build directory, rebuild and try again. -TGG
  8. Hi This link about blocks might help. http://greyminecraftcoder.blogspot.co.at/2014/12/blocks-18.html Edit: Actually, that link is for 1.8. So it might be a bit confusing. 1.7.10 doesn't have block states, it has getBlock and getBlockMetadata (0-15) instead. But the picture is still correct. Basic idea: 1) use for loops to iterate over a cube in x, y, z centred on the player's current location [xp, yp, zp]. 2) at each [x,y,z], calculate the squared distance from the player's [xp,yp,zp]. If the squared distance is less than radius*radius, your [x,y,z] is within radius of the player, so then use World.getBlock(x,y,z) to retrieve the block at that location. -TGG
  9. On the client there is only one player so you can probably use Minecraft.getMinecraft().thePlayer -TGG
  10. Umm but there is no player.getcurrentarmor True. Instead, this line gets the current armour piece (Helmet I think) ItemStack armourPiece0 = par3EntityPlayer.inventory.armorInventory[0]; -TGG
  11. Hi Try the ClientChatReceivedEvent, it gets called whenever the player receives a chat message. Have you used events before? http://www.wuppy29.com/minecraft/modding-tutorials/wuppys-minecraft-forge-modding-tutorials-for-1-7-events/#sthash.oZVk9wy3.dpbs -TGG
  12. For example, if your armour is an item- ItemStack armourPiece0 = par3EntityPlayer.inventory.armorInventory[0]; if (armourPiece0 != null && armourPiece0.getItem() == myCustomArmourItem) { // do my entity spawn } -TGG
  13. Hi This link talks about mining in a lot of detail, including drops http://greyminecraftcoder.blogspot.co.at/p/list-of-topics.html (see the 3 links under "Mining Blocks With Tools", especially this one http://greyminecraftcoder.blogspot.ch/2015/01/mining-blocks-with-tools.html near the end Short answer - it depends on whether the block is custom, your item is custom, or both are vanilla. Your best bet is probably Block.getDrops() or Item.onBlockDestroyed() or BlockEvent.HarvestDropsEvent -TGG
  14. No worries The debugger lets you place a breakpoint in the code, so that when the program is running and it reaches that line of code, it stops and lets you look at what's going on, for example what all the values of the variables are. You can step through it line by line to see where the code goes and what it does exactly. Once you've learnt how to use it (should only take a couple of hours) you'll wonder how you ever managed without it, it is really quite awesome. This is a decent example of the debugger and breakpoints, there are others including youtube if that's more your style http://www.vogella.com/tutorials/EclipseDebugging/article.html -TGG
  15. Hi Without seeing your code, it's hard to tell if you're on the right track. But if you just need to know which armour slot is which (helmet, breastplate etc) then for sure the easiest way is just to try it? System.out.println("Slot 0:" + player.inventory.armorInventory[0]); System.out.println("Slot 1:" + player.inventory.armorInventory[1]); System.out.println("Slot 2:" + player.inventory.armorInventory[2]); System.out.println("Slot 3:" + player.inventory.armorInventory[3]); -TGG
  16. Thanks for the links guys, they look helpful. -TGG
  17. Are you sure your registerRenderers is ever called? I would you suggest you add breakpoints or System.out.println() to the key parts of your code to see which bit isn't getting called as you expect, for example - the renderer registration - the constructor - the doRender() in Snowball etc -TGG
  18. I suggest you add a breakpoint to the vanilla code and see what Vanilla thinks your image dimensions are. TextureAtlasSprite::loadSprite() if (p_147964_2_ == null) { if (j != i) { throw new RuntimeException("broken aspect ratio and not an animation"); // breakpoint here } this.fixTransparentPixels(aint); this.framesTextureData.add(this.prepareAnisotropicFiltering(aint, i, j)); } -TGG
  19. Hi This link talks a lot about BlockStates http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html See the four links under "blocks" This example project shows a working example (example 3) of what you are trying to do https://github.com/TheGreyGhost/MinecraftByExample -TGG
  20. Hi In case you didn't know - the reason the parameters have unhelpful names is because the source code has been automatically generated from the minecraft compiled code. Helpful humans have renamed many of the classes and methods, but not all of them, because they tend to change every time a new version of minecraft comes out. The project is MCP and its homepage is here http://mcp.ocean-labs.de/page.php?4 They have a tool you can use to browse mappings with http://mcp.ocean-labs.de/news.php?item.13.1 and also a chatbot which you can use to add new mappings yourself http://mcpold.ocean-labs.de/index.php/MCPBot_Reborn It is clunky but better than nothing. -TGG
  21. Hi When generating chunks, try initialising the sky light map to a good initial guess. The vanilla is particularly poor at generating the sky light map if your initial guess is poor (i.e. you have objects in the sky area so the open spaces underneath them are shielded from the open sky. It causes a series of cascading updates to the sky light map, one block at a time. -TGG
  22. Try turning on alpha blending before rendering in your TESR try { GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // render here } finally { GL11.glPopAttrib(); } YOu could additionally try overriding TIleENtity.shouldRenderInPass(pass) to return true in pass 1. I'm not sure if that's necessary in this case though. Your break texture comes from the block texture, which means your block texture probably isn't found. Check your error console output for "using missing texture"... -TGG
  23. What are the symptoms? I'd suggest you use the vanilla rendering code for inspiration, eg RenderBlocks.renderBlockAsItem() This link might also help http://greyminecraftcoder.blogspot.com.au/2013/08/rendering-inventory-items.html -TGG
  24. Hi If you need server-side code, personally I'd just copy the entity-ray-tracing code to your own class and tweak it to do what you need, it's pretty straight forward. Packet from client to server would also work. Depending on what you're trying to do, Item.itemInteractionForEntity() might also work best of all. See EntityPlayer.interactWith() for the relevant vanilla code related to interacting with Entity you've just clicked on. Alternatively attack - see EntityPlayer.attackTargetEntityWithCurrentItem() such as AttackEntityEvent -TGG
×
×
  • Create New...

Important Information

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