diff --git a/README_8md.html b/README_8md.html new file mode 100644 index 00000000..c7be7d82 --- /dev/null +++ b/README_8md.html @@ -0,0 +1,75 @@ + + +
+ + + + +
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
▼Nmcpp | Namespace containing all the the mcpp library classes |
CBlockType | |
CBlocks | |
CSocketConnection | |
CMinecraftConnection | |
CCoordinate |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
BlockType class. +More...
+#include <ostream>
Go to the source code of this file.
++Classes | |
class | mcpp::BlockType |
struct | mcpp::Blocks |
+Namespaces | |
mcpp | |
Namespace containing all the the mcpp library classes. | |
BlockType class.
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
This is the complete list of members for mcpp::BlockType, including all inherited members.
+BlockType(int id=0, int modifier=0) | mcpp::BlockType | inline |
id | mcpp::BlockType | |
mod | mcpp::BlockType | |
operator!=(const BlockType &other) const | mcpp::BlockType | |
operator<<(std::ostream &out, const BlockType &block) | mcpp::BlockType | friend |
operator==(const BlockType &other) const | mcpp::BlockType | |
withMod(int modifier) const | mcpp::BlockType |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
#include <block.h>
+Public Member Functions | |
constexpr | BlockType (int id=0, int modifier=0) |
bool | operator== (const BlockType &other) const |
Equality comparison operator. More... | |
bool | operator!= (const BlockType &other) const |
Inequality comparison operator. More... | |
BlockType | withMod (int modifier) const |
+Public Attributes | |
int | id |
int | mod |
+Friends | |
std::ostream & | operator<< (std::ostream &out, const BlockType &block) |
Stream insertion operator for outputting the BlockType to an output stream. More... | |
+
|
+ +inlineconstexpr | +
bool mcpp::BlockType::operator!= | +( | +const BlockType & | +other | ) | +const | +
Inequality comparison operator.
+Watch out as this also compares the BlockType.mod element of the block, so some equalities may behave in unexpected ways e.g. rotated stairs
+other | The BlockType to compare with the current instance. |
bool mcpp::BlockType::operator== | +( | +const BlockType & | +other | ) | +const | +
Equality comparison operator.
+Watch out as this also compares the BlockType.mod element of the block, so some equalities may behave in unexpected ways e.g. rotated stairs
+other | The BlockType to compare with the current instance. |
BlockType mcpp::BlockType::withMod | +( | +int | +modifier | ) | +const | +
+
|
+ +friend | +
int mcpp::BlockType::id | +
int mcpp::BlockType::mod | +
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
This is the complete list of members for mcpp::Coordinate, including all inherited members.
+clone() const | mcpp::Coordinate | |
Coordinate(int x=0, int y=0, int z=0) | mcpp::Coordinate | explicit |
Coordinate(double x, double y, double z) | mcpp::Coordinate | |
operator!=(const Coordinate &obj) const | mcpp::Coordinate | |
operator+(const Coordinate &obj) const | mcpp::Coordinate | |
operator-(const Coordinate &obj) const | mcpp::Coordinate | |
operator<<(std::ostream &out, const Coordinate &coord) | mcpp::Coordinate | friend |
operator==(const Coordinate &obj) const | mcpp::Coordinate | |
x | mcpp::Coordinate | |
y | mcpp::Coordinate | |
z | mcpp::Coordinate |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
#include <util.h>
+Public Member Functions | |
Coordinate (int x=0, int y=0, int z=0) | |
Constructs a Coordinate object with integer values. More... | |
Coordinate (double x, double y, double z) | |
Constructs a Coordinate object with double values. More... | |
Coordinate | operator+ (const Coordinate &obj) const |
Adds two Coordinate objects. More... | |
bool | operator== (const Coordinate &obj) const |
Checks if two Coordinate objects are equal. More... | |
bool | operator!= (const Coordinate &obj) const |
Checks if two Coordinate objects are not equal. More... | |
Coordinate | operator- (const Coordinate &obj) const |
Subtracts one Coordinate object from another. More... | |
Coordinate | clone () const |
Creates a copy of the Coordinate object. More... | |
+Public Attributes | |
int | x |
int | y |
int | z |
+Friends | |
std::ostream & | operator<< (std::ostream &out, const Coordinate &coord) |
Outputs the Coordinate object to an ostream. More... | |
Represented using integers since sub-unit coordinates are not of particular relevance. Allows for operations such as addition between coordinates.
+
+
|
+ +explicit | +
Constructs a Coordinate object with integer values.
+x | The x-coordinate. Default is 0. |
y | The y-coordinate. Default is 0. |
z | The z-coordinate. Default is 0. |
mcpp::Coordinate::Coordinate | +( | +double | +x, | +
+ | + | double | +y, | +
+ | + | double | +z | +
+ | ) | ++ |
Constructs a Coordinate object with double values.
+x | The x-coordinate as a double. |
y | The y-coordinate as a double. |
z | The z-coordinate as a double. |
Coordinate mcpp::Coordinate::clone | +( | +) | +const | +
Creates a copy of the Coordinate object.
+bool mcpp::Coordinate::operator!= | +( | +const Coordinate & | +obj | ) | +const | +
Checks if two Coordinate objects are not equal.
+obj | The Coordinate object to compare with. |
Coordinate mcpp::Coordinate::operator+ | +( | +const Coordinate & | +obj | ) | +const | +
Adds two Coordinate objects.
+obj | The Coordinate object to add. |
Coordinate mcpp::Coordinate::operator- | +( | +const Coordinate & | +obj | ) | +const | +
Subtracts one Coordinate object from another.
+obj | The Coordinate object to subtract. |
bool mcpp::Coordinate::operator== | +( | +const Coordinate & | +obj | ) | +const | +
Checks if two Coordinate objects are equal.
+obj | The Coordinate object to compare with. |
+
|
+ +friend | +
Outputs the Coordinate object to an ostream.
+out | The output stream. |
coord | The Coordinate object to output. |
int mcpp::Coordinate::x | +
int mcpp::Coordinate::y | +
int mcpp::Coordinate::z | +
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
This is the complete list of members for mcpp::MinecraftConnection, including all inherited members.
+doCommand(const std::string &command) | mcpp::MinecraftConnection | |
getBlock(const Coordinate &loc) | mcpp::MinecraftConnection | |
getBlocks(const Coordinate &loc1, const Coordinate &loc2) | mcpp::MinecraftConnection | |
getHeight(int x, int z) | mcpp::MinecraftConnection | |
getHeights(const Coordinate &loc1, const Coordinate &loc2) | mcpp::MinecraftConnection | |
getPlayerPosition() | mcpp::MinecraftConnection | |
getPlayerTilePosition() | mcpp::MinecraftConnection | |
MinecraftConnection(const std::string &address="localhost", int port=4711) | mcpp::MinecraftConnection | explicit |
postToChat(const std::string &message) | mcpp::MinecraftConnection | |
setBlock(const Coordinate &loc, const BlockType &blockType) | mcpp::MinecraftConnection | |
setBlocks(const Coordinate &loc1, const Coordinate &loc2, const BlockType &blockType) | mcpp::MinecraftConnection | |
setPlayerPosition(const Coordinate &pos) | mcpp::MinecraftConnection | |
setPlayerTilePosition(const Coordinate &tile) | mcpp::MinecraftConnection |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
#include <mcpp.h>
+Public Member Functions | |
MinecraftConnection (const std::string &address="localhost", int port=4711) | |
Represents the main endpoint for interaction with the minecraft world. More... | |
void | postToChat (const std::string &message) |
Sends a message to the in-game chat, does not require a joined player. More... | |
void | doCommand (const std::string &command) |
Performs an in-game minecraft command. Players have to exist on the server and should be server operators (default with ELCI) More... | |
void | setPlayerPosition (const Coordinate &pos) |
Sets player pos (block pos of lower half of playermodel) to specified Coordinate. More... | |
Coordinate | getPlayerPosition () |
Returns a coordinate representing player position (block pos of lower half of playermodel) More... | |
void | setPlayerTilePosition (const Coordinate &tile) |
Sets player position to be one above specified tile (i.e. tile = block player is standing on) More... | |
Coordinate | getPlayerTilePosition () |
Returns the coordinate location of the block the player is standing on. More... | |
void | setBlock (const Coordinate &loc, const BlockType &blockType) |
Sets block at Coordinate loc to the BlockType specified by blockType. More... | |
void | setBlocks (const Coordinate &loc1, const Coordinate &loc2, const BlockType &blockType) |
Sets a cuboid of blocks to the specified BlockType blockType, with the corners of the cuboid provided by the Coordinate loc1 and loc2. More... | |
BlockType | getBlock (const Coordinate &loc) |
Returns BlockType object from the specified Coordinate loc with modifier. More... | |
std::vector< std::vector< std::vector< BlockType > > > | getBlocks (const Coordinate &loc1, const Coordinate &loc2) |
Returns a 3D vector of the BlockTypes of the requested cuboid with modifiers. More... | |
int | getHeight (int x, int z) |
Returns the height of the specific provided x and y coordinate. More... | |
std::vector< std::vector< int > > | getHeights (const Coordinate &loc1, const Coordinate &loc2) |
Provides a scaled option of the getHeight call to allow for considerable performance gains. More... | |
+
|
+ +explicit | +
Represents the main endpoint for interaction with the minecraft world.
+address | String address in IPV4 format, defaults to "localhost" |
port | Integer port to run on, defaults to 4711 as that is the port for ELCI |
void mcpp::MinecraftConnection::doCommand | +( | +const std::string & | +command | ) | ++ |
Performs an in-game minecraft command. Players have to exist on the server and should be server operators (default with ELCI)
+command | Command string in the in-game format (e.g. "time set day") |
BlockType mcpp::MinecraftConnection::getBlock | +( | +const Coordinate & | +loc | ) | ++ |
Returns BlockType object from the specified Coordinate loc with modifier.
+loc |
std::vector<std::vector<std::vector<BlockType> > > mcpp::MinecraftConnection::getBlocks | +( | +const Coordinate & | +loc1, | +
+ | + | const Coordinate & | +loc2 | +
+ | ) | ++ |
Returns a 3D vector of the BlockTypes of the requested cuboid with modifiers.
+loc1 | 1st corner of the cuboid |
loc2 | 2nd corner of the cuboid |
int mcpp::MinecraftConnection::getHeight | +( | +int | +x, | +
+ | + | int | +z | +
+ | ) | ++ |
Returns the height of the specific provided x and y coordinate.
+IMPORTANT: DO NOT USE FOR LARGE AREAS, IT WILL BE VERY SLOW USE getHeights() INSTEAD
+Gets the y-value of the highest non-air block at the specified (x, z) coordinate.
x | |
z |
std::vector<std::vector<int> > mcpp::MinecraftConnection::getHeights | +( | +const Coordinate & | +loc1, | +
+ | + | const Coordinate & | +loc2 | +
+ | ) | ++ |
Provides a scaled option of the getHeight call to allow for considerable performance gains.
+loc1 | |
loc2 |
Coordinate mcpp::MinecraftConnection::getPlayerPosition | +( | +) | ++ |
Returns a coordinate representing player position (block pos of lower half of playermodel)
+Coordinate mcpp::MinecraftConnection::getPlayerTilePosition | +( | +) | ++ |
Returns the coordinate location of the block the player is standing on.
+void mcpp::MinecraftConnection::postToChat | +( | +const std::string & | +message | ) | ++ |
Sends a message to the in-game chat, does not require a joined player.
+message |
void mcpp::MinecraftConnection::setBlock | +( | +const Coordinate & | +loc, | +
+ | + | const BlockType & | +blockType | +
+ | ) | ++ |
Sets block at Coordinate loc to the BlockType specified by blockType.
+loc | |
blockType |
void mcpp::MinecraftConnection::setBlocks | +( | +const Coordinate & | +loc1, | +
+ | + | const Coordinate & | +loc2, | +
+ | + | const BlockType & | +blockType | +
+ | ) | ++ |
Sets a cuboid of blocks to the specified BlockType blockType, with the corners of the cuboid provided by the Coordinate loc1 and loc2.
+loc1 | |
loc2 | |
blockType |
void mcpp::MinecraftConnection::setPlayerPosition | +( | +const Coordinate & | +pos | ) | ++ |
Sets player pos (block pos of lower half of playermodel) to specified Coordinate.
+pos | Coordinate to set |
void mcpp::MinecraftConnection::setPlayerTilePosition | +( | +const Coordinate & | +tile | ) | ++ |
Sets player position to be one above specified tile (i.e. tile = block player is standing on)
+tile | Coordinate to set |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
This is the complete list of members for mcpp::SocketConnection, including all inherited members.
+recv() const | mcpp::SocketConnection | |
send(const std::string &dataString) | mcpp::SocketConnection | |
sendCommand(const std::string &prefix, const Types &... args) | mcpp::SocketConnection | inline |
sendReceiveCommand(const T &prefix, const Types &... args) | mcpp::SocketConnection | inline |
SocketConnection(const std::string &address_str, uint16_t port) | mcpp::SocketConnection |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
#include <connection.h>
+Public Member Functions | |
SocketConnection (const std::string &address_str, uint16_t port) | |
void | send (const std::string &dataString) |
template<typename... Types> | |
void | sendCommand (const std::string &prefix, const Types &... args) |
template<typename T , typename... Types> | |
std::string | sendReceiveCommand (const T &prefix, const Types &... args) |
std::string | recv () const |
mcpp::SocketConnection::SocketConnection | +( | +const std::string & | +address_str, | +
+ | + | uint16_t | +port | +
+ | ) | ++ |
std::string mcpp::SocketConnection::recv | +( | +) | +const | +
void mcpp::SocketConnection::send | +( | +const std::string & | +dataString | ) | ++ |
+
|
+ +inline | +
Takes in parameters supporting std::stringstream conversion and a string prefix and transforms them into format "prefix(arg1,arg2,arg3)\n" (e.g. "chat.post(test)\n") and sends command to the server.
+Types |
prefix | |
args |
+
|
+ +inline | +
Sends via sendCommand() and returns the result from endpoint
+T | |
Types |
prefix | |
args |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
SocketConnection class. +More...
+#include <cstdint>
#include <iostream>
#include <sstream>
#include <string>
Go to the source code of this file.
++Classes | |
class | mcpp::SocketConnection |
+Namespaces | |
mcpp | |
Namespace containing all the the mcpp library classes. | |
+Macros | |
#define | FAIL_RESPONSE "Fail" |
SocketConnection class.
+#define FAIL_RESPONSE "Fail" | +
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+Files | |
file | block.h [code] |
BlockType class. | |
file | connection.h [code] |
SocketConnection class. | |
file | mcpp.h [code] |
MinecraftConnection class. | |
file | util.h [code] |
Coordinate class. | |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+Directories | |
directory | mcpp |
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
This page explains how to interpret the graphs that are generated by doxygen.
+Consider the following example:
This will result in the following graph:
+The boxes in the above graph have the following meaning:
+The arrows have the following meaning:
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
\ mcpp (Minecraft++) is a library built to interface with Minecraft through Spigot server running the ELCI plugin and using C++. It is currently limited to MacOS/Linux or Windows with WSL.
+âž¡ For more details on the broad strokes of mcpp, refer to the wiki! âž¡ Access the documentation hosted on this repo: mcpp documentation
+This library is based on mcpi, which is a Python library with similar functionality.
+In addition to C++ support, this library implements several new commands supported by ELCI:
getBlocks
to get a cuboid of blocks with modifiers in a performant manner,getHeights
to get a 2D area of heights in a performant manner,doCommand
to perform an in-game minecraft command which allows for additional functionality.This C++ version was created for the Royal Melbourne Institute of Technology (RMIT) to supplement the COSC2084 (Programming Studio 2) course.
+Since the release is intended for UNIX systems and not tested on Windows, the options to run locally are as follows:
MinecraftConnection()
if you are running Spigot with ELCI on Windows, which you can find using nslookup "$(hostname).local"
on your WSL terminal. The default port for ELCI is 4711
.g++
, make
, cmake
and any other build prerequisitesgit clone https://github.com/rozukke/mcpp.git
cmake .
and sudo make install
inside the cloned directory.#include <mcpp/mcpp.h>
directive.-lmcpp
for Makefiles or target_link_libraries(your_executable mcpp)
for CMake.The following applies to all code:
+Copyright 2024 Artemis Rosman and contributors
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 +
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+
+ mcpp
+
+ mcpp is a library that lets you interact with Minecraft using C++
+ |
+
MinecraftConnection class. +More...
+#include "block.h"
#include "connection.h"
#include "util.h"
#include <memory>
#include <string_view>
#include <vector>
Go to the source code of this file.
++Classes | |
class | mcpp::MinecraftConnection |
+Namespaces | |
mcpp | |
Namespace containing all the the mcpp library classes. | |
MinecraftConnection class.
+