Appendix 7Common Imports

Here is a listing of all of the imported package and class names used in our plugins. If you get an error that a symbol can’t be found, you may need to import the full class name. For instance, to use a HashMap you’d need to import java.util.HashMap, and to use a Block you’d need to import net.canarymod.api.world.blocks.Block.

You can always look up the full class name in the Java or Canary docs, but here are the most common ones for your convenience.

 
import​ com.pragprog.ahmine.ez.EZPlugin;
 
import​ java.util.ArrayList;
 
import​ java.util.Collection;
 
import​ java.util.HashMap;
 
import​ java.util.Iterator;
 
import​ java.util.List;
 
import​ java.util.Map;
 
import​ java.util.Stack;
 
import​ net.canarymod.BlockIterator; ...

Get Learn to Program with Minecraft Plugins, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.