Jump to content

DarkEyeDragon

Members
  • Posts

    36
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

DarkEyeDragon's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. I'm replacing the GuiConfirmOpenLink implementation with my own. So i need to get the textcomponent thats clicked to extract the URL from it. Unless there's any other way of doing this? Edit: I found out theres getClickEvent method (duhh) which makes things a lot easier. String link = Objects.requireNonNull(textComponent.getStyle().getClickEvent()).getValue(); Thanks for the help! this issue is resolved now ?
  2. Well not really. It's more to prove i'm actually formatting the TextComponent properly. and (hopefully) adding it correctly to the chat. so that the issue must be in retreiving the textcomonent Edit: my entire point being. Is there a way to get multiple (aka the whole textcomponent) lines using getTextComponent? as it name suggests it would return an entire textcomponent and not cut off halfway because the other part is on a new line
  3. So i'm trying to get a ITextComponent from chat using ITextComponent textComponent = Minecraft.getMinecraft().ingameGUI.getChatGUI().getChatComponent(Mouse.getX(), Mouse.getY()); however it only returns the text on the current line. Bit of context: I'm trying to resolve image urls and display a preview of them ingame. that all works well however with links longer than a single chatline it only returns the line you click on. I don't see why this is happening however as its added to a single ITextComponent this is the code that extracts and formats URL's @SubscribeEvent public void ChatReceived(ClientChatReceivedEvent e){ String text = e.getMessage().getUnformattedText(); if(Filter.extractUrls(text).size() > 0){ //e.setCanceled(true); for (String url : Filter.extractUrls(text)){ ITextComponent link = new TextComponentString(url); link.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, url)); link.getStyle().setColor(TextFormatting.GOLD); link.getStyle().setUnderlined(true); link.getStyle().setHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("Click to preview image"))); Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessage(link); } } } this works just fine so thats not the issue. is this supposed to act like this or should this be reported as a possible bug?
  4. So if you look at the forge modloader config, theres quite a lot of different options. I've managed to figure out the basic ones like: input string, input int, boolean, arraylist etc however, is there a place where i can see ALL of them? In particular i'm looking for "Cycle value string", "Pattern Validated String" and "Mod ID Selector"
  5. Okay... and whats the alternative then? They just seemed to have removed them and added no alternative?
  6. minecraft { srgExtra "PK: org/apache/httpcomponents com/darkeyedragon/screenshotuploader/client/org/apache/httpcomponents" } I am assuming you're talking about this? However i tried to add them and i just got errors: Could not find method srgExtra() for arguments [PK: org/pache/httpcomponents com/darkeyedragon/screenshotuploader/client/org/pache/httpcomponents] on object of type net.minecraftforge.gradle.user.patcherUser.forge.ForgeExtension.
  7. So after trying to solve this issue for a couple of hours now i have no idea's on what to do to fix this. My mod depends on 2 apache libs "fluent-hc" and "httpmime" they get included in my mod jar. but still somehow cant be loaded when asked to. Is there any special procedure i need to go trough for them to load properly? my current build.gradle: configurations { shade compile.extendsFrom shade } buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } 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 = "1.1.0" group = "com.darkeyedragon.screenshotuploader" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "ScreenshotUploader" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' } minecraft { version = "1.12.2-14.23.2.2611" 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. } dependencies { shade group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.5' shade group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.1' } 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' } } jar { configurations.shade.each { dep -> from(project.zipTree(dep)){ exclude 'META-INF', 'META-INF/**' } } } i've tried using shadowjar, no luck. Error [17:07:05] [Custom Image Uploading/INFO] [STDOUT]: [com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader:lambda$uploadImage$0:45]: SCREENSHOTLOGGER: 1 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDOUT]: [com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader:lambda$uploadImage$0:47]: SCREENSHOTLOGGER: 2 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDOUT]: [com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader:lambda$uploadImage$0:49]: SCREENSHOTLOGGER: 3 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDOUT]: [com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader:lambda$uploadImage$0:51]: SCREENSHOTLOGGER: 4 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDOUT]: [com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader:lambda$uploadImage$0:53]: SCREENSHOTLOGGER: 5 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDOUT]: [com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader:lambda$uploadImage$0:55]: SCREENSHOTLOGGER: 6 19:07:05gameinfoException in thread "Custom Image Uploading" [17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: java.lang.NoClassDefFoundError: org/apache/http/entity/mime/MultipartEntityBuilder 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader.lambda$uploadImage$0(CustomUploader.java:56) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader$$Lambda$157/2147095642.run(Unknown Source) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1052]: at java.lang.Thread.run(Thread.java:745) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: Caused by: java.lang.ClassNotFoundException: org.apache.http.entity.mime.MultipartEntityBuilder 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.net.URLClassLoader$1.run(URLClassLoader.java:372) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.net.URLClassLoader$1.run(URLClassLoader.java:361) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.security.AccessController.doPrivileged(Native Method) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.net.URLClassLoader.findClass(URLClassLoader.java:360) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:106) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.lang.ClassLoader.loadClass(ClassLoader.java:424) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: at java.lang.ClassLoader.loadClass(ClassLoader.java:357) 19:07:05gameinfo[17:07:05] [Custom Image Uploading/INFO] [STDERR]: [java.lang.ThreadGroup:uncaughtException:1061]: ... 5 more
  8. Okay scratch that. Regular uploading works (using the imgur API) my custom uploading (wich uses libraries) doesn't do anything. i get the message an upload is started. however nothing happens. (i checked my mod and all the required libs were there). Nothing from the process is logged either. And even if the upload server was unreachable it should still give me a message that uploading has failed. Any idea why this is happening? Edit: it works all fine when ran in intellij
  9. well either way.it seems to work now. Thanks
  10. do i still need to include Pulsar then? i tried just shading in my dependancies but that didnt seem to work dependencies { shade group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.5' shade group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.1' } intellij gives me this: 'add' in 'org.gradle.api.artifacts.dsl.DependencyHandler' cannot be applied to '(['group':java.lang.String, 'name':java.lang.String,...])' This inspection reports assignments with incompatible types
  11. configurations { shade compile.extendsFrom shade } buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } maven { name = 'Tethys (drakon.io)' url = "http://tethys.drakon.io/maven" } } dependencies { classpath 'io.drakon:pulsar:1.2.1' classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' } } 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 = "1.1.0" group = "com.darkeyedragon.screenshotuploader" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "ScreenshotUploader" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' } minecraft { srgExtra = "PK: io/drakon/pulsar com/darkeyedragon/screenshotuploader/client/pulsar" version = "1.12.2-14.23.2.2611" 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. } dependencies { shade 'io.drakon:pulsar:1.2.1' compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.5' compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.1' } 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' } } jar { configurations.shade.each { dep -> from(project.zipTree(dep)){ exclude 'META-INF', 'META-INF/**' } } } Okay so that works, however i'm not sure what the "srgExtra" is for, it gives me this error: Could not set unknown property 'srgExtra' for object of type net.minecraftforge.gradle.user.patcherUser.forge.ForgeExtension. Also, do i need to shade my other dependencies now too?
  12. So, me again. When running the client in Intellij everything works as expected. however when i build my jar, add it to my mods folder start up my game and load in any world everything works fine untill i press any key then it just crashes I am think i'm missing an dependancy? my build.graddle looks like this: buildscript { repositories { jcenter() maven { url = "http://files.minecraftforge.net/maven" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.3' } } 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. apply plugin: 'com.github.johnrengelman.shadow' apply plugin: 'java' version = "1.1.0" group = "com.darkeyedragon.screenshotuploader" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "ScreenshotUploader" sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. compileJava { sourceCompatibility = targetCompatibility = '1.8' } minecraft { version = "1.12.2-14.23.2.2611" 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. } dependencies { compile group: 'org.apache.httpcomponents', name: 'fluent-hc', version: '4.5.5' compile group: 'org.apache.httpcomponents', name: 'httpmime', version: '4.3.1' } 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' } } shadowJar { baseName = 'ScreenshotUploader-Release' classifier = null version = '1.1.0' } Note: i'm using a custom graddle version (the latest from their website) as shadowjar doesnt work with versions under 3.0 package com.darkeyedragon.screenshotuploader.client.Events; import com.darkeyedragon.screenshotuploader.client.KeyBindings; import com.darkeyedragon.screenshotuploader.client.ModConfig; import com.darkeyedragon.screenshotuploader.client.gui.CustomGui; import com.darkeyedragon.screenshotuploader.client.imageuploaders.CustomUploader; import com.darkeyedragon.screenshotuploader.client.imageuploaders.ImgurUploader; import net.minecraft.client.Minecraft; import net.minecraft.util.ScreenShotHelper; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.InputEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import java.awt.image.BufferedImage; import java.util.Timer; public class KeyPressEvent{ private ImgurUploader imgurUploader = new ImgurUploader(); private CustomUploader customUploader = new CustomUploader(); @SubscribeEvent @SideOnly(Side.CLIENT) public void onKeyInput(InputEvent.KeyInputEvent event){ if(KeyBindings.screenshotUploadKey.isPressed()){ //this is line 27 BufferedImage screenshot = ScreenShotHelper.createScreenshot(Minecraft.getMinecraft().displayWidth,Minecraft.getMinecraft().displayHeight, Minecraft.getMinecraft().getFramebuffer()); if(ModConfig.CustomServer){ if(!ModConfig.ServerSettings.server.isEmpty()) if(ModConfig.ServerSettings.postData.length > 0) customUploader.uploadImage(screenshot, ModConfig.ServerSettings.server); else customUploader.uploadImage(screenshot, ModConfig.ServerSettings.server); else System.out.println("Invalid URL"); }else{ imgurUploader.uploadImage(screenshot); } } } }
  13. it still not doing it for me... no matter what i put in that file. Its not giving any kind of error or any response whatsoever
  14. also my src if ur curious or need more info: https://github.com/DarkEyeDragon/ScreenshotUploader
  15. I can't get versioning to work in any way possible. I've looked at the examples, heck even tried the forge json format. my update.json file is located here: http://darkeyedragon.me/mods/updates/screenshotuploader.json it works fine for forge however. I have no idea what i'm doing wrong here. Feel free to ask for more information if this isn't everything you need.
×
×
  • Create New...

Important Information

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