Jump to content

UltraTechX

Forge Modder
  • Posts

    51
  • Joined

  • Last visited

Everything posted by UltraTechX

  1. oh, alrighty then. Forget the mod, then
  2. It might make more sense if I explain why I am trying to do with multiple servers. (if this part is confusing im sorry, I can easily make a quick video in obs showing it running) - I have a mod that downloads a bunch of other mods when you join a specific server, BUT, I ran into a problem once i took it out of eclipse. It would give me the "missing mods" error when I joined my server with it. So I thought about a buffer server, where that is the main server on 25565, and it only requires the mod that downloads everything, and since my mod sends a packet when you join with a link to a list full of mods, so when you are in the buffer server, it downloads the mods, then checks to see if any were new, and if there are new mods, restart the game and set it up for that server. Otherwise, if you already had all the mods and were configured for the server, take a piece of info from the packet containing server information and connect the user to that server. I am having trouble figuring out a way to "take a piece of info from the packet containing server information and connect the user to that server." without bungeecord. That is pretty much it
  3. While I work on that, im curious, is there a way for a mod (installed on a client) to connect the user to a server without being on the main menu?
  4. OK lol I will try it out today and see if I can get something working. Do you think it should be a spigot server with both of the forge servers?.
  5. Is there any way to do something like bungeecoord where you can connect between servers, but in forge? Thanks! Just a FYI, i am trying to send the player from one forge server to another
  6. I will try doing this and get update this comment when i am done testing it. UPDATE: It works! Thank you so much for helping me!
  7. Well, I was actually trying to get the client to send the packet to the server before when it joins the game, is there a better event to use for that? I am trying to make it so that when the client connects, it asks the server for a string, and then the server returns the string that will be inside a config file on the dedicated server. UPDATE: I will try again with the event FMLNetworkEvent.ClientConnectedToServerEvent and will update again if anything changes UPDATE 2: I tried again with the new event, now both errors are gone! But the main issue is still not fixed
  8. No longer getting the error client-side, but still getting it server side after changing that line of code server log: 2017-04-30 12:07:33,162 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream 2017-04-30 12:07:33,163 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream [12:07:33] [main/INFO] [GradleStart]: Extra: [] [12:07:33] [main/INFO] [GradleStart]: Running with arguments: [--tweakClass, net.minecraftforge.fml.common.launcher.FMLServerTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [12:07:33] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker [12:07:33] [main/INFO] [LaunchWrapper]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLServerTweaker [12:07:33] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [12:07:33] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLServerTweaker 2017-04-30 12:07:34,247 WARN Disabling terminal, you're running in an unsupported environment. [12:07:34] [main/INFO] [FML]: Forge Mod Loader version 13.19.1.2189 for Minecraft 1.11 loading [12:07:34] [main/INFO] [FML]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_131, running on Windows 10:amd64:10.0, installed at U:\Program Files\Java\jre1.8.0_131 [12:07:34] [main/INFO] [FML]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [12:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [12:07:34] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [12:07:34] [main/INFO] [GradleStart]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [12:07:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [12:07:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [12:07:34] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [12:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [12:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [12:07:34] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [12:07:34] [main/ERROR] [FML]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [12:07:36] [main/ERROR] [FML]: FML appears to be missing any signature data. This is not a good thing [12:07:36] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [12:07:36] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [12:07:39] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [12:07:39] [main/INFO] [LaunchWrapper]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [12:07:39] [main/INFO] [LaunchWrapper]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [12:07:41] [main/INFO] [LaunchWrapper]: Launching wrapped minecraft {net.minecraft.server.MinecraftServer} [12:07:50] [Server thread/INFO]: Starting minecraft server version 1.11 [12:07:50] [Server thread/INFO] [FML]: MinecraftForge v13.19.1.2189 Initialized [12:07:50] [Server thread/INFO] [FML]: Replaced 232 ore recipes [12:07:51] [Server thread/INFO] [FML]: Found 0 mods from the command line. Injecting into mod discoverer [12:07:51] [Server thread/INFO] [FML]: Searching U:\Users\UltraTechX\Desktop\ModDL\run\mods for mods [12:07:53] [Server thread/INFO] [FML]: Forge Mod Loader has identified 4 mods to load [12:07:53] [Server thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, forge, moddl] at CLIENT [12:07:53] [Server thread/INFO] [FML]: Attempting connection with missing mods [mcp, FML, forge, moddl] at SERVER [12:07:54] [Server thread/INFO] [FML]: Processing ObjectHolder annotations [12:07:54] [Server thread/INFO] [FML]: Found 443 ObjectHolder annotations [12:07:54] [Server thread/INFO] [FML]: Identifying ItemStackHolder annotations [12:07:54] [Server thread/INFO] [FML]: Found 0 ItemStackHolder annotations [12:07:54] [Server thread/INFO] [FML]: Applying holder lookups [12:07:54] [Server thread/INFO] [FML]: Holder lookups applied [12:07:54] [Server thread/INFO] [FML]: Applying holder lookups [12:07:54] [Server thread/INFO] [FML]: Holder lookups applied [12:07:54] [Server thread/INFO] [FML]: Applying holder lookups [12:07:54] [Server thread/INFO] [FML]: Holder lookups applied [12:07:55] [Server thread/INFO] [FML]: Configured a dormant chunk cache size of 0 [12:07:55] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Starting version check at http://files.minecraftforge.net/maven/net/minecraftforge/forge/promotions_slim.json [12:07:55] [Server thread/INFO] [FML]: Applying holder lookups [12:07:55] [Server thread/INFO] [FML]: Holder lookups applied [12:07:55] [Server thread/INFO] [FML]: Injecting itemstacks [12:07:55] [Server thread/INFO] [FML]: Itemstack injection complete [12:07:55] [Server thread/INFO]: Loading properties [12:07:55] [Server thread/INFO]: Default game type: SURVIVAL [12:07:55] [Server thread/INFO]: Generating keypair [12:07:55] [Forge Version Check/INFO] [ForgeVersionCheck]: [forge] Found status: UP_TO_DATE Target: null [12:07:55] [Server thread/INFO]: Starting Minecraft server on 192.168.1.5:25565 [12:07:55] [Server thread/INFO]: Using default channel type [12:07:55] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE! [12:07:55] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware. [12:07:55] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose. [12:07:55] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file. [12:07:55] [Server thread/INFO] [FML]: Injecting itemstacks [12:07:55] [Server thread/INFO] [FML]: Itemstack injection complete [12:07:55] [Server thread/INFO] [FML]: Forge Mod Loader has successfully loaded 4 mods [12:07:55] [Server thread/INFO]: Preparing level "world" [12:07:55] [Server thread/INFO] [FML]: Injecting existing block and item data into this server instance [12:07:56] [Server thread/INFO] [FML]: Applying holder lookups [12:07:56] [Server thread/INFO] [FML]: Holder lookups applied [12:07:56] [Server thread/INFO] [FML]: Loading dimension 0 (world) (net.minecraft.server.dedicated.DedicatedServer@bd6ed05) [12:07:56] [Server thread/INFO] [FML]: Loading dimension 1 (world) (net.minecraft.server.dedicated.DedicatedServer@bd6ed05) [12:07:56] [Server thread/INFO] [FML]: Loading dimension -1 (world) (net.minecraft.server.dedicated.DedicatedServer@bd6ed05) [12:07:56] [Server thread/INFO]: Preparing start region for level 0 [12:07:57] [Server thread/INFO]: Preparing spawn area: 20% [12:07:58] [Server thread/INFO]: Done (2.999s)! For help, type "help" or "?" [12:08:13] [Netty Server IO #2/INFO] [FML]: Client protocol version 2 [12:08:13] [Netty Server IO #2/INFO] [FML]: Client attempting to join with 4 mods : FML@8.0.99.99,forge@13.19.1.2189,moddl@A1,mcp@9.19 [12:08:13] [Server thread/INFO] [FML]: [Server thread] Server side modded connection established [12:08:13] [Server thread/INFO]: Player908[/192.168.1.5:63679] logged in with entity id 428 at (226.5, 68.0, 213.5) [12:08:13] [Server thread/INFO]: Player908 joined the game [12:08:13] [Server thread/ERROR] [FML]: FMLIndexedMessageCodec exception caught java.lang.RuntimeException: Missing at net.minecraftforge.fml.server.FMLServerHandler.getClientToServerNetworkManager(FMLServerHandler.java:289) ~[FMLServerHandler.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.getClientToServerNetworkManager(FMLCommonHandler.java:546) ~[FMLCommonHandler.class:?] at net.minecraftforge.fml.common.network.FMLOutboundHandler$OutboundTarget$8.selectNetworks(FMLOutboundHandler.java:245) ~[FMLOutboundHandler$OutboundTarget$8.class:?] at net.minecraftforge.fml.common.network.FMLOutboundHandler.write(FMLOutboundHandler.java:293) ~[FMLOutboundHandler.class:?] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:651) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:112) ~[MessageToMessageEncoder.class:4.0.23.Final] at io.netty.handler.codec.MessageToMessageCodec.write(MessageToMessageCodec.java:116) ~[MessageToMessageCodec.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:706) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:741) ~[AbstractChannelHandlerContext.class:4.0.23.Final] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:895) ~[DefaultChannelPipeline.class:4.0.23.Final] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:240) ~[AbstractChannel.class:4.0.23.Final] at net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper.sendToServer(SimpleNetworkWrapper.java:294) [SimpleNetworkWrapper.class:?] at com.ultratechx.moddl.ModDLEventHandler.onJoin(ModDLEventHandler.java:14) [ModDLEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_6_ModDLEventHandler_onJoin_PlayerLoggedInEvent.invoke(.dynamic) [?:?] at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90) [ASMEventHandler.class:?] at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:185) [EventBus.class:?] at net.minecraftforge.fml.common.FMLCommonHandler.firePlayerLoggedIn(FMLCommonHandler.java:566) [FMLCommonHandler.class:?] at net.minecraft.server.management.PlayerList.initializeConnectionToPlayer(PlayerList.java:236) [PlayerList.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.completeServerSideConnection(NetworkDispatcher.java:265) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher.access$100(NetworkDispatcher.java:73) [NetworkDispatcher.class:?] at net.minecraftforge.fml.common.network.handshake.NetworkDispatcher$1.update(NetworkDispatcher.java:214) [NetworkDispatcher$1.class:?] at net.minecraft.network.NetworkManager.processReceivedPackets(NetworkManager.java:309) [NetworkManager.class:?] at net.minecraft.network.NetworkSystem.networkTick(NetworkSystem.java:197) [NetworkSystem.class:?] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:818) [MinecraftServer.class:?] at net.minecraft.server.dedicated.DedicatedServer.updateTimeLightAndEntities(DedicatedServer.java:402) [DedicatedServer.class:?] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:699) [MinecraftServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:548) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_131]
  9. Today I was trying to get a simple string to the server using packets when a player joins a server, but the server-side handler never fires. Here is the code I used to try to get it working: Code: Any ideas? There are no errors in both the server and client side consoles in eclipse. Any help is appreciated! UPDATE: A new error just started occurring, i do not know why, but maybe it has something to do with the packet issue? Below are the logs
  10. ok then, ill just add a GUI prompt for the user to restart on their own, thanks for the feedback!
  11. If my mod downloads another mod to the mods folder, how can I restart the forge start up process to start the mod?
  12. It looks like it's an error from jsoup, I can't really help you with it. Ok then, thanks anyways!
  13. It worked! thanks, but new error... here is my mod file and build.gradle + log: MODDL.java package com.UltraTechX.MODDL; import net.minecraft.init.Blocks; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; import java.nio.channels.Channels; import java.nio.channels.ReadableByteChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; import org.jsoup.select.Elements; import org.jsoup.*; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.event.FMLInitializationEvent; @Mod(modid = MODDL.MODID, version = MODDL.VERSION, name = MODDL.NAME) public class MODDL { public static final String MODID = "MODDL"; public static final String NAME = "MODDL"; public static final String VERSION = "1.0"; @EventHandler public void preInit(FMLInitializationEvent event){ } @EventHandler public void init(FMLInitializationEvent event) { String FLINK = null; String FNAME = null; // some example code System.out.println(MODDL.MODID + " Is Downloading Mod From Repository!"); //start test download try { Document doc = Jsoup.connect("http://opifex.ddns.net/MODDL/index.html").get(); Elements links = doc.getElementsByTag("a"); for (Element link : links) { //test download FLINK = link.attr("href"); FNAME = link.text(); URL website = null; try { website = new URL(FLINK); } catch (MalformedURLException e) { System.out.println("WEBSITE CONNECTION CHECK FAILED, THIS COULD EITHER BE CAUSED BY AN INCORRECT URL IN THE MOD, A WEBSITE NOT CURRENTLY AVAILABLE, OR A BAD CONNECTION TO THE INTERNET - PRINTING STACK TRACE (ERR TYPE=MalformedURLException)"); e.printStackTrace(); } ReadableByteChannel rbc = null; try { rbc = Channels.newChannel(website.openStream()); } catch (IOException e) { System.out.println("OPENEING WEBSITE CONNECTION FAILED, THIS COULD EITHER RESULT FROM A WEBSITE VARIABLE SETUP ERROR (SEE CONSOLE ABOVE TO CHECK), FROM A BAD CONENCTION TO THE INTERNET, OR A UNAVAILABLE WEBSITE - PRINTING STACK TRACE (ERR TYPE=IOException)"); e.printStackTrace(); } FileOutputStream fos = null; try { new File(System.getProperty("user.home") + "/AppData/Roaming/.minecraft/Mods").mkdir(); fos = new FileOutputStream(System.getProperty("user.home") + "/AppData/Roaming/.minecraft/Mods/"+FNAME); } catch (FileNotFoundException e) { System.out.println("FILE NOT FOUND, THIS CAN BE CAUSED BY EITHER AN ERROR FROM ABOVE OR BY AN INCORRECT URL - PRINTING STACK TRACE (ERR TYPE=FileNotFoundException)"); e.printStackTrace(); } try { fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE); } catch (IOException e) { System.out.println("FAILED TO TRANSFER FILE FROM INITIAL LOCATION, THIS IS EITHER CAUSED BY A FILE NOT BEING DOWNLOADED OR A HARD DRIVE FAILIURE - PRINTING STACK TRACE (ERR TYPE=IOException)"); e.printStackTrace(); } try { fos.close(); } catch (IOException e) { System.out.println("FAILED TO CLOSE CONNECTION TO SERVER, THIS COULD EITHER RESULT FROM A CONNECTION LOSS EARLIER OR A MOD MALFUNCTION - PRINTING STACK TRACE (ERR TYPE=IOException)"); e.printStackTrace(); } //end test download } } catch (IOException ex) { System.out.println("FAILED TO GET REPOSITORY MOD LIST, THIS COULD RESULT FROM EITHER A BAD URL OR A NONEXISTING LIST - PRINTING STACK TRACE (ERR TYPE=IOException)"); ex.printStackTrace(); } //end test download } } build.gradle: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "1.0" group= "com.UltraTechX.MODDL" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "MODDL" configurations { shade compile.extendsFrom shade } minecraft { version = "1.7.10-10.13.4.1558-1.7.10" runDir = "eclipse" srgExtra "PK: org/jsoup com/UltraTechX/shadow/repack/org/jsoup" } 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 shade 'org.jsoup:jsoup:1.9.2' // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } jar { configurations.shade.each { dep -> from(project.zipTree(dep)){ exclude 'META-INF', 'META-INF/**' // you may exclude other things here if you want, or maybe copy the META-INF } } } 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, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } crash log: cpw.mods.fml.common.LoaderException: java.lang.ExceptionInInitializerError at cpw.mods.fml.common.LoadController.transition(LoadController.java:163) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:739) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:311) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:552) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:878) at net.minecraft.client.main.Main.main(SourceFile:148) 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.ExceptionInInitializerError at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities$EscapeMode.<clinit>(Entities.java:20) at com.UltraTechX.shadow.repack.org.jsoup.nodes.Document$OutputSettings.<init>(Document.java:371) at com.UltraTechX.shadow.repack.org.jsoup.nodes.Document.<init>(Document.java:18) at com.UltraTechX.shadow.repack.org.jsoup.parser.TreeBuilder.initialiseParse(TreeBuilder.java:29) at com.UltraTechX.shadow.repack.org.jsoup.parser.TreeBuilder.parse(TreeBuilder.java:42) at com.UltraTechX.shadow.repack.org.jsoup.parser.HtmlTreeBuilder.parse(HtmlTreeBuilder.java:52) at com.UltraTechX.shadow.repack.org.jsoup.parser.Parser.parseInput(Parser.java:30) at com.UltraTechX.shadow.repack.org.jsoup.helper.DataUtil.parseByteData(DataUtil.java:104) at com.UltraTechX.shadow.repack.org.jsoup.helper.HttpConnection$Response.parse(HttpConnection.java:653) at com.UltraTechX.shadow.repack.org.jsoup.helper.HttpConnection.get(HttpConnection.java:217) at com.UltraTechX.MODDL.MODDL.init(MODDL.java:47) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532) 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.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190) 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.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:737) ... 10 more Caused by: java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Properties.java:434) at java.util.Properties.load0(Properties.java:353) at java.util.Properties.load(Properties.java:341) at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities.loadEntities(Entities.java:241) at com.UltraTechX.shadow.repack.org.jsoup.nodes.Entities.<clinit>(Entities.java:225) ... 48 more I dont really know what could have caused this, but any help would be nice! UPDATE: it only crashes when the connection to my website (to get the mod download list) doesnt time out, so it has something to do with the shaded code for sure
  14. when I change org.jsoup to com.UltraTechX.shadow.repack.org.jsoup in the include section of the mods it just gives errors when I build so how to I work with building the mod if it just gives an error for not finding the jar in the directory specified? screenshot of cmd https://gyazo.com/c5a2a1e6b720dbb3f27090a6a38e17ee
  15. ok, using your suggestions I removed the maven repository and just left the shade inside the dependencies section, here it is, but with no new files appearing in in eclipse: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "1.0" group= "com.UltraTechX.MODDL" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "MODDL" configurations { shade compile.extendsFrom shade } minecraft { version = "1.7.10-10.13.4.1558-1.7.10" runDir = "eclipse" srgExtra "PK: org/jsoup com/UltraTechX/shadow/repack/org/jsoup" } 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 shade 'org.jsoup:jsoup:1.9.2' // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } jar { configurations.shade.each { dep -> from(project.zipTree(dep)){ exclude 'META-INF', 'META-INF/**' // you may exclude other things here if you want, or maybe copy the META-INF } } } 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, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } to set it up again I run is the above right to get the changes into eclipse?
  16. while looking around those threads I have changed the build.gradle into the following with no changes, could I be corrected on things I could improve? buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } maven { name = "jsoup" url = "http://mvnrepository.com/artifact/org.jsoup/jsoup/1.9.2" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "1.0" group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "modid" configurations { shade compile.extendsFrom shade } minecraft { version = "1.7.10-10.13.4.1558-1.7.10" runDir = "eclipse" srgExtra "PK: org/jsoup your/new/package/org/jsoup" } 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 shade 'org.jsoup:jsoup:1.9.2' // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } jar { configurations.shade.each { dep -> from(project.zipTree(dep)){ exclude 'META-INF', 'META-INF/**' // you may exclude other things here if you want, or maybe copy the META-INF } } } 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, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } Also a question, in the srgExtra "PK: org/jsoup your/new/package/org/jsoup" line, I dont know what to put as the new package directory, if I reference the main file as org.jsoup.Jsoup in src/main/java/com.UltraTechX.MODDL.MODDL.java and I put the new package location to org/josup would it locate the jar in src/main/java/org.josup ?
  17. Hello, I have been recently working on a mini-project for 1.7.10, and I use an html parser library to help me in the code called jsoup, and what I am trying to do is create a fat jar with the jsoup jar inside the normal mod so users don't have to have t in the mods folder. By doing this, though, I have been having trouble with getting it to appear inside the IDE and just get it to appear in the jar in general. Here is the build.gradle file: buildscript { repositories { mavenCentral() maven { name = "forge" url = "http://files.minecraftforge.net/maven" } maven { name = "sonatype" url = "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { classpath 'net.minecraftforge.gradle:ForgeGradle:1.2-SNAPSHOT' } } apply plugin: 'forge' version = "1.0" group= "com.yourname.modid" // http://maven.apache.org/guides/mini/guide-naming-conventions.html archivesBaseName = "modid" minecraft { version = "1.7.10-10.13.4.1558-1.7.10" runDir = "eclipse" } 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 compile files("libs/jsoup-1.9.2.jar") // for more info... // http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html // http://www.gradle.org/docs/current/userguide/dependency_management.html } 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, thats not the mcmod.info from(sourceSets.main.resources.srcDirs) { exclude 'mcmod.info' } } If you would like any more info please ask. And any help is appreciated!
  18. so, i recently remove Biomes O Plenty mod on my server, but after that it just spams the console with things like : after that it wont continue starting up, how can I make these errors go away so it will start up
  19. thanks! it works, i just need to get the item checking code working now!
  20. ok, i added a check to see if its not equal to null before continuing, but why would it be null? EDIT : it still crashes on the new if statement, but now with nullPointerException here is the error:
  21. how would I detect what a player is holding in an if statement when a block is right-clicked? I have this code but it keeps crashing with unexpected error: public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumFacing side, float hitX, float hitY, float hitZ) { if(playerIn.getHeldItem().getItem() instanceof serverKey){ System.out.println("true"); TileEntity tileentity = worldIn.getTileEntity(pos); return (tileentity instanceof tileEntityServer) ? ((tileEntityServer)tileentity).getCommandBlockLogic().func_175574_a(playerIn) : false; //tileEntityServer }else{ System.out.println("false"); return false; } }
  22. that works,but what about reading them?
  23. i have this block code: BlockPos neighbourPos = new BlockPos(x1 + x2 - x3, y1, z1 + z2 - z3); IBlockState neighbourState = world.getBlockState(neighbourPos); Block neighbourBlock = neighbourState.getBlock(); how could i use these variables to edit anothers block properties, because will get me the property, but it wont let me set it from another block.
  24. nevermind, i fixed it by adding this into my onBlockAdded method after taking a look at the BlockRailBase class: if (!worldIn.isRemote) { state = this.func_176564_a(worldIn, pos, state, true); }
  25. I have this basic class with EnumRailDirection: package ultratechx.autotrains; import net.minecraft.block.Block; import net.minecraft.block.BlockRail; import net.minecraft.block.BlockRailBase; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyEnum; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.IStringSerializable; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class railControlBlock extends BlockRail implements ITileEntityProvider { public static final PropertyEnum PART = PropertyEnum.create("part", EnumPartType.class); public static final PropertyEnum SHAPE = PropertyEnum.create("shape", BlockRailBase.EnumRailDirection.class); private static String name = "railControlBlock"; private int part; public railControlBlock(int pnum) { super(); GameRegistry.registerTileEntity(railControl.class, name); if(pnum == 0) { setDefaultState(this.blockState.getBaseState().withProperty(PART, EnumPartType.MIDDLE).withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); this.part = 0; }else if(pnum == 1){ setDefaultState(this.blockState.getBaseState().withProperty(PART, EnumPartType.LEFT).withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); this.part = 1; }else if(pnum == 2){ setDefaultState(this.blockState.getBaseState().withProperty(PART, EnumPartType.RIGHT).withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); this.part = 2; } GameRegistry.registerBlock(this, name); this.setCreativeTab(CreativeTabs.tabMisc); this.setUnlocalizedName(name); this.setHardness(2.0f); setBlockBounds(); this.setResistance(6.0f); this.setHarvestLevel("pickaxe", 2); this.isBlockContainer = true; } @Override public String toString() { return getName(); } @Override public TileEntity createNewTileEntity(World worldIn, int meta) { return new railControl(); } public static String getName(){ return name; } @SideOnly(Side.CLIENT) public AxisAlignedBB getSelectedBoundingBox(World worldIn, BlockPos pos) { setBlockBoundsBasedOnState(worldIn, pos); return super.getSelectedBoundingBox(worldIn, pos); } public IProperty getShapeProperty() { return SHAPE; } public IProperty getPartProperty() { return PART; } public IBlockState getStateFromMeta(int meta) { return getDefaultState().withProperty(PART, EnumPartType.byMetadata(meta)).withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata(meta)); } @Override public void setBlockBoundsBasedOnState(IBlockAccess worldIn, BlockPos pos) { setBlockBounds(); } private void setBlockBounds() { setBlockBounds(0F, 0.0F, 0F, 1F, 0.125F, 1F); } public int getMetaFromState(IBlockState state) { return ((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).getMetadata(); } @Override public IBlockState getActualState(IBlockState state, IBlockAccess worldIn, BlockPos pos){ if(this.part == 2){ return state.withProperty(PART, EnumPartType.RIGHT); }else if(this.part == 1){ return state.withProperty(PART, EnumPartType.LEFT); }else{ return state.withProperty(PART, EnumPartType.MIDDLE); } } protected BlockState createBlockState() { return new BlockState(this, new IProperty[] { PART, SHAPE }); } public boolean isOpaqueCube() { return false; } /** * If this block doesn't render as an ordinary block it will return False (examples: signs, buttons, stairs, etc) */ public boolean renderAsNormalBlock() { return false; } public int getRenderBlockPass() { return 1; } public void onNeighborBlockChange(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { updateMultiBlockStructure(worldIn, pos.getX(), pos.getY(), pos.getZ()); } public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state){ updateMultiBlockStructure(worldIn, pos.getX(), pos.getY(), pos.getZ()); } public void updateMultiBlockStructure(World world, int x, int y, int z){ isMultiBlockStructure(world, x, y, z); } public boolean isMultiBlockStructure(World world, int x1, int y1, int z1){ boolean mStructure = false; boolean currentCheckStructure = true; for(int x3 = 0; x3 < 3; x3++){ for(int z3 = 0; z3 < 3; z3++){ BlockPos neighbourPos = new BlockPos(x1 - x3, y1, z1 - z3); IBlockState neighbourState = world.getBlockState(neighbourPos); Block neighbourBlock = neighbourState.getBlock(); if(currentCheckStructure && neighbourBlock != AutoTrains.railControl){ System.out.println("this is not a multi block structure"); currentCheckStructure = false; }else{ System.out.println("this is a multi block structure"); } } } return false; } protected void onNeighborChangedInternal(World worldIn, BlockPos pos, IBlockState state, Block neighborBlock) { //whenever the blocks around it change } public static enum EnumPartType implements IStringSerializable { MIDDLE(0, "middle"), LEFT(1, "left"), RIGHT(2, "right"); private static final EnumPartType[] META_LOOKUP = new EnumPartType[values().length]; private final int meta; private final String name; private EnumPartType(int meta, String name) { this.meta = meta; this.name = name; } public int getMetadata() { return this.meta; } public String toString() { return this.name; } public String getName() { return this.name; } public static EnumPartType byMetadata(int meta) { if (meta < 0 || meta >= META_LOOKUP.length) { meta = 0; } return META_LOOKUP[meta]; } static { EnumPartType[] var0 = values(); int var1 = var0.length; for (int var2 = 0; var2 < var1; ++var2) { EnumPartType var3 = var0[var2]; META_LOOKUP[var3.getMetadata()] = var3; } } } } but it wont turn when it should like a normal rail, any ideas?
×
×
  • Create New...

Important Information

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