ModderDojo Java Modding 3: Getting Started With Eclipse

Previous post: ModderDojo Java Modding 2: Setting Up Your Development Environment
Next post: ModderDojo Java Modding 4: Creating Our First Mod – Getting Started

While waiting for Forge to install, let’s try out Eclipse.

If this is your first time running it, you will be prompted to create a workspace: the default location is fine

The first time, a Welcome screen appears, which you can X to close.

Java code belongs in classes, classes are organised in projects, and projects are in a workspace. In Eclipse, you can only have one workspace open at a time, but it can have multiple projects in it and each one can have multiple classes.

Create a new Java project: File – New – Project… then expand Java and select Java Project

newproj

Enter a project name, e.g. Test:

newproj2

If you are asked to switch to the Java Perspective, say yes.

To create a first program class file, select File – New – Class

Give the class a name (no spaces allowed), and tick the box at “public static void main”, as this will create some initial code for you:

newclass

You now have a starting piece of code:

test1java

Under the “TODO” comment (which you can delete or replace with a comment of your own), write a line of code to put up a message box:
JOptionPane.showMessageDialog(null, “Hello world”);

A red line will appear at JOptionPane, as it is not recognised; hover over it and select the fix “import JOptionPane”, which will add an extra line at the  top.

Alternatively (or as well), you could print a line to the system output, which goes the console window – that’s the one at the bottom of the screen in Eclipse:
System.out.println(“Hi there”);

testjava2

Press the Save icon and then the green Run icon to run your first program:

hellodlg

Previous post: ModderDojo Java Modding 2: Setting Up Your Development Environment
Next post: ModderDojo Java Modding 4: Creating Our First Mod – Getting Started

ModderDojo Java Modding 2: Setting Up Your Development Environment

Previous post: ModderDojo Java Modding 1: Beginning Java Mods with Forge
Next post: ModderDojo Java Modding 3: Getting Started With Eclipse

My instructions are based on this post, but I had to update several aspects of them for Forge 1.7.2: http://www.minecraftforum.net/topic/1889606-162-minecraft-forge-modding-1-the-eclipse-workspace/

You need to download the following:

The steps to install the Forge Java modding environment are below.

To install Eclipse:

  • Eclipse does not have an installer: you just unzip and run it.
  • Create a folder C:\Eclipse, copy your Eclipse zip file into it, and extract it
  • In the sub-folder, find Eclipse.exe: make a link to it on your desktop
  • Start it up and make sure it works
  • We can write a first “Hello World” program: see below.

To install Forge: http://www.minecraftforge.net/wiki/Installation/Source

  • Extract the Forge .zip file to a new folder, for example C:\MinecraftForge
  • Open a cmd window

Use cd to change directory to the forge folder, e.g:
cd \MinecraftForge
Now run this command (followed by the second gradlew command, see below):
gradlew setupDecompWorkspace –refresh-dependencies

Let the installer download all necessary files. This takes 20-30 minutes. Watch out for errors!

  • It will download MCP (Minecraft Coders Pack) automatically, as well as libraries
  • It will then download assets. These are non-code elements of Minecraft, e.g. language files, music files, record audio, sounds and more. These are now stored in a folder called “assets” under the “.minecraft” folder.
  • Finally, it will begin decompiling the Minecraft source code. When finished, you will have a new folder inside your “forge” folder called “mcp”.
  • Finally, create an Eclipse workspace for Forge with this command:
    gradlew eclipse

Previous post: ModderDojo Java Modding 1: Beginning Java Mods with Forge
Next post: ModderDojo Java Modding 3: Getting Started With Eclipse

ModderDojo Java Modding 1: Beginning Java Mods with Forge

craftdiamonds

This is the first post in a series. The following posts will cover several steps:

Next Post: ModderDojo Java Modding 2: Setting Up Your Development Environment.

CoderDojo Athenry Resumes on Saturday 18 Jan

Happy New Year!

CoderDojo Athenry is starting back up for 2014 on Saturday 18 January 2014. As always, it is on from noon in Gairmscoil Mhuire VEC school in Athenry.

New members are welcome to join us: Martha and Julie in Scratch Beginners will have a special area for new members, and new people are welcome in the other streams also. The mentors and other ninjas can help you get up to speed. If you have not been with us before, here is some more information: https://cdathenry.wordpress.com/about/

You are also welcome to return if you were with us previously but could not attend for some weeks in the run up to Christmas, and the mentors and other ninjas will help you catch up and settle back in.

We will continue with the streams that we had before Christmas:

  1. Beginners/Intermediate Scratch
  2. Advanced Scratch (for ninjas who have been through the Beginner/Intermediate stream)
  3. Beginners Python
  4. Minecraft Modders (aimed at those who are older and/or have completed Scratch Advanced – Java modding this term)
  5. Website Development: this is running in parallel with the weekly sessions

We look forward to seeing you there for some more great sessions!

Michael and the CoderDojo Athenry mentors.

Christmas is Coming …

pizza

Christmas is coming and CoderDojo Athenry is coming to an end for 2013, with our final session of the year on Saturday 14 December from 12:00. We will of course resume in January – keep an eye on the mailing list for exact dates.

Even if you missed one or two recent sessions, please do join us for our last session of the year, which will be a very special one: our ninjas from each of the different groups will demonstrate what they have been working on and then we will have a party with pizza and drinks!

For the first part of the session, each of the groups will have about 15 minutes during which ninjas from the group will demonstrate what they have been working on, in this order:

  1. Scratch Beginners
  2. Scratch Advanced
  3. Python Beginners
  4. Minecraft Modders

And don’t worry: we won’t put any ninja on the spot – nobody has to speak unless they would like to.

After the demos, we will all have a party!

Some parents have contacted us to offer to bring something for the party – thank you for your very kind offers, but Ciaran Folan and Gairmscoil Mhuire school are arranging the food, for which we are very grateful. Thank you, Ciaran, and of course huge thanks to you and the school for so generously hosting CoderDojo Athenry every week.

By the way, in case you are wondering about when we will be awarding belts this season, we will do that at the last session before Easter.

 

Scratch Beginners – Week 7 – Paint.net

Hello everyone,

Today we took a look at Paint.net, which is a drawing program. I quickly went through the menus but the best way to learn a program like this is to use it and experiment with it.

PAINTNET

The main reason we looked at it this week was because we will need it next week as we begin our modelling and stop/motion animation. After we take our photos we will be able to “clean them up before we bring them into Scratch as our Sprites.

snake

Next week, if the Moms and Dads could bring along a camera or phone along with the lead to attach these to your laptop.

And of course most important of all bring your imagination!

Here the full notes from todays session in PDF form. CDA-S3-Challenge07-LearnAboutPainting.pdf

ModderDojo Athenry Week 7: Learning More about Functions

In recent weeks, we have been writing JavaScript functions to build MineCraft structures using ScriptCraftJS.

Download our mods here: https://cdathenry.wordpress.com/2013/11/10/modderdojo-athenry-our-scriptcraftjs-minecraft-mods/

This week, we spent a bit more time learning about functions, since they are an extremely important part of any programming language. Slides below.

Function Parameters

Default Values for Parameters

Multiple Functions in a Mod (1)

Multiple Functions in a Mod (2)

Helper Functions and Standalone Functions

Why Use Multiple Functions?