O'Reilly logo

Learn to Program with Minecraft Plugins, 2nd Edition by Andy Hunt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

An Easy Undo

Say you’re going along and accidentally remove a file from your plugin directory. Or maybe you made a series of edits that turns out to be a really bad idea, and you want to go back. Oops. Have no fear: we’ve all done it.

In fact, let’s do it now, deliberately—and see how to fix it, using the CowShooter plugin where you’ve set up a Git repository.

Bring up CowShooter/src/cowshooter/CowTask.java, and somewhere randomly in the middle of the file, type some nonsense like “Zombie cows are coming! Run for your life! Braaaainsss.…” That will do for our example of making a mistake in a file. Java, of course, is not hip to our warning of the impending zombie-cow apocalypse, and has no idea what this means. Try to compile with build.sh ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required