Jump to content

Terrails

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Terrails

  1. How should I get ore generation from other mods, I'm basically making a mod which adds all kind of ores and I want to add a feature which can control ores from other mods, so people just add an ore into the config file and edit the options. How should I do that?
  2. I want to generate my platinum ore 1 per chunk, something like emerald but without defined biome generation. I'm not sure how they do it on emerald but I've made my own World Generator and used it on my ores but when I get to a really small vein size and chance it just stops generating the ore. Here's my world gen and here is the config file if you need to see the values.
  3. Well I figured it out I just needed to make an Ore Generation category and than in my ConfigHandler (where my config options are) I just needed to make something like this for each config option: copper = configOre.getBoolean("Generate", ORE_GEN + "." + ORE_COPPER, true, "Generate (If false it will ignore settings below and disable copper generation"); I made another category with variable ORE_GEN so in getBoolean where I need to define the category I just did ORE_GEN + "." + ORE_COPPER. And of course in my ConfigGUI I just removed all the other categories and only added the ORE_GEN.
  4. No really, that only adds the categories to the GUI I'm wondering how does he put categories in categories.
  5. Bump
  6. This is what I mean. This is the main page in Quark: And this is in the automation category like you see there are more categories and some config options in it. Thats what I want to do with my categories. I basically want to make an Ore Generation category and inside of it put 7 more categories for each ore type I added. This are my config classes https://github.com/Terrails/IngotHelper/tree/master/src/main/java/terrails/ingothelper/config
  7. Looks like I fixed it but I'm wondering on how should I put all my Ore Generation config categories in a category its like I explained above I want to place the 7 categories under another category so I don't have a those 7 categories right away when I open the Config GUI.
  8. I'm trying to get my config to work in game with the GUI but I can't get more than 1 category to show its options, other categories are just empty and I'm not sure why, is it because I'm using second config file for those categories? ConfigGUI (only GENERAL_SETTINGS is showing its content and that category is in a special config file, others are in another config file too but they are not showing their content in game, its just an empty category): https://github.com/Terrails/IngotHelper/blob/master/src/main/java/terrails/ingothelper/config/ConfigGUI.java#L27 I was also wondering if I could somehow put all those categories except GENERAL_SETTINGS in another category, by that I mean something like quark, a category and than a lot of other categories in it.
  9. Well good to I checked going through portals because the same thing is happening... I used EntityWorldJoinEvent... I really don't get it why ToughAsNails didn't handle all of this.
  10. Looks like it was that, I killed myself around 15 times and it didn't happen. I noticed to the there is a chance when you join your world to the same thing happens so I just copied everything from PlayerRespawnEvent and put it in PlayerLoggedInEvent. Thanks for all the help! (I'm sorry if I didn't understand some stuff before)
  11. Hmm... weird did you try killing yourself with less than max thirst couple of times? It doesn't happen every time, there is a chance to it works and to it doesn't. I removed FMLCommonHandler and fixed variable names instead of entityPlayer to clonedPlayer.
  12. yep that doesn't work... here is the repo ThirstMessage TANEvent RegisterMessage
  13. This is my packet: public class ThirstMessage implements IMessage { int thirst; public ThirstMessage() { } public ThirstMessage(int thirst) { this.thirst = thirst; } @Override public void fromBytes(ByteBuf buf) { thirst = buf.readInt(); } @Override public void toBytes(ByteBuf buf) { buf.writeInt(thirst); } public static class MessageHandler implements IMessageHandler<ThirstMessage, IMessage> { @Override public IMessage onMessage(ThirstMessage message, MessageContext ctx) { IThreadListener mainThread = Minecraft.getMinecraft(); EntityPlayer player = Minecraft.getMinecraft().player; mainThread.addScheduledTask(new Runnable() { @Override public void run() { final IThirst entityPlayer = player.getCapability(TANCapabilities.THIRST, null); entityPlayer.setThirst(message.thirst); } }); return null; } } } I registered it in my MainClass and the event: @SubscribeEvent public void playerRespawn(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent event){ // final IThirst entityPlayer = event.player.getCapability(TANCapabilities.THIRST, null); EntityPlayerMP player = (EntityPlayerMP) event.player; IThirst thirstData = ThirstHelper.getThirstData(event.player); MainClass.instance.sendTo(new ThirstMessage(thirstData.getThirst()), player); } The problem is to how should I get original players thirst level to set it in my packet without using fields, even if I put a number instead of thirstData.getThirst() I would still sometimes get full thirst.
  14. Adubbz told me to use this to send the packet to client IThirst thirstData = ThirstHelper.getThirstData(player); thirstData.setThirst(whatever); I used packet's before but it still wasn't working, this at least works if I for example put 5 in setThirst.
  15. So something like this which I already had before: @SubscribeEvent public void onClonePlayer(PlayerEvent.Clone player) { final IThirst originalPlayer = player.getOriginal().getCapability(TANCapabilities.THIRST, null); final IThirst entityPlayer = player.getEntityPlayer().getCapability(TANCapabilities.THIRST, null); entityPlayer.setThirst(originalPlayer.getThirst()); } and this is in respawnEvent... @SubscribeEvent public void playerRespawn(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent event){ // final IThirst entityPlayer = event.player.getCapability(TANCapabilities.THIRST, null); IThirst thirstData = ThirstHelper.getThirstData(event.player); thirstData.setThirst(thirstData.getThirst()); } and it still doesn't work. I tried to get the thirst with the entityPlayer that is in comment here.
  16. I don't know what's wrong but I'm having problems, how am I supposed to get instance? Do I set IThirst like this: @SubscribeEvent public void onClonePlayer(PlayerEvent.Clone player) { final IThirst originalPlayer = player.getOriginal().getCapability(TANCapabilities.THIRST, null); final IThirst entityPlayer = player.getEntityPlayer().getCapability(TANCapabilities.THIRST, null); this.oldPlayer = originalPlayer; this.newPlayer = entityPlayer; } and I have IThirst variables and in RespawnEvent I use it like this... @SubscribeEvent public void playerRespawn(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent event){ newPlayer.setThirst(oldPlayer.getThirst()); } I'm really not sure what to do anymore...
  17. What exactly do you mean by copy it over, so I use the IThirst instance and need to copy it over but how?
  18. Do you mean something like this? I make an integer, assign it in my Clone event an use it in Respawn event. It doesn't even work like that.
  19. How should I delay syncing?
  20. I got some help from Adubbz and I'm not sure what he means by "update list", how should I do that?
  21. I kinda figured it out. If I die with this Message and this kind of PlayerRespawnEvent my visual thirst gets set to 0 Message(pretty much the same one as tough as nails uses): Event (class needs to extend their ThirstHandler): What should I do further... I'm getting really confused by these packet's.
  22. I did all of that and its still happening: @SubscribeEvent public void respawn(net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerRespawnEvent event) { EntityPlayer entityPlayer = event.player; ThirstHandler thirstStats = (ThirstHandler)entityPlayer.getCapability(TANCapabilities.THIRST, null); MainClass.network.sendTo(new ThirstMessage(thirstStats.getThirst()), (EntityPlayerMP) event.player); }
  23. I tried couple of things and I still can't do anything: Message: Event
  24. I just looked through their code once more and they write their ThirstHandler to NBT and than read it in their MessageUpdateStat packet. How should I than just send thirst level to that NBT? I just somehow need to send the thirst level once when I die or join the world but how...
  25. I was trying this for a little bit in PlayerEvent.Clone and it was still happening... what am I doing wrong?
×
×
  • Create New...

Important Information

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