Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Issue starting modding on Eclipse


Recommended Posts

To be honest I can't completely figure out what my issue is, so a quick run through of the process. I downloaded and extracted forge mod 12.2 (file name: forge-1.12.2-14.23.5.2854-mdk), then copied it and renamed the copied folder to Forge Mod Test (saved at "D:\Documents\Forge Mod Test"). On Eclipse, I import an Existing Gradle Project, with Project root directory "D:\Documents\Forge Mod Test" and click finish. When the project is done importing, I go to the Gradle Tasks bar, select fg_runs, and run "genEclipseRuns". When this is done, I go to IDE task folder and run "eclipse". Then I refresh the project by going to File, and selecting "Refresh". (I've tried running "eclipse" then "genEclipseRuns" and run into the same issues described next). With the project slected, I click File, Import, Launch Configurations, Browse, and select the folder at path "D:\Documents\Forge Mod Test". I select the "Forge Mod Test" folder, then select the next 2 files "runClient.launch" and "runServer.launch", then click finish. I select the drop down menu next to the run button on eclipse, go to run configurations, and select runClient under the Java Application tab. Here, I go to environment and change "${MC_VERSION}" to "1.12" and click apply. I repeat that same process for runServer. Now I click run, and it tell me that "Errors exist inrequired project(s): Forge Mod Test". I proceed with launch and get the following error: 

Error: Could not find or load main class net.minecraftforge.legacydev.MainServer
Caused by: java.lang.ClassNotFoundException: net.minecraftforge.legacydev.MainServer

From what I have read, there is an issue with dependencies, and I'm not sure exactly how or where to run the "gradlew --refresh-dependencies". Below is a screenshot (and text) of the example code given by the forge MDK (the code has not been touched by my hands).

The error messages given on eclipse for the lines 3-8 are:

Multiple markers at this line
    - The import net cannot be resolved
    - The import org.apache cannot be 
     resolved
    - The import net cannot be resolved
    - The import net cannot be resolved
    - The import net cannot be resolved
    - The import net cannot be resolved

The rest of the errors are simply "xxx cannot be resolved to a type".

 

Mod Example Code: 

package com.example.examplemod;

import net.minecraft.init.Blocks;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventHandler;
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import org.apache.logging.log4j.Logger;

@Mod(modid = ExampleMod.MODID, name = ExampleMod.NAME, version = ExampleMod.VERSION)
public class ExampleMod
{
    public static final String MODID = "examplemod";
    public static final String NAME = "Example Mod";
    public static final String VERSION = "1.0";

    private static Logger logger;

    @EventHandler
    public void preInit(FMLPreInitializationEvent event)
    {
        logger = event.getModLog();
    }

    @EventHandler
    public void init(FMLInitializationEvent event)
    {
        // some example code
        logger.info("DIRT BLOCK >> {}", Blocks.DIRT.getRegistryName());
    }
}
 

  

image.png

