pi
Class Minecraft

Object
  extended by pi.Minecraft

public class Minecraft
extends Object

The main class to interact with a running instance of Minecraft Pi.

Example:   Minecraft.connect().setBlock(0, 2, 0, Block.GOLD_ORE)


Nested Class Summary
 class Minecraft.Camera
          Control the camera in the game we're connected to
 class Minecraft.Entities
          Methods for entities
 class Minecraft.Events
          Events
 class Minecraft.Player
          Methods for the player in the connected game
 
Field Summary
 Minecraft.Camera camera
           
 Minecraft.Entities entities
           
 Minecraft.Events events
           
 Minecraft.Player player
           
 Tools tools
           
 
Method Summary
 void autoFlush(boolean auto)
          If auto is false, commands are kept in a buffer until they are flushed with flush() or the buffer fills up.
Default is to automatically flush each command separately.
static Minecraft connect()
          Connect to a local mcpi game
static Minecraft connect(String host)
          Connect to a remote mcpi game
static Minecraft connect(String[] args)
          Connect with string args
protected  void finalize()
           
 void flush()
          Flush commands that are buffered, not needed, unless autoFlush(false).
 Block getBlock(Vec position)
          Get a block
 Block getBlockWithData(Vec position)
          Get a block
 int getHeight(int x, int z)
          Get the height of the world (last Y that isn't solid from top-down)
 int[] getPlayerEntityIds()
          Get the entity ids of the connected players
 void postToChat(String message)
          Post a message to the game chat
 void restoreCheckpoint()
          Restore the world state to the checkpoint
 void saveCheckpoint()
          Save a checkpoint that can be used for restoring the world
 void setBlock(int x, int y, int z, Block block)
          Set a block
 void setBlock(Vec position, Block block)
          Set a block
 void setBlocks(int x1, int y1, int z1, int x2, int y2, int z2, Block block)
          Set a cuboid of blocks
 void setBlocks(Vec begin, Vec end, Block block)
          Set a cuboid of blocks
 void setting(String key, boolean value)
          Keys: "world_immutable", "nametags_visible"
 
Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

camera

public final Minecraft.Camera camera

player

public final Minecraft.Player player

entities

public final Minecraft.Entities entities

events

public final Minecraft.Events events

tools

public final Tools tools
Method Detail

connect

public static Minecraft connect()
Connect to a local mcpi game


connect

public static Minecraft connect(String host)
Connect to a remote mcpi game


connect

public static Minecraft connect(String[] args)
Connect with string args

Parameters:
args - an array with optional host, port

getBlock

public Block getBlock(Vec position)
Get a block


getBlockWithData

public Block getBlockWithData(Vec position)
Get a block


setBlock

public void setBlock(int x,
                     int y,
                     int z,
                     Block block)
Set a block


setBlock

public void setBlock(Vec position,
                     Block block)
Set a block


setBlocks

public void setBlocks(int x1,
                      int y1,
                      int z1,
                      int x2,
                      int y2,
                      int z2,
                      Block block)
Set a cuboid of blocks


setBlocks

public void setBlocks(Vec begin,
                      Vec end,
                      Block block)
Set a cuboid of blocks


getHeight

public int getHeight(int x,
                     int z)
Get the height of the world (last Y that isn't solid from top-down)


getPlayerEntityIds

public int[] getPlayerEntityIds()
Get the entity ids of the connected players


setting

public void setting(String key,
                    boolean value)
Keys: "world_immutable", "nametags_visible"


saveCheckpoint

public void saveCheckpoint()
Save a checkpoint that can be used for restoring the world


restoreCheckpoint

public void restoreCheckpoint()
Restore the world state to the checkpoint


postToChat

public void postToChat(String message)
Post a message to the game chat


autoFlush

public void autoFlush(boolean auto)
If auto is false, commands are kept in a buffer until they are flushed with flush() or the buffer fills up.
Default is to automatically flush each command separately.


flush

public void flush()
Flush commands that are buffered, not needed, unless autoFlush(false).


finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable