23. Chop Down a Forest of Trees

In This Chapter

Examine the blocks in a large area of the game world

Find the block at an (x,y,z) location

Discover trees by checking for blocks that hold logs

Store locations that have been searched in an array list

Avoid server lag by using less memory in a mod

Create an inner class to represent an (x,y,z) location

Use the programming technique of recursion

Minecraft mods that add a new command to the game all start with the same basic framework. You extend the JavaPlugin class from the org.bukkit.plugin.java package; store the player, world, and server in instance variables; and override the superclass method onCommand().

When the player enters a command, onCommand() is called. If the command ...

Get Absolute Beginner’s Guide to Minecraft® Mods Programming, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.