Jump to content

FireController1847

Members
  • Posts

    290
  • Joined

  • Last visited

Everything posted by FireController1847

  1. I'm not sure whether I should downgrade shadow or upgrade gadle? What do I do? FAILURE: Build failed with an exception. * Where: Build file 'D:\Users\FireController1847\Development\Git\_CAT Minecraft\_CAT Mods\mc-ultimate-discord-pack\build.gradle' line: 13 * What went wrong: A problem occurred evaluating root project 'mc-ultimate-discord-pack'. > Failed to apply plugin [class 'com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin'] > This version of Shadow supports Gradle 3.0+ only. Please upgrade. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED This is my build.grade right now buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' classpath 'club.minnced:java-discord-rpc:2.0.0' classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' } } apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'java' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. version = "0.1.0" group = "com.visualfiredev.udp" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Ultimate Discord Pack" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' } minecraft { version = "1.12.2-14.23.4.2707" runDir = "run" // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // simply re-run your setup task after changing the mappings to update your workspace. mappings = "snapshot_20171003" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } repositories { jcenter() } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, // except that these dependencies get remapped to your current MCP mappings //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html shadow "club.minnced:java-discord-rpc:2.0.0" } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else except the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } }
  2. Okay, one more question. Now that I have my tick loop running every 2 seconds (or however quickly I want it to update) using the ClientTickEvent, how do I detect if the user is hosting a LAN server? Is this even possible from the client?
  3. I do understand this concept. I believe my word choice is making this more confusing than it needs to be. But, just to ensure I understand this concept, let me tell you how I understand it: The client has two sides when you enter a Singleplayer world: Two integrated sides, the Server Side, and the Client Side. You recently told me what both sides are for so I won't repeat that. When connecting to a dedicated server, the client still has two sides, but there is now a third side, or the dedicated server. I am still unsure how the dedicated server talks to the client and integrated server. When hosting a LAN world, the server side just becomes public, I believe. When connecting to a LAN world, it's as if you were on a dedicated and there are three sides. Please correct me if I'm wrong in any of these areas, as even after reading the new documentation on sides it is a little confusing for me. Hopefully now with the information you've provided me, I can achieve the effect I want. It is very much past my bedtime at this point, so any responses after this may come late (but if you respond sooner that's fine, I'll read it in the morning). Thanks for your help so far, and have a good night/day/evening or whatever else it is there.
  4. Yes, and that is all I'm trying to detect. I just need to know if the user is playing Multiplayer, including LAN, and if the player is playing Singleplayer. To set the presence, I need events when the user changes dimensions and first joins the world. The presence displays the current dimension the player is in. So, when the user joins a world, in a server or not, as well as changing their dimension, in a server or not, I need to update the presence. And each time I also detect if the user is in Singleplayer or Multiplayer. And event for when the user begins Open to LAN would be nice too.
  5. I don't care if the server is public lol. All that really matters is -- well, what it displays is "Playing Single player" or "Playing Multiplayer"
  6. I am making a Rich Presence mod for Discord, and one of the things the presence will say is if the user is connected to a server or not. If they are, I'll add the ability to ask others to join. If not, disable it. And apologies for using that terminology, I've edited it to make more sense.
  7. https://minecraft.curseforge.com/projects/coroutil
  8. Kind of specific situation, but about two hours of googling has come to no-avail (and this website's search system is horrible, no offence intended.) I need an event to detect when the Client has connected to a Singleplayer world and a Multiplayer world. Here are the specific times I need to know: - When the player has connected to a Singleplayer World. - When the player has connected to a LAN World. - When the player has connected to a Dedicated Server. I also need the player's current dimension in all of the above cases. I've tried using PlayerLoggedInEvent as well as EntityJoinWorldEvent. I got PlayerLoggedIn to work for a singleplayer world, but not a dedicated server. EntityJoinWorldEvent works fine, but I can't seem to find a way to limit it only to the current client. I ALSO need to know every time the player changes a dimension, and when the player has exited the end. This is a CLIENT-SIDE only party of the mod. PlayerChangedDimensionEvent and PlayerRespawnEvent both don't work for the dedicated server. Oh, also, while I'm here and this seems like a small thing to make a thread of so I just want to attribute this to my current messages, how do I get the version of Minecraft without doing Minecraft.getMinecraft().getVersion(); ?
  9. Okay, interesting. That makes sense, compared to last time I read it. I guess the most confusing part to me is, are these events logical-server only, or do they fire for both the logical-server and logical-client? And how are you supposed to know if the events run on the logical-server or the logical-client? And when would be the use cases to run something on either side?
  10. Oh? Have I been doing it wrong this whole time? I have the events only being added via the ClientProxy. Do I just not need SideOnly in that case? And yes, I have read your forge tutorial on sides. Was very confusing to me for some reason, but I understood most of it.
  11. I'm sorry to have to ask this but, how do I add it using maven? I can't understand a lot of these gradle tutorials as they're not for a pure beginner with gradle like me... Wait, that example you showed is from gradle? Don't I already have that?
  12. I've been using SideOnly because everything else I've tried doesn't give me the desired effect~ I use PlayerLoggedInEvent to detect when the player joins a singleplayer world and NOT a multiplayer world. I use PlayerChangedDimensionEvent to detect when the player changes dimensions... should I be using ServerSide for this? This is a client-only section of the mod, it cannot run on servers.
  13. Okay, I may be doing this entirely wrong (and I feel kind of bad for making two topics right after each other right before I go to bed), but I am using the "java-discord-rpc" module. I don't think I'm adding it right to build.gradle, but this is all I've done. buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' classpath 'club.minnced:java-discord-rpc:2.0.0' } } apply plugin: 'net.minecraftforge.gradle.forge' //Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. version = "0.1.0" group = "com.visualfiredev.udp" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "Ultimate Discord Pack" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' } minecraft { version = "1.12.2-14.23.4.2707" runDir = "run" // the mappings can be changed at any time, and must be in the following format. // snapshot_YYYYMMDD snapshot are built nightly. // stable_# stables are built at the discretion of the MCP team. // Use non-default mappings at your own risk. they may not always work. // simply re-run your setup task after changing the mappings to update your workspace. mappings = "snapshot_20171003" // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. } repositories { jcenter() } dependencies { // you may put jars on which you depend on in ./libs // or you may define them like so.. //compile "some.group:artifact:version:classifier" //compile "some.group:artifact:version" // real examples //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime. //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided, // except that these dependencies get remapped to your current MCP mappings //deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev' //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev' // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html compile "club.minnced:java-discord-rpc:2.0.0" } processResources { // this will ensure that this task is redone when the versions change. inputs.property "version", project.version inputs.property "mcversion", project.minecraft.version // replace stuff in mcmod.info, nothing else from(sourceSets.main.resources.srcDirs) { include 'mcmod.info' // replace version and mcversion expand 'version':project.version, 'mcversion':project.minecraft.version } // copy everything else except the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } Oh, right, and here's the crash report after I take the JAR from build/libs. ---- Minecraft Crash Report ---- // This is a token for 1 free hug. Redeem at your nearest Mojangsta: [~~HUG~~] Time: 6/5/18 12:15 AM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Ultimate Discord Pack (ultimatediscordpack) Caused by: java.lang.NoClassDefFoundError: com/visualfiredev/udp/RPC/UDPRichPresence at com.visualfiredev.udp.Reference.initiateDimensionNames(Reference.java:35) at com.visualfiredev.udp.UltimateDiscordPack.preInit(UltimateDiscordPack.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:627) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:218) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:196) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:135) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:627) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:245) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:466) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:377) at net.minecraft.client.main.Main.main(SourceFile:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: com.visualfiredev.udp.RPC.UDPRichPresence at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 43 more Caused by: java.lang.NoClassDefFoundError: club/minnced/discord/rpc/DiscordRichPresence at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ... 45 more Caused by: java.lang.ClassNotFoundException: club.minnced.discord.rpc.DiscordRichPresence at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 49 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 151264176 bytes (144 MB) / 369098752 bytes (352 MB) up to 8589934592 bytes (8192 MB) JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx8G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=16M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.42 Powered by Forge 14.23.4.2707 5 mods loaded, 5 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored | State | ID | Version | Source | Signature | |:----- |:------------------- |:------------ |:------------------------------- |:---------------------------------------- | | UCH | minecraft | 1.12.2 | minecraft.jar | None | | UCH | mcp | 9.42 | minecraft.jar | None | | UCH | FML | 8.0.99.99 | forge-1.12.2-14.23.4.2707.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 | | UCH | forge | 14.23.4.2707 | forge-1.12.2-14.23.4.2707.jar | e3c3d50c7c986df74c645c0ac54639741c90a557 | | UCEE | ultimatediscordpack | 0.1.0 | Ultimate Discord Pack-0.1.0.jar | None | Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 397.93' Renderer: 'GeForce GTX 960/PCIe/SSE2'
  14. Okay, the dimension change event emits for the nether, in and out. Now, I try the end and.. wait what? It emits when the user enters the end, but does not emit when the user leaves the end via an end gateway. Okay, if this is the case, what's the event I should use for checking when a user leaves the end? Here's my test code right now. @SubscribeEvent @SideOnly(Side.CLIENT) public void onLogin(PlayerLoggedInEvent event) { UltimateDiscordPack.logger.info("Player Logged In"); } @SubscribeEvent @SideOnly(Side.CLIENT) public void onChangeDimension(PlayerChangedDimensionEvent event) { UltimateDiscordPack.logger.info("Player Changed Dimension"); UltimateDiscordPack.logger.info("New Dimension ID: " + event.player.dimension); } @SubscribeEvent @SideOnly(Side.CLIENT) public void onPlayerRespawn(PlayerRespawnEvent event) { UltimateDiscordPack.logger.info("Player Respawned"); }
  15. This worked for me, thanks! Ohh! I apologize for the misunderstanding. If you had said "External GUI" I probably would have understood you. I thought you were talking about making a MINECRAFT GUI and I was very confused.
  16. Nonono, okay, I am making nothing that has to do with a GUI Discord has these things called "games" that when you're playing a game, under your username it will say "Playing <game name>". Recently, though, Discord added this thing called "Rich Presence", that allows game creators (or modders, like me) to give more information about the game, so instead of it just saying "Playing <game name>" it can show up with something like seen in the video. (With the server icon as the big square, and the crafting table as the small logo). In this menu, Discord allows game creators to add two buttons: "Ask to Join" and "Spectate". The Ask to Join button can be seen on a profile when someone is playing the game (they have an example of it here). When someone clicks the Ask to Join button, it will launch Minecraft and put them directly into the same server as the user. The issue is, the Ask to Join button requires an encrypted code to match up players to the correct servers. This code I need to make is a mix between the player's UUID, the mod ID, and the IP of the server, hence why I said UUID_MODID_SERVERIP. When another user on Discord sees your profile and clicks "Ask to Join", it will take the code, put it in the launch options of THEIR game, and then I need to decode it into where I can add the player to the server. For the Spectate button, it's the same issue. I need the UUID_MODID_SERVERIP-"SPECTATE" to be my "encrypted code", where it will force the user into spectate mode. I am making nothing that has to do with the Minecraft title screen or GUI, but integration with Discord (the chat engine)'s Rich Presence, which you can click here for the link to the Rich Presence Documentation. Although, yes, you did get what happens on the Ask to Join part correct. It will send a client side message where the user can say yes or no, and then it connects them to the game (although I'm still not 100% sure how the Ask to Join button works). Here's some images of what I'm talking about.
  17. That's not what I'm doing at all, actually, as seen in this video on my YouTube channel, it explains what I am trying to do. (Read this after watching): As you can see, I need to get the player for the "Ask to Join" buttons and "Spectate" buttons. The reason being is the encrypted code I need to set for Discord is "UUID_MODID_SERVERIP", so I need the user for the UUID. I can get the server data, that's easy. I'm not making a GUI whatsoever.
  18. Hence why I would have my issue. I need an event (or some other way way) that does that exact same thing as ClientConnectedToServerEvent, but AFTER the world and player are set.
  19. Yea, so when I do something like this: @SubscribeEvent @SideOnly(Side.CLIENT) public void connectToServerEvent(ClientConnectedToServerEvent event) { ServerData data = Minecraft.getMinecraft().getCurrentServerData(); if (data == null) return; // Disable singleplayer load as that's handled above // Handle stuff Minecraft.getMinecraft().player // This is null Minecraft.getMinecraft().world // This is null } Both .player and .world are null on this event, and I need to get the data from the player.
  20. I could do that, but that still doesn't solve my "getting the Player & World" issue
  21. As you posted that I was writing this reply! Haha. Here's my entire file of what I've tried. I am making a Discord Rich Presence bot, that when connected to Singleplayer it will show that you're playing singleplayer, and disable the "Ask to join" and "Spectate" buttons, and for a server I want to be able to add "Ask to join" and "Spectate" buttons as well as download the server icon for the rich presence box. To do so, though, I need the UUID of the user and the server IP that way when a user hits the "Ask to join" button it works correctly.
  22. Hmm, okay. That would bring me back to my original question then: I could work up some kind of contraption to set a variable to true on connect and then disable it after world load, but I just want to see if there's an easier way first ^ While doing so, it turns out that mc.player is also null on the first world load event.
×
×
  • Create New...

Important Information

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