Jump to content

Recommended Posts

Posted

I want to track my mod (and only my mod) with git. I searched this forum and found an older post about Using MCP and Forge with GitHub. This pointed me to the wiki where I found Github & jenkins buildsystem.

 

But I still don't get it! Here is my problem:

 

To work with MCP/Forge I download and unzip the source package. Inside I find the install.sh script which I execute to get (among other stuff) forge/mcp/src. This is the directory I put my code into. But it is scattered all around the MCP sources:

 

  • mod classes go to forge/mcp/src/minecraft/mypackage
  • textures go to forge/mcp/src/minecraft/assets/mypackage
  • and then there is forge/mcp/src/minecraft/mcmod.info and my logo png

 

I don't want to track the other sources and I really don't want the other stuff inside forge/mcp part of which seems to be OS dependent and would break when cloned from a Linux environment to Windows.

 

I know I can ignore this stuff using .gitignore.

 

BUT: How can I clone such a git repo?

 

[*]First attempt was to unzip source, execute install.sh and then clone into forge/mcp/src. This must fail because git complains that  forge/mcp/src exists and is not empty

[*]Second attempt was to clone the repo first, then unzip over it (which works) and then executing the installer. This also fails because now the installer complains that forge/mcp exists and is not empty!

 

I would really love to share my mods with others but I can't see a simple cross-plattform-proof solution.

 

Can you please help me?

Posted

this -might- be solved, but if you don't want to do it pahimrs way, (i use pahimars way) you can use the .gitnore file, google it

I know about .gitignore, I even mentioned it in my question. But it does not solve the cloning problem at all. Please tell me which part of my question is not understandable.

 

I am still watching pahimrs video tutorial (video tutorials are always so time consuming). As far as I watched it now, he is creating a new eclipse workspace instead of using the one shipped with mcp. That's a workaround I can live with, but then I have to explain how to setup this workspace to those that clone my repository (they will have other absolute paths on their systems).

 

I wished there was a written tutorial so I would not have to watch >30min of video materials just to learn which environment variables I have to set in eclipse.

Posted

Thank you all for your help. I gave a very enjoyable workshop called 'Programming Minecraft Mods in Java'. You can find my project setup and sample code on github. There within the README.md you can find the steps to get this setup working. Below I describe how I initially created my project setup.

 

I have a setup similar to the one of Pahimar, but figured out a less time consuming way to create it.

 

My forge directory is within a directory called 'minecraft-forge-mods' (which is also the name of my git repository) and my own mod is called 'aeir_mod' which resides within a 'sources' directory. You are free to change this in the steps below, but for illustration here is

 

the directory tree of my porject:

 

minecraft-forge-mods
│
├── eclipse
│   ├── Minecraft
│   │   └── bin
│   └── aeir_mod
│       └── bin
├── eclipse_cfg
│   └── forgeMCP-eclipse-launch-config
├── forge
│   ├── client
.   .

│   │
.   .

│   ├── mcp
│   │   ├── bin
│   │   ├── conf
│   │   ├── docs
│   │   ├── eclipse
│   │   │   └── Minecraft
│   │   ├── jars
│   │   │   ├── assets
│   │   │   ├── libraries
│   │   │   └── versions
│   │   ├── lib
│   │   ├── logs
│   │   ├── reobf
│   │   ├── runtime
│   │   ├── src
│   │   └── temp
.   .

│
.

├── source
│   └── aeir_mod
│       ├── common
│       │   └── de
│       │       └── blogspot
│       │           └── debukkitsblog
│       │               └── proxies
│       └── resources
│           └── assets
│               └── basis
│                   └── textures
│                       ├── blocks
│                       └── items
└── textures

 

Note that 'textures' on the top level is just my gimp workspace. Also note that everything beneath forge is ignored by git (see .gitignore in my repo)

 

These are the steps to create this setup:

 

- copy the preconfigured forge workspace:

cp -a  forge/mcp/eclipse eclipse

 

- remove all generated code from bin:

rm -r eclipse/Minecraft/bin/*

 

- start eclipse and point it to the copied workspace

 

- within eclipse open the 'Minecraft' project Properties (right click the project in the Package Explorer view to open its context menu, select Properties)

 

- Within project properties go to 'Resource' -> 'Linked Sources'

 

- mark the variable 'MCP_LOC' and 'Edit...' it: change its 'Location' to

${WORKSPACE_LOC}/../forge/mcp

${WORKSPACE_LOC} is a variable that points to your workspace directory. From there you move up one level ('../') and you descend into the MCP directory ('forge/mcp')

 

- still within the project 'Properties' select 'Java Build Path' and on the 'Order and Export' tab check all libraries

 

- in the package explorer view expand the 'Minecraft' project, right click the 'src' directory to open its 'Properties'

 

- within the 'src' directory 'Properties' select 'Resource' and 'Edit...' its 'Location'. Change the location to:

MCP_LOC/src/minecraft

 

These steps should give you a working mindcraft forge project - without your mod.

 

To add your mod:

 

- create a new project

 

- on tab Source remove the src directory from build path and

 

- Link two additional source directories:

 

    'Location':

WORKSPACE_LOC/../source/aeir_mod/common

    'Name':

common

 

    'Location':

WORKSPACE_LOC/../source/aeir_mod/resources

    'Name':

resources

 

- on tab Projects add the Minecraft project created above to the list of Required projects on the build path

 

- after creating your project delete its auto-generated src folder

 

In future you can add more mods the same way. As your mod projects require the Minecraft project and the Minecraft projects exports all libraries it depends on, you don't have to add those libraries to your mod projects again.

 

If in future something in Minecraft Forge changes, change it in the Minecraft project.

 

Now you have to adjust the ('Run' ->) 'Run Configurations' for your projects:

 

- under 'Java Application' you can find the preconfigured 'Client' and 'Server' run configurations for the Minecraft project.

 

- optionally select them and on their 'Common' tab check 'Run' and 'Debug' under 'Display in favorites menu'

 

- optionally on the 'Arguments' tab, 'Program Arguments' you can add

[email protected] yourpasswort

of your Majong account

 

- copy the configurations and give them a telling name like 'Modded Client' (or 'aeir_mod Client' in my case) and 'Modded Server'

 

- on the copied run configuration's 'Main' tab change the 'Project' to your mod ('aeir_mod Client' in my case)

 

- on the tab 'Classpath' select 'User Entries' and 'Add Projects...', check the 'Minecraft' project and make sure that 'Add exported entries of selected projects' and 'Add required projects of selected projects' are unchecked

 

Hope I did not forget something. If so, please tell me. Have fun!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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