Jump to content

TheGreyGhost

Members
  • Posts

    3280
  • Joined

  • Last visited

  • Days Won

    8

Everything posted by TheGreyGhost

  1. In 10.12.0.1024 it has been updated to setUnlocalizedName I believe. It was func_149663_c in the 'beta' release. -TGG
  2. Hi What do you really want to do with the food bar? Do you want the player to be able to eat more, or do you just want finer control / display of the food level? You could probably use ASM & Reflection to modify FoodStats to store a float internally instead of an integer, and allow you to take small fractions of food bar away. To be honest it at the moment it sounds like a lot of trouble for not much gain? -TGG
  3. Hi This message (and subsequent messages) might interest you http://www.minecraftforge.net/forum/index.php/topic,13353.msg81663.html#msg81663 I think there are plenty of folks interested but most of us (me included) lack the skills at the moment. This project from Abrar looks like it will be a valuable part of the puzzle https://github.com/MinecraftForge/Srg2Source If you've got the skills and motivation for this I'm keen to support you how I can. -TGG
  4. I believe the hint was that you shouldn't edit Vanilla code. Any mods should be written from scratch (or using APIs), rather than editing base code, so as to retain the maximum compatibility and ease of porting between versions. That's kind of the point of everything Forge has been working towards I guess I'm not being completely clear about the reason I am so fond of editing vanilla code. It's not because I want to edit base classes and distribute them in my mod, for very many good reasons like you say. The reason I edit base classes is because editing base classes can help a huge amount during debugging, and when trying to understand how the vanilla works. For example If I'm getting a Null Pointer Exception in the one of the base classes, like Entity.moveEntity: List list = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(par1, par3, par5)); for (int i = 0; i < list.size(); ++i) { par3 = ((AxisAlignedBB)list.get(i)).calculateYOffset(this.boundingBox, par3); // line 758 NPE here } Unfortunately I can't just put a breakpoint on this line to inspect what's happening because it gets called many many times a second before the NPE occurs. In some cases a watchpoint can help but often makes the code run far too slowly. But if I am able to edit the base source it becomes trivial for (int i = 0; i < list.size(); ++i) { if (list.get(i) == null) { System.out.println("list.get(i) is null"); // BREAKPOINT HERE } par3 = ((AxisAlignedBB)list.get(i)).calculateYOffset(this.boundingBox, par3); // line 758 NPE here } and I can inspect list to see what's going on. Likewise, if I'm trying to figure out how come, when I implement IProjectile without deriving from EntityArrow, my projectile lags behind the true position and then randomly syncs up 20 seconds later after it sticks in a wall, then it's a big help to sprinkle System.out.println throughout EntityArrow.onUpdate (and as it turns out - EntityTrackerEntry.sendLocationToAllClients). Same deal with trying to figure out the sequence of events when you break a block. The new forge gradle build is (in my opinion) a huge improvement over the old way. I'm just looking for the best of both worlds. -TGG
  5. Hi I sent Abrar a couple of messages last week offering help with implementing some testing / integration for S2S, he hasn't replied yet, but do you know what specifically I could help with? Realistically I can spend say 8 hours a week on it which isn't much but might be of some help? Thanks for the hint about editable source :-) -TGG
  6. fair enough :-) A related question actually - how do you apply the new name (either the one you figured out or the one you got from the bot) in the new gradle setup, where vanilla is all in a library and can't be edited? Is there a "patch" file somewhere you can edit and re-deobfuscate? (I liked being able to edit the vanilla to debug and understand the code better (rename variables for example), but I haven't yet figured out how to convert the library to editable code and have it build properly - there are obviously a few subtleties to it I don't understand yet) -TGG
  7. Are you kidding? It's painful! Don't get me wrong, it's much much better than nothing and I'm very grateful they made it, but if you're doing more than a handful of names it gets real tedious real quick. And it seems to be impossible to correct mistakes, even if you've just entered a new name yourself and notice a spelling error. Well that's easy enough to accommodate. Download the name mappings from the server, apply to the local decompiled obfuscated code by gradle or whatnot, then after refactoring the names, run a gradle "diff script" or similar on the client, and send the information back to the server again. -TGG
  8. Hi I had the same problem, I solved it like this http://www.minecraftforge.net/forum/index.php?topic=11963.0 After figuring out the correct path I added a new artifact to copy the files for me automatically from my source folder to the out. -TGG
  9. Hi By gum obfuscated code is confusing... I guess the crash occurs whenever an entity collides with the spikes? I would suggest that you go to line 758 in Entity.moveEntity and see if you can figure out what object is null on that line. In my 1.7.2 this is List list = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(par1, par3, par5)); for (int i = 0; i < list.size(); ++i) { par3 = ((AxisAlignedBB)list.get(i)).calculateYOffset(this.boundingBox, par3); // line 758 } so almost certainly the getCollidingBoundingBoxes is returning a list with a null entry in it but I don't know how, it doesn't look like it should be able to. Perhaps you could add some logging code or a breakpoint to your Block func_149668_a to see if you can figure out where the null is coming from. It's sure not clear to me. -TGG
  10. I think the long delay for the recent MCP update is showing that there has to be a better way than relying on a few overworked folks at MCP to do all the decompiling and deobfuscation themselves. This is something that could be crowdsourced relatively easily with the right tools because it is intrinsically parallel and verifying the "correct answer" is easy (i.e. the decompiled code compiles back to the original bytecode properly - although this might be compiler dependent?) I also think that, in order to properly realise the advantages of Srg2Source, there needs to be a much better repository than the chatbot currently available. Perhaps something that lets you download a class file, "refactor" the names you're interested in using your IDE, then upload back up again to the server (so it can diff your source and extract the names you replaced). A bit of cunning pattern matching would probably allow automatic matching of most of the names, perhaps with a manual sanity check if the signature has changed. I don't have most of the skills I'd need to even set up a proof of concept for this, but I'm seriously considering bringing myself up to speed. (Only problem is that's going to take a long time). -TGG
  11. Hi I've got a sneaking suspicion that this will stop working when you try to package your mod as a zip for releasing it. If you plan to release your mod eventually, you might want to check that this method still works when you package it up, before you spend too much time on it. I've never tried doing this myself so I can't suggest any other way, sorry. -TGG
  12. Hi This link shows how to do it for 1.6.4, it's the same for 1.7.2 except you select 1.7.2 instead of 1.6.4. You can also change the "Game directory" (the top option in edit profile) to put your save games etc in a different spot, which will prevent your 1.7.2 saves from getting mixed up with the newer ones. -TGG
  13. Hi Perhaps I should have been more explicit - you will need to Block.setLightValue(1.0F) at least once when you construct the block instance, for example like BlockGlowstone. public static final Block glowStone = (new BlockGlowStone(89, Material.glass)).setHardness(0.3F).setStepSound(soundGlassFootstep).setLightValue(1.0F).setUnlocalizedName("lightgem").setTextureName("glowstone"); There is no need to set it every time in your getLightValue method. Try changing the block metadata using World.setBlock(int x, int y, int z, int newBlockID, int newMetadata, int flags) where flags is 2 + 1 -TGG
  14. Hi I think you're on the right track with the renderers, just put the registering in your ClientProxy and take them out of your main. I also found ClientProxy confusing at first. This link might help http://greyminecraftcoder.blogspot.com/2013/11/how-forge-starts-up-your-code.html -TGG
  15. Hi Some background information on lighting here http://greyminecraftcoder.blogspot.com.au/2013/08/lighting.html Your world.getBlockMetadata(x, y, z) == 4 ? 2 : 1 doesn't appear to match your description.. >= 5 ? 2 : 1 perhaps? I think you don't need to use setLightValue at all. Vanilla only uses it to tell whether a block is glowing (>=1) or not (==0). getLightValue is called whenever vanilla needs to know the strength of the blocklight. Instead, just return world.getBLockMetadata(x,y,z) >= 5 ? 2 : 1 -TGG
  16. Hi Crash is good, that means your renderer is registered and being called. Now you just need to figure out why it's crashing. If you're having trouble with that, post the crash log and the code causing the crash. -TGG
  17. HI FYI the reason == doesn't work is explained in this link. It talks about Strings but the idea is the same. http://stackoverflow.com/questions/513832/how-do-i-compare-strings-in-java -TGG
  18. You might find this link useful to learn about events http://www.minecraftforum.net/topic/1419836-forge-4x-events-howto/ -TGG
  19. Could you post ClientProxy and show us which line is line 12? -TGG
  20. Hi Do you have some experience with reading the error log and debugging errors? If not this link might help http://www.terryanderson.ca/debugging/run.html A null pointer exception at at Crystalorb.ClientProxy.registerRenderThings(ClientProxy.java:12) probably means you have forgotten to initialise something before you use it. -TGG
  21. Hi I'd suggest using a TileEntity instead of messing with the Block. Whenever I've tried changing block boundingboxes larger in the past it's been an awful headache. Then in the updateEntity method on the server, check for nearby players and apply potion effects. TileEntityBeacon does exactly that, check it out. -TGG
  22. Hi A bit of googling on glRotatef will show you how to use it. You're right that you will need to know something about the player, what you actually need is the relative positions of the particle and the player's eyes in order to rotate them correctly. You want the particle to rotate around the vertical axis so the basic concepts are: glRotatef(angle, 0, 1, 0); where deltax = particle midpoint x - player eye x deltaz = particle midpoint z - player eye z and angle = atan2(deltax, deltaz) * 180 / Math.PI; That's the general idea. But it will need a bit of playing to get it right - I'm pretty sure that render particle passes in the deltax and deltaz you need because the player's eyes are at 0,0 - but I'm not 100% sure, I suggest having a look at the vanilla to see if you can figure it out, alternatively add some logging code to print out what the values are when you render your test particle. Also, angle might rotate the wrong way or it might be out by 90, 180, or 270 degrees, i.e you may need to do eg angle = -angle and/or angle += 90 // or 180 or 270 With a bit of trial & error you should manage it... -TGG
  23. Hi sorry dude, I don't think there's any more help I can give you than what's in this thread already. -TGG
  24. Hi OK, I'll give it a go. Previously I haven't been able to change the mapping for a searge name once it has been entered (even if I was the one who just entered it and noticed a spelling mistake...) -TGG
  25. Hi This link might help get some of the basic concepts straight (the sections on Blocks) http://greyminecraftcoder.blogspot.com.au/p/list-of-topics.html especially http://greyminecraftcoder.blogspot.com.au/2013/07/blocks.html http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-non-standard-blocks.html -TGG
×
×
  • Create New...

Important Information

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