Jump to content

RealTheUnderTaker11

Members
  • Posts

    66
  • Joined

  • Last visited

Everything posted by RealTheUnderTaker11

  1. I had a feeling I was going to have to use packets, but thanks for this example. I probably would of made a whole new packet handler if I hadn't seen this, so again, thank you! It worked great, and now if I come across any other weird situation that makes the client de-sync, I can just use that same method.
  2. So my mod can increase the players health, but when a player with 20 hearts of health goes to a different dimension it shows them as only have 10 hearts of health. They actually still have 20, but it just doesn't show it, even if they are hit and lose some health. The only way I got it to show was getting hit down below 10 then healing back up. Is there something wrong I'm doing or is there some way I should be updating the client? Code is here, all the stuff to do with hearts is in the max health. https://github.com/TheUnderTaker11/GeneticsReborn/tree/master/src/main/java/com/theundertaker11/GeneticsReborn/api/capability
  3. Thank you that's exactly what I needed! And thanks for the clarification.
  4. I found the LivingAttackEvent but it doesn't have a target like the player one does. Is there any way for me to get a target any time an entity hits another entity? Or likewise a version of LivingHurtEvent that I can figure out what entity did the hitting.
  5. Or you could not use vanilla durability system and use NBT tags for your durability. Then you could easily change the max durability in the update method or whatever its called in your tools class by checking the EntityPlayer#dimension. Override the getDurabilityForDisplay and it will even show the green bar just like it was using normal durability. Someone can stop me if that is somehow a bad idea.
  6. Yes I have already used capabilities on players to do a different function in my mod, but I'm asking how to actually change the max health or whatever else of a player. Wow thank you so much for the examples, that's awesome you have a whole mod just for helping people on these forums. Also I had seen that wiki page that you linked, because I actually found a different thread where you had linked that same page before and I went to it. Although it does explain what attributes are, it doesn't really say how to use them for my purposes. edit: Jesus the more I read through this the less I feel like I know. I'm slowing catching on though... Slowly.
  7. I can't seem to find any tutorials or threads on how I should use attributes to add traits to players, so how would I do it? The only things on EntityPlayer related to attributes seem to be getters. I gather I should probably be using AttributeModifier somehow, but at the same time there is a whole list of IAtributes in SharedMonsterAttributes. My end goal is to use these to change the players attack speed, max health, and movement speed. So is there any good resources I can use to figure out what I need to do?
  8. A place for pretty good tutorials is http://modwiki.temporal-reality.com/mw/index.php/Main_Page, it could be really helpful to get you started. It gives a basic tutorial on how to make a basic tile entity and one that holds inventory with a GUI. You could change around where the slots are placed and make it work like a crafting table if you wanted.
  9. Alright thank you for explaining that. Now my second question still stands, where to I do the actual stuff? I feel like making those variables final is a pretty bad idea.
  10. "Use Minecraft.getMinecraft() on the client." "Minecraft is a Client-Side-Only class." Hmmmmmmmm What I am saying is that the packet, since it is a keybind, will be sent from the client to the server. There could be situations when you send a packet from server to client. I am asking for clarification on which one I should use. Does the context come from the client that sent it, hence I would have to use Minecraft.getMinecraft(), or is the context gotten from the server where the actual stuff should happen, and I'm supposed to assume the server already knows what player sent it?
  11. Okay so now I'm really confused. So I got two questions now. My first question is, when it says "//or Minecraft.getMinecraft() on the client" does it mean when I'm sending it from the client, or when it's being run on the client? It never really said. Second question is, where do I even put the code I want to actually do stuff? When it is in the run() like I have it now, I just get an error saying Cannot refer to the non-final local variable ctx defined in an enclosing scope and the same thing for the message#Distance. For context my end goal is for this to "teleport" or move the player in the direction he is looking when he hits a keybind. Sure I could change the distance if I wanted but the actual info in the packet sends is arbitrary for what I want. I just need it to know a player hit the key and check a capability on the player.
  12. So then it is clientside only, and I do need packets. In that case, could I use the link given in my OP to set up the packets, or is there a better tutorial I could use?
  13. Okay thank you, whew I was hoping I wasn't going to have to go through all that packet handler stuff just to have a keybind! [EDIT] So question, what situation could I call that in though? It seems like it would need a point of reference, so do I have to call it on the clientside? Or could I call it somewhere like in the PlayerTick event?
  14. I've been looking around and from everything I've seen there used to be a forge wiki page on it but there no long is. Do I have to set up a whole packet handler like this http://www.minecraftforge.net/forum/index.php?topic=20135.0 and all the keyhandler stuff, or is there an easier way to do it? Looking around the closest thing I could find was this http://www.minecraftforge.net/forum/index.php?topic=25751.msg131395#msg131395 but like I said, I'm not sure. Basically my question is how should I make a keybinding and all needed things for that in 1.10.2?
  15. Thanks, I have to treat it like a special snowflake but I was able to check for the ender dragon parts class whatever it's called, but it worked.
  16. I am using the EntityInteract event to try and tell when a player right clicks entities, and it has worked on everything I've tested so far besides the end dragon. For some reason it's like it has no idea when I right click it. This is what I'm using on the event.getTarget() to check if its something alive. if(target instanceof EntityLivingBase&&!(target instanceof EntityPlayer)) And just in case the all the code for the event is in the spoiler below.
  17. While at work today I thought to myself "Oh my god I didn't set the 2 numbers to doubles, only the resulting int." So I did that and the progress bar works perfect, and shows the animation. I'm setting this thread as resolved.(Fire don't work but I'll try and figure that out myself now.)
  18. Okay so update, I went and made it manually do each variable, and it sends both if even one is different than before. My problems are still this 1) The fire animation only has 2 states, fully on or not at all. It's fully on if the power is 100% full and any other time(power<full) it is completely off. 2) Progress is still always 0%, but I've found something that might be the cause. So when I put print screens as such in the lines below, public double percComplete() { System.out.println("EnergyUsed:"+this.energyUsed+" EnergyNeeded:"+this.ENERGY_NEEDED); System.out.println("The number it is spitting out is"+(double)(this.energyUsed/this.ENERGY_NEEDED)); return (double)(this.energyUsed/this.ENERGY_NEEDED); } I get this out in console (Note the EnergyUsed changed every tick, I just gave one example of what was printing out) Is there something obvious I'm missing here or what?
  19. Alright that is true, I can check if each variable is different one at a time, since there is only like 2 I'm checking. And energyUsed is updating, since in the console showed it going up at 20 rf/t like it should have. I'll go and set them to manually check then come back here.
  20. Okay so that told me its updating the GUI to what the energyUsed(Current energy put into the item so far) is, but it never sends what the energy stored is. Console only prints ID 1 when I open it, and isn't sending ID 1 while it processes an item.
  21. I'm glad you pointed that out, cause now I see I had a line that said this.energy = (20*this.overclockers) Which means as soon as operation started the energy was set to 20, and since it used that right away it just stayed at 0. (I went through and removed the overclocker things for now since they were ill thought out and messed things up.) When I removed that the energy went down as it should, but the progress bar still always says 0%, as well as the fire emblem only glowing when there is full power. I don't know how to work with GUI's well enough to even know how I'm supposed to make the fire emblems height represent how much power is stored in the machine. So to sum it up, the power shows how much RF is in there right when you mouse over, but the animation is only an on/off thing, and the progress bar still doesn't work at all. [EDIT] Change that, the gui only removes 20 rf/t. Even if I'm giving it enough power from a bank, the GUI will still be taking away that much RF/t and won't update how much it actually has until you close and open it.
  22. I figured as much. Finally finished uploading, here is the link https://www.dropbox.com/s/qy1egavxrukq7d6/20161231_133149.rar?dl=0
  23. Sorry I had to type all that super fast, lot of things going on in the house right now. I see now I had a lot of typos. I made a video but its like 30 seconds long and my upload is trash so I'll post a link to it in a bit. Also, I meant I want something that I can use to create GUI's instead of just trying to make the code. I am terrible at this type of stuff. I can't even make good looking textures from scratch, much less a whole GUI.
  24. So now I changed that and made the progress one actually do math for the progress of the item its "burning" But now it shows energy in the GUI until I put an item in. The second it start processing the item both values go back to 0 and stay there till it is finished. Is there some kind of GUI make I could use for when I end up making my own? GUI's make me sad. GUI code-http://pastebin.com/hZiiqzj8 Tile Entity Code-http://pastebin.com/UfyN1h2M and container code just in case, I don't think I changed anything here though
  25. Capabilities are not the problem though. Besides the shift clicking the capability works perfect. My problem is the GUI not updating anything besides when the item is finished processing.(I put organic matter in the input, wait a bit, and a diamond pops up in the output.) It is using power, and it is storing its power just fine. I have enderIO in my env to test everything with. Do most big RF mods use the forge energy system now? Most I've seen still have COFH in them so I felt it was safer to use that, be compatible with as many as possible.
×
×
  • Create New...

Important Information

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