Jump to content

Bets

Members
  • Posts

    153
  • Joined

  • Last visited

Everything posted by Bets

  1. Can I loop through all the users in the tab list?
  2. Some servers have titles like this at their tab list - I want to use it do detect when a player is at a certain place
  3. Will it work if I'm trying to detect a fake player that his name is for example §lWelcome ?
  4. Hopefully I'll manage to get it working haha. Meanwhile I'm trying to check if the player is connected to a game by looking at the tab list. I got to this point "mc.getNetHandler().getPlayerInfoMap()", do I need to loop through it and somehow check if it finds the players name or there is some other faster way of doing so? P:
  5. It will be a pain to get this to work lol but I'll try!
  6. Isn't there like a better way of getting JSON data from the web without the external stuff?
  7. And that means I need to get NOT ONLY OKHTTP but OKIO TOOOO0OOOOO..... dang it.
  8. Now the game is crashing whenever I am loading the recompiled mod ;-; Found the issue, no idea why it happens though: The game crashed whilst there was a severe problem during mod loading that has caused the game to failError: net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: okhttp3/OkHttpClient
  9. Found the issue, apparently there are two places that say "dependencies"
  10. dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' classpath 'com.squareup.okhttp3:okhttp:3.6.0' }
  11. I added this: classpath 'com.squareup.okhttp3:okhttp:3.6.0' to my dependencies section inside the gradle file. Do I need to remove the jars from eclipse too? I am still getting errors like: cannot find symbol Response response = APIClient.newCall(request).execute(); ^
  12. I'm a little lost right now... I have a class that extends CommandBase, there I give it the command name, usage etc. Do I need to call that class from my preinitevent (I need to perhaps register it?), right? How do I do that? just like I did for my "THING" class? or there is some other way to do so? The command class is called testCommand, and as I said before extends CommandBase. So I should just add this line to my preinit? MinecraftForge.EVENT_BUS.register(new testCommand());
  13. Hmm, looks like there's an issue with Forge and OkHttp I am getting errors when I try to build the mod (running it inside Eclipse works) This is one of the errors I get when I try to recompile the mod: E:\forge-1.8.9-11.15.1.1902-1.8.9-mdk\build\sources\main\java\name\mods\testingForge\this\THING.java:16: error: package okhttp3 does not exist import okhttp3.Response; ^ Any idea why?
  14. Oh yeah lol forgot it's not like js haha. I use "null" because the API returns a JSON object, and when the user is not connected to a server it returns "null"
  15. Yes I know, but where should I call it, inside my @Mod class? how do I do this? should it be inside my preinit? what should be before it?
  16. Works perfectly! one problem I found is when I check if a string is == to "null" or anything else it doesn't work. for (String str : getUserData(player)) { if (str != "null") { System.out.println(str + " " + player); } } The getUserData function checks the connected server of a player from an API that is loaded from the web using GSON, "str" should give back the server of the player and if it's null it should just ignore it, but it doesn't.
  17. So I just need to change the @EventHandler to @SubscribeEvent. because the @Mod one is in my mod class.
  18. Well... I have this inside a very fancy class I call "THING": @EventHandler public static void runUponConnectingToServer(ClientConnectedToServerEvent e) { System.out.println("IS THIS WORKING?"); Minecraft.getMinecraft().addScheduledTask(new Runnable() { @Override public void run() { System.out.println("WORKS!"); } }); } This is how I register the class: @Mod.EventHandler public void preInit(FMLPreInitializationEvent e) { MinecraftForge.EVENT_BUS.register(new THING()); }
  19. I have a couple of functions that control the OkHttp one, one that is calling the server and the receiving ones - do all of them need to be in the runnable? I tried just inserting a simple System.out.printIn("123"); inside the runnable but it doesn't seem to do anything.
  20. Oh! so Minecraft.getMinecraft(); is called IThreadListener? lol I did not know that! I think i'll figure it out now thanks!
  21. This method is a mc method? how do you call something like this
  22. I am a little new to it, I do understand it but not everything 100% just yet. Most of my stuff I was doing in JavaScript or ActionScript.
  23. I have this in my preinit @Mod.EventHandler public void preInit(FMLPreInitializationEvent e) { MinecraftForge.EVENT_BUS.register(new THING()); } How do I call ntCommandHandler#registerCommand?
  24. So I basically need to create an IThreadListener#addScheduledTask runnable (if I'm correct) and run the ClientConnectedToServerEvent inside it?
×
×
  • Create New...

Important Information

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