Jump to content

Terrails

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Terrails

  1. I somehow made my game to throw an connection terminated error when I try to join my world. In my PlayerEvent.Clone it worked fine but sometimes when I login into the world my thirst would have that glitch again, so I wanted to put it into EntityJoinWorldEvent and than it started giving me that error. Event Class (I have a lot of isModLoaded because I want to my mod to work with 1.9-1.11 and ToughAsNails changed their modid to lowercase in 1.11 and I think I can't add 2 modid's into @Optional.Method("modid")): ThirstMessage and ThirstMessageHandler: Error: http://pastebin.com/YudBAdz5
  2. How can I do that without creating a special class for that? (Not making my own ThirstHandler)
  3. Do I need to do something like this? (sorry I never did this kind of stuff) https://github.com/Glitchfiend/ToughAsNails/blob/85ec7ddd56574a22fccf4cd021b0e63f6429f0b4/src/main/java/toughasnails/thirst/ThirstHandler.java#L132
  4. Thanks! Everything works perfectly. Only problem is if I die sometimes my thirst is full, Its a visual bug is there a way to fix this? If I relog or drink water the bug fixes itself, or if I lose thirst
  5. I have another problem.... Is there a way to put this into an IF statement so my mod can load without ToughAsNails? @Nullable public static IThirst getThirst(final EntityLivingBase entity) { return entity.getCapability(TANCapabilities.THIRST, null); }
  6. I was such an idiot.... it was so simple... this is all I needed to do: @SubscribeEvent public void onClonePlayer(PlayerEvent.Clone player){ final IThirst oldThirst = getThirst(player.getOriginal()); final IThirst newThirst = getThirst(player.getEntityPlayer()); if(oldThirst.getThirst() <= ConfigHandler.thirstAmount && ConfigHandler.amountThirst && Loader.isModLoaded("toughasnails")){ newThirst.setThirst(ConfigHandler.thirstAmount); newThirst.setHydration(oldThirst.getHydration()); } else if(ConfigHandler.thirst && Loader.isModLoaded("toughasnails")) { newThirst.setThirst(oldThirst.getThirst()); newThirst.setHydration(oldThirst.getHydration()); } } @Nullable public static IThirst getThirst(final EntityLivingBase entity) { return entity.getCapability(TANCapabilities.THIRST, null); } I just needed getThirst method from which I get THIRST capability and in my Clone method I just getThirst from original and the entityplayer. Of course I needed to register the event. I used this for tough as nails hydration too.
  7. If I have Tough as Nails installed it should when a player die's set players thirst like the one before his death. And yes it doesn't do anything it just resets the thirst to max when I die.
  8. I don't crash. the problem is to it doesn't want to work... I think its something in my EntityPlayer but I'm not sure.
  9. bump... I can't find the issue.
  10. I just made an PlayerEvent class and did this in it: This is my EntityPlayer and my event (I registered it in CommonProxy) But it doesn't want to work, I think its something in my EntityPlayer but I'm not sure
  11. bump
  12. bump.... anything?
  13. I need to make my own getOriginal method somehow but I'm not sure how to do it.
  14. I'm trying to add Tough as Nails support for my mod. Basically I want players to keep their thirst level when they die. How should I do this, for hunger I used getOriginal but how should I get Original's thirst level? I already have the deobfuscated jar file in libs folder and I can access the classes but my problem is how do I get thirst level before death.
  15. I removed the comment from the super call and I tried 2 different way to fix the readFromNBT but nothing.
  16. I fixed 1, 3, 4 and 5 (I updated the github with it) But my battery still won't save its content when I place it. I'll fix the 2 and 6 little bit later.
  17. That doesn't help with the placing, but thanks for informing me.
  18. Here you go this is the folder where my Battery is: https://github.com/Terrails/MineDustry/tree/master/src/main/java/terrails/minedustry/common/blocks/machine/battery I'm doing some random stuff so don't mind the mess!
  19. So I added an ItemBlock subclass into my Block class and it still doesn't want to work. The registry name's have to be the same I know that, but looks like the ItemBlock isn't getting called, I tested it with breakpoints ItemBlock which I added, how am I supposed to call the ItemBlock? this is the subclass.
  20. Oh ok than where do I store the NBT back to the block when I put it on the ground?
  21. I used the getTileDataItemStack because of banners had it but I removed it now. What should I do in onBlockPlacedBy than?
  22. I did this in my Block and I didn't change my Tile https://gist.github.com/Terrails/304ce5c367c6f1a16bdd2a6954d81fab
  23. I can't figure it out... It just doesn't want to apply. I even tried looking at BlockBanner
  24. For now I made the block save its stored power into NBT when I break it. But I'm not sure how to use the NBT in onBlockPlacedBy method. I'm using Actually Addition in my workspace so I can see the NBT. What I added to the Block class: TileEntity
  25. BlockBasicBattery https://gist.github.com/Terrails/cf9282a47e5949162c62ac347f9507bf BaseEnergyContainer https://gist.github.com/Terrails/f3be7032f7a3c097d0fadde5abd0d7b0 TileEntityBasicBattery https://gist.github.com/Terrails/344147dc45a24a35217dab20f0d2312b
×
×
  • Create New...

Important Information

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