();
+
+ private int maxCommandsPerTick = 9000;
+
+ private boolean closed = false;
+
+ private Player attachedPlayer = null;
+
+ private CmdEntity cmdEntity;
+ private CmdEvent cmdEvent;
+ private CmdPlayer cmdPlayer;
+ private CmdWorld cmdWorld;
+
+ public RemoteSession(RaspberryJuicePlugin plugin, Socket socket) throws IOException {
+ this.socket = socket;
+ this.plugin = plugin;
+ this.locationType = plugin.getLocationType();
+ init();
+ createCmdObject();
+ }
+
+ public void init() throws IOException {
+ socket.setTcpNoDelay(true);
+ socket.setKeepAlive(true);
+ socket.setTrafficClass(0x10);
+ this.in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "utf-8"));
+ this.out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream(), "utf-8"));
+ startThreads();
+ plugin.getLogger().info("Opened connection to" + socket.getRemoteSocketAddress() + ".");
+ }
+
+ public void createCmdObject(){
+ cmdEntity = new CmdEntity(this);
+ cmdEvent = new CmdEvent(this);
+ cmdPlayer = new CmdPlayer(this);
+ cmdWorld = new CmdWorld(this);
+
+ }
+
+ protected void startThreads() {
+ inThread = new Thread(new InputThread());
+ inThread.start();
+ outThread = new Thread(new OutputThread());
+ outThread.start();
+ }
+
+
+ public Location getOrigin() {
+ return origin;
+ }
+
+ public void setOrigin(Location origin) {
+ this.origin = origin;
+ }
+
+ public Socket getSocket() {
+ return socket;
+ }
+
+ public void queuePlayerInteractEvent(PlayerInteractEvent event) {
+ //plugin.getLogger().info(event.toString());
+ interactEventQueue.add(event);
+ }
+
+ public void queueChatPostedEvent(AsyncPlayerChatEvent event) {
+ //plugin.getLogger().info(event.toString());
+ chatPostedQueue.add(event);
+ }
+
+ public void queueArrowHitEvent(ProjectileHitEvent event){
+ arrowHitEventQueue.add(event);
+ }
+
+ /**
+ * called from the server main thread
+ */
+ public void tick() {
+ if (origin == null) {
+ switch (locationType) {
+ case ABSOLUTE:
+ this.origin = new Location(plugin.getServer().getWorlds().get(0), 0, 0, 0);
+ break;
+ case RELATIVE:
+ this.origin = plugin.getServer().getWorlds().get(0).getSpawnLocation();
+ break;
+ default:
+ throw new IllegalArgumentException("Unknown location type " + locationType);
+ }
+ }
+ int processedCount = 0;
+ String message;
+ while ((message = inQueue.poll()) != null) {
+ handleLine(message);
+ processedCount++;
+ if (processedCount >= maxCommandsPerTick) {
+ plugin.getLogger().warning("Over " + maxCommandsPerTick +
+ " commands were queued - deferring " + inQueue.size() + " to next tick");
+ break;
+ }
+ }
+
+ if (!running && inQueue.size() <= 0) {
+ pendingRemoval = true;
+ }
+ }
+
+ protected void handleLine(String line) {
+ //System.out.println(line);
+ String methodName = line.substring(0, line.indexOf("("));
+ //split string into args, handles , inside " i.e. ","
+ String[] args = line.substring(line.indexOf("(") + 1, line.length() - 1).split(",");
+ //System.out.println(methodName + ":" + Arrays.toString(args));
+ handleCommand(methodName, args);
+ }
+
+ protected void handleCommand(String c, String[] args) {
+
+ try {
+ // get the server
+ Server server = plugin.getServer();
+
+ // get the world
+ World world = origin.getWorld();
+
+ // 分割命令
+ String[] cmd = c.split("[.]", 2);
+
+ if (cmd[0].equals("player")) {
+ cmdPlayer.execute(cmd[1], args);
+
+ } else if (cmd[0].equals("entity")) {
+ cmdEntity.execute(cmd[1], args);
+
+ } else if (cmd[0].equals("world")) {
+// new CmdWorld(this).execute(world, cmd[1], args);
+ cmdWorld.execute(world, cmd[1], args);
+
+ } else if (cmd[0].equals("events")) {
+ cmdEvent.execute(cmd[1], args);
+
+ // chat.post
+ } else if (c.equals("chat.post")) {
+ //create chat message from args as it was split by ,
+ String chatMessage = "";
+ int count;
+ for (count = 0; count < args.length; count++) {
+ chatMessage = chatMessage + args[count] + " ";
+ }
+ chatMessage = chatMessage.substring(0, chatMessage.length() - 1);
+ server.broadcastMessage(chatMessage);
+
+ // not a command which is supported
+ } else {
+ plugin.getLogger().warning(c + " is not supported.");
+ send("Fail," + c + " is not supported.");
+ }
+ } catch (Exception e) {
+
+ plugin.getLogger().warning("Error occured handling command");
+ e.printStackTrace();
+ send("Fail,Please check out minecraft server console");
+
+ }
+ }
+
+ // create a cuboid of lots of blocks
+ private void setCuboid(Location pos1, Location pos2, String blockType, byte data) {
+ int minX, maxX, minY, maxY, minZ, maxZ;
+ World world = pos1.getWorld();
+ minX = pos1.getBlockX() < pos2.getBlockX() ? pos1.getBlockX() : pos2.getBlockX();
+ maxX = pos1.getBlockX() >= pos2.getBlockX() ? pos1.getBlockX() : pos2.getBlockX();
+ minY = pos1.getBlockY() < pos2.getBlockY() ? pos1.getBlockY() : pos2.getBlockY();
+ maxY = pos1.getBlockY() >= pos2.getBlockY() ? pos1.getBlockY() : pos2.getBlockY();
+ minZ = pos1.getBlockZ() < pos2.getBlockZ() ? pos1.getBlockZ() : pos2.getBlockZ();
+ maxZ = pos1.getBlockZ() >= pos2.getBlockZ() ? pos1.getBlockZ() : pos2.getBlockZ();
+
+ for (int x = minX; x <= maxX; ++x) {
+ for (int z = minZ; z <= maxZ; ++z) {
+ for (int y = minY; y <= maxY; ++y) {
+ updateBlock(world, x, y, z, blockType, data);
+ }
+ }
+ }
+ }
+
+ // get a cuboid of lots of blocks
+ private String getBlocks(Location pos1, Location pos2) {
+ StringBuilder blockData = new StringBuilder();
+
+ int minX, maxX, minY, maxY, minZ, maxZ;
+ World world = pos1.getWorld();
+ minX = pos1.getBlockX() < pos2.getBlockX() ? pos1.getBlockX() : pos2.getBlockX();
+ maxX = pos1.getBlockX() >= pos2.getBlockX() ? pos1.getBlockX() : pos2.getBlockX();
+ minY = pos1.getBlockY() < pos2.getBlockY() ? pos1.getBlockY() : pos2.getBlockY();
+ maxY = pos1.getBlockY() >= pos2.getBlockY() ? pos1.getBlockY() : pos2.getBlockY();
+ minZ = pos1.getBlockZ() < pos2.getBlockZ() ? pos1.getBlockZ() : pos2.getBlockZ();
+ maxZ = pos1.getBlockZ() >= pos2.getBlockZ() ? pos1.getBlockZ() : pos2.getBlockZ();
+
+ for (int y = minY; y <= maxY; ++y) {
+ for (int x = minX; x <= maxX; ++x) {
+ for (int z = minZ; z <= maxZ; ++z) {
+ blockData.append(world.getBlockAt(x, y, z).getType().name() + ",");
+ }
+ }
+ }
+
+ return blockData.substring(0, blockData.length() > 0 ? blockData.length() - 1 : 0); // We don't want last comma
+ }
+
+ // updates a block
+ private void updateBlock(World world, Location loc, String blockType, byte blockData) {
+ Block thisBlock = world.getBlockAt(loc);
+ updateBlock(thisBlock, blockType, blockData);
+ }
+
+ private void updateBlock(World world, int x, int y, int z, String blockType, byte blockData) {
+ Block thisBlock = world.getBlockAt(x, y, z);
+ updateBlock(thisBlock, blockType, blockData);
+ }
+
+ private void updateBlock(Block thisBlock, String blockType, byte blockData) {
+ // check to see if the block is different - otherwise leave it
+ blockType = blockType.toUpperCase();
+ if ((thisBlock.getType() != Material.valueOf(blockType))) {
+ thisBlock.setType(Material.valueOf(blockType.toUpperCase()));
+// thisBlock.setTypeIdAndData(blockType, blockData, true);
+ }
+ }
+
+ // gets the current player
+ public Player getCurrentPlayer() {
+ if (!serverHasPlayer()) {
+ send("Fail,There are no players in the server.");
+ return null;
+ }
+ Player player = attachedPlayer;
+ // if the player hasnt already been retreived for this session, go and get it.
+ if (player == null) {
+ player = plugin.getHostPlayer();
+ attachedPlayer = player;
+ }
+ return player;
+ }
+
+ private boolean serverHasPlayer() {
+ return !Bukkit.getOnlinePlayers().isEmpty();
+ }
+
+ public Location parseRelativeBlockLocation(String xstr, String ystr, String zstr) {
+ int x = (int) Double.parseDouble(xstr);
+ int y = (int) Double.parseDouble(ystr);
+ int z = (int) Double.parseDouble(zstr);
+ return parseLocation(origin.getWorld(), x, y, z, origin.getBlockX(), origin.getBlockY(), origin.getBlockZ());
+ }
+
+ public Location parseRelativeLocation(String xstr, String ystr, String zstr) {
+ double x = Double.parseDouble(xstr);
+ double y = Double.parseDouble(ystr);
+ double z = Double.parseDouble(zstr);
+ return parseLocation(origin.getWorld(), x, y, z, origin.getX(), origin.getY(), origin.getZ());
+ }
+
+ public Location parseRelativeBlockLocation(String xstr, String ystr, String zstr, float pitch, float yaw) {
+ Location loc = parseRelativeBlockLocation(xstr, ystr, zstr);
+ loc.setPitch(pitch);
+ loc.setYaw(yaw);
+ return loc;
+ }
+
+ public Location parseRelativeLocation(String xstr, String ystr, String zstr, float pitch, float yaw) {
+ Location loc = parseRelativeLocation(xstr, ystr, zstr);
+ loc.setPitch(pitch);
+ loc.setYaw(yaw);
+ return loc;
+ }
+
+ public String blockLocationToRelative(Location loc) {
+ return parseLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), origin.getBlockX(), origin.getBlockY(), origin.getBlockZ());
+ }
+
+ public String locationToRelative(Location loc) {
+ return parseLocation(loc.getX(), loc.getY(), loc.getZ(), origin.getX(), origin.getY(), origin.getZ());
+ }
+
+ private String parseLocation(double x, double y, double z, double originX, double originY, double originZ) {
+ return (x - originX) + "," + (y - originY) + "," + (z - originZ);
+ }
+
+ private Location parseLocation(World world, double x, double y, double z, double originX, double originY, double originZ) {
+ return new Location(world, originX + x, originY + y, originZ + z);
+ }
+
+ private String parseLocation(int x, int y, int z, int originX, int originY, int originZ) {
+ return (x - originX) + "," + (y - originY) + "," + (z - originZ);
+ }
+
+ private Location parseLocation(World world, int x, int y, int z, int originX, int originY, int originZ) {
+ return new Location(world, originX + x, originY + y, originZ + z);
+ }
+
+ public void send(Object a) {
+ send(a.toString());
+ }
+
+ public void send(String a) {
+ if (pendingRemoval) return;
+ synchronized (outQueue) {
+ outQueue.add(a);
+ }
+ }
+
+ public void close() {
+ if (closed) return;
+ running = false;
+ pendingRemoval = true;
+
+ //wait for threads to stop
+ try {
+ inThread.join(2000);
+ outThread.join(2000);
+ } catch (InterruptedException e) {
+ plugin.getLogger().warning("Failed to stop in/out thread");
+ e.printStackTrace();
+ }
+
+ try {
+ socket.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ plugin.getLogger().info("Closed connection to" + socket.getRemoteSocketAddress() + ".");
+ }
+
+ public void kick(String reason) {
+ try {
+ out.write(reason);
+ out.flush();
+ } catch (Exception e) {
+ }
+ close();
+ }
+
+ /**
+ * socket listening thread
+ */
+ private class InputThread implements Runnable {
+ public void run() {
+ plugin.getLogger().info("Starting input thread");
+ while (running) {
+ try {
+ String newLine = in.readLine();
+ //System.out.println(newLine);
+ if (newLine == null) {
+ running = false;
+ } else {
+ inQueue.add(newLine);
+ //System.out.println("Added to in queue");
+ }
+ } catch (Exception e) {
+ // if its running raise an error
+ if (running) {
+ if (e.getMessage().equals("Connection reset")) {
+ plugin.getLogger().info("Connection reset");
+ } else {
+ e.printStackTrace();
+ }
+ running = false;
+ }
+ }
+ }
+ //close in buffer
+ try {
+ in.close();
+ } catch (Exception e) {
+ plugin.getLogger().warning("Failed to close in buffer");
+ e.printStackTrace();
+ }
+ }
+ }
+
+ private class OutputThread implements Runnable {
+ public void run() {
+ plugin.getLogger().info("Starting output thread!");
+ while (running) {
+ try {
+ String line;
+ while ((line = outQueue.poll()) != null) {
+ out.write(line);
+ out.write('\n');
+ }
+ out.flush();
+ Thread.yield();
+ Thread.sleep(1L);
+ } catch (Exception e) {
+ // if its running raise an error
+ if (running) {
+ e.printStackTrace();
+ running = false;
+ }
+ }
+ }
+ //close out buffer
+ try {
+ out.close();
+ } catch (Exception e) {
+ plugin.getLogger().warning("Failed to close out buffer");
+ e.printStackTrace();
+ }
+ }
+ }
+
+ /**
+ * from CraftBukkit's org.bukkit.craftbukkit.block.CraftBlock.blockFactToNotch
+ */
+ public static int blockFaceToNotch(BlockFace face) {
+ switch (face) {
+ case DOWN:
+ return 0;
+ case UP:
+ return 1;
+ case NORTH:
+ return 2;
+ case SOUTH:
+ return 3;
+ case WEST:
+ return 4;
+ case EAST:
+ return 5;
+ default:
+ return 7; // Good as anything here, but technically invalid
+ }
+ }
}
diff --git a/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdEntity.java b/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdEntity.java
new file mode 100644
index 00000000..3e56ad8b
--- /dev/null
+++ b/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdEntity.java
@@ -0,0 +1,111 @@
+package net.zhuoweizhang.raspberryjuice.cmd;
+
+import net.zhuoweizhang.raspberryjuice.RaspberryJuicePlugin;
+import net.zhuoweizhang.raspberryjuice.RemoteSession;
+import org.bukkit.Location;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.Player;
+import org.bukkit.util.Vector;
+
+public class CmdEntity {
+ private final String preFix = "entity.";
+ private RemoteSession session;
+ private RaspberryJuicePlugin plugin;
+
+ public CmdEntity(RemoteSession session) {
+ this.session = session;
+
+ this.plugin = session.plugin;
+ }
+
+ public void execute(String command, String[] args) {
+
+ //get entity based on id
+ Entity entity = plugin.getEntity(Integer.parseInt(args[0]));
+
+ if (entity == null) {
+ plugin.getLogger().info("Entity [" + args[0] + "] not found.");
+ session.send("Fail,This entity identity not exist");
+ }
+
+ // entity.getTile
+ if (command.equals("getTile")) {
+
+ session.send(session.blockLocationToRelative(entity.getLocation()));
+
+ // entity.setTile
+ } else if (command.equals("setTile")) {
+ String x = args[1], y = args[2], z = args[3];
+ Location loc = entity.getLocation();
+
+ entity.teleport(session.parseRelativeBlockLocation(x, y, z, loc.getPitch(), loc.getYaw()));
+
+ // entity.getPos
+ } else if (command.equals("getPos")) {
+
+ session.send(session.locationToRelative(entity.getLocation()));
+
+ // entity.setPos
+ } else if (command.equals("setPos")) {
+ String x = args[1], y = args[2], z = args[3];
+ Location loc = entity.getLocation();
+
+ entity.teleport(session.parseRelativeLocation(x, y, z, loc.getPitch(), loc.getYaw()));
+
+ // entity.setDirection
+ } else if (command.equals("setDirection")) {
+ Double x = Double.parseDouble(args[1]);
+ Double y = Double.parseDouble(args[2]);
+ Double z = Double.parseDouble(args[3]);
+ Location loc = entity.getLocation();
+
+ loc.setDirection(new Vector(x, y, z));
+ entity.teleport(loc);
+
+ // entity.getDirection
+ } else if (command.equals("getDirection")) {
+
+ session.send(entity.getLocation().getDirection().toString());
+
+ // entity.setRotation
+ } else if (command.equals("setRotation")) {
+ Float yaw = Float.parseFloat(args[1]);
+ Location loc = entity.getLocation();
+
+ loc.setYaw(yaw);
+ entity.teleport(loc);
+
+ // entity.getRotation
+ } else if (command.equals("getRotation")) {
+
+ session.send(entity.getLocation().getYaw());
+
+ // entity.setPitch
+ } else if (command.equals("setPitch")) {
+ Float pitch = Float.parseFloat(args[1]);
+ Location loc = entity.getLocation();
+
+ loc.setPitch(pitch);
+ entity.teleport(loc);
+
+ // entity.getPitch
+ } else if (command.equals("getPitch")) {
+ session.send(entity.getLocation().getPitch());
+
+ // entity.getListName
+ } else if (command.equals("getName")) {
+ if (entity instanceof Player) {
+ Player p = (Player) entity;
+ //sending list name because plugin.getNamedPlayer() uses list name
+ session.send(p.getPlayerListName());
+ } else {
+ session.send(entity.getName());
+ }
+
+ } else {
+ session.plugin.getLogger().warning(preFix + command + " is not supported.");
+ session.send("Fail," + preFix + command + " is not supported.");
+ }
+
+ }
+}
diff --git a/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdEvent.java b/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdEvent.java
new file mode 100644
index 00000000..d42fe3b3
--- /dev/null
+++ b/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdEvent.java
@@ -0,0 +1,76 @@
+package net.zhuoweizhang.raspberryjuice.cmd;
+
+import net.zhuoweizhang.raspberryjuice.RemoteSession;
+import org.bukkit.Location;
+import org.bukkit.block.Block;
+import org.bukkit.event.entity.ProjectileHitEvent;
+import org.bukkit.event.player.AsyncPlayerChatEvent;
+import org.bukkit.event.player.PlayerInteractEvent;
+
+public class CmdEvent {
+ private final String preFix = "events.";
+ private RemoteSession session;
+
+ public CmdEvent(RemoteSession session) {
+ this.session = session;
+ }
+
+ public void execute(String command, String[] args) {
+ // events.clear
+ if (command.equals("clear")) {
+ session.interactEventQueue.clear();
+ session.chatPostedQueue.clear();
+
+ // events.block.hits
+ } else if (command.equals("block.hits")) {
+ StringBuilder b = new StringBuilder();
+ PlayerInteractEvent event;
+ while ((event = session.interactEventQueue.poll()) != null) {
+ Block block = event.getClickedBlock();
+ Location loc = block.getLocation();
+ b.append(session.blockLocationToRelative(loc));
+ b.append(",");
+ b.append(session.blockFaceToNotch(event.getBlockFace()));
+ b.append(",");
+ b.append(event.getPlayer().getEntityId());
+ if (session.interactEventQueue.size() > 0) {
+ b.append("|");
+ }
+ }
+ session.send(b.toString());
+
+ // events.chat.posts
+ } else if (command.equals("chat.posts")) {
+ StringBuilder b = new StringBuilder();
+ AsyncPlayerChatEvent event;
+ while ((event = session.chatPostedQueue.poll()) != null) {
+ b.append(event.getPlayer().getEntityId());
+ b.append(",");
+ b.append(event.getMessage());
+ if (session.chatPostedQueue.size() > 0) {
+ b.append("|");
+ }
+ }
+ session.send(b.toString());
+
+ } else if(command.equals("arrow.hits")){
+ StringBuilder b = new StringBuilder();
+ ProjectileHitEvent event;
+ while ((event = session.arrowHitEventQueue.poll()) != null) {
+ Block block = event.getHitBlock();
+ if(block == null) continue;
+ Location loc = block.getLocation();
+ b.append(session.blockLocationToRelative(loc));
+ b.append(",");
+ b.append(event.getEntity().getEntityId());
+ if (session.arrowHitEventQueue.size() > 0) {
+ b.append("|");
+ }
+ }
+ session.send(b.toString());
+ } else{
+ session.plugin.getLogger().warning(preFix + command + " is not supported.");
+ session.send("Fail," + preFix + command + " is not supported.");
+ }
+ }
+}
diff --git a/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdPlayer.java b/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdPlayer.java
new file mode 100644
index 00000000..ca7153f6
--- /dev/null
+++ b/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdPlayer.java
@@ -0,0 +1,165 @@
+package net.zhuoweizhang.raspberryjuice.cmd;
+
+import net.zhuoweizhang.raspberryjuice.RemoteSession;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.entity.Player;
+import org.bukkit.util.Vector;
+
+public class CmdPlayer {
+ private final String preFix = "player.";
+ private RemoteSession session;
+
+ public CmdPlayer(RemoteSession session) {
+ this.session = session;
+ }
+
+ private boolean serverHasPlayer() {
+ return !Bukkit.getOnlinePlayers().isEmpty();
+ }
+
+ private Player getCurrentPlayer() {
+ if (!serverHasPlayer()) {
+ session.send("Fail,There are no players in the server.");
+ return null;
+ } else {
+ for (Player player : Bukkit.getServer().getOnlinePlayers()) {
+ return player;
+ }
+ }
+ return null;
+ }
+
+ public void execute(String command, String[] args) {
+
+ Player currentPlayer = getCurrentPlayer();
+ if (currentPlayer == null) {
+ session.send("Fail,There are no players in the server.");
+ return;
+ }
+
+ // player.getTile
+ if (command.equals("getTile")) {
+
+ session.send(session.blockLocationToRelative(currentPlayer.getLocation()));
+
+ // player.setTile
+ } else if (command.equals("setTile")) {
+ String x = args[0], y = args[1], z = args[2];
+
+ //get players current location, so when they are moved we will use the same pitch and yaw (rotation)
+ Location loc = currentPlayer.getLocation();
+ currentPlayer.teleport(session.parseRelativeBlockLocation(x, y, z, loc.getPitch(), loc.getYaw()));
+
+ // player.getAbsPos
+ } else if (command.equals("getAbsPos")) {
+
+ session.send(currentPlayer.getLocation());
+
+ // player.setAbsPos
+ } else if (command.equals("setAbsPos")) {
+ String x = args[0], y = args[1], z = args[2];
+
+ //get players current location, so when they are moved we will use the same pitch and yaw (rotation)
+ Location loc = currentPlayer.getLocation();
+ loc.setX(Double.parseDouble(x));
+ loc.setY(Double.parseDouble(y));
+ loc.setZ(Double.parseDouble(z));
+ currentPlayer.teleport(loc);
+
+ // player.getPos
+ } else if (command.equals("getPos")) {
+
+ session.send(session.locationToRelative(currentPlayer.getLocation()));
+
+ // player.setPos
+ } else if (command.equals("setPos")) {
+ String x = args[0], y = args[1], z = args[2];
+
+ //get players current location, so when they are moved we will use the same pitch and yaw (rotation)
+ Location loc = currentPlayer.getLocation();
+ currentPlayer.teleport(session.parseRelativeLocation(x, y, z, loc.getPitch(), loc.getYaw()));
+
+ // player.setDirection
+ } else if (command.equals("setDirection")) {
+ Double x = Double.parseDouble(args[0]);
+ Double y = Double.parseDouble(args[1]);
+ Double z = Double.parseDouble(args[2]);
+
+ Location loc = currentPlayer.getLocation();
+ loc.setDirection(new Vector(x, y, z));
+ currentPlayer.teleport(loc);
+
+ // player.getDirection
+ } else if (command.equals("getDirection")) {
+
+ session.send(currentPlayer.getLocation().getDirection().toString());
+
+ // player.setRotation
+ } else if (command.equals("setRotation")) {
+ Float yaw = Float.parseFloat(args[0]);
+
+ Location loc = currentPlayer.getLocation();
+ loc.setYaw(yaw);
+ currentPlayer.teleport(loc);
+
+ // player.getRotation
+ } else if (command.equals("getRotation")) {
+
+ float yaw = currentPlayer.getLocation().getYaw();
+ // turn bukkit's 0 - -360 to positive numbers
+ if (yaw < 0) yaw = yaw * -1;
+ session.send(yaw);
+
+ // player.setPitch
+ } else if (command.equals("setPitch")) {
+ Float pitch = Float.parseFloat(args[0]);
+
+ Location loc = currentPlayer.getLocation();
+ loc.setPitch(pitch);
+ currentPlayer.teleport(loc);
+
+ // player.getPitch
+ } else if (command.equals("getPitch")) {
+
+ session.send(currentPlayer.getLocation().getPitch());
+
+ // player.getFoodLevel
+ } else if (command.equals("getFoodLevel")) {
+
+ session.send(currentPlayer.getFoodLevel());
+
+ // player.setFoodLevel
+ } else if (command.equals("setFoodLevel")) {
+ Integer foodLevel = Integer.parseInt(args[0]);
+
+ currentPlayer.setFoodLevel(foodLevel);
+
+ // player.getHealth
+ } else if(command.equals("getHealth")) {
+
+ session.send(currentPlayer.getHealth());
+
+ // player.setHealth
+ } else if(command.equals("setHealth")){
+ Double health = Double.parseDouble(args[0]);
+
+ currentPlayer.setHealth(health);
+
+ // player.sendTitle
+ } else if (command.equals("sendTitle")) {
+
+ String title = args[0];
+ String subTitle = args[1];
+ Integer fadeIn = Integer.parseInt(args[2]);
+ Integer stay = Integer.parseInt(args[3]);
+ Integer fadeOut = Integer.parseInt(args[4]);
+ currentPlayer.sendTitle(title, subTitle, fadeIn, stay, fadeOut);
+
+ } else {
+ session.plugin.getLogger().warning(preFix + command + " is not supported.");
+ session.send("Fail," + preFix + command + " is not supported.");
+ }
+ }
+
+}
diff --git a/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdWorld.java b/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdWorld.java
new file mode 100644
index 00000000..2717f126
--- /dev/null
+++ b/src/main/java/net/zhuoweizhang/raspberryjuice/cmd/CmdWorld.java
@@ -0,0 +1,226 @@
+package net.zhuoweizhang.raspberryjuice.cmd;
+
+import net.zhuoweizhang.raspberryjuice.RaspberryJuicePlugin;
+import net.zhuoweizhang.raspberryjuice.RemoteSession;
+import org.bukkit.Bukkit;
+import org.bukkit.Location;
+import org.bukkit.Material;
+import org.bukkit.World;
+import org.bukkit.block.Block;
+import org.bukkit.block.BlockFace;
+import org.bukkit.block.BlockState;
+import org.bukkit.block.Sign;
+import org.bukkit.block.data.type.WallSign;
+import org.bukkit.entity.Entity;
+import org.bukkit.entity.EntityType;
+import org.bukkit.entity.Player;
+
+import java.util.Collection;
+
+public class CmdWorld {
+ private final String preFix = "world.";
+ private RemoteSession session;
+ private RaspberryJuicePlugin plugin;
+
+ public CmdWorld(RemoteSession session) {
+ this.session = session;
+ this.plugin = session.plugin;
+ }
+
+ public void execute(World world, String command, String[] args) {
+
+ // world.getBlock
+ if (command.equals("getBlock")) {
+ Location loc = session.parseRelativeBlockLocation(args[0], args[1], args[2]);
+
+ session.send(world.getBlockAt(loc).getType().name());
+
+ // world.getBlocks
+ } else if (command.equals("getBlocks")) {
+ Location loc1 = session.parseRelativeBlockLocation(args[0], args[1], args[2]);
+ Location loc2 = session.parseRelativeBlockLocation(args[3], args[4], args[5]);
+
+ session.send(getBlocks(loc1, loc2));
+
+ // world.setBlock
+ } else if (command.equals("setBlock")) {
+ Location loc = session.parseRelativeBlockLocation(args[0], args[1], args[2]);
+
+ updateBlock(world, loc, args[3]);
+
+ // world.setBlocks
+ } else if (command.equals("setBlocks")) {
+ Location loc1 = session.parseRelativeBlockLocation(args[0], args[1], args[2]);
+ Location loc2 = session.parseRelativeBlockLocation(args[3], args[4], args[5]);
+ String blockType = args[6];
+
+ setCuboid(loc1, loc2, blockType);
+
+ // world.getPlayerIds
+ } else if (command.equals("getPlayerIds")) {
+ StringBuilder bdr = new StringBuilder();
+ Collection extends Player> players = Bukkit.getOnlinePlayers();
+ if (players.size() > 0) {
+ for (Player p : players) {
+ bdr.append(p.getEntityId());
+ bdr.append("|");
+ }
+ bdr.deleteCharAt(bdr.length() - 1);
+ session.send(bdr.toString());
+ } else {
+ session.send("Fail," + "There are no players in the server.");
+ }
+
+ // world.getPlayerId
+ } else if (command.equals("getPlayerId")) {
+ Player p = plugin.getNamedPlayer(args[0]);
+ if (p != null) {
+ session.send(p.getEntityId());
+ } else {
+ plugin.getLogger().info("Player [" + args[0] + "] not found.");
+ session.send("Fail," + "T he player not exist");
+ }
+
+ // world.getHeight
+ } else if (command.equals("getHeight")) {
+ session.send(world.getHighestBlockYAt(session.parseRelativeBlockLocation(args[0], "0", args[1])));
+
+ }
+ // world.setSign
+ else if (command.equals("setSign")) {
+ Location loc = session.parseRelativeBlockLocation(args[0], args[1], args[2]);
+ Block thisBlock = world.getBlockAt(loc);
+
+ thisBlock.setType(Material.valueOf(args[3]));
+
+ org.bukkit.block.data.type.Sign s = (org.bukkit.block.data.type.Sign) thisBlock.getBlockData();
+ s.setRotation(BlockFace.valueOf(args[4]));
+ thisBlock.setBlockData(s);
+
+ BlockState signState = thisBlock.getState();
+
+ if (signState instanceof Sign) {
+ Sign sign = (Sign) signState;
+
+ for (int i = 5; i - 5 < 4 && i < args.length; i++) {
+ sign.setLine(i - 5, args[i]);
+ }
+ sign.update();
+ }
+
+
+ } else if (command.equals("setWallSign")) {
+ Location loc = session.parseRelativeBlockLocation(args[0], args[1], args[2]);
+ Block thisBlock = world.getBlockAt(loc);
+ thisBlock.setType(Material.valueOf(args[3]));
+
+ WallSign s = (WallSign) thisBlock.getBlockData();
+ s.setFacing(BlockFace.valueOf(args[4]));
+ thisBlock.setBlockData(s);
+
+ BlockState signState = thisBlock.getState();
+
+ if (signState instanceof Sign) {
+ Sign sign = (Sign) signState;
+
+ for (int i = 5; i - 5 < 4 && i < args.length; i++) {
+ sign.setLine(i - 5, args[i]);
+ }
+ sign.update();
+ }
+
+ // world.spawnEntity
+ } else if (command.equals("spawnEntity")) {
+ Location loc = session.parseRelativeBlockLocation(args[0], args[1], args[2]);
+ Entity entity = world.spawnEntity(loc, EntityType.fromId(Integer.parseInt(args[3])));
+ session.send(entity.getEntityId());
+
+ // world.explode
+ } else if (command.equals("createExplosion")) {
+ Location loc = session.parseRelativeBlockLocation(args[0], args[1], args[2]);
+ Float power = Float.parseFloat(args[3]);
+
+ world.createExplosion(loc, power);
+
+ // world.getEntityTypes
+ } else if (command.equals("getEntityTypes")) {
+ StringBuilder bdr = new StringBuilder();
+ for (EntityType entityType : EntityType.values()) {
+ if (entityType.isSpawnable() && entityType.getTypeId() >= 0) {
+ bdr.append(entityType.getTypeId());
+ bdr.append(",");
+ bdr.append(entityType.toString());
+ bdr.append("|");
+ }
+ }
+ session.send(bdr.toString());
+
+ } else {
+ session.plugin.getLogger().warning(preFix + command + " is not supported.");
+ session.send("Fail," + preFix + command + " is not supported.");
+ }
+ }
+
+ // create a cuboid of lots of blocks
+ private void setCuboid(Location pos1, Location pos2, String blockType) {
+ int minX, maxX, minY, maxY, minZ, maxZ;
+ World world = pos1.getWorld();
+ minX = pos1.getBlockX() < pos2.getBlockX() ? pos1.getBlockX() : pos2.getBlockX();
+ maxX = pos1.getBlockX() >= pos2.getBlockX() ? pos1.getBlockX() : pos2.getBlockX();
+ minY = pos1.getBlockY() < pos2.getBlockY() ? pos1.getBlockY() : pos2.getBlockY();
+ maxY = pos1.getBlockY() >= pos2.getBlockY() ? pos1.getBlockY() : pos2.getBlockY();
+ minZ = pos1.getBlockZ() < pos2.getBlockZ() ? pos1.getBlockZ() : pos2.getBlockZ();
+ maxZ = pos1.getBlockZ() >= pos2.getBlockZ() ? pos1.getBlockZ() : pos2.getBlockZ();
+
+ for (int x = minX; x <= maxX; ++x) {
+ for (int z = minZ; z <= maxZ; ++z) {
+ for (int y = minY; y <= maxY; ++y) {
+ updateBlock(world, x, y, z, blockType);
+ }
+ }
+ }
+ }
+
+ // get a cuboid of lots of blocks
+ private String getBlocks(Location pos1, Location pos2) {
+ StringBuilder blockData = new StringBuilder();
+
+ int minX, maxX, minY, maxY, minZ, maxZ;
+ World world = pos1.getWorld();
+ minX = pos1.getBlockX() < pos2.getBlockX() ? pos1.getBlockX() : pos2.getBlockX();
+ maxX = pos1.getBlockX() >= pos2.getBlockX() ? pos1.getBlockX() : pos2.getBlockX();
+ minY = pos1.getBlockY() < pos2.getBlockY() ? pos1.getBlockY() : pos2.getBlockY();
+ maxY = pos1.getBlockY() >= pos2.getBlockY() ? pos1.getBlockY() : pos2.getBlockY();
+ minZ = pos1.getBlockZ() < pos2.getBlockZ() ? pos1.getBlockZ() : pos2.getBlockZ();
+ maxZ = pos1.getBlockZ() >= pos2.getBlockZ() ? pos1.getBlockZ() : pos2.getBlockZ();
+
+ for (int y = minY; y <= maxY; ++y) {
+ for (int x = minX; x <= maxX; ++x) {
+ for (int z = minZ; z <= maxZ; ++z) {
+ blockData.append(world.getBlockAt(x, y, z).getType().name() + ",");
+ }
+ }
+ }
+
+ return blockData.substring(0, blockData.length() > 0 ? blockData.length() - 1 : 0); // We don't want last comma
+ }
+
+ // updates a block
+ private void updateBlock(World world, Location loc, String blockType) {
+ Block thisBlock = world.getBlockAt(loc);
+ updateBlock(thisBlock, blockType);
+ }
+
+ private void updateBlock(World world, int x, int y, int z, String blockType) {
+ Block thisBlock = world.getBlockAt(x, y, z);
+ updateBlock(thisBlock, blockType);
+ }
+
+ private void updateBlock(Block thisBlock, String blockType) {
+ // check to see if the block is different - otherwise leave it
+ blockType = blockType.toUpperCase();
+ if ((thisBlock.getType() != Material.valueOf(blockType))) {
+ thisBlock.setType(Material.valueOf(blockType.toUpperCase()));
+ }
+ }
+}
diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml
index 46a97e03..5fd14ef8 100644
--- a/src/main/resources/config.yml
+++ b/src/main/resources/config.yml
@@ -2,7 +2,7 @@
port: 4711
# Determine whether locations are RELATIVE to the spawn point (default like pi) or ABSOLUTE
-location: RELATIVE
+location: ABSOLUTE
# Determine whether hit events are triggered by LEFT clicks, RIGHT clicks or BOTH
-hitclick: RIGHT
\ No newline at end of file
+hitclick: LEFT
\ No newline at end of file
diff --git a/src/main/resources/mcpi/api/python/original/mcpi/__init__.py b/src/main/resources/mcpi/__init__.py
similarity index 100%
rename from src/main/resources/mcpi/api/python/original/mcpi/__init__.py
rename to src/main/resources/mcpi/__init__.py
diff --git a/src/main/resources/mcpi/api/java/HOW_TO_RUN_DEMOS.txt b/src/main/resources/mcpi/api/java/HOW_TO_RUN_DEMOS.txt
deleted file mode 100644
index 0cf53f03..00000000
--- a/src/main/resources/mcpi/api/java/HOW_TO_RUN_DEMOS.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-Use one of the lines below to run a demo. [host] is an optional ip-address.
-
-java -cp McPiDemos.jar pi.demo.LoopDemo [host]
-java -cp McPiDemos.jar pi.demo.LowLevelDemo [host]
-java -cp McPiDemos.jar pi.demo.TextDemo [host]
-java -cp McPiDemos.jar pi.demo.TurtleDemo [host]
-
-java -cp McPiDemos.jar pi.demo.sokoban.Sokoban [host]
diff --git a/src/main/resources/mcpi/api/java/McPi.jar b/src/main/resources/mcpi/api/java/McPi.jar
deleted file mode 100644
index 7118ab8e..00000000
Binary files a/src/main/resources/mcpi/api/java/McPi.jar and /dev/null differ
diff --git a/src/main/resources/mcpi/api/java/McPiDemos.jar b/src/main/resources/mcpi/api/java/McPiDemos.jar
deleted file mode 100644
index cded4d08..00000000
Binary files a/src/main/resources/mcpi/api/java/McPiDemos.jar and /dev/null differ
diff --git a/src/main/resources/mcpi/api/java/doc/allclasses-frame.html b/src/main/resources/mcpi/api/java/doc/allclasses-frame.html
deleted file mode 100644
index 95f4938d..00000000
--- a/src/main/resources/mcpi/api/java/doc/allclasses-frame.html
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-All Classes (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-All Classes
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/allclasses-noframe.html b/src/main/resources/mcpi/api/java/doc/allclasses-noframe.html
deleted file mode 100644
index e3cdb78b..00000000
--- a/src/main/resources/mcpi/api/java/doc/allclasses-noframe.html
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-All Classes (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-All Classes
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/constant-values.html b/src/main/resources/mcpi/api/java/doc/constant-values.html
deleted file mode 100644
index af5892f3..00000000
--- a/src/main/resources/mcpi/api/java/doc/constant-values.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-Constant Field Values (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Constant Field Values
-
-
-Contents
-
-
-
-
-
-
-
-
-pi.Vec
-
-
-
-public static final int
-MAX_Y
-127
-
-
-
-public static final int
-MIN_Y
--128
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/deprecated-list.html b/src/main/resources/mcpi/api/java/doc/deprecated-list.html
deleted file mode 100644
index a754ff8c..00000000
--- a/src/main/resources/mcpi/api/java/doc/deprecated-list.html
+++ /dev/null
@@ -1,45 +0,0 @@
-
-
-
-
-
-
-
-Deprecated List (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Deprecated API
-
-
-Contents
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/index.html b/src/main/resources/mcpi/api/java/doc/index.html
deleted file mode 100644
index 2fdfe5a0..00000000
--- a/src/main/resources/mcpi/api/java/doc/index.html
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
-Minecraft Pi Edition, Java API
-
-
-
-
-
-
-
-
-
-
-
-
-
-Frame Alert
-
-
-This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
-
-Link toNon-frame version.
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/overview-frame.html b/src/main/resources/mcpi/api/java/doc/overview-frame.html
deleted file mode 100644
index a6537ec7..00000000
--- a/src/main/resources/mcpi/api/java/doc/overview-frame.html
+++ /dev/null
@@ -1,47 +0,0 @@
-
-
-
-
-
-
-
-Overview List (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/overview-summary.html b/src/main/resources/mcpi/api/java/doc/overview-summary.html
deleted file mode 100644
index bbd5bdf2..00000000
--- a/src/main/resources/mcpi/api/java/doc/overview-summary.html
+++ /dev/null
@@ -1,63 +0,0 @@
-
-
-
-
-
-
-
-Overview (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Minecraft Pi Edition - Java API
-
-
-
-
-
-
-Api
-
-
-pi
-Protocol classes
-
-
-pi.event
-Use to react on events in the game
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/package-list b/src/main/resources/mcpi/api/java/doc/package-list
deleted file mode 100644
index 582d0c9b..00000000
--- a/src/main/resources/mcpi/api/java/doc/package-list
+++ /dev/null
@@ -1,3 +0,0 @@
-pi
-pi.event
-pi.tool
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Block.html b/src/main/resources/mcpi/api/java/doc/pi/Block.html
deleted file mode 100644
index 00fd3fb7..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Block.html
+++ /dev/null
@@ -1,1534 +0,0 @@
-
-
-
-
-
-
-
-Block (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Block
-
-Object
- pi.Block
-
-
-
-public class Block extends Object
-
-
-
-A Minecraft Block description
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- boolean
-equals (Object obj)
-
-
-
-
-
-
- int
-hashCode ()
-
-
-
-
-
-
-static Block
-id (int id)
-
-
- Get a block with and withId (use a constant like Block.TNT)
-
-
-
- String
-toString ()
-
-
-
-
-
-
- Block
-withData (int data)
-
-
- Get a block with extra data
-
-
-
-static Block
-wool (Color color)
-
-
- Get a wool block of a specific color
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-AIR
-
-public static final Block AIR
-
-
-
-
-
-
-
-STONE
-
-public static final Block STONE
-
-
-
-
-
-
-
-GRASS
-
-public static final Block GRASS
-
-
-
-
-
-
-
-DIRT
-
-public static final Block DIRT
-
-
-
-
-
-
-
-COBBLESTONE
-
-public static final Block COBBLESTONE
-
-
-
-
-
-
-
-WOOD_PLANKS
-
-public static final Block WOOD_PLANKS
-
-
-
-
-
-
-
-SAPLING
-
-public static final Block SAPLING
-
-
-
-
-
-
-
-BEDROCK
-
-public static final Block BEDROCK
-
-
-
-
-
-
-
-WATER_FLOWING
-
-public static final Block WATER_FLOWING
-
-
-
-
-
-
-
-WATER
-
-public static final Block WATER
-
-
-
-
-
-
-
-WATER_STATIONARY
-
-public static final Block WATER_STATIONARY
-
-
-
-
-
-
-
-LAVA_FLOWING
-
-public static final Block LAVA_FLOWING
-
-
-
-
-
-
-
-LAVA
-
-public static final Block LAVA
-
-
-
-
-
-
-
-LAVA_STATIONARY
-
-public static final Block LAVA_STATIONARY
-
-
-
-
-
-
-
-SAND
-
-public static final Block SAND
-
-
-
-
-
-
-
-GRAVEL
-
-public static final Block GRAVEL
-
-
-
-
-
-
-
-GOLD_ORE
-
-public static final Block GOLD_ORE
-
-
-
-
-
-
-
-IRON_ORE
-
-public static final Block IRON_ORE
-
-
-
-
-
-
-
-COAL_ORE
-
-public static final Block COAL_ORE
-
-
-
-
-
-
-
-WOOD
-
-public static final Block WOOD
-
-
-
-
-
-
-
-LEAVES
-
-public static final Block LEAVES
-
-
-
-
-
-
-
-GLASS
-
-public static final Block GLASS
-
-
-
-
-
-
-
-LAPIS_LAZULI_ORE
-
-public static final Block LAPIS_LAZULI_ORE
-
-
-
-
-
-
-
-LAPIS_LAZULI_BLOCK
-
-public static final Block LAPIS_LAZULI_BLOCK
-
-
-
-
-
-
-
-SANDSTONE
-
-public static final Block SANDSTONE
-
-
-
-
-
-
-
-BED
-
-public static final Block BED
-
-
-
-
-
-
-
-COBWEB
-
-public static final Block COBWEB
-
-
-
-
-
-
-
-GRASS_TALL
-
-public static final Block GRASS_TALL
-
-
-
-
-
-
-
-WOOL
-
-public static final Block WOOL
-
-
-
-
-
-
-
-FLOWER_YELLOW
-
-public static final Block FLOWER_YELLOW
-
-
-
-
-
-
-
-FLOWER_CYAN
-
-public static final Block FLOWER_CYAN
-
-
-
-
-
-
-
-MUSHROOM_BROWN
-
-public static final Block MUSHROOM_BROWN
-
-
-
-
-
-
-
-MUSHROOM_RED
-
-public static final Block MUSHROOM_RED
-
-
-
-
-
-
-
-GOLD_BLOCK
-
-public static final Block GOLD_BLOCK
-
-
-
-
-
-
-
-IRON_BLOCK
-
-public static final Block IRON_BLOCK
-
-
-
-
-
-
-
-STONE_SLAB_DOUBLE
-
-public static final Block STONE_SLAB_DOUBLE
-
-
-
-
-
-
-
-STONE_SLAB
-
-public static final Block STONE_SLAB
-
-
-
-
-
-
-
-BRICK_BLOCK
-
-public static final Block BRICK_BLOCK
-
-
-
-
-
-
-
-TNT
-
-public static final Block TNT
-
-
-
-
-
-
-
-BOOKSHELF
-
-public static final Block BOOKSHELF
-
-
-
-
-
-
-
-MOSS_STONE
-
-public static final Block MOSS_STONE
-
-
-
-
-
-
-
-OBSIDIAN
-
-public static final Block OBSIDIAN
-
-
-
-
-
-
-
-TORCH
-
-public static final Block TORCH
-
-
-
-
-
-
-
-FIRE
-
-public static final Block FIRE
-
-
-
-
-
-
-
-STAIRS_WOOD
-
-public static final Block STAIRS_WOOD
-
-
-
-
-
-
-
-CHEST
-
-public static final Block CHEST
-
-
-
-
-
-
-
-DIAMOND_ORE
-
-public static final Block DIAMOND_ORE
-
-
-
-
-
-
-
-DIAMOND_BLOCK
-
-public static final Block DIAMOND_BLOCK
-
-
-
-
-
-
-
-CRAFTING_TABLE
-
-public static final Block CRAFTING_TABLE
-
-
-
-
-
-
-
-FARMLAND
-
-public static final Block FARMLAND
-
-
-
-
-
-
-
-FURNACE_INACTIVE
-
-public static final Block FURNACE_INACTIVE
-
-
-
-
-
-
-
-FURNACE_ACTIVE
-
-public static final Block FURNACE_ACTIVE
-
-
-
-
-
-
-
-DOOR_WOOD
-
-public static final Block DOOR_WOOD
-
-
-
-
-
-
-
-LADDER
-
-public static final Block LADDER
-
-
-
-
-
-
-
-STAIRS_COBBLESTONE
-
-public static final Block STAIRS_COBBLESTONE
-
-
-
-
-
-
-
-DOOR_IRON
-
-public static final Block DOOR_IRON
-
-
-
-
-
-
-
-REDSTONE_ORE
-
-public static final Block REDSTONE_ORE
-
-
-
-
-
-
-
-SNOW
-
-public static final Block SNOW
-
-
-
-
-
-
-
-ICE
-
-public static final Block ICE
-
-
-
-
-
-
-
-SNOW_BLOCK
-
-public static final Block SNOW_BLOCK
-
-
-
-
-
-
-
-CACTUS
-
-public static final Block CACTUS
-
-
-
-
-
-
-
-CLAY
-
-public static final Block CLAY
-
-
-
-
-
-
-
-SUGAR_CANE
-
-public static final Block SUGAR_CANE
-
-
-
-
-
-
-
-FENCE
-
-public static final Block FENCE
-
-
-
-
-
-
-
-GLOWSTONE_BLOCK
-
-public static final Block GLOWSTONE_BLOCK
-
-
-
-
-
-
-
-BEDROCK_INVISIBLE
-
-public static final Block BEDROCK_INVISIBLE
-
-
-
-
-
-
-
-STONE_BRICK
-
-public static final Block STONE_BRICK
-
-
-
-
-
-
-
-GLASS_PANE
-
-public static final Block GLASS_PANE
-
-
-
-
-
-
-
-MELON
-
-public static final Block MELON
-
-
-
-
-
-
-
-FENCE_GATE
-
-public static final Block FENCE_GATE
-
-
-
-
-
-
-
-GLOWING_OBSIDIAN
-
-public static final Block GLOWING_OBSIDIAN
-
-
-
-
-
-
-
-NETHER_REACTOR_CORE
-
-public static final Block NETHER_REACTOR_CORE
-
-
-
-
-
-
-
-
-
-
-
-id
-
-public static Block id (int id)
-
-Get a block with and withId (use a constant like Block.TNT)
-
-
-
-
-
-
-
-
-withData
-
-public Block withData (int data)
-
-Get a block with extra data
-
-
-
-
-
-
-
-
-hashCode
-
-public int hashCode ()
-
-
-Overrides: hashCode in class Object
-
-
-
-
-
-
-
-
-equals
-
-public boolean equals (Object obj)
-
-
-Overrides: equals in class Object
-
-
-
-
-
-
-
-
-toString
-
-public String toString ()
-
-
-Overrides: toString in class Object
-
-
-
-
-
-
-
-
-wool
-
-public static Block wool (Color color)
-
-Get a wool block of a specific color
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Color.html b/src/main/resources/mcpi/api/java/doc/pi/Color.html
deleted file mode 100644
index 6653a288..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Color.html
+++ /dev/null
@@ -1,437 +0,0 @@
-
-
-
-
-
-
-
-Color (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Enum Color
-
-Object
- Enum<Color >
- pi.Color
-
-
-All Implemented Interfaces: java.io.Serializable, Comparable<Color >
-
-
-
-public enum Color extends Enum<Color >
-
-
-
-Colors
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
-static Color
-valueOf (String name)
-
-
- Returns the enum constant of this type with the specified name.
-
-
-
-static Color []
-values ()
-
-
- Returns an array containing the constants of this enum type, in
-the order they are declared.
-
-
-
-
-
-Methods inherited from class Enum
-
-
-clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
-
-
-
-
-Methods inherited from class Object
-
-
-getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Enum Constant Detail
-
-
-
-
-WHITE
-
-public static final Color WHITE
-
-
-
-
-
-
-
-ORANGE
-
-public static final Color ORANGE
-
-
-
-
-
-
-
-MAGENTA
-
-public static final Color MAGENTA
-
-
-
-
-
-
-
-LIGHT_BLUE
-
-public static final Color LIGHT_BLUE
-
-
-
-
-
-
-
-YELLOW
-
-public static final Color YELLOW
-
-
-
-
-
-
-
-LIME
-
-public static final Color LIME
-
-
-
-
-
-
-
-PINK
-
-public static final Color PINK
-
-
-
-
-
-
-
-GRAY
-
-public static final Color GRAY
-
-
-
-
-
-
-
-LIGHT_GRAY
-
-public static final Color LIGHT_GRAY
-
-
-
-
-
-
-
-CYAN
-
-public static final Color CYAN
-
-
-
-
-
-
-
-PURPLE
-
-public static final Color PURPLE
-
-
-
-
-
-
-
-BLUE
-
-public static final Color BLUE
-
-
-
-
-
-
-
-BROWN
-
-public static final Color BROWN
-
-
-
-
-
-
-
-GREEN
-
-public static final Color GREEN
-
-
-
-
-
-
-
-RED
-
-public static final Color RED
-
-
-
-
-
-
-
-BLACK
-
-public static final Color BLACK
-
-
-
-
-
-
-
-
-
-
-
-values
-
-public static Color [] values ()
-
-Returns an array containing the constants of this enum type, in
-the order they are declared. This method may be used to iterate
-over the constants as follows:
-
-for (Color c : Color.values())
- System.out.println(c);
-
-
-
-
-Returns: an array containing the constants of this enum type, in
-the order they are declared
-
-
-
-
-
-valueOf
-
-public static Color valueOf (String name)
-
-Returns the enum constant of this type with the specified name.
-The string must match exactly an identifier used to declare an
-enum constant in this type. (Extraneous whitespace characters are
-not permitted.)
-
-
-Parameters: name - the name of the enum constant to be returned.
-Returns: the enum constant with the specified name
- Throws:
-IllegalArgumentException - if this enum type has no constant
-with the specified name
-NullPointerException - if the argument is null
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Item.html b/src/main/resources/mcpi/api/java/doc/pi/Item.html
deleted file mode 100644
index 8af6ab07..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Item.html
+++ /dev/null
@@ -1,1129 +0,0 @@
-
-
-
-
-
-
-
-Item (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Item
-
-Object
- pi.Item
-
-
-
-public class Item extends Object
-
-
-
-A Minecraft Item description (no use yet)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- boolean
-equals (Object obj)
-
-
-
-
-
-
- int
-hashCode ()
-
-
-
-
-
-
- String
-toString ()
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-IRON_SHOVEL
-
-public static final Item IRON_SHOVEL
-
-
-
-
-
-
-
-IRON_PICKAXE
-
-public static final Item IRON_PICKAXE
-
-
-
-
-
-
-
-IRON_AXE
-
-public static final Item IRON_AXE
-
-
-
-
-
-
-
-BOW
-
-public static final Item BOW
-
-
-
-
-
-
-
-ARROW
-
-public static final Item ARROW
-
-
-
-
-
-
-
-COAL
-
-public static final Item COAL
-
-
-
-
-
-
-
-DIAMOND
-
-public static final Item DIAMOND
-
-
-
-
-
-
-
-IRON_INGOT
-
-public static final Item IRON_INGOT
-
-
-
-
-
-
-
-GOLD_INGOT
-
-public static final Item GOLD_INGOT
-
-
-
-
-
-
-
-IRON_SWORD
-
-public static final Item IRON_SWORD
-
-
-
-
-
-
-
-WOODEN_SWORD
-
-public static final Item WOODEN_SWORD
-
-
-
-
-
-
-
-WOODEN_SHOVEL
-
-public static final Item WOODEN_SHOVEL
-
-
-
-
-
-
-
-WOODEN_PICKAXE
-
-public static final Item WOODEN_PICKAXE
-
-
-
-
-
-
-
-WOODEN_AXE
-
-public static final Item WOODEN_AXE
-
-
-
-
-
-
-
-STONE_SWORD
-
-public static final Item STONE_SWORD
-
-
-
-
-
-
-
-STONE_SHOVEL
-
-public static final Item STONE_SHOVEL
-
-
-
-
-
-
-
-STONE_PICKAXE
-
-public static final Item STONE_PICKAXE
-
-
-
-
-
-
-
-STONE_AXE
-
-public static final Item STONE_AXE
-
-
-
-
-
-
-
-DIAMOND_SWORD
-
-public static final Item DIAMOND_SWORD
-
-
-
-
-
-
-
-DIAMOND_SHOVEL
-
-public static final Item DIAMOND_SHOVEL
-
-
-
-
-
-
-
-DIAMOND_PICKAXE
-
-public static final Item DIAMOND_PICKAXE
-
-
-
-
-
-
-
-DIAMOND_AXE
-
-public static final Item DIAMOND_AXE
-
-
-
-
-
-
-
-STICK
-
-public static final Item STICK
-
-
-
-
-
-
-
-BOWL
-
-public static final Item BOWL
-
-
-
-
-
-
-
-GOLD_SWORD
-
-public static final Item GOLD_SWORD
-
-
-
-
-
-
-
-GOLD_SHOVEL
-
-public static final Item GOLD_SHOVEL
-
-
-
-
-
-
-
-GOLD_PICKAXE
-
-public static final Item GOLD_PICKAXE
-
-
-
-
-
-
-
-GOLD_AXE
-
-public static final Item GOLD_AXE
-
-
-
-
-
-
-
-STRING
-
-public static final Item STRING
-
-
-
-
-
-
-
-FEATHER
-
-public static final Item FEATHER
-
-
-
-
-
-
-
-GUNPOWDER
-
-public static final Item GUNPOWDER
-
-
-
-
-
-
-
-FLINT
-
-public static final Item FLINT
-
-
-
-
-
-
-
-WHEAT
-
-public static final Item WHEAT
-
-
-
-
-
-
-
-SIGN
-
-public static final Item SIGN
-
-
-
-
-
-
-
-WOODEN_DOOR
-
-public static final Item WOODEN_DOOR
-
-
-
-
-
-
-
-IRON_DOOR
-
-public static final Item IRON_DOOR
-
-
-
-
-
-
-
-SNOWBALL
-
-public static final Item SNOWBALL
-
-
-
-
-
-
-
-LEATHER
-
-public static final Item LEATHER
-
-
-
-
-
-
-
-CLAY_BRICK
-
-public static final Item CLAY_BRICK
-
-
-
-
-
-
-
-CLAY
-
-public static final Item CLAY
-
-
-
-
-
-
-
-SUGAR_CANE
-
-public static final Item SUGAR_CANE
-
-
-
-
-
-
-
-PAPER
-
-public static final Item PAPER
-
-
-
-
-
-
-
-BOOK
-
-public static final Item BOOK
-
-
-
-
-
-
-
-SLIMEBALL
-
-public static final Item SLIMEBALL
-
-
-
-
-
-
-
-EGG
-
-public static final Item EGG
-
-
-
-
-
-
-
-COMPASS
-
-public static final Item COMPASS
-
-
-
-
-
-
-
-CLOCK
-
-public static final Item CLOCK
-
-
-
-
-
-
-
-GLOWSTONE_DUST
-
-public static final Item GLOWSTONE_DUST
-
-
-
-
-
-
-
-DYE
-
-public static final Item DYE
-
-
-
-
-
-
-
-BONE
-
-public static final Item BONE
-
-
-
-
-
-
-
-SUGAR
-
-public static final Item SUGAR
-
-
-
-
-
-
-
-SHEARS
-
-public static final Item SHEARS
-
-
-
-
-
-
-
-CAMERA
-
-public static final Item CAMERA
-
-
-
-
-
-
-
-
-
-
-
-hashCode
-
-public int hashCode ()
-
-
-Overrides: hashCode in class Object
-
-
-
-
-
-
-
-
-equals
-
-public boolean equals (Object obj)
-
-
-Overrides: equals in class Object
-
-
-
-
-
-
-
-
-toString
-
-public String toString ()
-
-
-Overrides: toString in class Object
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Camera.html b/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Camera.html
deleted file mode 100644
index c928199c..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Camera.html
+++ /dev/null
@@ -1,241 +0,0 @@
-
-
-
-
-
-
-
-Minecraft.Camera (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Minecraft.Camera
-
-Object
- pi.Minecraft.Camera
-
-
-Enclosing class: Minecraft
-
-
-
-public class Minecraft.Camera extends Object
-
-
-
-Control the camera in the game we're connected to
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-Minecraft.Camera
-
-public Minecraft.Camera ()
-
-
-
-
-
-
-
-
-
-setNormal
-
-public void setNormal ()
-
-
-
-
-
-
-
-
-setNormal
-
-public void setNormal (int mobEntityId)
-
-
-
-
-
-
-
-
-setThirdPerson
-
-public void setThirdPerson ()
-
-
-
-
-
-
-
-
-setThirdPerson
-
-public void setThirdPerson (int entityId)
-
-
-
-
-
-
-
-
-setFixed
-
-public void setFixed ()
-
-
-
-
-
-
-
-
-setPosition
-
-public void setPosition (VecFloat position)
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Entities.html b/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Entities.html
deleted file mode 100644
index 4abd09ac..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Entities.html
+++ /dev/null
@@ -1,205 +0,0 @@
-
-
-
-
-
-
-
-Minecraft.Entities (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Minecraft.Entities
-
-Object
- pi.Minecraft.Entities
-
-
-Enclosing class: Minecraft
-
-
-
-public class Minecraft.Entities extends Object
-
-
-
-Methods for entities
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-Minecraft.Entities
-
-public Minecraft.Entities ()
-
-
-
-
-
-
-
-
-
-getPosition
-
-public Vec getPosition (int entityId)
-
-
-
-
-
-
-
-
-setPosition
-
-public void setPosition (int entityId,
- Vec tile)
-
-
-
-
-
-
-
-
-getExactPosition
-
-public VecFloat getExactPosition (int entityId)
-
-
-
-
-
-
-
-
-setExactPosition
-
-public void setExactPosition (VecFloat pos)
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Events.html b/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Events.html
deleted file mode 100644
index 420a1cd6..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Events.html
+++ /dev/null
@@ -1,169 +0,0 @@
-
-
-
-
-
-
-
-Minecraft.Events (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Minecraft.Events
-
-Object
- pi.Minecraft.Events
-
-
-Enclosing class: Minecraft
-
-
-
-public class Minecraft.Events extends Object
-
-
-
-Events
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-Minecraft.Events
-
-public Minecraft.Events ()
-
-
-
-
-
-
-
-
-
-clearAll
-
-public void clearAll ()
-
-Clear all old events
-
-
-
-
-
-
-
-
-pollBlockHits
-
-public List<BlockHitEvent > pollBlockHits ()
-
-Only triggered by sword
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Player.html b/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Player.html
deleted file mode 100644
index d3a11cbd..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.Player.html
+++ /dev/null
@@ -1,230 +0,0 @@
-
-
-
-
-
-
-
-Minecraft.Player (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Minecraft.Player
-
-Object
- pi.Minecraft.Player
-
-
-Enclosing class: Minecraft
-
-
-
-public class Minecraft.Player extends Object
-
-
-
-Methods for the player in the connected game
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-Minecraft.Player
-
-public Minecraft.Player ()
-
-
-
-
-
-
-
-
-
-getPosition
-
-public Vec getPosition ()
-
-
-
-
-
-
-
-
-setPosition
-
-public void setPosition (Vec position)
-
-
-
-
-
-
-
-
-getExactPosition
-
-public VecFloat getExactPosition ()
-
-
-
-
-
-
-
-
-setExactPosition
-
-public void setExactPosition (VecFloat position)
-
-
-
-
-
-
-
-
-setting
-
-public void setting (String key,
- boolean value)
-
-Keys: autojump, Values: true/false For example to disable
- automatic jumping:
- mc.player.setting("autojump", false);
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.html b/src/main/resources/mcpi/api/java/doc/pi/Minecraft.html
deleted file mode 100644
index c8f81e52..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Minecraft.html
+++ /dev/null
@@ -1,657 +0,0 @@
-
-
-
-
-
-
-
-Minecraft (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Minecraft
-
-Object
- 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)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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
-
-
-
-
-
-
-
-
-
-
-
-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
-
-
-
-
-
-
-
-
-
-
-
-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
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Vec.Unit.html b/src/main/resources/mcpi/api/java/doc/pi/Vec.Unit.html
deleted file mode 100644
index 3b8dc399..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Vec.Unit.html
+++ /dev/null
@@ -1,229 +0,0 @@
-
-
-
-
-
-
-
-Vec.Unit (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Vec.Unit
-
-Object
- pi.Vec
- pi.Vec.Unit
-
-
-Enclosing class: Vec
-
-
-
-public static class Vec.Unit extends Vec
-
-
-
-A vector with length=1
-
-
-
-
-
-
-
-
-
-
-
-
-Nested Class Summary
-
-
-
-
-
-Nested classes/interfaces inherited from class pi.Vec
-
-
-Vec.Unit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- Vec.Unit
-neg ()
-
-
- Negate (multiply with -1)
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-X
-
-public static final Vec.Unit X
-
-
-
-
-
-
-
-Y
-
-public static final Vec.Unit Y
-
-
-
-
-
-
-
-Z
-
-public static final Vec.Unit Z
-
-
-
-
-
-
-
-
-
-
-
-neg
-
-public Vec.Unit neg ()
-
-Description copied from class: Vec
-Negate (multiply with -1)
-
-
-Overrides: neg in class Vec
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/Vec.html b/src/main/resources/mcpi/api/java/doc/pi/Vec.html
deleted file mode 100644
index 4f3e7f23..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/Vec.html
+++ /dev/null
@@ -1,454 +0,0 @@
-
-
-
-
-
-
-
-Vec (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class Vec
-
-Object
- pi.Vec
-
-
-Direct Known Subclasses: Vec.Unit
-
-
-
-public class Vec extends Object
-
-
-
-
-
-
-
-
-
-
-
-
-Nested Class Summary
-
-
-
-static class
-Vec.Unit
-
-
- A vector with length=1
-
-
-
-
-
-
-
-
-Field Summary
-
-
-
-static int
-MAX_Y
-
-
-
-
-
-
-static int
-MIN_Y
-
-
-
-
-
-
- int
-x
-
-
-
-
-
-
- int
-y
-
-
-
-
-
-
- int
-z
-
-
-
-
-
-
-static Vec
-ZERO
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- Vec
-add (int x,
- int y,
- int z)
-
-
- Add
-
-
-
- Vec
-add (Vec v)
-
-
- Add
-
-
-
- int
-dot (Vec v)
-
-
- Scalar product
-
-
-
- boolean
-equals (Object obj)
-
-
-
-
-
-
- int
-hashCode ()
-
-
-
-
-
-
- Vec
-mul (int s)
-
-
- Multiply with integer (scale)
-
-
-
- Vec
-neg ()
-
-
- Negate (multiply with -1)
-
-
-
- Vec
-sub (Vec v)
-
-
- Subtract
-
-
-
- String
-toString ()
-
-
-
-
-
-
-static Vec
-xyz (int x,
- int y,
- int z)
-
-
- Create
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-ZERO
-
-public static final Vec ZERO
-
-
-
-
-
-
-
-MIN_Y
-
-public static final int MIN_Y
-
-
-See Also: Constant Field Values
-
-
-
-
-MAX_Y
-
-public static final int MAX_Y
-
-
-See Also: Constant Field Values
-
-
-
-
-x
-
-public final int x
-
-
-
-
-
-
-
-y
-
-public final int y
-
-
-
-
-
-
-
-z
-
-public final int z
-
-
-
-
-
-
-
-
-
-
-
-xyz
-
-public static Vec xyz (int x,
- int y,
- int z)
-
-Create
-
-
-
-
-
-
-
-
-add
-
-public Vec add (Vec v)
-
-Add
-
-
-
-
-
-
-
-
-add
-
-public Vec add (int x,
- int y,
- int z)
-
-Add
-
-
-
-
-
-
-
-
-sub
-
-public Vec sub (Vec v)
-
-Subtract
-
-
-
-
-
-
-
-
-mul
-
-public Vec mul (int s)
-
-Multiply with integer (scale)
-
-
-
-
-
-
-
-
-neg
-
-public Vec neg ()
-
-Negate (multiply with -1)
-
-
-
-
-
-
-
-
-dot
-
-public int dot (Vec v)
-
-Scalar product
-
-
-
-
-
-
-
-
-hashCode
-
-public int hashCode ()
-
-
-Overrides: hashCode in class Object
-
-
-
-
-
-
-
-
-equals
-
-public boolean equals (Object obj)
-
-
-Overrides: equals in class Object
-
-
-
-
-
-
-
-
-toString
-
-public final String toString ()
-
-
-Overrides: toString in class Object
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/VecFloat.html b/src/main/resources/mcpi/api/java/doc/pi/VecFloat.html
deleted file mode 100644
index 9af17a07..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/VecFloat.html
+++ /dev/null
@@ -1,396 +0,0 @@
-
-
-
-
-
-
-
-VecFloat (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-Class VecFloat
-
-Object
- pi.VecFloat
-
-
-
-public class VecFloat extends Object
-
-
-
-A vector of three floats
-
-
-
-
-
-
-
-
-
-
-
-
-Field Summary
-
-
-
- float
-x
-
-
-
-
-
-
- float
-y
-
-
-
-
-
-
- float
-z
-
-
-
-
-
-
-static VecFloat
-ZERO
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-ZERO
-
-public static final VecFloat ZERO
-
-
-
-
-
-
-
-x
-
-public final float x
-
-
-
-
-
-
-
-y
-
-public final float y
-
-
-
-
-
-
-
-z
-
-public final float z
-
-
-
-
-
-
-
-
-
-
-
-xyz
-
-public static VecFloat xyz (float x,
- float y,
- float z)
-
-Create
-
-
-
-
-
-
-
-
-add
-
-public VecFloat add (VecFloat v)
-
-Add
-
-
-
-
-
-
-
-
-sub
-
-public VecFloat sub (VecFloat v)
-
-Subtract
-
-
-
-
-
-
-
-
-mul
-
-public VecFloat mul (float s)
-
-Multiply with a float (scale)
-
-
-
-
-
-
-
-
-neg
-
-public VecFloat neg ()
-
-Negate (multiply with -1)
-
-
-
-
-
-
-
-
-dot
-
-public float dot (VecFloat v)
-
-Scalar product
-
-
-
-
-
-
-
-
-normalized
-
-public VecFloat normalized ()
-
-Get a vector in the same direction but with length 1
-
-
-
-
-
-
-
-
-length
-
-public float length ()
-
-Length
-
-
-
-
-
-
-
-
-lengthSq
-
-public float lengthSq ()
-
-length * length
-
-
-
-
-
-
-
-
-toString
-
-public final String toString ()
-
-
-Overrides: toString in class Object
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Block.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Block.html
deleted file mode 100644
index de665e53..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Block.html
+++ /dev/null
@@ -1,784 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Block (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Block
-
-
-
-
-
-Packages that use Block
-
-
-pi
-Protocol classes
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods in pi that return Block
-
-
-
- Block
-Minecraft. getBlock (Vec position)
-
-
- Get a block
-
-
-
- Block
-Minecraft. getBlockWithData (Vec position)
-
-
- Get a block
-
-
-
-static Block
-Block. id (int id)
-
-
- Get a block with and withId (use a constant like Block.TNT)
-
-
-
- Block
-Block. withData (int data)
-
-
- Get a block with extra data
-
-
-
-static Block
-Block. wool (Color color)
-
-
- Get a wool block of a specific color
-
-
-
-
-
-
-
-Methods in pi with parameters of type Block
-
-
-
- void
-Minecraft. setBlock (int x,
- int y,
- int z,
- Block block)
-
-
- Set a block
-
-
-
- void
-Minecraft. setBlock (Vec position,
- Block block)
-
-
- Set a block
-
-
-
- void
-Minecraft. setBlocks (int x1,
- int y1,
- int z1,
- int x2,
- int y2,
- int z2,
- Block block)
-
-
- Set a cuboid of blocks
-
-
-
- void
-Minecraft. setBlocks (Vec begin,
- Vec end,
- Block block)
-
-
- Set a cuboid of blocks
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Color.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Color.html
deleted file mode 100644
index 52dedabd..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Color.html
+++ /dev/null
@@ -1,104 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Color (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Color
-
-
-
-
-
-Packages that use Color
-
-
-pi
-Protocol classes
-
-
-
-
-
-
-
-
-
-
-
-Methods in pi that return Color
-
-
-
-static Color
-Color. valueOf (String name)
-
-
- Returns the enum constant of this type with the specified name.
-
-
-
-static Color []
-Color. values ()
-
-
- Returns an array containing the constants of this enum type, in
-the order they are declared.
-
-
-
-
-
-
-
-Methods in pi with parameters of type Color
-
-
-
-static Block
-Block. wool (Color color)
-
-
- Get a wool block of a specific color
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Item.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Item.html
deleted file mode 100644
index 5056a350..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Item.html
+++ /dev/null
@@ -1,495 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Item (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Item
-
-
-
-
-
-Packages that use Item
-
-
-pi
-Protocol classes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Camera.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Camera.html
deleted file mode 100644
index 14cf6f2f..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Camera.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft.Camera (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft.Camera
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Entities.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Entities.html
deleted file mode 100644
index 0e43eba0..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Entities.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft.Entities (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft.Entities
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Events.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Events.html
deleted file mode 100644
index e7fa858e..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Events.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft.Events (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft.Events
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Player.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Player.html
deleted file mode 100644
index d0c09500..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.Player.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft.Player (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft.Player
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.html
deleted file mode 100644
index 59e541d1..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Minecraft.html
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Minecraft
-
-
-
-
-
-Packages that use Minecraft
-
-
-pi
-Protocol classes
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-
-
-
-Methods in pi that return Minecraft
-
-
-
-static Minecraft
-Minecraft. connect ()
-
-
- Connect to a local mcpi game
-
-
-
-static Minecraft
-Minecraft. connect (String host)
-
-
- Connect to a remote mcpi game
-
-
-
-static Minecraft
-Minecraft. connect (String[] args)
-
-
- Connect with string args
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Vec.Unit.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Vec.Unit.html
deleted file mode 100644
index 24c33218..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Vec.Unit.html
+++ /dev/null
@@ -1,186 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Vec.Unit (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Vec.Unit
-
-
-
-
-
-Packages that use Vec.Unit
-
-
-pi
-Protocol classes
-
-
-pi.event
-Use to react on events in the game
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/Vec.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/Vec.html
deleted file mode 100644
index db032020..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/Vec.html
+++ /dev/null
@@ -1,343 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.Vec (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.Vec
-
-
-
-
-
-Packages that use Vec
-
-
-pi
-Protocol classes
-
-
-pi.event
-Use to react on events in the game
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-Uses of Vec in pi
-
-
-
-
-
-
-
-Subclasses of Vec in pi
-
-
-
-static class
-Vec.Unit
-
-
- A vector with length=1
-
-
-
-
-
-
-
-Fields in pi declared as Vec
-
-
-
-static Vec
-Vec. ZERO
-
-
-
-
-
-
-
-
-
-
-Methods in pi that return Vec
-
-
-
- Vec
-Vec. add (int x,
- int y,
- int z)
-
-
- Add
-
-
-
- Vec
-Vec. add (Vec v)
-
-
- Add
-
-
-
- Vec
-Minecraft.Player. getPosition ()
-
-
-
-
-
-
- Vec
-Minecraft.Entities. getPosition (int entityId)
-
-
-
-
-
-
- Vec
-Vec. mul (int s)
-
-
- Multiply with integer (scale)
-
-
-
- Vec
-Vec. neg ()
-
-
- Negate (multiply with -1)
-
-
-
- Vec
-Vec. sub (Vec v)
-
-
- Subtract
-
-
-
-static Vec
-Vec. xyz (int x,
- int y,
- int z)
-
-
- Create
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods in pi.tool with parameters of type Vec
-
-
-
- Text
-Text. at (Vec pos)
-
-
- Set the position of the text
-
-
-
- Turtle
-Turtle. setHome (Vec home)
-
-
- Set the turtle setHome pos
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/class-use/VecFloat.html b/src/main/resources/mcpi/api/java/doc/pi/class-use/VecFloat.html
deleted file mode 100644
index e4d39ec0..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/class-use/VecFloat.html
+++ /dev/null
@@ -1,209 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.VecFloat (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.VecFloat
-
-
-
-
-
-Packages that use VecFloat
-
-
-pi
-Protocol classes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/event/BlockEvent.html b/src/main/resources/mcpi/api/java/doc/pi/event/BlockEvent.html
deleted file mode 100644
index b8d78fdd..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/event/BlockEvent.html
+++ /dev/null
@@ -1,150 +0,0 @@
-
-
-
-
-
-
-
-BlockEvent (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi.event
-
-Class BlockEvent
-
-Object
- pi.event.BlockEvent
-
-
-Direct Known Subclasses: BlockHitEvent
-
-
-
-public abstract class BlockEvent extends Object
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-position
-
-public final Vec position
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-BlockEvent
-
-public BlockEvent (Vec position)
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/event/BlockHitEvent.html b/src/main/resources/mcpi/api/java/doc/pi/event/BlockHitEvent.html
deleted file mode 100644
index 59a030e4..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/event/BlockHitEvent.html
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
-
-
-
-
-BlockHitEvent (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi.event
-
-Class BlockHitEvent
-
-Object
- pi.event.BlockEvent
- pi.event.BlockHitEvent
-
-
-
-public class BlockHitEvent extends BlockEvent
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-surfaceDirection
-
-public final Vec.Unit surfaceDirection
-
-
-
-
-
-
-
-entityId
-
-public final int entityId
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-BlockHitEvent
-
-public BlockHitEvent (Vec position,
- Vec.Unit surfaceDirection,
- int entityId)
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/event/class-use/BlockEvent.html b/src/main/resources/mcpi/api/java/doc/pi/event/class-use/BlockEvent.html
deleted file mode 100644
index 4b7389af..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/event/class-use/BlockEvent.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.event.BlockEvent (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.event.BlockEvent
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/event/class-use/BlockHitEvent.html b/src/main/resources/mcpi/api/java/doc/pi/event/class-use/BlockHitEvent.html
deleted file mode 100644
index a3d94aca..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/event/class-use/BlockHitEvent.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.event.BlockHitEvent (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.event.BlockHitEvent
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/event/package-frame.html b/src/main/resources/mcpi/api/java/doc/pi/event/package-frame.html
deleted file mode 100644
index 76bd981c..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/event/package-frame.html
+++ /dev/null
@@ -1,35 +0,0 @@
-
-
-
-
-
-
-
-pi.event (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-pi.event
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/event/package-summary.html b/src/main/resources/mcpi/api/java/doc/pi/event/package-summary.html
deleted file mode 100644
index 0e489423..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/event/package-summary.html
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-
-
-
-
-
-pi.event (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Package pi.event
-
-Use to react on events in the game
-
-See:
-
- Description
-
-
-
-
-
-
-
-Package pi.event Description
-
-
-
-Use to react on events in the game
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/event/package-use.html b/src/main/resources/mcpi/api/java/doc/pi/event/package-use.html
deleted file mode 100644
index 7da764e1..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/event/package-use.html
+++ /dev/null
@@ -1,88 +0,0 @@
-
-
-
-
-
-
-
-Uses of Package pi.event (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Package pi.event
-
-
-
-
-
-Packages that use pi.event
-
-
-pi
-Protocol classes
-
-
-pi.event
-Use to react on events in the game
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/package-frame.html b/src/main/resources/mcpi/api/java/doc/pi/package-frame.html
deleted file mode 100644
index 0949c8d1..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/package-frame.html
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
-
-
-
-
-
-pi (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-pi
-
-
-
-
-
-
-Enums
-
-
-Color
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/package-summary.html b/src/main/resources/mcpi/api/java/doc/pi/package-summary.html
deleted file mode 100644
index 663c2c38..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/package-summary.html
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-pi (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Package pi
-
-Protocol classes
-
-See:
-
- Description
-
-
-
-
-
-Class Summary
-
-
-Block
-A Minecraft Block description
-
-
-Item
-A Minecraft Item description (no use yet)
-
-
-Minecraft
-The main class to interact with a running instance of Minecraft Pi.
-
-
-Vec
-
-
-
-Vec.Unit
-A vector with length=1
-
-
-VecFloat
-A vector of three floats
-
-
-
-
-
-
-
-
-
-Enum Summary
-
-
-Color
-Colors
-
-
-
-
-
-
-Package pi Description
-
-
-
-Protocol classes
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/package-use.html b/src/main/resources/mcpi/api/java/doc/pi/package-use.html
deleted file mode 100644
index 7bab0764..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/package-use.html
+++ /dev/null
@@ -1,191 +0,0 @@
-
-
-
-
-
-
-
-Uses of Package pi (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Package pi
-
-
-
-
-
-Packages that use pi
-
-
-pi
-Protocol classes
-
-
-pi.event
-Use to react on events in the game
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-Classes in pi used by pi
-
-
-Block
-
-
- A Minecraft Block description
-
-
-Color
-
-
- Colors
-
-
-Item
-
-
- A Minecraft Item description (no use yet)
-
-
-Minecraft
-
-
- The main class to interact with a running instance of Minecraft Pi.
-
-
-Minecraft.Camera
-
-
- Control the camera in the game we're connected to
-
-
-Minecraft.Entities
-
-
- Methods for entities
-
-
-Minecraft.Events
-
-
- Events
-
-
-Minecraft.Player
-
-
- Methods for the player in the connected game
-
-
-Vec
-
-
-
-
-
-Vec.Unit
-
-
- A vector with length=1
-
-
-VecFloat
-
-
- A vector of three floats
-
-
-
-
-
-
-
-
-
-
-
-
-Classes in pi used by pi.tool
-
-
-Block
-
-
- A Minecraft Block description
-
-
-Minecraft
-
-
- The main class to interact with a running instance of Minecraft Pi.
-
-
-Vec
-
-
-
-
-
-Vec.Unit
-
-
- A vector with length=1
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/Text.html b/src/main/resources/mcpi/api/java/doc/pi/tool/Text.html
deleted file mode 100644
index e88fd0c5..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/Text.html
+++ /dev/null
@@ -1,203 +0,0 @@
-
-
-
-
-
-
-
-Text (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi.tool
-
-Class Text
-
-Object
- pi.tool.Text
-
-
-
-public class Text extends Object
-
-
-
-A tool to draw text in the Minecraft world. Example:
-
- text.with("Arial", 18).xyz2(Vec.xyz(0, 2, 0)).draw("Hello, world!").
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Method Summary
-
-
-
- Text
-at (Vec pos)
-
-
- Set the position of the text
-
-
-
- void
-draw (String text)
-
-
- Draw a text with the current settings in the Minecraft world
-
-
-
- Text
-with (Block block)
-
-
- Set the block type to use for drawing
-
-
-
- Text
-with (String fontName,
- int fontSizeInPoints)
-
-
- Set the font
-
-
-
- Text
-withOrientation (Vec.Unit u,
- Vec.Unit v)
-
-
- Set the orientation of the text
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-at
-
-public Text at (Vec pos)
-
-Set the position of the text
-
-
-
-
-
-
-
-
-with
-
-public Text with (Block block)
-
-Set the block type to use for drawing
-
-
-
-
-
-
-
-
-with
-
-public Text with (String fontName,
- int fontSizeInPoints)
-
-Set the font
-
-
-
-
-
-
-
-
-withOrientation
-
-public Text withOrientation (Vec.Unit u,
- Vec.Unit v)
-
-Set the orientation of the text
-
-
-
-
-
-
-
-
-draw
-
-public void draw (String text)
-
-Draw a text with the current settings in the Minecraft world
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/Tools.html b/src/main/resources/mcpi/api/java/doc/pi/tool/Tools.html
deleted file mode 100644
index 17b8ae01..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/Tools.html
+++ /dev/null
@@ -1,165 +0,0 @@
-
-
-
-
-
-
-
-Tools (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi.tool
-
-Class Tools
-
-Object
- pi.tool.Tools
-
-
-
-public class Tools extends Object
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-text
-
-public final Text text
-
-
-
-
-
-
-
-turtle
-
-public final Turtle turtle
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-Tools
-
-public Tools (Minecraft world)
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/Turtle.html b/src/main/resources/mcpi/api/java/doc/pi/tool/Turtle.html
deleted file mode 100644
index 5d7c3035..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/Turtle.html
+++ /dev/null
@@ -1,391 +0,0 @@
-
-
-
-
-
-
-
-Turtle (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-pi.tool
-
-Class Turtle
-
-Object
- pi.tool.Turtle
-
-
-
-public class Turtle extends Object
-
-
-
-A turtle that can be used for shouldPlaceBlock
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods inherited from class Object
-
-
-clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
-
-
-
-
-
-
-
-Constructor Detail
-
-
-
-
-Turtle
-
-public Turtle (Minecraft mc)
-
-
-
-
-
-
-
-
-
-setHome
-
-public Turtle setHome (Vec home)
-
-Set the turtle setHome pos
-
-
-
-
-
-
-
-
-home
-
-public Turtle home ()
-
-Move the turtle to setHome with default orientation
-
-
-
-
-
-
-
-
-on
-
-public Turtle on ()
-
-Start shouldPlaceBlock
-
-
-
-
-
-
-
-
-off
-
-public Turtle off ()
-
-Stop shouldPlaceBlock
-
-
-
-
-
-
-
-
-block
-
-public Turtle block (Block block)
-
-
-
-
-
-
-
-
-jump
-
-public Turtle jump (int dx,
- int dy,
- int dz)
-
-Jump without placing blocks
-
-
-
-
-
-
-
-
-left
-
-public Turtle left ()
-
-Turn 90 degrees CCW
-
-
-
-
-
-
-
-
-right
-
-public Turtle right ()
-
-Turn 90 degrees CW
-
-
-
-
-
-
-
-
-around
-
-public Turtle around ()
-
-Turn 180 degrees
-
-
-
-
-
-
-
-
-forward
-
-public Turtle forward (int steps)
-
-
-
-
-
-
-
-
-back
-
-public Turtle back (int steps)
-
-
-
-
-
-
-
-
-up
-
-public Turtle up (int steps)
-
-
-
-
-
-
-
-
-down
-
-public Turtle down (int steps)
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Text.html b/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Text.html
deleted file mode 100644
index 74dd48c4..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Text.html
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.tool.Text (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.tool.Text
-
-
-
-
-
-Packages that use Text
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Tools.html b/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Tools.html
deleted file mode 100644
index 53c19791..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Tools.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.tool.Tools (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.tool.Tools
-
-
-
-
-
-Packages that use Tools
-
-
-pi
-Protocol classes
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Turtle.html b/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Turtle.html
deleted file mode 100644
index 062c1b13..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/class-use/Turtle.html
+++ /dev/null
@@ -1,193 +0,0 @@
-
-
-
-
-
-
-
-Uses of Class pi.tool.Turtle (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Class pi.tool.Turtle
-
-
-
-
-
-Packages that use Turtle
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Methods in pi.tool that return Turtle
-
-
-
- Turtle
-Turtle. around ()
-
-
- Turn 180 degrees
-
-
-
- Turtle
-Turtle. back (int steps)
-
-
-
-
-
-
- Turtle
-Turtle. block (Block block)
-
-
-
-
-
-
- Turtle
-Turtle. down (int steps)
-
-
-
-
-
-
- Turtle
-Turtle. forward (int steps)
-
-
-
-
-
-
- Turtle
-Turtle. home ()
-
-
- Move the turtle to setHome with default orientation
-
-
-
- Turtle
-Turtle. jump (int dx,
- int dy,
- int dz)
-
-
- Jump without placing blocks
-
-
-
- Turtle
-Turtle. left ()
-
-
- Turn 90 degrees CCW
-
-
-
- Turtle
-Turtle. off ()
-
-
- Stop shouldPlaceBlock
-
-
-
- Turtle
-Turtle. on ()
-
-
- Start shouldPlaceBlock
-
-
-
- Turtle
-Turtle. right ()
-
-
- Turn 90 degrees CW
-
-
-
- Turtle
-Turtle. setHome (Vec home)
-
-
- Set the turtle setHome pos
-
-
-
- Turtle
-Turtle. up (int steps)
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/package-frame.html b/src/main/resources/mcpi/api/java/doc/pi/tool/package-frame.html
deleted file mode 100644
index 8e4c377e..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/package-frame.html
+++ /dev/null
@@ -1,37 +0,0 @@
-
-
-
-
-
-
-
-pi.tool (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-pi.tool
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/package-summary.html b/src/main/resources/mcpi/api/java/doc/pi/tool/package-summary.html
deleted file mode 100644
index 34dd19b7..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/package-summary.html
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-pi.tool (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Package pi.tool
-
-Tools with higher level functionality
-
-See:
-
- Description
-
-
-
-
-
-Class Summary
-
-
-Text
-A tool to draw text in the Minecraft world.
-
-
-Tools
-
-
-
-Turtle
-A turtle that can be used for shouldPlaceBlock
-
-
-
-
-
-
-Package pi.tool Description
-
-
-
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/pi/tool/package-use.html b/src/main/resources/mcpi/api/java/doc/pi/tool/package-use.html
deleted file mode 100644
index 991e292b..00000000
--- a/src/main/resources/mcpi/api/java/doc/pi/tool/package-use.html
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
-
-
-Uses of Package pi.tool (Minecraft Pi Edition, Java API)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-Uses of Package pi.tool
-
-
-
-
-
-Packages that use pi.tool
-
-
-pi
-Protocol classes
-
-
-pi.tool
-Tools with higher level functionality
-
-
-
-
-
-
-
-
-
-
-
-
-Classes in pi.tool used by pi.tool
-
-
-Text
-
-
- A tool to draw text in the Minecraft world.
-
-
-Turtle
-
-
- A turtle that can be used for shouldPlaceBlock
-
-
-
-
-
-
-
-
-
-
diff --git a/src/main/resources/mcpi/api/java/doc/resources/inherit.gif b/src/main/resources/mcpi/api/java/doc/resources/inherit.gif
deleted file mode 100644
index c814867a..00000000
Binary files a/src/main/resources/mcpi/api/java/doc/resources/inherit.gif and /dev/null differ
diff --git a/src/main/resources/mcpi/api/java/doc/stylesheet.css b/src/main/resources/mcpi/api/java/doc/stylesheet.css
deleted file mode 100644
index 58651373..00000000
--- a/src/main/resources/mcpi/api/java/doc/stylesheet.css
+++ /dev/null
@@ -1,602 +0,0 @@
-body {
- background-color: #ffffff;
- color: #333;
- font-family: "Helvetica", "Arial", sans-serif;
- font-size: 100%;
- margin: 0;
-}
-
-a:link, a:visited {
- text-decoration: none;
- color: #4c6b87;
-}
-
-a:hover, a:focus {
- text-decoration: none;
- color: #bb7a2a;
-}
-
-a:active {
- text-decoration: none;
- color: #4c6b87;
-}
-
-a[name] {
- color: #353833;
-}
-
-a[name]:hover {
- text-decoration: none;
- color: #353833;
-}
-
-pre {
- font-size: 1.3em;
-}
-
-h1 {
- font-size: 1.8em;
-}
-
-h2 {
- font-size: 1.5em;
-}
-
-h3 {
- font-size: 1.4em;
-}
-
-h4 {
- font-size: 1.3em;
-}
-
-h5 {
- font-size: 1.2em;
-}
-
-h6 {
- font-size: 1.1em;
-}
-
-ul {
- list-style-type: disc;
-}
-
-code, tt {
- font-size: 1.2em;
-}
-
-dt code {
- font-size: 1.2em;
-}
-
-table tr td dt code {
- font-size: 1.2em;
- vertical-align: top;
-}
-
-sup {
- font-size: .6em;
-}
-
-/*
-Document title and Copyright styles
-*/
-
-.clear {
- clear: both;
- height: 0px;
- overflow: hidden;
-}
-
-.aboutLanguage {
- float: right;
- padding: 0px 21px;
- font-size: .8em;
- z-index: 200;
- margin-top: -7px;
-}
-
-.legalCopy {
- margin-left: .5em;
-}
-
-.bar a, .bar a:link, .bar a:visited, .bar a:active {
- color: #FFFFFF;
- text-decoration: none;
-}
-
-.bar a:hover, .bar a:focus {
- color: #bb7a2a;
-}
-
-.tab {
- background-color: #0066FF;
- background-image: url(resources/titlebar.gif);
- background-position: left top;
- background-repeat: no-repeat;
- color: #ffffff;
- padding: 8px;
- width: 5em;
- font-weight: bold;
-}
-
-/*
-Navigation bar styles
-*/
-
-.bar {
- background-image: url(resources/background.gif);
- background-repeat: repeat-x;
- color: #FFFFFF;
- padding: .8em .5em .4em .8em;
- height: auto;
-
-
-/*height
-
-:1.8em;*/
- font-size: 1em;
- margin: 0;
-}
-
-.topNav {
- background-image: url(resources/background.gif);
- background-repeat: repeat-x;
- color: #FFFFFF;
- float: left;
- padding: 0;
- width: 100%;
- clear: right;
- height: 2.8em;
- padding-top: 10px;
- overflow: hidden;
-}
-
-.bottomNav {
- margin-top: 10px;
- background-image: url(resources/background.gif);
- background-repeat: repeat-x;
- color: #FFFFFF;
- float: left;
- padding: 0;
- width: 100%;
- clear: right;
- height: 2.8em;
- padding-top: 10px;
- overflow: hidden;
-}
-
-.subNav {
- background-color: #dee3e9;
- border-bottom: 1px solid #9eadc0;
- float: left;
- width: 100%;
- overflow: hidden;
-}
-
-.subNav div {
- clear: left;
- float: left;
- padding: 0 0 6px 6px;
-}
-
-ul.navList, ul.subNavList {
- float: left;
- margin: 0 25px 0 0;
- padding: 0;
-}
-
-ul.navList li {
- list-style: none;
- float: left;
- padding: 3px 6px;
-}
-
-ul.subNavList li {
- list-style: none;
- float: left;
- font-size: 90%;
-}
-
-.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
- color: #FFFFFF;
- text-decoration: none;
-}
-
-.topNav a:hover, .bottomNav a:hover {
- text-decoration: none;
- color: #bb7a2a;
-}
-
-.navBarCell1Rev {
- background-image: url(resources/tab.gif);
- background-color: #a88834;
- color: #FFFFFF;
- margin: auto 5px;
- border: 1px solid #c9aa44;
-}
-
-.header, .footer {
- clear: both;
- margin: 0 20px;
- padding: 5px 0 0 0;
-}
-
-.indexHeader {
- margin: 10px;
- position: relative;
-}
-
-.indexHeader h1 {
- font-size: 1.3em;
-}
-
-.title {
- color: #2c4557;
- margin: 10px 0;
-}
-
-.subTitle {
- margin: 5px 0 0 0;
-}
-
-.header ul {
- margin: 0 0 25px 0;
- padding: 0;
-}
-
-.footer ul {
- margin: 20px 0 5px 0;
-}
-
-.header ul li, .footer ul li {
- list-style: none;
- font-size: 1.2em;
-}
-
-/*
-Heading styles
-*/
-
-div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
- background-color: #dee3e9;
- border-top: 1px solid #9eadc0;
- border-bottom: 1px solid #9eadc0;
- margin: 0 0 6px -8px;
- padding: 2px 5px;
-}
-
-ul.blockList ul.blockList ul.blockList li.blockList h3 {
- background-color: #dee3e9;
- border-top: 1px solid #9eadc0;
- border-bottom: 1px solid #9eadc0;
- margin: 0 0 6px -8px;
- padding: 2px 5px;
-}
-
-ul.blockList ul.blockList li.blockList h3 {
- padding: 0;
- margin: 15px 0;
-}
-
-ul.blockList li.blockList h2 {
- padding: 0px 0 20px 0;
-}
-
-/*
-Page layout container styles
-*/
-
-.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
- clear: both;
- padding: 10px 20px;
- position: relative;
-}
-
-.indexContainer {
- margin: 10px;
- position: relative;
- font-size: 1.0em;
-}
-
-.indexContainer h2 {
- font-size: 1.1em;
- padding: 0 0 3px 0;
-}
-
-.indexContainer ul {
- margin: 0;
- padding: 0;
-}
-
-.indexContainer ul li {
- list-style: none;
- margin-bottom: 2px;
-}
-
-.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
- font-size: 1.1em;
- font-weight: bold;
- margin: 10px 0 0 0;
- color: #4E4E4E;
-}
-
-.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
- margin: 10px 0 10px 20px;
-}
-
-.serializedFormContainer dl.nameValue dt {
- margin-left: 1px;
- font-size: 1.1em;
- display: inline;
- font-weight: bold;
-}
-
-.serializedFormContainer dl.nameValue dd {
- margin: 0 0 0 1px;
- font-size: 1.1em;
- display: inline;
-}
-
-/*
-List styles
-*/
-
-ul.horizontal li {
- display: inline;
- font-size: 0.9em;
-}
-
-ul.inheritance {
- margin: 0;
- padding: 0;
-}
-
-ul.inheritance li {
- display: inline;
- list-style: none;
-}
-
-ul.inheritance li ul.inheritance {
- margin-left: 15px;
- padding-left: 15px;
- padding-top: 1px;
-}
-
-ul.blockList, ul.blockListLast {
- margin: 10px 0 10px 0;
- padding: 0;
-}
-
-ul.blockList li.blockList, ul.blockListLast li.blockList {
- list-style: none;
- margin-bottom: 25px;
-}
-
-ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
- padding: 0 0 8px 8px;
- background-color: #ffffff;
- border: 1px solid #9eadc0;
- border-top: none;
-}
-
-ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
- margin-left: 0;
- padding-left: 0;
- padding-bottom: 15px;
- border: none;
- border-bottom: 1px solid #9eadc0;
-}
-
-ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
- list-style: none;
- border-bottom: none;
- padding-bottom: 0;
-}
-
-table tr td dl, table tr td dl dt, table tr td dl dd {
- margin-top: 0;
- margin-bottom: 1px;
-}
-
-/*
-Table styles
-*/
-
-.contentContainer table, .classUseContainer table, .constantValuesContainer table {
- border-bottom: 1px solid #9eadc0;
- width: 100%;
-}
-
-.contentContainer ul li table, .classUseContainer ul li table, .constantValuesContainer ul li table {
- width: 100%;
-}
-
-.contentContainer .description table, .contentContainer .details table {
- border-bottom: none;
-}
-
-.contentContainer ul li table th.colOne, .contentContainer ul li table th.colFirst, .contentContainer ul li table th.colLast, .classUseContainer ul li table th, .constantValuesContainer ul li table th, .contentContainer ul li table td.colOne, .contentContainer ul li table td.colFirst, .contentContainer ul li table td.colLast, .classUseContainer ul li table td, .constantValuesContainer ul li table td {
- vertical-align: top;
- padding-right: 20px;
-}
-
-.contentContainer ul li table th.colLast, .classUseContainer ul li table th.colLast,.constantValuesContainer ul li table th.colLast,
-.contentContainer ul li table td.colLast, .classUseContainer ul li table td.colLast,.constantValuesContainer ul li table td.colLast,
-.contentContainer ul li table th.colOne, .classUseContainer ul li table th.colOne,
-.contentContainer ul li table td.colOne, .classUseContainer ul li table td.colOne {
- padding-right: 3px;
-}
-
-.overviewSummary caption, .packageSummary caption, .contentContainer ul.blockList li.blockList caption, .summary caption, .classUseContainer caption, .constantValuesContainer caption {
- position: relative;
- text-align: left;
- background-repeat: no-repeat;
- color: #FFFFFF;
- font-weight: bold;
- clear: none;
- overflow: hidden;
- padding: 0px;
- margin: 0px;
-}
-
-caption a:link, caption a:hover, caption a:active, caption a:visited {
- color: #FFFFFF;
-}
-
-.overviewSummary caption span, .packageSummary caption span, .contentContainer ul.blockList li.blockList caption span, .summary caption span, .classUseContainer caption span, .constantValuesContainer caption span {
- white-space: nowrap;
- padding-top: 8px;
- padding-left: 8px;
- display: block;
- float: left;
- background-image: url(resources/titlebar.gif);
- height: 18px;
-}
-
-.overviewSummary .tabEnd, .packageSummary .tabEnd, .contentContainer ul.blockList li.blockList .tabEnd, .summary .tabEnd, .classUseContainer .tabEnd, .constantValuesContainer .tabEnd {
- width: 10px;
- background-image: url(resources/titlebar_end.gif);
- background-repeat: no-repeat;
- background-position: top right;
- position: relative;
- float: left;
-}
-
-ul.blockList ul.blockList li.blockList table {
- margin: 0 0 12px 0px;
- width: 100%;
-}
-
-.tableSubHeadingColor {
- background-color: #EEEEFF;
-}
-
-.altColor {
- background-color: #eeeeef;
-}
-
-.rowColor {
- background-color: #ffffff;
-}
-
-.overviewSummary td, .packageSummary td, .contentContainer ul.blockList li.blockList td, .summary td, .classUseContainer td, .constantValuesContainer td {
- text-align: left;
- padding: 6px 3px 6px 7px;
-}
-
-th.colFirst, th.colLast, th.colOne, .constantValuesContainer th {
- background: #dee3e9;
- border-top: 1px solid #9eadc0;
- border-bottom: 1px solid #9eadc0;
- text-align: left;
- padding: 6px 3px 6px 7px;
-}
-
-td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
- font-weight: bold;
-}
-
-td.colFirst, th.colFirst {
- border-left: 1px solid #9eadc0;
- white-space: nowrap;
-}
-
-td.colLast, th.colLast {
- border-right: 1px solid #9eadc0;
-}
-
-td.colOne, th.colOne {
- border-right: 1px solid #9eadc0;
- border-left: 1px solid #9eadc0;
-}
-
-table.overviewSummary {
- padding: 0px;
- margin-left: 0px;
-}
-
-table.overviewSummary td.colFirst, table.overviewSummary th.colFirst,
-table.overviewSummary td.colOne, table.overviewSummary th.colOne {
- width: 25%;
- vertical-align: middle;
-}
-
-table.packageSummary td.colFirst, table.overviewSummary th.colFirst {
- width: 25%;
- vertical-align: middle;
-}
-
-/*
-Content styles
-*/
-
-.description pre {
- margin-top: 0;
-}
-
-.deprecatedContent {
- margin: 0;
- padding: 10px 0;
-}
-
-.docSummary {
- padding: 0;
-}
-
-.sourceLineNo {
- color: green;
- padding: 0 30px 0 0;
-}
-
-h1.hidden {
- visibility: hidden;
- overflow: hidden;
- font-size: .9em;
-}
-
-.block {
- display: block;
- margin: 3px 0 0 0;
-}
-
-.strong {
- font-weight: bold;
-}
-
-table.overviewSummary td.colFirst, table.overviewSummary th.colFirst, table.overviewSummary td.colOne, table.overviewSummary
-th.colOne {
- width: 5%;
-}
-
-table.overviewSummary td.colFirst code {
- float: right;
-}
-
-table.overviewSummary .block {
- padding-left: 3em;
-}
-
-table.overviewSummary .block .block {
- padding-left: 0em;
-}
-
-table.overviewSummary, table.packageSummary {
- border-collapse: collapse;
-}
-
-table.overviewSummary td, table.packageSummary td {
-
-}
-
-td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active,
-td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover {
- font-weight: normal;
-}
-
-td.colOne strong a:link, td.colOne strong a:active, td.colOne strong a:visited, td.colOne strong a:hover, td.colFirst strong
-a:link, td.colFirst strong a:active, td.colFirst strong a:visited, td.colFirst strong a:hover, td.colLast strong a:link,
-td.colLast strong a:active, td.colLast strong a:visited, td.colLast strong a:hover {
- font-weight: bold;
-}
diff --git a/src/main/resources/mcpi/api/java/lib/McPi.jar b/src/main/resources/mcpi/api/java/lib/McPi.jar
deleted file mode 100644
index 7118ab8e..00000000
Binary files a/src/main/resources/mcpi/api/java/lib/McPi.jar and /dev/null differ
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/Block.java b/src/main/resources/mcpi/api/java/src-api/pi/Block.java
deleted file mode 100644
index 07083745..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/Block.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package pi;
-
-/**
- * A Minecraft Block description
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class Block {
-
- final int id, data;
-
- Block(int id, int data) {
- this.id = id;
- this.data = data & 0xf;
- }
-
- /**
- * Get a block with and withId (use a constant like Block.TNT)
- */
- public static Block id(int id) {
- return new Block(id, 0);
- }
-
- /**
- * Get a block with extra data
- */
- public Block withData(int data) {
- return new Block(id, data);
- }
-
- static Block decode(String s) {
- return id(Integer.parseInt(s));
- }
-
- static Block decodeWithData(String s) {
- String[] ss = s.split(",");
- int id = Integer.parseInt(ss[0]);
- int data = Integer.parseInt(ss[1]);
- return new Block(id, data);
- }
-
- @Override
- public int hashCode() {
- return (id << 8) + data;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof Block)) {
- return false;
- }
- return hashCode() == ((Block) obj).hashCode();
- }
-
- @Override
- public String toString() {
- return id + (data == 0 ? "" : "," + data);
- }
-
- /**
- * Get a wool block of a specific color
- */
- public static Block wool(Color color) {
- return WOOL.withData(color.woolColorData);
- }
- // Predefined blocks
- public static final Block //
- AIR = id(0),
- STONE = id(1),
- GRASS = id(2),
- DIRT = id(3),
- COBBLESTONE = id(4),
- WOOD_PLANKS = id(5),
- SAPLING = id(6),
- BEDROCK = id(7),
- WATER_FLOWING = id(8),
- WATER = WATER_FLOWING,
- WATER_STATIONARY = id(9),
- LAVA_FLOWING = id(10),
- LAVA = LAVA_FLOWING,
- LAVA_STATIONARY = id(11),
- SAND = id(12),
- GRAVEL = id(13),
- GOLD_ORE = id(14),
- IRON_ORE = id(15),
- COAL_ORE = id(16),
- WOOD = id(17),
- LEAVES = id(18),
- GLASS = id(20),
- LAPIS_LAZULI_ORE = id(21),
- LAPIS_LAZULI_BLOCK = id(22),
- SANDSTONE = id(24),
- BED = id(26),
- COBWEB = id(30),
- GRASS_TALL = id(31),
- WOOL = id(35),
- FLOWER_YELLOW = id(37),
- FLOWER_CYAN = id(38),
- MUSHROOM_BROWN = id(39),
- MUSHROOM_RED = id(40),
- GOLD_BLOCK = id(41),
- IRON_BLOCK = id(42),
- STONE_SLAB_DOUBLE = id(43),
- STONE_SLAB = id(44),
- BRICK_BLOCK = id(45),
- TNT = id(46),
- BOOKSHELF = id(47),
- MOSS_STONE = id(48),
- OBSIDIAN = id(49),
- TORCH = id(50),
- FIRE = id(51),
- STAIRS_WOOD = id(53),
- CHEST = id(54),
- DIAMOND_ORE = id(56),
- DIAMOND_BLOCK = id(57),
- CRAFTING_TABLE = id(58),
- FARMLAND = id(60),
- FURNACE_INACTIVE = id(61),
- FURNACE_ACTIVE = id(62),
- DOOR_WOOD = id(64),
- LADDER = id(65),
- STAIRS_COBBLESTONE = id(67),
- DOOR_IRON = id(71),
- REDSTONE_ORE = id(73),
- SNOW = id(78),
- ICE = id(79),
- SNOW_BLOCK = id(80),
- CACTUS = id(81),
- CLAY = id(82),
- SUGAR_CANE = id(83),
- FENCE = id(85),
- GLOWSTONE_BLOCK = id(89),
- BEDROCK_INVISIBLE = id(95),
- STONE_BRICK = id(98),
- GLASS_PANE = id(102),
- MELON = id(103),
- FENCE_GATE = id(107),
- GLOWING_OBSIDIAN = id(246),
- NETHER_REACTOR_CORE = id(247);
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/Color.java b/src/main/resources/mcpi/api/java/src-api/pi/Color.java
deleted file mode 100644
index dd2330eb..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/Color.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package pi;
-
-/**
- * Colors
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public enum Color {
-
- WHITE, ORANGE, MAGENTA, LIGHT_BLUE,
- YELLOW, LIME, PINK, GRAY,
- LIGHT_GRAY, CYAN, PURPLE, BLUE,
- BROWN, GREEN, RED, BLACK;
-
- /**
- * the block DATA for the color
- */
- final int woolColorData = ordinal();
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/Connection.java b/src/main/resources/mcpi/api/java/src-api/pi/Connection.java
deleted file mode 100644
index d5ad20d8..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/Connection.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package pi;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.Closeable;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.net.Socket;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-/**
- * Connection to a Minecraft Pi game
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class Connection {
-
- Socket socket;
- BufferedWriter out;
- BufferedReader in;
- boolean autoFlush = true;
-
- Connection(String host, int port) {
- Log.info("Connecting to " + host + ":" + port);
- if (host != null) {
- try {
- this.socket = new Socket(host, port);
- socket.setTcpNoDelay(true);
- socket.setKeepAlive(true);
- socket.setTrafficClass(0x10);
- this.in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
- this.out = new BufferedWriter(new OutputStreamWriter(socket.getOutputStream()));
- } catch (IOException e) {
- throw new ConnectionException("Couldn't connect to Minecraft, is it running?");
- }
- }
- Log.info("Connected");
- }
-
- void send(Object... parts) {
- try {
- drain(in);
- for (int i = 0; i < parts.length; i++) {
- out.write(parts[i].toString());
- if (i == 0) {
- out.write('(');
- } else if (i < parts.length - 1) {
- out.write(',');
- }
- }
- out.write(")\n");
- if (autoFlush) {
- flush();
- }
- } catch (IOException e) {
- throw new ConnectionException(e);
- }
- }
-
- void flush() {
- try {
- out.flush();
- } catch (IOException e) {
- throw new ConnectionException(e);
- }
- }
-
- void drain(BufferedReader in) throws IOException {
- while (in.ready()) {
- int c = in.read();
- System.err.print((char) c);
- }
- }
-
- String receive() {
- try {
- return in.readLine();
- } catch (IOException e) {
- throw new ConnectionException(e);
- }
- }
-
- void close() {
- close(in, out);
- try {
- socket.close();
- } catch (IOException _) {
- }
- }
-
- void close(Closeable... cs) {
- for (Closeable c : cs) {
- try {
- if (c != null) {
- c.close();
- }
- } catch (IOException _) {
- }
- }
- }
-
- void autoFlush(boolean flush) {
- this.autoFlush = flush;
- if (flush) {
- flush();
- }
- }
-
- /**
- *
- */
- static class ConnectionException extends RuntimeException {
-
- ConnectionException(String message) {
- super(message);
- }
-
- ConnectionException(Throwable cause) {
- super(cause);
- }
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/EventFactory.java b/src/main/resources/mcpi/api/java/src-api/pi/EventFactory.java
deleted file mode 100644
index a6df8125..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/EventFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package pi;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Scanner;
-import static pi.Vec.Unit.*;
-import pi.event.BlockHitEvent;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class EventFactory {
-
- static List createBlockHitEvents(String eventList) {
- List events = new ArrayList();
-
- if (!eventList.isEmpty()) {
- for (String event : eventList.split("\\|")) {
- Scanner s = new Scanner(event).useDelimiter(",");
- Vec position = Vec.xyz(s.nextInt(), s.nextInt(), s.nextInt());
- Vec.Unit surfaceDirection = faceIdxToDirection(s.nextInt());
- int entityId = s.nextInt();
- events.add(new BlockHitEvent(position, surfaceDirection, entityId));
- }
- }
-
- return events;
- }
-
- static Unit faceIdxToDirection(int faceIdx) {
- Unit[] faceDirs = {Y.neg(), Y, Z.neg(), Z, X.neg(), X};
- return faceDirs[faceIdx];
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/Item.java b/src/main/resources/mcpi/api/java/src-api/pi/Item.java
deleted file mode 100644
index 715fe5cd..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/Item.java
+++ /dev/null
@@ -1,96 +0,0 @@
-package pi;
-
-/**
- * A Minecraft Item description (no use yet)
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class Item {
-
- final int id;
-
- Item(int id) {
- this.id = id;
- }
-
- static Item id(int id) {
- return new Item(id);
- }
-
- static Item decode(String s) {
- return id(Integer.parseInt(s));
- }
-
- @Override
- public int hashCode() {
- return id;
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof Item)) {
- return false;
- }
- return id == ((Item) obj).id;
- }
-
- @Override
- public String toString() {
- return Integer.toString(id);
- }
- // Predefined items
- public static final Item //
- IRON_SHOVEL = id(256),
- IRON_PICKAXE = id(257),
- IRON_AXE = id(258),
- BOW = id(261),
- ARROW = id(262),
- COAL = id(263),
- DIAMOND = id(264),
- IRON_INGOT = id(265),
- GOLD_INGOT = id(266),
- IRON_SWORD = id(267),
- WOODEN_SWORD = id(268),
- WOODEN_SHOVEL = id(269),
- WOODEN_PICKAXE = id(270),
- WOODEN_AXE = id(271),
- STONE_SWORD = id(272),
- STONE_SHOVEL = id(273),
- STONE_PICKAXE = id(274),
- STONE_AXE = id(275),
- DIAMOND_SWORD = id(276),
- DIAMOND_SHOVEL = id(277),
- DIAMOND_PICKAXE = id(278),
- DIAMOND_AXE = id(279),
- STICK = id(280),
- BOWL = id(281),
- GOLD_SWORD = id(283),
- GOLD_SHOVEL = id(284),
- GOLD_PICKAXE = id(285),
- GOLD_AXE = id(286),
- STRING = id(287),
- FEATHER = id(288),
- GUNPOWDER = id(289),
- FLINT = id(292),
- WHEAT = id(296),
- SIGN = id(323),
- WOODEN_DOOR = id(324),
- IRON_DOOR = id(330),
- SNOWBALL = id(332),
- LEATHER = id(334),
- CLAY_BRICK = id(336),
- CLAY = id(337),
- SUGAR_CANE = id(338),
- PAPER = id(339),
- BOOK = id(340),
- SLIMEBALL = id(341),
- EGG = id(344),
- COMPASS = id(345),
- CLOCK = id(347),
- GLOWSTONE_DUST = id(348),
- DYE = id(351),
- BONE = id(352),
- SUGAR = id(353),
- SHEARS = id(359),
- CAMERA = id(456);
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/Log.java b/src/main/resources/mcpi/api/java/src-api/pi/Log.java
deleted file mode 100644
index d80f23a1..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/Log.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package pi;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class Log {
-
- static void debug(String s) {
- if (false) {
- System.out.println(s);
- }
- }
-
- static void info(String s) {
- System.out.println(s);
- }
-
- static void error(String s) {
- System.err.println(s);
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/Minecraft.java b/src/main/resources/mcpi/api/java/src-api/pi/Minecraft.java
deleted file mode 100644
index c9c2ef84..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/Minecraft.java
+++ /dev/null
@@ -1,297 +0,0 @@
-package pi;
-
-import java.util.Arrays;
-import java.util.List;
-import pi.event.BlockHitEvent;
-import pi.tool.Tools;
-
-/**
- * The main class to interact with a running instance of Minecraft Pi.
- *
- * Example:
- * Minecraft.connect().setBlock(0, 2, 0, Block.GOLD_ORE)
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class Minecraft {
-
- Connection connection;
- static final int DEFAULT_PORT = 4711;
- //
- public final Camera camera = new Camera();
- public final Player player = new Player();
- public final Entities entities = new Entities();
- public final Events events = new Events();
- public final Tools tools = new Tools(this);
-
- Minecraft(Connection connection) {
- this.connection = connection;
- }
-
- /**
- * Connect to a local mcpi game
- */
- public static Minecraft connect() {
- return connect("127.0.0.1");
- }
-
- /**
- * Connect to a remote mcpi game
- */
- public static Minecraft connect(String host) {
- return connect(host, DEFAULT_PORT);
- }
-
- /**
- * Connect to mcpi on a specific host/port
- */
- static Minecraft connect(String host, int port) {
- return new Minecraft(new Connection(host, port));
- }
-
- /**
- * Connect with string args
- *
- * @param args an array with optional host, port
- */
- public static Minecraft connect(String[] args) {
- System.err.println(Arrays.asList(args));
- String host = args.length >= 1 ? args[0] : "127.0.0.1";
- int port = args.length >= 2 ? Integer.parseInt(args[1]) : Minecraft.DEFAULT_PORT;
- return Minecraft.connect(host, port);
- }
-
- /**
- * Get a block
- */
- public Block getBlock(Vec position) {
- send("world.getBlock", position);
- return Block.decode(receive());
- }
-
- /**
- * Get a block
- */
- public Block getBlockWithData(Vec position) {
- send("world.getBlock", position);
- return Block.decodeWithData(receive());
- }
-
- /**
- * Set a block
- */
- public void setBlock(int x, int y, int z, Block block) {
- setBlock(Vec.xyz(x, y, z), block);
- }
-
- /**
- * Set a block
- */
- public void setBlock(Vec position, Block block) {
- send("world.setBlock", position, block);
- }
-
- /**
- * Set a cuboid of blocks
- */
- public void setBlocks(int x1, int y1, int z1, int x2, int y2, int z2, Block block) {
- setBlocks(Vec.xyz(x1, y1, z1), Vec.xyz(x2, y2, z2), block);
- }
-
- /**
- * Set a cuboid of blocks
- */
- public void setBlocks(Vec begin, Vec end, Block block) {
- send("world.setBlocks", begin, end, block);
- }
-
- /**
- * Get the height of the world (last Y that isn't solid from top-down)
- */
- public int getHeight(int x, int z) {
- send("world.getHeight", x, z);
- return Integer.parseInt(receive());
- }
-
- /**
- * Get the entity ids of the connected players
- */
- public int[] getPlayerEntityIds() {
- send("world.getPlayerIds");
- String[] strIds = receive().split("|");
- int[] ids = new int[strIds.length];
- for (int i = 0; i < ids.length; i++) {
- ids[i] = Integer.parseInt(strIds[i]);
- }
- return ids;
- }
-
- /**
- * Keys: "world_immutable", "nametags_visible"
- */
- public void setting(String key, boolean value) {
- send("world.setting", key, value == false ? 0 : 1);
- }
-
- /**
- * Save a checkpoint that can be used for restoring the world
- */
- public void saveCheckpoint() {
- send("world.checkpoint.save");
- }
-
- /**
- * Restore the world state to the checkpoint
- */
- public void restoreCheckpoint() {
- send("world.checkpoint.restore");
- }
-
- /**
- * Post a message to the game chat
- */
- public void postToChat(String message) {
- send("chat.post", message);
- }
-
- /**
- * 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.
- */
- public void autoFlush(boolean auto) {
- connection.autoFlush(auto);
- }
-
- /**
- * Flush commands that are buffered, not needed, unless autoFlush(false).
- */
- public void flush() {
- connection.flush();
- }
-
- /**
- * Methods for the player in the connected game
- */
- public class Player {
-
- public Vec getPosition() {
- send("player.getTile");
- return Vec.decode(receive());
- }
-
- public void setPosition(Vec position) {
- send("player.setTile", position);
- }
-
- public VecFloat getExactPosition() {
- send("player.getPos");
- return VecFloat.decode(receive());
- }
-
- public void setExactPosition(VecFloat position) {
- send("player.setPos", position);
- }
-
- /**
- * Keys: autojump, Values: true/false For example to disable
- * automatic jumping:
- * mc.player.setting("autojump", false);
- */
- public void setting(String key, boolean value) {
- send("player.setting", key, value == false ? 0 : 1);
- }
- }
-
- /**
- * Methods for entities
- */
- public class Entities {
-
- public Vec getPosition(int entityId) {
- send("entity.getTile", entityId);
- return Vec.decode(receive());
- }
-
- public void setPosition(int entityId, Vec tile) {
- send("entity.setTile", entityId, tile);
- }
-
- public VecFloat getExactPosition(int entityId) {
- send("entity.getPos", entityId);
- return VecFloat.decode(receive());
- }
-
- public void setExactPosition(VecFloat pos) {
- send("entity.setPos");
- }
- }
-
- /**
- * Control the camera in the game we're connected to
- */
- public class Camera {
-
- public void setNormal() {
- send("camera.mode.setNormal");
- }
-
- public void setNormal(int mobEntityId) {
- send("camera.mode.setNormal", mobEntityId);
- }
-
- public void setThirdPerson() {
- send("camera.mode.setFollow");
- }
-
- public void setThirdPerson(int entityId) {
- send("camera.mode.setFollow", entityId);
- }
-
- public void setFixed() {
- send("camera.mode.setFixed");
- }
-
- public void setPosition(VecFloat position) {
- send("camera.setPos", position);
- }
- }
-
- /**
- * Events
- */
- public class Events {
-
- /**
- * Clear all old events
- */
- public void clearAll() {
- send("events.clear");
- }
-
- /**
- * Only triggered by sword
- */
- public List pollBlockHits() {
- send("events.block.hits");
- return EventFactory.createBlockHitEvents(receive());
- }
- }
-
- void send(Object... parts) {
- connection.send(parts);
- }
-
- String receive() {
- if (!connection.autoFlush) {
- throw new IllegalStateException("Methods that return data aren't supported with autoflush off!");
- }
- return connection.receive();
- }
-
- @Override
- protected void finalize() throws Throwable {
- super.finalize();
- connection.close();
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/Vec.java b/src/main/resources/mcpi/api/java/src-api/pi/Vec.java
deleted file mode 100644
index d3429bf6..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/Vec.java
+++ /dev/null
@@ -1,111 +0,0 @@
-package pi;
-
-import java.util.Scanner;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class Vec {
-
- public final static Vec ZERO = new Vec(0, 0, 0);
- public final static int MIN_Y = -128, MAX_Y = 127;
- public final int x, y, z;
-
- Vec(int x, int y, int z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- /**
- * Create
- */
- public static Vec xyz(int x, int y, int z) {
- return new Vec(x, y, z);
- }
-
- /**
- * Add
- */
- public Vec add(Vec v) {
- return xyz(x + v.x, y + v.y, z + v.z);
- }
-
- /**
- * Add
- */
- public Vec add(int x, int y, int z) {
- return xyz(this.x + x, this.y + y, this.z + z);
- }
-
- /**
- * Subtract
- */
- public Vec sub(Vec v) {
- return xyz(x - v.x, y - v.y, z - v.z);
- }
-
- /**
- * Multiply with integer (scale)
- */
- public Vec mul(int s) {
- return xyz(s * x, s * y, s * z);
- }
-
- /**
- * Negate (multiply with -1)
- */
- public Vec neg() {
- return xyz(-x, -y, -z);
- }
-
- /**
- * Scalar product
- */
- public int dot(Vec v) {
- return x * v.x + y * v.y + z * v.z;
- }
-
- @Override
- public int hashCode() {
- return x | (y << 20) | (z << 10);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == null || !(obj instanceof Vec)) {
- return false;
- }
- return hashCode() == ((Vec) obj).hashCode();
- }
-
- @Override
- public final String toString() {
- return x + "," + y + "," + z;
- }
-
- static Vec decode(String encoded) {
- Scanner s = new Scanner(encoded).useDelimiter("\\,");
- return xyz(s.nextInt(), s.nextInt(), s.nextInt());
- }
-
- /**
- * A vector with length=1
- */
- public static class Unit extends Vec {
-
- public final static Unit X = new Unit(1, 0, 0);
- public final static Unit Y = new Unit(0, 1, 0);
- public final static Unit Z = new Unit(0, 0, 1);
-
- Unit(int x, int y, int z) {
- super(x, y, z);
- }
-
- @Override
- public Unit neg() {
- return new Unit(-x, -y, -z);
- }
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/VecFloat.java b/src/main/resources/mcpi/api/java/src-api/pi/VecFloat.java
deleted file mode 100644
index ccfcb840..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/VecFloat.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package pi;
-
-import java.util.Scanner;
-
-/**
- * A vector of three floats
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class VecFloat {
-
- public static final VecFloat ZERO = new VecFloat(0, 0, 0);
- public final float x, y, z;
-
- VecFloat(float x, float y, float z) {
- this.x = x;
- this.y = y;
- this.z = z;
- }
-
- /**
- * Create
- */
- public static VecFloat xyz(float x, float y, float z) {
- return new VecFloat(x, y, z);
- }
-
- /**
- * Add
- */
- public VecFloat add(VecFloat v) {
- return xyz(x + v.x, y + v.y, z + v.z);
- }
-
- /**
- * Subtract
- */
- public VecFloat sub(VecFloat v) {
- return xyz(x - v.x, y - v.y, z - v.z);
- }
-
- /**
- * Multiply with a float (scale)
- */
- public VecFloat mul(float s) {
- return xyz(s * x, s * y, s * z);
- }
-
- /**
- * Negate (multiply with -1)
- */
- public VecFloat neg() {
- return mul(-1);
- }
-
- /**
- * Scalar product
- */
- public float dot(VecFloat v) {
- return x * v.x + y * v.y + z * v.z;
- }
-
- /**
- * Cross product
- */
- VecFloat cross(VecFloat v) {
- throw new UnsupportedOperationException("not implemented yet");
- }
-
- /**
- * Get a vector in the same direction but with length 1
- */
- public VecFloat normalized() {
- return mul(1f / length());
- }
-
- /**
- * Length
- */
- public float length() {
- return (float) Math.sqrt(lengthSq());
- }
-
- /**
- * length * length
- */
- public float lengthSq() {
- return dot(this);
- }
-
- static VecFloat decode(String encoded) {
- Scanner s = new Scanner(encoded).useDelimiter("\\,");
- return xyz(s.nextFloat(), s.nextFloat(), s.nextFloat());
- }
-
- @Override
- public final String toString() {
- return x + "," + y + "," + z;
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/BlockAddedEvent.java b/src/main/resources/mcpi/api/java/src-api/pi/event/BlockAddedEvent.java
deleted file mode 100644
index 850f6c2e..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/BlockAddedEvent.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package pi.event;
-
-import pi.Vec;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class BlockAddedEvent extends BlockEvent {
-
- public BlockAddedEvent(Vec position) {
- super(position);
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/BlockEvent.java b/src/main/resources/mcpi/api/java/src-api/pi/event/BlockEvent.java
deleted file mode 100644
index d7b70152..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/BlockEvent.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package pi.event;
-
-import pi.Vec;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public abstract class BlockEvent {
-
- public final Vec position;
-
- public BlockEvent(Vec position) {
- this.position = position;
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/BlockHitEvent.java b/src/main/resources/mcpi/api/java/src-api/pi/event/BlockHitEvent.java
deleted file mode 100644
index 9a725edb..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/BlockHitEvent.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package pi.event;
-
-import pi.Vec;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class BlockHitEvent extends BlockEvent {
-
- public final Vec.Unit surfaceDirection;
- public final int entityId;
-
- public BlockHitEvent(Vec position, Vec.Unit surfaceDirection, int entityId) {
- super(position);
- this.surfaceDirection = surfaceDirection;
- this.entityId = entityId;
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/BlockRemovedEvent.java b/src/main/resources/mcpi/api/java/src-api/pi/event/BlockRemovedEvent.java
deleted file mode 100644
index d81eef32..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/BlockRemovedEvent.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package pi.event;
-
-import pi.Vec;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class BlockRemovedEvent extends BlockEvent {
-
- public BlockRemovedEvent(Vec position) {
- super(position);
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/ChatMessageEvent.java b/src/main/resources/mcpi/api/java/src-api/pi/event/ChatMessageEvent.java
deleted file mode 100644
index e09b4af8..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/ChatMessageEvent.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package pi.event;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class ChatMessageEvent {
-
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/EntityEvent.java b/src/main/resources/mcpi/api/java/src-api/pi/event/EntityEvent.java
deleted file mode 100644
index f02b5fc0..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/EntityEvent.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package pi.event;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-abstract class EntityEvent {
-
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/PlayerConnectEvent.java b/src/main/resources/mcpi/api/java/src-api/pi/event/PlayerConnectEvent.java
deleted file mode 100644
index 36389156..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/PlayerConnectEvent.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package pi.event;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class PlayerConnectEvent extends PlayerEvent {
-
- public final int entityId;
-
- public PlayerConnectEvent(int entityId) {
- this.entityId = entityId;
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/PlayerEvent.java b/src/main/resources/mcpi/api/java/src-api/pi/event/PlayerEvent.java
deleted file mode 100644
index d90740da..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/PlayerEvent.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package pi.event;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-abstract class PlayerEvent {
-
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/event/package.html b/src/main/resources/mcpi/api/java/src-api/pi/event/package.html
deleted file mode 100644
index b1909ed8..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/event/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Use to react on events in the game
-
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/package.html b/src/main/resources/mcpi/api/java/src-api/pi/package.html
deleted file mode 100644
index 28d932a2..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Protocol classes
-
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/tool/Csg.java b/src/main/resources/mcpi/api/java/src-api/pi/tool/Csg.java
deleted file mode 100644
index d66344c0..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/tool/Csg.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package pi.tool;
-
-/**
- * Constructive Solid Geometry tool
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class Csg {
-
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/tool/Text.java b/src/main/resources/mcpi/api/java/src-api/pi/tool/Text.java
deleted file mode 100644
index 1ae53140..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/tool/Text.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package pi.tool;
-
-import java.awt.*;
-import java.awt.geom.*;
-import java.awt.image.*;
-import pi.*;
-
-/**
- * A tool to draw text in the Minecraft world. Example:
- *
- * text.with("Arial", 18).xyz2(Vec.xyz(0, 2, 0)).draw("Hello, world!").
- *
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class Text {
-
- Minecraft minecraft;
- //
- Vec basePos = Vec.xyz(0, 1, 0);
- Font font = Font.decode("SansSerif-PLAIN-9");
- Vec u = Vec.Unit.X, v = Vec.Unit.Y;
- Block block = Block.WOOD_PLANKS;
-
- Text(Minecraft minecraft) {
- this.minecraft = minecraft;
- }
-
- /**
- * Set the position of the text
- */
- public Text at(Vec pos) {
- this.basePos = pos;
- return this;
- }
-
- /**
- * Set the block type to use for drawing
- */
- public Text with(Block block) {
- this.block = block;
- return this;
- }
-
- /**
- * Set the font
- */
- public Text with(String fontName, int fontSizeInPoints) {
- this.font = new Font(fontName, Font.PLAIN, fontSizeInPoints);
- return this;
- }
-
- /**
- * Set the orientation of the text
- */
- public Text withOrientation(Vec.Unit u, Vec.Unit v) {
- if (u.equals(v)) {
- throw new IllegalArgumentException("u and v can't be equal!");
- }
- this.u = u;
- this.v = v;
- return this;
- }
-
- /**
- * Draw a text with the current settings in the Minecraft world
- */
- public void draw(String text) {
- BufferedImage img = createImage(text);
- final int w = img.getWidth(), h = img.getHeight();
- for (int j = h - 1; j >= 0; j--) {
- for (int i = 0; i < w; i++) {
- if ((img.getRGB(i, j) & 1) == 1) {
- Vec relativeBlockPos = u.mul(i).add(v.mul((h - j)));
- Vec blockPos = basePos.add(relativeBlockPos);
- minecraft.setBlock(blockPos, block);
- }
- }
- }
- }
-
- private BufferedImage createImage(String text) {
- BufferedImage buf = new BufferedImage(1000, 200, BufferedImage.TYPE_BYTE_BINARY);
- Graphics2D g = buf.createGraphics();
-
- g.setFont(font);
- FontMetrics fm = g.getFontMetrics();
- g.drawString(text, 1, 1 + fm.getAscent());
- Rectangle2D bounds = fm.getStringBounds(text, g);
- buf = buf.getSubimage(0, 0, (int) bounds.getWidth() + 1, (int) bounds.getHeight() + 1);
- g.dispose();
- return buf;
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/tool/Tools.java b/src/main/resources/mcpi/api/java/src-api/pi/tool/Tools.java
deleted file mode 100644
index 6433fb75..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/tool/Tools.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package pi.tool;
-
-import pi.Minecraft;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class Tools {
-
- public final Text text;
- public final Turtle turtle;
-
- public Tools(Minecraft world) {
- this.text = new Text(world);
- this.turtle = new Turtle(world);
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/tool/Turtle.java b/src/main/resources/mcpi/api/java/src-api/pi/tool/Turtle.java
deleted file mode 100644
index 7862d081..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/tool/Turtle.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package pi.tool;
-
-import pi.*;
-import static pi.Vec.xyz;
-
-/**
- * A turtle that can be used for shouldPlaceBlock
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class Turtle {
-
- Minecraft minecraft;
- //
- Vec home = Vec.ZERO;
- Vec pos = Vec.ZERO, dir = Vec.Unit.X;
- Block block = Block.WOOD_PLANKS;
- boolean shouldPlaceBlock = false;
-
- public Turtle(Minecraft mc) {
- this.minecraft = mc;
- }
-
- /**
- * Set the turtle setHome pos
- */
- public Turtle setHome(Vec home) {
- this.home = home;
- return this;
- }
-
- /**
- * Move the turtle to setHome with default orientation
- */
- public Turtle home() {
- this.pos = Vec.ZERO;
- this.dir = Vec.Unit.X;
- return this;
- }
-
- /**
- * Start shouldPlaceBlock
- */
- public Turtle on() {
- this.shouldPlaceBlock = true;
- placeBlock();
- return this;
- }
-
- /**
- * Stop shouldPlaceBlock
- */
- public Turtle off() {
- this.shouldPlaceBlock = false;
- return this;
- }
-
- public Turtle block(Block block) {
- this.block = block;
- return this;
- }
-
- void placeBlock() {
- if (shouldPlaceBlock) {
- minecraft.setBlock(home.add(pos), block);
- }
- }
-
- /**
- * Jump without placing blocks
- */
- public Turtle jump(int dx, int dy, int dz) {
- pos = pos.add(dx, dy, dz);
- return this;
- }
-
- /**
- * Turn 90 degrees CCW
- */
- public Turtle left() {
- this.dir = xyz(dir.z, 0, -dir.x);
- return this;
- }
-
- /**
- * Turn 90 degrees CW
- */
- public Turtle right() {
- this.dir = xyz(-dir.z, 0, dir.x);
- return this;
- }
-
- /**
- * Turn 180 degrees
- */
- public Turtle around() {
- this.dir = xyz(-dir.x, 0, -dir.z);
- return this;
- }
-
- public Turtle forward(int steps) {
- return move(steps, dir);
- }
-
- public Turtle back(int steps) {
- return move(steps, dir.neg());
- }
-
- public Turtle up(int steps) {
- return move(steps, Vec.Unit.Y);
- }
-
- public Turtle down(int steps) {
- return move(steps, Vec.Unit.Y.neg());
- }
-
- Turtle move(int steps, Vec d) {
- while (steps-- > 0) {
- this.pos = pos.add(d);
- placeBlock();
- }
- return this;
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-api/pi/tool/package.html b/src/main/resources/mcpi/api/java/src-api/pi/tool/package.html
deleted file mode 100644
index e31aeafd..00000000
--- a/src/main/resources/mcpi/api/java/src-api/pi/tool/package.html
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Tools with higher level functionality
-
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/ChristmasTreeDemo.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/ChristmasTreeDemo.java
deleted file mode 100644
index 6be42ad8..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/ChristmasTreeDemo.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package pi.demo;
-
-import pi.*;
-import static pi.Vec.xyz;
-
-/**
- * Build a big christmas tree!
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class ChristmasTreeDemo {
- //
- static double[] tree = {//
- 0.5, 1, 1.5, 2, 2.6, 3, 4, 5, 6,//
- 4, 5, 6, 7, 8, 8.6,//
- 7, 8, 9, 10, 10.6,//
- 9, 10, 11, 12, 13};
-
- public static void main(String[] args) {
- Minecraft mc = Minecraft.connect(args);
- drawChristmasTree(mc, Vec.ZERO);
- }
-
- static void drawChristmasTree(Minecraft mc, Vec p) {
- // Clear area and add snow on the ground
- Vec v = xyz(20, 0, 20);
- mc.setBlocks(v.neg(), v.add(0, 50, 0), Block.AIR);
- mc.setBlocks(v.neg(), v, Block.SNOW_BLOCK);
-
- int h = 6;
-
- // Draw "branches"
- for (int i = 0; i < tree.length; i++) {
- drawDisc(mc, p.add(0, h, 0), tree[tree.length - i - 1], Block.LEAVES.withData(1));
- h++;
- }
-
- // Draw trunk
- mc.setBlocks(p.add(-1, 0, 0), p.add(1, h - 6, 0), Block.WOOD);
- mc.setBlocks(p.add(0, 0, -1), p.add(0, h - 6, 1), Block.WOOD);
-
- // Draw star
- drawStar(mc, p.add(0, h, 0));
- }
-
- static void drawDisc(Minecraft mc, Vec p, double r, Block b) {
- int rr = (int) Math.ceil(r);
- for (int j = -rr; j <= rr; j++) {
- for (int i = -rr; i <= rr; i++) {
- double diff = i * i + j * j - r * r;
- if (diff <= 0) {
- mc.setBlock(p.add(i, 0, j), b);
- }
- }
- }
- }
-
- private static void drawStar(Minecraft mc, Vec p) {
- double[] radii = {0, 0, 1, 2, 1, 0};
- for (int i = 0; i < radii.length; i++) {
- drawDisc(mc, p.add(0, i, 0), radii[i], Block.GOLD_BLOCK);
- }
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/DigitalClock.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/DigitalClock.java
deleted file mode 100644
index 1f8168bf..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/DigitalClock.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package pi.demo;
-
-import java.text.DateFormat;
-import java.util.Date;
-import pi.Minecraft;
-import pi.tool.Text;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class DigitalClock {
- public static void main(String[] args) {
- //Text textTool = Minecraft.connect(args).tools.text;
-
- String lastTime = "";
- DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.SHORT);
- while (true) {
- String time = timeFormatter.format(new Date());
- if (!time.equals(lastTime)) {
- System.out.println(time);
- lastTime = time;
- }
- try {
- Thread.sleep(100);
- } catch (InterruptedException _) {
- }
- }
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/LoopDemo.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/LoopDemo.java
deleted file mode 100644
index c8672dda..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/LoopDemo.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package pi.demo;
-
-import static pi.Block.*;
-import pi.Minecraft;
-import pi.Vec;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class LoopDemo {
- public static void main(String[] args) {
- Minecraft mc = Minecraft.connect(args);
-
- for (int i = 0; i < 8; i++) {
- for (int j = 0; j < 8; j++) {
- mc.setBlock(Vec.xyz(i, 2, j), IRON_BLOCK);
- }
- }
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/LowLevelDemo.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/LowLevelDemo.java
deleted file mode 100644
index 6b793d5e..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/LowLevelDemo.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package pi.demo;
-
-import static pi.Block.*;
-import pi.Minecraft;
-import static pi.Vec.xyz;
-
-/**
- * Manipulate blocks with the low level api
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class LowLevelDemo {
-
- public static void main(String[] args) {
- createPool(Minecraft.connect(args));
- }
-
- static void createPool(Minecraft mc) {
- final int height = 0;
-
- final int r = 7;
- // Build a kind of half sphere pool
- for (int k = -r; k <= height; k++) {
- for (int j = -r; j <= r; j++) {
- for (int i = -r; i <= r; i++) {
- if (i * i + j * j + k * k < r * r) {
- mc.setBlock(xyz(i, k, j), WATER_STATIONARY);
- } else {
- mc.setBlock(xyz(i, k, j), STONE);
- }
- }
- }
- }
-
- // Set air above pool
- mc.setBlocks(xyz(r, height + 1, -r), xyz(-r, height + 30, r), AIR);
-
- // Drop the player in the pool
- mc.player.setPosition(xyz(0, 10, 0));
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/TextDemo.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/TextDemo.java
deleted file mode 100644
index 4792fb0f..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/TextDemo.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package pi.demo;
-
-import pi.Minecraft;
-import pi.tool.Text;
-import static pi.Block.*;
-import static pi.Vec.Unit.*;
-import static pi.Vec.xyz;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class TextDemo {
-
- public static void main(String[] args) {
- Text textTool = Minecraft.connect(args).tools.text;
-
- // Just draw a text
- textTool.at(xyz(0, 0, 20)).draw("pi");
-
- // Symbols are fun (skull and bones, arrr!)
- textTool.at(xyz(0, 0, 35)).with("Wingdings", 50).with(STONE).draw("\u2620");
-
- // More settings
- textTool.at(xyz(0, 10, 0)).with("Arial", 12).with(SAND).withOrientation(X, Z).draw("fun!");
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/TurtleDemo.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/TurtleDemo.java
deleted file mode 100644
index c17fe217..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/TurtleDemo.java
+++ /dev/null
@@ -1,52 +0,0 @@
-package pi.demo;
-
-import pi.*;
-import pi.tool.Turtle;
-import static pi.Block.*;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class TurtleDemo {
- public static void main(String[] args) {
- Turtle turtle = Minecraft.connect(args).tools.turtle;
-
- int width = 9, depth = 5, height = 3;
- drawHouse(turtle, width, depth, height);
- }
-
- /**
- * Draw a square house at turtle setHome
- *
- * @param turtle the turtle to use for drawing
- * @param width the width of the house
- * @param height the height of the walls
- */
- private static void drawHouse(Turtle turtle, int width, int depth, int height) {
- width--;
-
- // Floor
-
- // Walls
- turtle.home().off().up(1).block(BRICK_BLOCK).on();
- for (int i = 0; i < height; i++) {
- turtle.forward(depth).right().
- forward(width).right().
- forward(depth).right().
- forward(width).right();
- turtle.up(1);
- }
-
- // Roof
- turtle.jump(0, 0, -1).block(WOOD);
- for (int s = depth; s >= 0; s -= 2) {
- turtle.forward(s).right().forward(width + 2).right()
- .forward(s).right().forward(width + 2).right();
- turtle.jump(1, 1, 0);
- }
-
- // Door
- turtle.home().block(AIR).off().up(1).right().forward(width / 2).on().up(1);
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/Usage.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/Usage.java
deleted file mode 100644
index 8fe5ed00..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/Usage.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package pi.demo;
-
-/**
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class Usage {
- public static void main(String[] args) {
- System.out.println("Read the file HOW_TO_RUN.txt in the McPiDemos directory");
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Level.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Level.java
deleted file mode 100644
index 62d89d3c..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Level.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package pi.demo.sokoban;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Scanner;
-
-/**
- * A Sokoban level
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class Level {
- int number;
- String name;
- LevelTile[][] tiles;
- int width, height;
-
- Level(String data, int number) {
- this.number = number;
- Scanner s = new Scanner(data);
- this.name = s.nextLine();
- List rows = new ArrayList();
- while (s.hasNextLine()) {
- LevelTile[] row = parseRow(s.nextLine());
- this.width = Math.max(width, row.length);
- rows.add(row);
- }
- this.height = rows.size();
- tiles = rows.toArray(new LevelTile[height][]);
- }
-
- LevelTile get(Position p) {
- LevelTile[] row = tiles[p.j];
- return (p.i < row.length) ? row[p.i] : LevelTile.EMPTY;
- }
-
- private static LevelTile[] parseRow(String line) {
- List row = new ArrayList();
- for (char c : line.toCharArray()) {
- row.add(LevelTile.from(c));
- }
- return row.toArray(new LevelTile[row.size()]);
- }
-
- static List loadLevels() {
- List levels = new ArrayList();
- Scanner s = new Scanner(Level.class.getResourceAsStream("Level_Data"));
- s.useDelimiter("#").next();
- while (s.hasNext()) {
- levels.add(new Level(s.next(), levels.size() + 1));
- }
- return levels;
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/LevelTile.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/LevelTile.java
deleted file mode 100644
index e556565b..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/LevelTile.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package pi.demo.sokoban;
-
-/**
- * Level tile
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-enum LevelTile {
- EMPTY(' '), WALL('='), PLAYER('p'), STONE('s'), TARGET('t'), TARGET_AND_STONE('T');
- private char id;
-
- private LevelTile(char id) {
- this.id = id;
- }
-
- static LevelTile from(char id) {
- for (LevelTile t : values()) {
- if (t.id == id) {
- return t;
- }
- }
- throw new RuntimeException("Unknown id: " + id);
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Level_Data b/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Level_Data
deleted file mode 100644
index f2eff4ed..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Level_Data
+++ /dev/null
@@ -1,49 +0,0 @@
-= wall, p player, s stone, t target
-
-#Too easy
-============
-= p s t=
-============
-#Still easy
-============
-= t=
-= =
- = s=
- = p =
- ==========
-#Just work
-==========
-=t s t=
-= =
-=s s p=
-= =
-=t s t=
-==========
-#Not hard
- =====
- = ====
- = = =
- == ps t=
-=== ===t=
-= s = =t=
-= s = ===
-= =
-=====
-#centimoves
-========
-= = =
-= = =st=
-= st=
-= = =st=
-= = =
-===== p=
- ====
-#harder now?
-=======
-= t =
-= = = =
-= sps =
-= = =t=
-= T =
-=======
-
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Position.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Position.java
deleted file mode 100644
index 2815abc3..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Position.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package pi.demo.sokoban;
-
-import pi.Vec;
-
-/**
- * A position in a Sokoban level
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-class Position {
- final int i, j;
-
- private Position(int i, int j) {
- this.i = i;
- this.j = j;
- }
-
- static Position uv(int i, int j) {
- return new Position(i, j);
- }
-
- static Position fromWorld(Vec v) {
- return new Position(v.x, v.z);
- }
-
- Vec toWorld(int height) {
- return Vec.xyz(i, height, j);
- }
-
- @Override
- public int hashCode() {
- return (i << 16) + j;
- }
-
- @Override
- public boolean equals(Object obj) {
- if ((obj == null) || !(obj instanceof Position)) {
- return false;
- }
- return hashCode() == ((Position) obj).hashCode();
- }
-
- @Override
- public String toString() {
- return i + "," + j;
- }
-}
diff --git a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Sokoban.java b/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Sokoban.java
deleted file mode 100644
index 365e4267..00000000
--- a/src/main/resources/mcpi/api/java/src-demos/pi/demo/sokoban/Sokoban.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package pi.demo.sokoban;
-
-import java.util.*;
-import static pi.Block.*;
-import pi.*;
-import pi.event.BlockHitEvent;
-
-/**
- * Sokoban game for Minecraft
- *
- * @author Daniel Frisk, twitter:danfrisk
- */
-public class Sokoban {
- Minecraft mc;
- //
- List levels = Level.loadLevels();
- Level level;
- //
- PositionSet walls = new PositionSet(), targets = new PositionSet(), stones = new PositionSet();
-
- public Sokoban(Minecraft minecraft) {
- this.mc = minecraft;
- }
-
- /**
- *
- */
- public static void main(String[] args) {
- new Sokoban(Minecraft.connect(args)).run();
- }
-
- public void run() {
- mc.postToChat("Sokoban!");
- mc.camera.setNormal();
- mc.setting("immutable", true);
-
- while (true) {
- if (stones.equals(targets)) {
- if (level != null) {
- mc.postToChat("Level finished!");
- sleep(2000);
- }
- int ni = level == null ? 0 : level.number >= levels.size() ? 0 : level.number;
- startLevel(levels.get(ni));
- }
-
- List hits = mc.events.pollBlockHits();
- if (!hits.isEmpty()) {
- BlockHitEvent ev = hits.iterator().next();
- onBlockHit(ev.position, ev.surfaceDirection.neg());
- }
-
- sleep(80);
- }
- }
-
- void startLevel(Level level) {
- this.level = level;
-
- walls.clear();
- targets.clear();
- stones.clear();
-
- // Clear the ground
- mc.setBlocks(Position.uv(0, 0).toWorld(0),
- Position.uv(level.width - 1, level.height - 1).toWorld(10),
- AIR);
-
- mc.setBlocks(Position.uv(0, 0).toWorld(-1),
- Position.uv(level.width - 1, level.height - 1).toWorld(-1),
- SANDSTONE);
-
- // Set level blocks and teleport the player
- for (int v = 0; v < level.height; v++) {
- for (int u = 0; u < level.width; u++) {
- Position pos = Position.uv(u, v);
-
- LevelTile t = level.get(pos);
- if (LevelTile.EMPTY == t) {
- continue;
- }
- if (LevelTile.WALL == t) {
- walls.add(pos);
- mc.setBlocks(pos.toWorld(0), pos.toWorld(2), STONE);
- }
- if (LevelTile.PLAYER == t) {
- mc.player.setPosition(pos.toWorld(2));
- }
- if (LevelTile.TARGET == t || LevelTile.TARGET_AND_STONE == t) {
- targets.add(pos);
- mc.setBlock(pos.toWorld(-1), wool(Color.LIGHT_BLUE));
- }
- if (LevelTile.STONE == t || LevelTile.TARGET_AND_STONE == t) {
- stones.add(pos);
- mc.setBlock(pos.toWorld(0), IRON_BLOCK);
- }
- }
- }
-
- mc.events.clearAll();
- mc.postToChat("Level " + level.number + " - " + level.name);
- }
-
- void onBlockHit(Vec position, Vec.Unit direction) {
- Position from = Position.fromWorld(position);
- Position to = Position.fromWorld(position.add(direction));
- if (!from.equals(to) && !walls.contains(to) && !stones.contains(to)) {
- if (stones.remove(from)) {
- stones.add(to);
- mc.setBlock(to.toWorld(0), targets.contains(to) ? GOLD_BLOCK : IRON_BLOCK);
- mc.setBlock(position, AIR);
- }
- }
- }
-
- void sleep(long millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException _) {
- }
- }
-
- /**
- *
- */
- private static class PositionSet extends HashSet {
- }
-}
diff --git a/src/main/resources/mcpi/api/python/modded/mcpi/minecraft.py b/src/main/resources/mcpi/api/python/modded/mcpi/minecraft.py
deleted file mode 100644
index bffb491d..00000000
--- a/src/main/resources/mcpi/api/python/modded/mcpi/minecraft.py
+++ /dev/null
@@ -1,261 +0,0 @@
-from .connection import Connection
-from .vec3 import Vec3
-from .event import BlockEvent, ChatEvent
-from .entity import Entity
-from .block import Block
-import math
-from .util import flatten
-
-""" Minecraft PI low level api v0.1_1
-
- Note: many methods have the parameter *arg. This solution makes it
- simple to allow different types, and variable number of arguments.
- The actual magic is a mix of flatten_parameters() and __iter__. Example:
- A Cube class could implement __iter__ to work in Minecraft.setBlocks(c, id).
-
- (Because of this, it's possible to "erase" arguments. CmdPlayer removes
- entityId, by injecting [] that flattens to nothing)
-
- @author: Aron Nieminen, Mojang AB"""
-
-""" Updated to include functionality provided by RaspberryJuice:
-- getBlocks()
-- getDirection()
-- getPitch()
-- getRotation()
-- getPlayerEntityId()
-- pollChatPosts()
-- setSign()
-- spawnEntity()"""
-
-def intFloor(*args):
- return [int(math.floor(x)) for x in flatten(args)]
-
-class CmdPositioner:
- """Methods for setting and getting positions"""
- def __init__(self, connection, packagePrefix):
- self.conn = connection
- self.pkg = packagePrefix
-
- def getPos(self, id):
- """Get entity position (entityId:int) => Vec3"""
- s = self.conn.sendReceive(self.pkg + b".getPos", id)
- return Vec3(*list(map(float, s.split(","))))
-
- def setPos(self, id, *args):
- """Set entity position (entityId:int, x,y,z)"""
- self.conn.send(self.pkg + b".setPos", id, args)
-
- def getTilePos(self, id):
- """Get entity tile position (entityId:int) => Vec3"""
- s = self.conn.sendReceive(self.pkg + b".getTile", id)
- return Vec3(*list(map(int, s.split(","))))
-
- def setTilePos(self, id, *args):
- """Set entity tile position (entityId:int) => Vec3"""
- self.conn.send(self.pkg + b".setTile", id, intFloor(*args))
-
- def setDirection(self, id, *args):
- """Set entity direction (entityId:int, x,y,z)"""
- self.conn.send(self.pkg + b".setDirection", id, args)
-
- def getDirection(self, id):
- """Get entity direction (entityId:int) => Vec3"""
- s = self.conn.sendReceive(self.pkg + b".getDirection", id)
- return Vec3(*map(float, s.split(",")))
-
- def setRotation(self, id, yaw):
- """Set entity rotation (entityId:int, yaw)"""
- self.conn.send(self.pkg + b".setRotation", id, yaw)
-
- def getRotation(self, id):
- """get entity rotation (entityId:int) => float"""
- return float(self.conn.sendReceive(self.pkg + b".getRotation", id))
-
- def setPitch(self, id, pitch):
- """Set entity pitch (entityId:int, pitch)"""
- self.conn.send(self.pkg + b".setPitch", id, pitch)
-
- def getPitch(self, id):
- """get entity pitch (entityId:int) => float"""
- return float(self.conn.sendReceive(self.pkg + b".getPitch", id))
-
- def setting(self, setting, status):
- """Set a player setting (setting, status). keys: autojump"""
- self.conn.send(self.pkg + b".setting", setting, 1 if bool(status) else 0)
-
-class CmdEntity(CmdPositioner):
- """Methods for entities"""
- def __init__(self, connection):
- CmdPositioner.__init__(self, connection, b"entity")
-
- def getName(self, id):
- """Get the list name of the player with entity id => [name:str]
-
- Also can be used to find name of entity if entity is not a player."""
- return self.conn.sendReceive(b"entity.getName", id)
-
-
-class CmdPlayer(CmdPositioner):
- """Methods for the host (Raspberry Pi) player"""
- def __init__(self, connection):
- CmdPositioner.__init__(self, connection, b"player")
- self.conn = connection
-
- def getPos(self):
- return CmdPositioner.getPos(self, [])
- def setPos(self, *args):
- return CmdPositioner.setPos(self, [], args)
- def getTilePos(self):
- return CmdPositioner.getTilePos(self, [])
- def setTilePos(self, *args):
- return CmdPositioner.setTilePos(self, [], args)
- def setDirection(self, *args):
- return CmdPositioner.setDirection(self, [], args)
- def getDirection(self):
- return CmdPositioner.getDirection(self, [])
- def setRotation(self, yaw):
- return CmdPositioner.setRotation(self, [], yaw)
- def getRotation(self):
- return CmdPositioner.getRotation(self, [])
- def setPitch(self, pitch):
- return CmdPositioner.setPitch(self, [], pitch)
- def getPitch(self):
- return CmdPositioner.getPitch(self, [])
-
-class CmdCamera:
- def __init__(self, connection):
- self.conn = connection
-
- def setNormal(self, *args):
- """Set camera mode to normal Minecraft view ([entityId])"""
- self.conn.send(b"camera.mode.setNormal", args)
-
- def setFixed(self):
- """Set camera mode to fixed view"""
- self.conn.send(b"camera.mode.setFixed")
-
- def setFollow(self, *args):
- """Set camera mode to follow an entity ([entityId])"""
- self.conn.send(b"camera.mode.setFollow", args)
-
- def setPos(self, *args):
- """Set camera entity position (x,y,z)"""
- self.conn.send(b"camera.setPos", args)
-
-
-class CmdEvents:
- """Events"""
- def __init__(self, connection):
- self.conn = connection
-
- def clearAll(self):
- """Clear all old events"""
- self.conn.send(b"events.clear")
-
- def pollBlockHits(self):
- """Only triggered by sword => [BlockEvent]"""
- s = self.conn.sendReceive(b"events.block.hits")
- events = [e for e in s.split("|") if e]
- return [BlockEvent.Hit(*list(map(int, e.split(",")))) for e in events]
-
- def pollChatPosts(self):
- """Triggered by posts to chat => [ChatEvent]"""
- s = self.conn.sendReceive(b"events.chat.posts")
- events = [e for e in s.split("|") if e]
- return [ChatEvent.Post(int(e[:e.find(",")]), e[e.find(",") + 1:]) for e in events]
-
-class Minecraft:
- """The main class to interact with a running instance of Minecraft Pi."""
- def __init__(self, connection):
- self.conn = connection
-
- self.camera = CmdCamera(connection)
- self.entity = CmdEntity(connection)
- self.player = CmdPlayer(connection)
- self.events = CmdEvents(connection)
-
- def getBlock(self, *args):
- """Get block (x,y,z) => id:int"""
- return int(self.conn.sendReceive(b"world.getBlock", intFloor(args)))
-
- def getBlockWithData(self, *args):
- """Get block with data (x,y,z) => Block"""
- ans = self.conn.sendReceive(b"world.getBlockWithData", intFloor(args))
- return Block(*list(map(int, ans.split(","))))
-
- def getBlocks(self, *args):
- """Get a cuboid of blocks (x0,y0,z0,x1,y1,z1) => [id:int]"""
- s = self.conn.sendReceive(b"world.getBlocks", intFloor(args))
- return map(int, s.split(","))
-
- def setBlock(self, *args):
- """Set block (x,y,z,id,[data])"""
- self.conn.send(b"world.setBlock", intFloor(args))
-
- def setBlocks(self, *args):
- """Set a cuboid of blocks (x0,y0,z0,x1,y1,z1,id,[data])"""
- self.conn.send(b"world.setBlocks", intFloor(args))
-
- def setSign(self, *args):
- """Set a sign (x,y,z,id,data,[line1,line2,line3,line4])
-
- Wall signs (id=68) require data for facing direction 2=north, 3=south, 4=west, 5=east
- Standing signs (id=63) require data for facing rotation (0-15) 0=south, 4=west, 8=north, 12=east
- @author: Tim Cummings https://www.triptera.com.au/wordpress/"""
- lines = []
- flatargs = []
- for arg in flatten(args):
- flatargs.append(arg)
- for flatarg in flatargs[5:]:
- lines.append(flatarg.replace(",",";").replace(")","]").replace("(","["))
- self.conn.send(b"world.setSign",intFloor(flatargs[0:5]) + lines)
-
- def spawnEntity(self, *args):
- """Spawn entity (x,y,z,id,[data])"""
- return int(self.conn.sendReceive(b"world.spawnEntity", intFloor(args)))
-
- def getHeight(self, *args):
- """Get the height of the world (x,z) => int"""
- return int(self.conn.sendReceive(b"world.getHeight", intFloor(args)))
-
- def getPlayerEntityIds(self):
- """Get the entity ids of the connected players => [id:int]"""
- ids = self.conn.sendReceive(b"world.getPlayerIds")
- return list(map(int, ids.split("|")))
-
- def getPlayerEntityId(self, name):
- """Get the entity id of the named player => [id:int]"""
- return int(self.conn.sendReceive(b"world.getPlayerId", name))
-
- def saveCheckpoint(self):
- """Save a checkpoint that can be used for restoring the world"""
- self.conn.send(b"world.checkpoint.save")
-
- def restoreCheckpoint(self):
- """Restore the world state to the checkpoint"""
- self.conn.send(b"world.checkpoint.restore")
-
- def postToChat(self, msg):
- """Post a message to the game chat"""
- self.conn.send(b"chat.post", msg)
-
- def setting(self, setting, status):
- """Set a world setting (setting, status). keys: world_immutable, nametags_visible"""
- self.conn.send(b"world.setting", setting, 1 if bool(status) else 0)
-
- def getEntityTypes(self):
- """Return a list of Entity objects representing all the entity types in Minecraft"""
- s = self.conn.sendReceive(b"world.getEntityTypes")
- types = [t for t in s.split("|") if t]
- return [Entity(int(e[:e.find(",")]), e[e.find(",") + 1:]) for e in types]
-
-
- @staticmethod
- def create(address = "localhost", port = 4711):
- return Minecraft(Connection(address, port))
-
-
-if __name__ == "__main__":
- mc = Minecraft.create()
- mc.postToChat("Hello, Minecraft!")
diff --git a/src/main/resources/mcpi/api/python/original/mcpi/event.py b/src/main/resources/mcpi/api/python/original/mcpi/event.py
deleted file mode 100644
index 68193bc9..00000000
--- a/src/main/resources/mcpi/api/python/original/mcpi/event.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from .vec3 import Vec3
-
-class BlockEvent:
- """An Event related to blocks (e.g. placed, removed, hit)"""
- HIT = 0
-
- def __init__(self, type, x, y, z, face, entityId):
- self.type = type
- self.pos = Vec3(x, y, z)
- self.face = face
- self.entityId = entityId
-
- def __repr__(self):
- sType = {
- BlockEvent.HIT: "BlockEvent.HIT"
- }.get(self.type, "???")
-
- return "BlockEvent(%s, %d, %d, %d, %d, %d)"%(
- sType,self.pos.x,self.pos.y,self.pos.z,self.face,self.entityId);
-
- @staticmethod
- def Hit(x, y, z, face, entityId):
- return BlockEvent(BlockEvent.HIT, x, y, z, face, entityId)
diff --git a/src/main/resources/mcpi/api/python/original/mcpi/minecraft.py b/src/main/resources/mcpi/api/python/original/mcpi/minecraft.py
deleted file mode 100644
index 1d1f293d..00000000
--- a/src/main/resources/mcpi/api/python/original/mcpi/minecraft.py
+++ /dev/null
@@ -1,176 +0,0 @@
-from .connection import Connection
-from .vec3 import Vec3
-from .event import BlockEvent
-from .block import Block
-import math
-from .util import flatten
-
-""" Minecraft PI low level api v0.1_1
-
- Note: many methods have the parameter *arg. This solution makes it
- simple to allow different types, and variable number of arguments.
- The actual magic is a mix of flatten_parameters() and __iter__. Example:
- A Cube class could implement __iter__ to work in Minecraft.setBlocks(c, id).
-
- (Because of this, it's possible to "erase" arguments. CmdPlayer removes
- entityId, by injecting [] that flattens to nothing)
-
- @author: Aron Nieminen, Mojang AB"""
-
-
-def intFloor(*args):
- return [int(math.floor(x)) for x in flatten(args)]
-
-class CmdPositioner:
- """Methods for setting and getting positions"""
- def __init__(self, connection, packagePrefix):
- self.conn = connection
- self.pkg = packagePrefix
-
- def getPos(self, id):
- """Get entity position (entityId:int) => Vec3"""
- s = self.conn.sendReceive(self.pkg + b".getPos", id)
- return Vec3(*list(map(float, s.split(","))))
-
- def setPos(self, id, *args):
- """Set entity position (entityId:int, x,y,z)"""
- self.conn.send(self.pkg + b".setPos", id, args)
-
- def getTilePos(self, id):
- """Get entity tile position (entityId:int) => Vec3"""
- s = self.conn.sendReceive(self.pkg + b".getTile", id)
- return Vec3(*list(map(int, s.split(","))))
-
- def setTilePos(self, id, *args):
- """Set entity tile position (entityId:int) => Vec3"""
- self.conn.send(self.pkg + b".setTile", id, intFloor(*args))
-
- def setting(self, setting, status):
- """Set a player setting (setting, status). keys: autojump"""
- self.conn.send(self.pkg + b".setting", setting, 1 if bool(status) else 0)
-
-
-class CmdEntity(CmdPositioner):
- """Methods for entities"""
- def __init__(self, connection):
- CmdPositioner.__init__(self, connection, b"entity")
-
-
-class CmdPlayer(CmdPositioner):
- """Methods for the host (Raspberry Pi) player"""
- def __init__(self, connection):
- CmdPositioner.__init__(self, connection, b"player")
- self.conn = connection
-
- def getPos(self):
- return CmdPositioner.getPos(self, [])
- def setPos(self, *args):
- return CmdPositioner.setPos(self, [], args)
- def getTilePos(self):
- return CmdPositioner.getTilePos(self, [])
- def setTilePos(self, *args):
- return CmdPositioner.setTilePos(self, [], args)
-
-class CmdCamera:
- def __init__(self, connection):
- self.conn = connection
-
- def setNormal(self, *args):
- """Set camera mode to normal Minecraft view ([entityId])"""
- self.conn.send(b"camera.mode.setNormal", args)
-
- def setFixed(self):
- """Set camera mode to fixed view"""
- self.conn.send(b"camera.mode.setFixed")
-
- def setFollow(self, *args):
- """Set camera mode to follow an entity ([entityId])"""
- self.conn.send(b"camera.mode.setFollow", args)
-
- def setPos(self, *args):
- """Set camera entity position (x,y,z)"""
- self.conn.send(b"camera.setPos", args)
-
-
-class CmdEvents:
- """Events"""
- def __init__(self, connection):
- self.conn = connection
-
- def clearAll(self):
- """Clear all old events"""
- self.conn.send(b"events.clear")
-
- def pollBlockHits(self):
- """Only triggered by sword => [BlockEvent]"""
- s = self.conn.sendReceive(b"events.block.hits")
- events = [e for e in s.split("|") if e]
- return [BlockEvent.Hit(*list(map(int, e.split(",")))) for e in events]
-
-
-class Minecraft:
- """The main class to interact with a running instance of Minecraft Pi."""
- def __init__(self, connection):
- self.conn = connection
-
- self.camera = CmdCamera(connection)
- self.entity = CmdEntity(connection)
- self.player = CmdPlayer(connection)
- self.events = CmdEvents(connection)
-
- def getBlock(self, *args):
- """Get block (x,y,z) => id:int"""
- return int(self.conn.sendReceive(b"world.getBlock", intFloor(args)))
-
- def getBlockWithData(self, *args):
- """Get block with data (x,y,z) => Block"""
- ans = self.conn.sendReceive(b"world.getBlockWithData", intFloor(args))
- return Block(*list(map(int, ans.split(","))))
- """
- @TODO
- """
- def getBlocks(self, *args):
- """Get a cuboid of blocks (x0,y0,z0,x1,y1,z1) => [id:int]"""
- return int(self.conn.sendReceive(b"world.getBlocks", intFloor(args)))
-
- def setBlock(self, *args):
- """Set block (x,y,z,id,[data])"""
- self.conn.send(b"world.setBlock", intFloor(args))
-
- def setBlocks(self, *args):
- """Set a cuboid of blocks (x0,y0,z0,x1,y1,z1,id,[data])"""
- self.conn.send(b"world.setBlocks", intFloor(args))
-
- def getHeight(self, *args):
- """Get the height of the world (x,z) => int"""
- return int(self.conn.sendReceive(b"world.getHeight", intFloor(args)))
-
- def getPlayerEntityIds(self):
- """Get the entity ids of the connected players => [id:int]"""
- ids = self.conn.sendReceive(b"world.getPlayerIds")
- return list(map(int, ids.split("|")))
-
- def saveCheckpoint(self):
- """Save a checkpoint that can be used for restoring the world"""
- self.conn.send(b"world.checkpoint.save")
-
- def restoreCheckpoint(self):
- """Restore the world state to the checkpoint"""
- self.conn.send(b"world.checkpoint.restore")
-
- def postToChat(self, msg):
- """Post a message to the game chat"""
- self.conn.send(b"chat.post", msg)
-
- def setting(self, setting, status):
- """Set a world setting (setting, status). keys: world_immutable, nametags_visible"""
- self.conn.send(b"world.setting", setting, 1 if bool(status) else 0)
-
- @staticmethod
- def create(address = "localhost", port = 4711):
- return Minecraft(Connection(address, port))
-
-
-if __name__ == "__main__":
- mc = Minecraft.create()
- mc.postToChat("Hello, Minecraft!")
diff --git a/src/main/resources/mcpi/api/python/modded/mcpi/block.py b/src/main/resources/mcpi/block.py
similarity index 71%
rename from src/main/resources/mcpi/api/python/modded/mcpi/block.py
rename to src/main/resources/mcpi/block.py
index b64bc6c1..52c85023 100644
--- a/src/main/resources/mcpi/api/python/modded/mcpi/block.py
+++ b/src/main/resources/mcpi/block.py
@@ -49,11 +49,8 @@ def __repr__(self):
LAPIS_LAZULI_BLOCK = Block(22)
SANDSTONE = Block(24)
BED = Block(26)
-RAIL_POWERED = Block(27)
-RAIL_DETECTOR = Block(28)
COBWEB = Block(30)
GRASS_TALL = Block(31)
-DEAD_BUSH = Block(32)
WOOL = Block(35)
FLOWER_YELLOW = Block(37)
FLOWER_CYAN = Block(38)
@@ -78,15 +75,11 @@ def __repr__(self):
FARMLAND = Block(60)
FURNACE_INACTIVE = Block(61)
FURNACE_ACTIVE = Block(62)
-SIGN_STANDING = Block(63)
DOOR_WOOD = Block(64)
LADDER = Block(65)
-RAIL = Block(66)
STAIRS_COBBLESTONE = Block(67)
-SIGN_WALL = Block(68)
DOOR_IRON = Block(71)
REDSTONE_ORE = Block(73)
-TORCH_REDSTONE = Block(76)
SNOW = Block(78)
ICE = Block(79)
SNOW_BLOCK = Block(80)
@@ -94,40 +87,11 @@ def __repr__(self):
CLAY = Block(82)
SUGAR_CANE = Block(83)
FENCE = Block(85)
-PUMPKIN = Block(86)
-NETHERRACK = Block(87)
-SOUL_SAND = Block(88)
GLOWSTONE_BLOCK = Block(89)
-LIT_PUMPKIN = Block(91)
-STAINED_GLASS = Block(95)
BEDROCK_INVISIBLE = Block(95)
-TRAPDOOR = Block(96)
STONE_BRICK = Block(98)
GLASS_PANE = Block(102)
MELON = Block(103)
FENCE_GATE = Block(107)
-STAIRS_BRICK = Block(108)
-STAIRS_STONE_BRICK = Block(109)
-MYCELIUM = Block(110)
-NETHER_BRICK = Block(112)
-FENCE_NETHER_BRICK = Block(113)
-STAIRS_NETHER_BRICK = Block(114)
-END_STONE = Block(121)
-WOODEN_SLAB = Block(126)
-STAIRS_SANDSTONE = Block(128)
-EMERALD_ORE = Block(129)
-RAIL_ACTIVATOR = Block(157)
-LEAVES2 = Block(161)
-TRAPDOOR_IRON = Block(167)
-FENCE_SPRUCE = Block(188)
-FENCE_BIRCH = Block(189)
-FENCE_JUNGLE = Block(190)
-FENCE_DARK_OAK = Block(191)
-FENCE_ACACIA = Block(192)
-DOOR_SPRUCE = Block(193)
-DOOR_BIRCH = Block(194)
-DOOR_JUNGLE = Block(195)
-DOOR_ACACIA = Block(196)
-DOOR_DARK_OAK = Block(197)
GLOWING_OBSIDIAN = Block(246)
NETHER_REACTOR_CORE = Block(247)
diff --git a/src/main/resources/mcpi/api/python/original/mcpi/connection.py b/src/main/resources/mcpi/connection.py
similarity index 90%
rename from src/main/resources/mcpi/api/python/original/mcpi/connection.py
rename to src/main/resources/mcpi/connection.py
index ab078e88..dd337bd4 100644
--- a/src/main/resources/mcpi/api/python/original/mcpi/connection.py
+++ b/src/main/resources/mcpi/connection.py
@@ -53,8 +53,9 @@ def _send(self, s):
def receive(self):
"""Receives data. Note that the trailing newline '\n' is trimmed"""
s = self.socket.makefile("r").readline().rstrip("\n")
- if s == Connection.RequestFailed:
- raise RequestError("%s failed"%self.lastSent.strip())
+ checkFail = s.split(",")
+ if checkFail[0] == Connection.RequestFailed:
+ raise RequestError("%s failed! Cause: %s" % (self.lastSent.strip(),checkFail[-1]))
return s
def sendReceive(self, *data):
diff --git a/src/main/resources/mcpi/entity.py b/src/main/resources/mcpi/entity.py
new file mode 100644
index 00000000..b78a4850
--- /dev/null
+++ b/src/main/resources/mcpi/entity.py
@@ -0,0 +1,102 @@
+class Entity:
+ '''Minecraft PI entity description. Can be sent to Minecraft.spawnEntity'''
+
+ def __init__(self, id, name = None):
+ self.id = id
+ self.name = name
+
+ def __cmp__(self, rhs):
+ return hash(self) - hash(rhs)
+
+ def __eq__(self, rhs):
+ return self.id == rhs.id
+
+ def __hash__(self):
+ return self.id
+
+ def __iter__(self):
+ '''Allows an Entity to be sent whenever id is needed'''
+ return iter((self.id,))
+
+ def __repr__(self):
+ return 'Entity(%d)'%(self.id)
+
+EXPERIENCE_ORB = Entity(2, "EXPERIENCE_ORB")
+AREA_EFFECT_CLOUD = Entity(3, "AREA_EFFECT_CLOUD")
+ELDER_GUARDIAN = Entity(4, "ELDER_GUARDIAN")
+WITHER_SKELETON = Entity(5, "WITHER_SKELETON")
+STRAY = Entity(6, "STRAY")
+EGG = Entity(7, "EGG")
+LEASH_HITCH = Entity(8, "LEASH_HITCH")
+PAINTING = Entity(9, "PAINTING")
+ARROW = Entity(10, "ARROW")
+SNOWBALL = Entity(11, "SNOWBALL")
+FIREBALL = Entity(12, "FIREBALL")
+SMALL_FIREBALL = Entity(13, "SMALL_FIREBALL")
+ENDER_PEARL = Entity(14, "ENDER_PEARL")
+ENDER_SIGNAL = Entity(15, "ENDER_SIGNAL")
+THROWN_EXP_BOTTLE = Entity(17, "THROWN_EXP_BOTTLE")
+ITEM_FRAME = Entity(18, "ITEM_FRAME")
+WITHER_SKULL = Entity(19, "WITHER_SKULL")
+PRIMED_TNT = Entity(20, "PRIMED_TNT")
+HUSK = Entity(23, "HUSK")
+SPECTRAL_ARROW = Entity(24, "SPECTRAL_ARROW")
+SHULKER_BULLET = Entity(25, "SHULKER_BULLET")
+DRAGON_FIREBALL = Entity(26, "DRAGON_FIREBALL")
+ZOMBIE_VILLAGER = Entity(27, "ZOMBIE_VILLAGER")
+SKELETON_HORSE = Entity(28, "SKELETON_HORSE")
+ZOMBIE_HORSE = Entity(29, "ZOMBIE_HORSE")
+ARMOR_STAND = Entity(30, "ARMOR_STAND")
+DONKEY = Entity(31, "DONKEY")
+MULE = Entity(32, "MULE")
+EVOKER_FANGS = Entity(33, "EVOKER_FANGS")
+EVOKER = Entity(34, "EVOKER")
+VEX = Entity(35, "VEX")
+VINDICATOR = Entity(36, "VINDICATOR")
+ILLUSIONER = Entity(37, "ILLUSIONER")
+MINECART_COMMAND = Entity(40, "MINECART_COMMAND")
+BOAT = Entity(41, "BOAT")
+MINECART = Entity(42, "MINECART")
+MINECART_CHEST = Entity(43, "MINECART_CHEST")
+MINECART_FURNACE = Entity(44, "MINECART_FURNACE")
+MINECART_TNT = Entity(45, "MINECART_TNT")
+MINECART_HOPPER = Entity(46, "MINECART_HOPPER")
+MINECART_MOB_SPAWNER = Entity(47, "MINECART_MOB_SPAWNER")
+CREEPER = Entity(50, "CREEPER")
+SKELETON = Entity(51, "SKELETON")
+SPIDER = Entity(52, "SPIDER")
+GIANT = Entity(53, "GIANT")
+ZOMBIE = Entity(54, "ZOMBIE")
+SLIME = Entity(55, "SLIME")
+GHAST = Entity(56, "GHAST")
+PIG_ZOMBIE = Entity(57, "PIG_ZOMBIE")
+ENDERMAN = Entity(58, "ENDERMAN")
+CAVE_SPIDER = Entity(59, "CAVE_SPIDER")
+SILVERFISH = Entity(60, "SILVERFISH")
+BLAZE = Entity(61, "BLAZE")
+MAGMA_CUBE = Entity(62, "MAGMA_CUBE")
+ENDER_DRAGON = Entity(63, "ENDER_DRAGON")
+WITHER = Entity(64, "WITHER")
+BAT = Entity(65, "BAT")
+WITCH = Entity(66, "WITCH")
+ENDERMITE = Entity(67, "ENDERMITE")
+GUARDIAN = Entity(68, "GUARDIAN")
+SHULKER = Entity(69, "SHULKER")
+PIG = Entity(90, "PIG")
+SHEEP = Entity(91, "SHEEP")
+COW = Entity(92, "COW")
+CHICKEN = Entity(93, "CHICKEN")
+SQUID = Entity(94, "SQUID")
+WOLF = Entity(95, "WOLF")
+MUSHROOM_COW = Entity(96, "MUSHROOM_COW")
+SNOWMAN = Entity(97, "SNOWMAN")
+OCELOT = Entity(98, "OCELOT")
+IRON_GOLEM = Entity(99, "IRON_GOLEM")
+HORSE = Entity(100, "HORSE")
+RABBIT = Entity(101, "RABBIT")
+POLAR_BEAR = Entity(102, "POLAR_BEAR")
+LLAMA = Entity(103, "LLAMA")
+LLAMA_SPIT = Entity(104, "LLAMA_SPIT")
+PARROT = Entity(105, "PARROT")
+VILLAGER = Entity(120, "VILLAGER")
+ENDER_CRYSTAL = Entity(200, "ENDER_CRYSTAL")
\ No newline at end of file
diff --git a/src/main/resources/mcpi/event.py b/src/main/resources/mcpi/event.py
new file mode 100644
index 00000000..5bec5cba
--- /dev/null
+++ b/src/main/resources/mcpi/event.py
@@ -0,0 +1,65 @@
+from .vec3 import Vec3
+
+class BlockEvent:
+ """An Event related to blocks (e.g. placed, removed, hit)"""
+ HIT = 0
+
+ def __init__(self, type, x, y, z, face, entityId):
+ self.type = type
+ self.pos = Vec3(x, y, z)
+ self.face = face
+ self.entityId = entityId
+
+ def __repr__(self):
+ sType = {
+ BlockEvent.HIT: "BlockEvent.HIT"
+ }.get(self.type, "???")
+
+ return "BlockEvent(%s, %d, %d, %d, %d, %d)"%(
+ sType,self.pos.x,self.pos.y,self.pos.z,self.face,self.entityId);
+
+ @staticmethod
+ def Hit(x, y, z, face, entityId):
+ return BlockEvent(BlockEvent.HIT, x, y, z, face, entityId)
+
+class ArrowHitEvent:
+ """An Event related to blocks (e.g. placed, removed, hit)"""
+ HIT = 0
+
+ def __init__(self, type, x, y, z, entityId):
+ self.type = type
+ self.pos = Vec3(x, y, z)
+ self.entityId = entityId
+
+ def __repr__(self):
+ sType = {
+ ArrowHitEvent.HIT: "ArrowHitEvent.HIT"
+ }.get(self.type, "???")
+
+ return "BlockEvent(%s, %d, %d, %d, %d)"%(
+ sType,self.pos.x,self.pos.y,self.pos.z,self.entityId);
+
+ @staticmethod
+ def Hit(x, y, z, entityId):
+ return ArrowHitEvent(ArrowHitEvent.HIT, x, y, z, entityId)
+
+class ChatEvent:
+ """An Event related to chat (e.g. posts)"""
+ POST = 0
+
+ def __init__(self, type, entityId, message):
+ self.type = type
+ self.entityId = entityId
+ self.message = message
+
+ def __repr__(self):
+ sType = {
+ ChatEvent.POST: "ChatEvent.POST"
+ }.get(self.type, "???")
+
+ return "ChatEvent(%s, %d, %s)"%(
+ sType,self.entityId,self.message);
+
+ @staticmethod
+ def Post(entityId, message):
+ return ChatEvent(ChatEvent.POST, entityId, message)
\ No newline at end of file
diff --git a/src/main/resources/mcpi/minecraft.py b/src/main/resources/mcpi/minecraft.py
new file mode 100644
index 00000000..ec92b6b2
--- /dev/null
+++ b/src/main/resources/mcpi/minecraft.py
@@ -0,0 +1,329 @@
+from .connection import Connection
+from .vec3 import Vec3
+from .event import BlockEvent, ChatEvent, ArrowHitEvent
+#from .entity import Entity
+#from .block import Block
+from .util import flatten
+from warnings import warn
+
+""" Minecraft PI low level api v0.1_1
+
+ Note: many methods have the parameter *arg. This solution makes it
+ simple to allow different types, and variable number of arguments.
+ The actual magic is a mix of flatten_parameters() and __iter__. Example:
+ A Cube class could implement __iter__ to work in Minecraft.setBlocks(c, id).
+
+ (Because of this, it's possible to "erase" arguments. CmdPlayer removes
+ entityId, by injecting [] that flattens to nothing)
+
+ @author: Aron Nieminen, Mojang AB"""
+
+
+def intFloor(*args):
+ return [int(x) for x in flatten(args)]
+
+class CmdPositioner:
+ """Methods for setting and getting positions"""
+ def __init__(self, connection, packagePrefix):
+ self.conn = connection
+ self.pkg = packagePrefix
+
+ def getPos(self, ID) -> Vec3:
+ """Get entity position (entityId:int) => Vec3"""
+ s = self.conn.sendReceive(self.pkg + b".getPos", ID)
+ return Vec3(*list(map(float, s.split(","))))
+
+ def setPos(self, ID, x:float, y:float, z:float) -> None:
+ """Set entity position (entityId:int, x,y,z)"""
+ self.conn.send(self.pkg + b".setPos", ID, x, y, z)
+
+ def getTilePos(self, ID) -> Vec3:
+ """Get entity tile position (entityId:int) => Vec3"""
+ s = self.conn.sendReceive(self.pkg + b".getTile", ID)
+ return Vec3(*list(map(int, s.split(","))))
+
+ def setTilePos(self, ID, x:int, y:int, z:int) -> None:
+ """Set entity tile position (entityId:int) => Vec3"""
+ self.conn.send(self.pkg + b".setTile", ID, x, y, z)
+
+ def getDirection(self, ID) -> Vec3:
+ """Get direction of the entity"""
+ s = self.conn.sendReceive(self.pkg + b".getDirection", id)
+ return Vec3(*list(s.split(",")))
+
+ def setDirection(self, ID, x:float, y:float, z:float) -> None:
+ """Set direction of the entity"""
+ self.conn.send(self.pkg + b".setDirection", ID, x, y, z)
+
+ def getRotation(self, ID) -> float:
+ """Get rotation if the entity"""
+ s = self.conn.sendReceive(self.pkg + b".getRotation", ID)
+ return float(s)
+
+ def setRotation(self, ID, yaw) -> float:
+ """Set rotation if the entity"""
+ self.conn.send(self.pkg + b".setRotation", ID, yaw)
+
+ def getPitch(self, ID) -> float:
+ """Get pitch if the entity"""
+ s = self.conn.sendReceive(self.pkg + b".getPitch", ID)
+ return float(s)
+
+ def setPitch(self, ID, pitch) -> None:
+ """Set pitch if the entity"""
+ self.conn.send(self.pkg + b".setPitch", ID, pitch)
+
+ def setting(self, setting, status):
+ """Set a player setting (setting, status). keys: autojump"""
+ self.conn.send(self.pkg + b".setting", setting, 1 if bool(status) else 0)
+
+
+class CmdEntity(CmdPositioner):
+ """Methods for entities"""
+ def __init__(self, connection):
+ CmdPositioner.__init__(self, connection, b"entity")
+
+ def getName(self, ID):
+ """Get the list name of the player with entity id => [name:str]
+
+ Also can be used to find name of entity if entity is not a player."""
+ return self.conn.sendReceive(b"entity.getName", ID)
+
+
+class CmdPlayer(CmdPositioner):
+ """Methods for the host (Raspberry Pi) player"""
+ def __init__(self, connection):
+ CmdPositioner.__init__(self, connection, b"player")
+ self.conn = connection
+
+ def getPos(self) -> Vec3:
+ return CmdPositioner.getPos(self, [])
+ def setPos(self, x:float, y:float, z:float) -> None:
+ return CmdPositioner.setPos(self, [], x, y, z)
+ def getTilePos(self) -> Vec3:
+ return CmdPositioner.getTilePos(self, [])
+ def setTilePos(self, x:int, y:int, z:int) -> None:
+ return CmdPositioner.setTilePos(self, [], x, y, z)
+ def getDirection(self) -> Vec3:
+ return CmdPositioner.getDirection(self, [])
+ def setDirection(self, x:float, y:float, z:float) -> None:
+ return CmdPositioner.setDirection(self, [], x, y, z)
+ def getRotation(self) -> float:
+ return CmdPositioner.getRotation(self, [])
+ def setRotation(self, yaw) -> None:
+ return CmdPositioner.setRotation(self, [], yaw)
+ def getPitch(self) -> float:
+ return CmdPositioner.getPitch(self, [])
+ def setPitch(self, pitch) -> None:
+ return CmdPositioner.setPitch(self, [], pitch)
+
+ def getFoodLevel(self) -> int:
+ return self.conn.sendReceive(self.pkg + b".getFoodLevel", [])
+
+ def setFoodLevel(self, foodLevel:int) -> None:
+ self.conn.send(self.pkg + b".setFoodLevel", foodLevel)
+
+ def getHealth(self) -> float:
+ return self.conn.sendReceive(self.pkg + b".getHealth", [])
+
+ def setHealth(self, health:float) -> None:
+ self.conn.send(self.pkg + b".setHealth", [], health)
+
+ def sendTitle(self, title:str, subTitle:str="", fadeIn:int=10, stay:int=70, fadeOut:int=20) -> None:
+ self.conn.send(self.pkg + b".sendTitle", id, title, subTitle, fadeIn, stay, fadeOut)
+
+class CmdCamera:
+ def __init__(self, connection):
+ self.conn = connection
+
+ def setNormal(self, *args) -> None:
+ """Set camera mode to normal Minecraft view ([entityId])"""
+ self.conn.send(b"camera.mode.setNormal", args)
+
+ def setFixed(self) -> None:
+ """Set camera mode to fixed view"""
+ self.conn.send(b"camera.mode.setFixed")
+
+ def setFollow(self, *args) -> None:
+ """Set camera mode to follow an entity ([entityId])"""
+ self.conn.send(b"camera.mode.setFollow", args)
+
+ def setPos(self, x:float, y:float, z:float) -> None:
+ """Set camera entity position (x,y,z)"""
+ self.conn.send(b"camera.setPos", x, y, z)
+
+
+class CmdEvents:
+ """Events"""
+ def __init__(self, connection):
+ self.conn = connection
+
+ def clearAll(self):
+ """Clear all old events"""
+ self.conn.send(b"events.clear")
+
+ def pollBlockHits(self):
+ """Only triggered by sword => [BlockEvent]"""
+ s = self.conn.sendReceive(b"events.block.hits")
+ events = [e for e in s.split("|") if e]
+ return [BlockEvent.Hit(*list(map(int, e.split(",")))) for e in events]
+
+ def pollArrowHits(self):
+ """Only triggered by sword => [BlockEvent]"""
+ s = self.conn.sendReceive(b"events.arrow.hits")
+ events = [e for e in s.split("|") if e]
+ return [ArrowHitEvent.Hit(*list(map(int, e.split(",")))) for e in events]
+
+ def pollChatPosts(self):
+ """Triggered by posts to chat => [ChatEvent]"""
+ s = self.conn.sendReceive(b"events.chat.posts")
+ events = [e for e in s.split("|") if e]
+ return [ChatEvent.Post(int(e[:e.find(",")]), e[e.find(",") + 1:]) for e in events]
+
+
+class Minecraft:
+ """The main class to interact with a running instance of Minecraft Pi."""
+ def __init__(self, connection):
+ self.conn = connection
+
+ self.camera = CmdCamera(connection)
+ self.entity = CmdEntity(connection)
+ self.player = CmdPlayer(connection)
+ self.events = CmdEvents(connection)
+
+ def getBlock(self, x:int, y:int, z:int) -> str:
+ """Get block (x,y,z) => id:int"""
+ return self.conn.sendReceive(b"world.getBlock", x, y, z)
+
+ def getBlocks(self, x1:int, y1:int, z1:int, x2:int, y2:int, z2:int) -> list:
+ """Get a cuboid of blocks (x0,y0,z0,x1,y1,z1) => [id:int]"""
+ blocks = self.conn.sendReceive(b"world.getBlocks", x1, y1, z1, x2, y2, z2)
+ arr1d = blocks.split(',')
+
+ xSize = abs(x1 - x2) + 1
+ ySize = abs(y1 - y2) + 1
+ zSize = abs(z1 - z2) + 1
+ totalSize = xSize * ySize * zSize
+ arr3d = []
+
+ if len(arr1d) != totalSize:
+ warn('Get number of blocks is incomplete')
+
+ for i in range(0,totalSize,xSize*ySize):
+ curArr = []
+ for j in range(0,xSize*ySize,xSize):
+ curArr.append(arr1d[i+j:i+j+xSize])
+ arr3d.append(curArr)
+ return arr3d
+
+ def setBlock(self, x:int, y:int, z:int, block:str) -> None:
+ """Set block (x,y,z,id,[data])"""
+ self.conn.send(b"world.setBlock", x, y, z, block)
+
+ def setBlocks(self, x1:int, y1:int, z1:int, x2:int, y2:int, z2:int, block) -> None:
+ """Set a cuboid of blocks (x1,y1,z1,x2,y2,z2,id,[data])"""
+ self.conn.send(b"world.setBlocks", x1, y1, z1, x2, y2, z2, block)
+
+ def getHeight(self, x:int, z:int) -> int:
+ """Get the height of the world (x,z) => int"""
+ return self.conn.sendReceive(b"world.getHeight", x, z)
+
+ def getPlayerEntityIds(self) -> list:
+ """Get the entity ids of the connected players => [id:int]"""
+ ids = self.conn.sendReceive(b"world.getPlayerIds")
+ return list(map(int, ids.split("|")))
+
+# def saveCheckpoint(self):
+# """Save a checkpoint that can be used for restoring the world"""
+# self.conn.send(b"world.checkpoint.save")
+
+# def restoreCheckpoint(self):
+# """Restore the world state to the checkpoint"""
+# self.conn.send(b"world.checkpoint.restore")
+
+ def postToChat(self, *msg) -> None:
+ """Post a message to the game chat"""
+ self.conn.send(b"chat.post", msg)
+
+ # TODO:修改成一個py檔處理Sign
+ def setSign(self, x:int, y:int, z:int, signType:str, signDir:int, line1:str="", line2:str="", line3:str="", line4:str="") -> None:
+ minecraftSignsType = ["SPRUCE_SIGN","ACACIA_SIGN","BIRCH_SIGN","DARK_OAK_SIGN","JUNGLE_SIGN","OAK_SIGN"]
+
+ # ["SPRUCE_WALL_SIGN","ACACIA_WALL_SIGN","BIRCH_WALL_SIGN","DARK_OAK_WALL_SIGN","JUNGLE_WALL_SIGN","OAK_WALL_SIGN"]
+ minecraftSignsDir = {0:'SOUTH',
+ 1:'SOUTH_SOUTH_WEST',
+ 2:'SOUTH_WEST',
+ 3:'WEST_SOUTH_WEST',
+ 4:'WEST',
+ 5:'WEST_NORTH_WEST',
+ 6:'NORTH_WEST',
+ 7:'NORTH_NORTH_WEST',
+ 8:'NORTH',
+ 9:'NORTH_NORTH_EAST',
+ 10:'NORTH_EAST',
+ 11:'EAST_NORTH_EAST',
+ 12:'EAST',
+ 13:'EAST_SOUTH_EAST',
+ 14:'SOUTH_EAST',
+ 15:'SOUTH_SOUTH_EAST'
+ }
+
+ if type(signDir) == int:
+ if 0 <= signDir < 16:
+ signDir = minecraftSignsDir.get(signDir)
+ elif type(signDir) == str:
+ for k,v in minecraftSignsDir.items():
+ if signDir == v:
+ break
+ else:
+ signDir = minecraftSignsDir.get(0)
+
+ signType = signType.upper()
+ if signType not in minecraftSignsType: raise Exception("Sign name error")
+ self.conn.send(b"world.setSign", x, y, z , signType, signDir, line1 ,line2 ,line3 ,line4)
+
+ def setWallSign(self, x:int, y:int, z:int, signType:str, signDir:int, line1="",line2="",line3="",line4="") -> None:
+ minecraftSignsType = ["SPRUCE_WALL_SIGN","ACACIA_WALL_SIGN","BIRCH_WALL_SIGN","DARK_OAK_WALL_SIGN","JUNGLE_WALL_SIGN","OAK_WALL_SIGN"]
+
+ minecraftSignsDir = {0:'SOUTH',
+ 1:'WEST',
+ 2:'NORTH',
+ 3:'EAST'}
+
+ if type(signDir) == int:
+ if 0 <= signDir < 4:
+ signDir = minecraftSignsDir.get(signDir)
+ elif type(signDir) == str:
+ for k,v in minecraftSignsDir.items():
+ if signDir == v:
+ break
+ else:
+ signDir = minecraftSignsDir.get(0)
+
+ signType = signType.upper()
+ if signType not in minecraftSignsType: raise Exception("Sign name error")
+ self.conn.send(b"world.setWallSign", x, y, z , signType, signDir, line1 ,line2 ,line3 ,line4)
+
+ def spawnEntity(self, x:int, y:int, z:int, entityID:int) -> int:
+ """Spawn entity (x,y,z,id,[data])"""
+ return int(self.conn.sendReceive(b"world.spawnEntity", x, y, z, entityID))
+
+ def createExplosion(self, x:int, y:int, z:int, power:int=4) -> None:
+ self.conn.send(b"world.createExplosion", x, y, z, power)
+
+ def getPlayerEntityId(self, name:str) -> int:
+ """Get the entity id of the named player => [id:int]"""
+ return int(self.conn.sendReceive(b"world.getPlayerId", name))
+
+ def setting(self, setting, status):
+ """Set a world setting (setting, status). keys: world_immutable, nametags_visible"""
+ self.conn.send(b"world.setting", setting, 1 if bool(status) else 0)
+
+ @staticmethod
+ def create(address = "localhost", port = 4711):
+ return Minecraft(Connection(address, port))
+
+
+if __name__ == "__main__":
+ mc = Minecraft.create()
+ mc.postToChat("Hello, Minecraft!")
diff --git a/src/main/resources/mcpi/api/python/original/mcpi/util.py b/src/main/resources/mcpi/util.py
similarity index 76%
rename from src/main/resources/mcpi/api/python/original/mcpi/util.py
rename to src/main/resources/mcpi/util.py
index 9791072e..c3ef4412 100644
--- a/src/main/resources/mcpi/api/python/original/mcpi/util.py
+++ b/src/main/resources/mcpi/util.py
@@ -11,8 +11,8 @@ def flatten_parameters_to_bytestring(l):
def _misc_to_bytes(m):
"""
- Convert an arbitrary object into a string encoded as a CP437 series of bytes.
+ Convert an arbitrary object into a string encoded as a UTF8 series of bytes.
See `Connection.send` for more details.
"""
- return str(m).encode("cp437")
+ return str(m).encode("utf8")
diff --git a/src/main/resources/mcpi/api/python/original/mcpi/vec3.py b/src/main/resources/mcpi/vec3.py
similarity index 100%
rename from src/main/resources/mcpi/api/python/original/mcpi/vec3.py
rename to src/main/resources/mcpi/vec3.py
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 4271bc56..533d6295 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,7 +1,8 @@
-author: Zhuowei
+author: [Zhuowei,MinecraftDawn]
database: false
description: Implementation of the Minecraft PI modding API
main: net.zhuoweizhang.raspberryjuice.RaspberryJuicePlugin
name: RaspberryJuice
startup: postworld
-version: '1.11'
+version: '1.14-0.6'
+api-version: 1.13
\ No newline at end of file
diff --git a/src/test/java/net/zhuoweizhang/raspberryjuice/SessionStepDefs.java b/src/test/java/net/zhuoweizhang/raspberryjuice/SessionStepDefs.java
deleted file mode 100644
index 9b66940e..00000000
--- a/src/test/java/net/zhuoweizhang/raspberryjuice/SessionStepDefs.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package net.zhuoweizhang.raspberryjuice;
-
-import cucumber.api.java.en.And;
-import cucumber.api.java.en.Given;
-import cucumber.api.java.en.Then;
-import cucumber.api.java.en.When;
-import mockit.Mock;
-import mockit.MockUp;
-import mockit.Mocked;
-import org.bukkit.Location;
-import org.bukkit.World;
-//import org.bukkit.craftbukkit.v1_9_R1.CraftWorld;
-import org.testng.Assert;
-
-import java.net.Socket;
-
-public class SessionStepDefs {
-
- @Mocked
- private World world;
-
- private RemoteSession remoteSession;
- private LocationType locationType;
- private Location requestedPosition;
- private String locationAsString;
- private Location location;
-
-
- @Given("^The location type (.*)$")
- public void theLocationType(String type) throws Throwable {
- locationType = LocationType.valueOf(type);
-
- RaspberryJuicePlugin plugin = new MockUp() {
- @Mock
- public LocationType getLocationType() {
- return locationType;
- }
- }.getMockInstance();
-
- Socket socket = new MockUp() {
- }.getMockInstance();
-
- new MockUp() {
- @Mock
- public void init() {
- //Avoid the real init as it errors out and we don't need it for our tests
- }
- };
-
- remoteSession = new RemoteSession(plugin, socket);
- }
-
- @And("^a spawn point of (.*), (.*), (.*)$")
- public void aSpawnPointOf(double x, double y, double z) throws Throwable {
- Location origin = new Location(world, x, y, z);
- remoteSession.setOrigin(origin);
- }
-
- @And("^a location point of (\\d+), (\\d+), (-?\\d+)$")
- public void aLocationPointOf(int x, int y, int z) throws Throwable {
- requestedPosition = new Location(world, x, y, z);
- }
-
- @When("^a request for a relative location is made$")
- public void aRequestForARelativeLocationIsMade() throws Throwable {
- locationAsString = remoteSession.locationToRelative(requestedPosition);
- }
-
- @Then("^the relative location should have co-ordinates (.*), (.*), (.*)$")
- public void theRelativeLocationShouldHaveCoOrdinates(String x, String y, String z) throws Throwable {
- String[] split = locationAsString.split(",");
- Assert.assertEquals(split[0], x);
- Assert.assertEquals(split[1], y);
- Assert.assertEquals(split[2], z);
- }
-
- @When("^a request for a relative block location is made at (.*), (.*), (.*)$")
- public void aRequestForARelativeBlockLocationIsMade(String x, String y, String z) throws Throwable {
- location = remoteSession.parseRelativeBlockLocation(x, y, z);
- }
-
- @Then("^the block location should have co-ordinates (.*), (.*), (.*)$")
- public void theBlockLocationShouldHaveCoOrdinates(int x, int y, int z) throws Throwable {
- Assert.assertEquals(location.getBlockX(), x);
- Assert.assertEquals(location.getBlockY(), y);
- Assert.assertEquals(location.getBlockZ(), z);
- }
-
- @When("^a request for a relative location is made at (.*), (.*), (.*)$")
- public void aRequestForARelativeLocationIsMade(String x, String y, String z) throws Throwable {
- location = remoteSession.parseRelativeLocation(x, y, z);
- }
-
- @Then("^the location should have co-ordinates (.*), (.*), (.*)$")
- public void theLocationShouldHaveCoOrdinates(double x, double y, double z) throws Throwable {
- Assert.assertEquals(location.getX(), x);
- Assert.assertEquals(location.getY(), y);
- Assert.assertEquals(location.getZ(), z);
- }
-}
diff --git a/src/test/resources/net/zhuoweizhang/raspberryjuice/remotesession.feature b/src/test/resources/net/zhuoweizhang/raspberryjuice/remotesession.feature
deleted file mode 100644
index f988cf93..00000000
--- a/src/test/resources/net/zhuoweizhang/raspberryjuice/remotesession.feature
+++ /dev/null
@@ -1,44 +0,0 @@
-Feature: Calculate the relative locations as different config options and pi/bukkit can provide different locations
-
- Scenario Outline: Test the locationToRelative function
-
- Given The location type
- And a spawn point of , ,
- And a location point of 20, 3, -5
- When a request for a relative location is made
- Then the relative location should have co-ordinates , ,
-
- Examples:
- | LocationType | SpawnX | SpawnY | SpawnZ | LocationX | LocationY | LocationZ |
- | RELATIVE | 0 | 0 | 0 | 20.0 | 3.0 | -5.0 |
- | RELATIVE | -100 | 50 | 100 | 120.0 | -47.0 | -105.0 |
- | ABSOLUTE | 0 | 0 | 0 | 20.0 | 3.0 | -5.0 |
- | ABSOLUTE | -100 | 50 | 100 | 20.0 | 3.0 | -5.0 |
-
- Scenario Outline: Determine the location of co-ordinates relative to a block
-
- Given The location type
- And a spawn point of , ,
- When a request for a relative block location is made at 32, 69, -100
- Then the block location should have co-ordinates , ,
-
- Examples:
- | LocationType | SpawnX | SpawnY | SpawnZ | LocationX | LocationY | LocationZ |
- | RELATIVE | 0 | 0 | 0 | 32 | 69 | -100 |
- | RELATIVE | -100 | 50 | 100 | -68 | 119 | 0 |
- | ABSOLUTE | 0 | 0 | 0 | 32 | 69 | -100 |
- | ABSOLUTE | -100 | 50 | 100 | 32 | 69 | -100 |
-
- Scenario Outline: Determine the location of co-ordinates
-
- Given The location type
- And a spawn point of , ,
- When a request for a relative location is made at 32, 69, -100
- Then the location should have co-ordinates , ,
-
- Examples:
- | LocationType | SpawnX | SpawnY | SpawnZ | LocationX | LocationY | LocationZ |
- | RELATIVE | 0 | 0 | 0 | 32 | 69 | -100 |
- | RELATIVE | -100 | 50 | 100 | -68 | 119 | 0 |
- | ABSOLUTE | 0 | 0 | 0 | 32 | 69 | -100 |
- | ABSOLUTE | -100 | 50 | 100 | 32 | 69 | -100 |