Terrails
Members-
Posts
186 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Terrails
-
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
-
How can I do that without creating a special class for that? (Not making my own ThirstHandler)
-
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
-
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
-
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); }
-
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.
-
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.
-
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.
-
bump... I can't find the issue.
-
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
-
bump.... anything?
-
I need to make my own getOriginal method somehow but I'm not sure how to do it.
-
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.
-
I removed the comment from the super call and I tried 2 different way to fix the readFromNBT but nothing.
-
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.
-
That doesn't help with the placing, but thanks for informing me.
-
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!
-
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.
-
Oh ok than where do I store the NBT back to the block when I put it on the ground?
-
I used the getTileDataItemStack because of banners had it but I removed it now. What should I do in onBlockPlacedBy than?
-
I did this in my Block and I didn't change my Tile https://gist.github.com/Terrails/304ce5c367c6f1a16bdd2a6954d81fab
-
I can't figure it out... It just doesn't want to apply. I even tried looking at BlockBanner
-
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
-
BlockBasicBattery https://gist.github.com/Terrails/cf9282a47e5949162c62ac347f9507bf BaseEnergyContainer https://gist.github.com/Terrails/f3be7032f7a3c097d0fadde5abd0d7b0 TileEntityBasicBattery https://gist.github.com/Terrails/344147dc45a24a35217dab20f0d2312b