Everything posted by Bets
-
[1.8.9] OkHttp crushing the client?
Can I loop through all the users in the tab list?
-
[1.8.9] OkHttp crushing the client?
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
-
[1.8.9] OkHttp crushing the client?
Will it work if I'm trying to detect a fake player that his name is for example §lWelcome ?
-
[1.8.9] OkHttp crushing the client?
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:
-
[1.8.9] OkHttp crushing the client?
It will be a pain to get this to work lol but I'll try!
-
[1.8.9] OkHttp crushing the client?
Isn't there like a better way of getting JSON data from the web without the external stuff?
-
[1.8.9] OkHttp crushing the client?
And that means I need to get NOT ONLY OKHTTP but OKIO TOOOO0OOOOO..... dang it.
-
[1.8.9] OkHttp crushing the client?
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
-
[1.8.9] OkHttp crushing the client?
Found the issue, apparently there are two places that say "dependencies"
-
[1.8.9] OkHttp crushing the client?
dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.1-SNAPSHOT' classpath 'com.squareup.okhttp3:okhttp:3.6.0' }
-
[1.8.9] OkHttp crushing the client?
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(); ^
-
ICommand not recognizing when on server
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());
-
[1.8.9] OkHttp crushing the client?
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?
-
[1.8.9] OkHttp crushing the client?
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"
-
ICommand not recognizing when on server
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?
-
[1.8.9] OkHttp crushing the client?
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.
-
[1.8.9] OkHttp crushing the client?
So I just need to change the @EventHandler to @SubscribeEvent. because the @Mod one is in my mod class.
-
[1.8.9] OkHttp crushing the client?
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()); }
-
[1.8.9] OkHttp crushing the client?
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.
-
[1.8.9] OkHttp crushing the client?
Oh! so Minecraft.getMinecraft(); is called IThreadListener? lol I did not know that! I think i'll figure it out now thanks!
-
ICommand not recognizing when on server
This method is a mc method? how do you call something like this
-
ICommand not recognizing when on server
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.
-
ICommand not recognizing when on server
So like the "new THING" one?
-
ICommand not recognizing when on server
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?
-
[1.8.9] OkHttp crushing the client?
So I basically need to create an IThreadListener#addScheduledTask runnable (if I'm correct) and run the ClientConnectedToServerEvent inside it?
IPS spam blocked by CleanTalk.