Link to post
Share on other sites
Guest
This topic is now closed to further replies.


  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I'm writing a mod for weapons and I ran into the problem of projectile position when shooting. How can I spawn a projectile so that when viewed from the first person, it flies out of the weapon, and not from the center of the screen?
    • Can you please tell me how to fix this?   ---- Minecraft Crash Report ---- WARNING: coremods are present:   FMLLoadingPlugin (Keystrokes-8.0.2 (1.8.9) (1).jar)   FMLLoadingPlugin (AutoGG-4.0.3 (1.8.9).jar)   LabyModCoreMod (LabyMod-3.jar) Contact their authors BEFORE contacting forge // Shall we play a game? Time: 4/10/21 2:56 PM Description: Initializing game java.lang.NumberFormatException: For input string: " 300"     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)     at java.lang.Integer.parseInt(Integer.java:569)     at java.lang.Integer.parseInt(Integer.java:615)     at com.erel.Main.Main.preInit(Main.java:102)     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:497)     at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560)     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:497)     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 net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189)     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:497)     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 net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)     at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:417)     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:329)     at net.minecraft.client.main.Main.main(SourceFile:124)     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:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace:     at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)     at java.lang.Integer.parseInt(Integer.java:569)     at java.lang.Integer.parseInt(Integer.java:615)     at com.erel.Main.Main.preInit(Main.java:102)     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:497)     at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:560)     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:497)     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 net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:211)     at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:189)     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:497)     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 net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:118)     at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:556)     at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:243)     at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:417) -- Initialization -- Details: Stacktrace:     at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:329)     at net.minecraft.client.main.Main.main(SourceFile:124)     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:497)     at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)     at net.minecraft.launchwrapper.Launch.main(Launch.java:28) -- System Details -- Details:     Minecraft Version: 1.8.9     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 265271952 bytes (252 MB) / 771751936 bytes (736 MB) up to 2147483648 bytes (2048 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0     FML: MCP 9.19 Powered by Forge 11.15.1.1722 Optifine OptiFine_1.8.9_HD_U_L5 9 mods loaded, 9 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored     UCH    mcp{9.19} [Minecraft Coder Pack] (minecraft.jar)      UCH    FML{8.0.99.99} [Forge Mod Loader] (forge-1.8.9-11.15.1.1722.jar)      UCH    Forge{11.15.1.1722} [Minecraft Forge] (forge-1.8.9-11.15.1.1722.jar)      UCH    modcore{0.1.47} [ModCore] (Sk1er Modcore-0.1.47 (1.8.9).jar)      UCE    CPSmod{1.0} [CPSmod] ((1.8.9)CPSmod_v1.0.jar)      UCH    autogg{4.0.3} [AutoGG] (AutoGG-4.0.3 (1.8.9).jar)      UCH    keystrokesmod{8.0.2} [KeystrokesMod] (Keystrokes-8.0.2 (1.8.9) (1).jar)      UCH    labymod{3.8.4} [LabyMod] (LabyMod-3.jar)      UCH    timechanger{2.1} [TimeChanger] (TimeChanger-2.2.1 (1).jar)      Loaded coremods (and transformers):  FMLLoadingPlugin (Keystrokes-8.0.2 (1.8.9) (1).jar)    FMLLoadingPlugin (AutoGG-4.0.3 (1.8.9).jar)   club.sk1er.mods.core.forge.ClassTransformer LabyModCoreMod (LabyMod-3.jar)   net.labymod.core.asm.LabyModTransformer   net.labymod.addons.itemphysic.asm.ItemPhysicTransformer   net.labymod.addons.resourcepacks24.asm.Resourcepacks24Transformer     GL info: ' Vendor: 'Intel' Version: '4.6.0 - Build 26.20.100.7926' Renderer: 'Intel(R) UHD Graphics'     Launched Version: 1.8.9-forge1.8.9-11.15.1.1722     LWJGL: 2.9.4     OpenGL: Intel(R) UHD Graphics GL version 4.6.0 - Build 26.20.100.7926, Intel     GL Caps: Using GL 1.3 multitexturing. Using GL 1.3 texture combiners. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Shaders are available because OpenGL 2.1 is supported. VBOs are available because OpenGL 1.5 is supported.     Using VBOs: Yes     Is Modded: Definitely; Client brand changed to 'fml,forge'     Type: Client (map_client.txt)     Resource Packs: Lebbyy Retrowave.zip, Bridge Gang     Current Language: English (US)     Profiler Position: N/A (disabled)     CPU: 4x Intel(R) Core(TM) i3-1005G1 CPU @ 1.20GHz     OptiFine Version: OptiFine_1.8.9_HD_U_L5     OptiFine Build: 20191204-143016     Render Distance Chunks: 5     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: null     OpenGlVersion: 4.6.0 - Build 26.20.100.7926     OpenGlRenderer: Intel(R) UHD Graphics     OpenGlVendor: Intel     CpuCount: 4
    • You're going to need to be more specific. What list is changing size, how often does it change, how many entries can be stored within the list, does the block have a tile entity?
    • Yes, you can still sign jars as that is not a Forge concept, that is a java one. ForgeGradle adds the ability to sign a jar within your buildscript while the event was used to check if there was a violation in the signature. Although the event doesn't exist anymore, ForgeGradle still supports signing a jar through the SignJar task. As for how to sign a java jar, you would need to generate an key-pair. Using Java's keytool command also wraps the public key into a X.509 self-signed certificate which can be used in a bunch of other places. Once you have this generated, make sure to remember the location it's stored on your computer, the alias given for unique identification, the keystore password, and the key password. We can then create the signed jar by having the base jar finalized by our task and making sure it executes after the jar has been reobfuscated via 'reobfJar' within the build.gradle.
    • So i'm running modded minecraft with shaders and noticed my fps was quite low. I did some tests and found that on minecraft with optifine alone, my pc could handle shaders at 130 fps at 48 render distance and also that the gpu usage was on 100%, while when i had forge and optifine at the same time, it wouldn't even handle 90 constant at 12 render distance, and the gpu usage varied from 30-50%. Is there any fix to this?
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.