Showing preview only (1,390K chars total). Download the full file or copy to clipboard to get everything.
Repository: fador/mineserver
Branch: master
Commit: 0d3ed44a4354
Files: 383
Total size: 1.3 MB
Directory structure:
gitextract_4q_cqrt4/
├── .gitignore
├── CMakeLists.txt
├── CMakeModules/
│ ├── FindEvent.cmake
│ ├── FindNoise.cmake
│ └── toolchain-i686-w64-mingw32.cmake
├── Dockerfile
├── LICENSE
├── README.md
├── files/
│ ├── CMakeLists.txt
│ ├── ENABLED_RECIPES.cfg
│ ├── banned.txt
│ ├── commands.cfg
│ ├── config.cfg
│ ├── item_alias.cfg
│ ├── motd.txt
│ ├── permissions.txt
│ ├── recipes/
│ │ ├── armour/
│ │ │ ├── boots_chain.recipe
│ │ │ ├── boots_diamond.recipe
│ │ │ ├── boots_gold.recipe
│ │ │ ├── boots_iron.recipe
│ │ │ ├── boots_leather.recipe
│ │ │ ├── chestplate_chain.recipe
│ │ │ ├── chestplate_diamond.recipe
│ │ │ ├── chestplate_gold.recipe
│ │ │ ├── chestplate_iron.recipe
│ │ │ ├── chestplate_leather.recipe
│ │ │ ├── helmet_chain.recipe
│ │ │ ├── helmet_diamond.recipe
│ │ │ ├── helmet_gold.recipe
│ │ │ ├── helmet_iron.recipe
│ │ │ ├── helmet_leather.recipe
│ │ │ ├── legging_chain.recipe
│ │ │ ├── legging_diamond.recipe
│ │ │ ├── legging_gold.recipe
│ │ │ ├── legging_iron.recipe
│ │ │ └── legging_leather.recipe
│ │ ├── block/
│ │ │ ├── sand_hslab.recipe
│ │ │ ├── smooth_hslab.recipe
│ │ │ ├── stone_hslab.recipe
│ │ │ └── wood_hslab.recipe
│ │ ├── cloth/
│ │ │ ├── black.recipe
│ │ │ ├── blue.recipe
│ │ │ ├── brown.recipe
│ │ │ ├── cyan.recipe
│ │ │ ├── darkgreen.recipe
│ │ │ ├── grey.recipe
│ │ │ ├── lightblue.recipe
│ │ │ ├── lightgreen.recipe
│ │ │ ├── lightgrey.recipe
│ │ │ ├── magenta.recipe
│ │ │ ├── orange.recipe
│ │ │ ├── pink.recipe
│ │ │ ├── purple.recipe
│ │ │ ├── red.recipe
│ │ │ ├── white.recipe
│ │ │ └── yellow.recipe
│ │ ├── dyes/
│ │ │ ├── cyan.recipe
│ │ │ ├── grey.recipe
│ │ │ ├── lightblue.recipe
│ │ │ ├── lightgrey.recipe
│ │ │ ├── lime.recipe
│ │ │ ├── magenta.recipe
│ │ │ ├── orange.recipe
│ │ │ ├── pink.recipe
│ │ │ ├── purple.recipe
│ │ │ ├── red.recipe
│ │ │ ├── white.recipe
│ │ │ └── yellow.recipe
│ │ ├── food/
│ │ │ ├── apple_golden.recipe
│ │ │ ├── bowls.recipe
│ │ │ ├── bread.recipe
│ │ │ ├── cake.recipe
│ │ │ ├── mushroomstew.recipe
│ │ │ └── sugar.recipe
│ │ ├── materials/
│ │ │ ├── block_brick.recipe
│ │ │ ├── block_clay.recipe
│ │ │ ├── block_diamond.recipe
│ │ │ ├── block_glowstone.recipe
│ │ │ ├── block_gold.recipe
│ │ │ ├── block_iron.recipe
│ │ │ ├── block_sandstone.recipe
│ │ │ ├── block_snow.recipe
│ │ │ ├── block_wool.recipe
│ │ │ ├── clay.recipe
│ │ │ ├── ingots_diamond.recipe
│ │ │ ├── ingots_gold.recipe
│ │ │ ├── ingots_iron.recipe
│ │ │ ├── sticks.recipe
│ │ │ ├── tnt.recipe
│ │ │ ├── wood_planks_acacia.recipe
│ │ │ ├── wood_planks_birch.recipe
│ │ │ ├── wood_planks_dark_oak.recipe
│ │ │ ├── wood_planks_jungle.recipe
│ │ │ ├── wood_planks_oak.recipe
│ │ │ └── wood_planks_spruce.recipe
│ │ ├── mechanism/
│ │ │ ├── button_stone.recipe
│ │ │ ├── dispenser.recipe
│ │ │ ├── door_iron.recipe
│ │ │ ├── door_wood.recipe
│ │ │ ├── lever.recipe
│ │ │ ├── note_block.recipe
│ │ │ ├── pressure_stone.recipe
│ │ │ ├── pressure_wood.recipe
│ │ │ └── torch_redstone.recipe
│ │ ├── misc/
│ │ │ ├── bed.recipe
│ │ │ ├── book.recipe
│ │ │ ├── bookshelf.recipe
│ │ │ ├── chest.recipe
│ │ │ ├── fence_acacia.recipe
│ │ │ ├── fence_birch.recipe
│ │ │ ├── fence_dark_oak.recipe
│ │ │ ├── fence_jungle.recipe
│ │ │ ├── fence_oak.recipe
│ │ │ ├── fence_spruce.recipe
│ │ │ ├── furnace.recipe
│ │ │ ├── jackolantern.recipe
│ │ │ ├── jukebox.recipe
│ │ │ ├── ladder.recipe
│ │ │ ├── painting.recipe
│ │ │ ├── paper.recipe
│ │ │ ├── sign.recipe
│ │ │ ├── stairs_stone.recipe
│ │ │ ├── stairs_wood.recipe
│ │ │ ├── torch.recipe
│ │ │ └── workbench.recipe
│ │ ├── tools/
│ │ │ ├── axe_diamond.recipe
│ │ │ ├── axe_gold.recipe
│ │ │ ├── axe_iron.recipe
│ │ │ ├── axe_stone.recipe
│ │ │ ├── axe_wood.recipe
│ │ │ ├── bucket.recipe
│ │ │ ├── clock.recipe
│ │ │ ├── compass.recipe
│ │ │ ├── fishingrod.recipe
│ │ │ ├── flintsteel.recipe
│ │ │ ├── hoe_diamond.recipe
│ │ │ ├── hoe_gold.recipe
│ │ │ ├── hoe_iron.recipe
│ │ │ ├── hoe_stone.recipe
│ │ │ ├── hoe_wood.recipe
│ │ │ ├── pickaxe_diamond.recipe
│ │ │ ├── pickaxe_gold.recipe
│ │ │ ├── pickaxe_iron.recipe
│ │ │ ├── pickaxe_stone.recipe
│ │ │ ├── pickaxe_wood.recipe
│ │ │ ├── shears.recipe
│ │ │ ├── shovel_diamond.recipe
│ │ │ ├── shovel_gold.recipe
│ │ │ ├── shovel_iron.recipe
│ │ │ ├── shovel_stone.recipe
│ │ │ └── shovel_wood.recipe
│ │ ├── transport/
│ │ │ ├── boat.recipe
│ │ │ ├── minecart.recipe
│ │ │ ├── minecart_powered.recipe
│ │ │ ├── minecart_storage.recipe
│ │ │ └── minecart_tracks.recipe
│ │ ├── weapons/
│ │ │ ├── arrows.recipe
│ │ │ ├── bow.recipe
│ │ │ ├── sword_diamond.recipe
│ │ │ ├── sword_gold.recipe
│ │ │ ├── sword_iron.recipe
│ │ │ ├── sword_stone.recipe
│ │ │ └── sword_wood.recipe
│ │ └── white.recipe
│ ├── roles.txt
│ ├── rules.txt
│ ├── test.lua
│ └── whitelist.txt
├── init.d/
│ └── mineserver.centos
├── plugins/
│ ├── CMakeLists.txt
│ ├── binlog/
│ │ ├── binlog.cfg
│ │ ├── binlog.cpp
│ │ ├── binlog.h
│ │ └── binlogdump.cpp
│ ├── commands/
│ │ ├── commands.cpp
│ │ └── commands.h
│ ├── crapMobs/
│ │ ├── crapMobs.cpp
│ │ └── crapMobs.h
│ ├── cursesui/
│ │ ├── screen.cpp
│ │ └── screen.h
│ ├── filelog/
│ │ └── filelog.cpp
│ ├── flatpermissions/
│ │ └── flatpermissions.cpp
│ ├── luascript/
│ │ ├── luascript.cpp
│ │ ├── luawrapper.cpp
│ │ └── luawrapper.h
│ ├── nBreak/
│ │ ├── nBreak.cpp
│ │ └── nBreak.h
│ ├── nether/
│ │ ├── nether.cpp
│ │ └── nether.h
│ └── passiveMobs/
│ ├── passiveMobs.cpp
│ └── passiveMobs.h
├── src/
│ ├── CMakeLists.txt
│ ├── SystemExceptions.h
│ ├── blocks/
│ │ ├── basic.cpp
│ │ ├── basic.h
│ │ ├── bed.cpp
│ │ ├── bed.h
│ │ ├── blockbrewingstand.cpp
│ │ ├── blockbrewingstand.h
│ │ ├── blockfurnace.cpp
│ │ ├── blockfurnace.h
│ │ ├── cake.cpp
│ │ ├── cake.h
│ │ ├── chest.cpp
│ │ ├── chest.h
│ │ ├── default.cpp
│ │ ├── default.h
│ │ ├── door.cpp
│ │ ├── door.h
│ │ ├── falling.cpp
│ │ ├── falling.h
│ │ ├── fire.cpp
│ │ ├── fire.h
│ │ ├── ice.cpp
│ │ ├── ice.h
│ │ ├── jackolantern.cpp
│ │ ├── jackolantern.h
│ │ ├── ladder.cpp
│ │ ├── ladder.h
│ │ ├── leaves.cpp
│ │ ├── leaves.h
│ │ ├── liquid.cpp
│ │ ├── liquid.h
│ │ ├── note.cpp
│ │ ├── note.h
│ │ ├── planks.cpp
│ │ ├── planks.h
│ │ ├── plant.cpp
│ │ ├── plant.h
│ │ ├── pumpkin.cpp
│ │ ├── pumpkin.h
│ │ ├── redstone.cpp
│ │ ├── redstone.h
│ │ ├── redstoneutil.cpp
│ │ ├── redstoneutil.h
│ │ ├── sign.cpp
│ │ ├── sign.h
│ │ ├── snow.cpp
│ │ ├── snow.h
│ │ ├── stair.cpp
│ │ ├── stair.h
│ │ ├── step.cpp
│ │ ├── step.h
│ │ ├── tnt.cpp
│ │ ├── tnt.h
│ │ ├── torch.cpp
│ │ ├── torch.h
│ │ ├── tracks.cpp
│ │ ├── tracks.h
│ │ ├── wood.cpp
│ │ ├── wood.h
│ │ ├── wool.cpp
│ │ ├── wool.h
│ │ ├── workbench.cpp
│ │ └── workbench.h
│ ├── chat.cpp
│ ├── chat.h
│ ├── chunkmap.h
│ ├── cliScreen.cpp
│ ├── cliScreen.h
│ ├── config/
│ │ ├── lexer.cpp
│ │ ├── lexer.h
│ │ ├── node.cpp
│ │ ├── node.h
│ │ ├── parser.cpp
│ │ ├── parser.h
│ │ ├── scanner.cpp
│ │ └── scanner.h
│ ├── config.h
│ ├── configure.h.in
│ ├── constants.cpp
│ ├── constants.h
│ ├── constants_num.h
│ ├── extern.h
│ ├── fastset.h
│ ├── furnace.cpp
│ ├── furnace.h
│ ├── furnaceManager.cpp
│ ├── furnaceManager.h
│ ├── inventory/
│ │ ├── inventoryBasic.cpp
│ │ ├── inventoryBrewingstand.cpp
│ │ ├── inventoryBrewingstand.h
│ │ ├── inventoryChest.cpp
│ │ ├── inventoryChest.h
│ │ ├── inventoryFurnace.cpp
│ │ ├── inventoryFurnace.h
│ │ ├── inventoryPlayer.cpp
│ │ ├── inventoryPlayer.h
│ │ ├── inventoryWorkbench.cpp
│ │ ├── inventoryWorkbench.h
│ │ └── inventorybasic.h
│ ├── inventory.cpp
│ ├── inventory.h
│ ├── items/
│ │ ├── food.cpp
│ │ ├── food.h
│ │ ├── itembasic.cpp
│ │ ├── itembasic.h
│ │ ├── projectile.cpp
│ │ └── projectile.h
│ ├── json.cpp
│ ├── json.h
│ ├── lighting.cpp
│ ├── lighting.h
│ ├── logger.cpp
│ ├── logger.h
│ ├── logtype.h
│ ├── map.cpp
│ ├── map.h
│ ├── mcregion.cpp
│ ├── mcregion.h
│ ├── metadata.cpp
│ ├── metadata.h
│ ├── mineserver.cpp
│ ├── mineserver.h
│ ├── mineserver.pro
│ ├── mob.cpp
│ ├── mob.h
│ ├── nbt.cpp
│ ├── nbt.h
│ ├── packets.cpp
│ ├── packets.h
│ ├── permissions.h
│ ├── physics.cpp
│ ├── physics.h
│ ├── plugin.cpp
│ ├── plugin.h
│ ├── plugin_api.cpp
│ ├── plugin_api.h
│ ├── plugins/
│ │ ├── PyScript/
│ │ │ ├── .gitignore
│ │ │ ├── MineServer.i
│ │ │ ├── PyScript.cpp
│ │ │ ├── PyScript.h
│ │ │ ├── makefile
│ │ │ ├── python/
│ │ │ │ └── TriggTest.py
│ │ │ ├── python_plugin_api.cpp
│ │ │ └── python_plugin_api.h
│ │ ├── banlist/
│ │ │ ├── banlist.cpp.unused
│ │ │ └── banlist.h
│ │ └── command/
│ │ ├── command.cpp.unused
│ │ └── command.h
│ ├── protocol.cpp
│ ├── protocol.h
│ ├── random.cpp
│ ├── random.h
│ ├── redstoneSimulation.cpp
│ ├── redstoneSimulation.h
│ ├── screenBase.cpp
│ ├── screenBase.h
│ ├── signalhandler.cpp
│ ├── signalhandler.h
│ ├── sockets.cpp
│ ├── sockets.h
│ ├── stdtime.h
│ ├── threadpool.cpp
│ ├── threadpool.h
│ ├── tools.cpp
│ ├── tools.h
│ ├── tree.cpp
│ ├── tree.h
│ ├── user.cpp
│ ├── user.h
│ ├── utf8.h
│ ├── vec.h
│ └── worldgen/
│ ├── biomegen.cpp
│ ├── biomegen.h
│ ├── cavegen.cpp
│ ├── cavegen.h
│ ├── eximgen.cpp
│ ├── eximgen.h
│ ├── heavengen.cpp
│ ├── heavengen.h
│ ├── mapgen.cpp
│ ├── mapgen.h
│ ├── nethergen.cpp
│ └── nethergen.h
└── win32/
├── mineserver.vcxproj
├── mineserver.vcxproj.filters
├── mineserver_VS2013.sln
└── plugins/
├── plugin_commands.vcxproj
├── plugin_filelog.vcxproj
├── plugin_flatpermissions.vcxproj
├── plugin_luascript.vcxproj
└── plugin_passivemobs.vcxproj
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# ignore kate temp files
*~
# ignore cmake crap
CMakeFiles
CMakeCache.txt
src/configure.h
include/configure.h
# ignore our compile directory
bin
# qmake .pro(ject) per platform config file
src/mineserver.pro.user
================================================
FILE: CMakeLists.txt
================================================
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(mineserver)
CMAKE_POLICY(SET CMP0003 NEW)
#
# project version
#
# Justasic: Get the git revision location for the branch we're on
if(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/.git/HEAD")
file(STRINGS ${${PROJECT_NAME}_SOURCE_DIR}/.git/HEAD GIT_HEAD_LOC REGEX ".*")
#file(GIT_HEAD_LOC ${${PROJECT_NAME}_SOURCE_DIR}/.git/HEAD REGEX ".*")
string(LENGTH ${GIT_HEAD_LOC} HEAD_LEN)
math(EXPR LEN "${HEAD_LEN} - 5")
string(SUBSTRING ${GIT_HEAD_LOC} 5 ${LEN} GIT_HEAD)
endif(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/.git/HEAD")
# Justasic: Get the git revision we're on for the version string
if(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/.git/${GIT_HEAD}")
# Justasic: read_from_file(${${PROJECT_NAME}_SOURCE_DIR}/.git/${GIT_HEAD} ".*" VERSION_STR)
file(STRINGS ${${PROJECT_NAME}_SOURCE_DIR}/.git/${GIT_HEAD} VERSION_STR REGEX ".*")
# Justasic: Get the length of the string
string(LENGTH ${VERSION_STR} VERSION_LEN)
# Justasic: Subtract 7 from the string's length
math(EXPR VERSION_NUM_LEN "${VERSION_LEN} - ${VERSION_LEN} + 7")
# Justasic: Extract the value from the string
string(SUBSTRING ${VERSION_STR} 0 ${VERSION_NUM_LEN} VERSION_GIT)
endif(EXISTS "${${PROJECT_NAME}_SOURCE_DIR}/.git/${GIT_HEAD}")
# Set the actual version strings, these are used inside the program later
SET(${PROJECT_NAME}_MAJOR_VERSION 0)
SET(${PROJECT_NAME}_MINOR_VERSION 2)
SET(${PROJECT_NAME}_PATCH_LEVEL 0)
# Justasic: the rest is automatic
SET(${PROJECT_NAME}_VERSION_SIMPLE "${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL}")
# Justasic: Get the git revision as well, really only useful for locating what revision we're on
SET(${PROJECT_NAME}_VERSION_COMPLETE "${${PROJECT_NAME}_VERSION_SIMPLE}-${VERSION_GIT}")
# set default build to Debug
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE Debug
CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
FORCE
)
ENDIF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
#
# Configure paths
#
SET(CONFIG_DIR_BIN bin/)
SET(CONFIG_DIR_ETC etc/${PROJECT_NAME}/)
SET(CONFIG_DIR_LIB lib/${PROJECT_NAME}/)
SET(CONFIG_DIR_SHARE ./)
IF(WIN32)
MESSAGE(STATUS "CONFIG_LOCAL is set -- assuming local build")
SET(CONFIG_DIR_BIN bin/)
SET(CONFIG_DIR_ETC bin/)
SET(CONFIG_DIR_LIB bin/)
SET(CONFIG_DIR_SHARE ./)
SET(CONFIG_PREFIX ${CMAKE_INSTALL_PREFIX})
ENDIF()
# The DISTSOURCE parameter tells the executable where to find the factory defaults.
# It is used by Mineserver::configDirectoryPrepare() to install the factory defaults.
# In the Release build, this should eventually be overridden by a central location
# like $PREFIX/share/mineserver/files, I suppose.
SET(CONFIG_DIR_DISTSOURCE files)
#
# Include directories
#
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
# CMake crap to include
include(CheckFunctionExists)
include(CheckIncludeFile)
include(CheckTypeSize)
include(CheckLibraryExists)
include(CheckCXXCompilerFlag)
# functions/includes needed during compile
check_function_exists(backtrace HAVE_BACKTRACE)
check_include_file(sys/utsname.h HAVE_SYS_UTSNAME_H)
# Output paths
SET(EXECUTABLE_OUTPUT_PATH bin)
SET(LIBRARY_OUTPUT_PATH bin)
# Set compiler specific build flags
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "-W -Wall -Wno-unused-variable -Wno-unused-parameter -pedantic -std=c++11")
SET(CMAKE_CXX_FLAGS_DEBUG "-DDEBUG -g -O0")
SET(CMAKE_CXX_FLAGS_PROFILE "-DDEBUG -g -pg")
SET(CMAKE_CXX_FLAGS_RELEASE "-O4 -s -DNDEBUG")
ENDIF()
IF(MSVC_IDE)
SET(CMAKE_CXX_FLAGS "/DWIN32 /D_CONSOLE /DZLIB_WINAPI /fp:fast /EHsc")
SET(CMAKE_CXX_FLAGS_DEBUG "/DDEBUG /D_DEBUG /MTd /Zi")
SET(CMAKE_CXX_FLAGS_RELEASE "/MT /D_SECURE_SCL=0")
ENDIF(MSVC_IDE)
#
# dependencies
#
SET(TARGET ${PROJECT_NAME})
SET(mineserver_depends -lpthread)
# Note that on Ubuntu systems, CMake's FindOpenSSL.cmake file does not define
# all the proper defines, therefore our old and generic library finder does not
# work like it should :< - Justasic
Find_package(OpenSSL REQUIRED)
Find_package(Event REQUIRED)
Find_package(Noise REQUIRED)
Find_package(ZLIB REQUIRED)
include_directories(${ZLIB_INCLUDE_DIR} ${NOISE_INCLUDE_DIR} ${OPENSSL_INCLUDE_DIR} ${EVENT_INCLUDE_DIR})
LIST(APPEND mineserver_depends "${ZLIB_LIBRARY};${NOISE_LIBRARY};${OPENSSL_LIBRARIES};${EVENT_LIBRARY}")
# preprocess configuration file
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/src/configure.h.in ${PROJECT_BINARY_DIR}/src/configure.h)
#
# platform-specific tweaks
#
IF(WIN32)
# this requires WinMain() entry, disabled until console/GUI option is added
#set(exe "WIN32")
# this shouldn't be here, but can cmake find these .lib's?
# do we really need winmm?
FOREACH(lib ws2_32 winmm)
STRING(TOUPPER ${lib} LIB)
LIST(APPEND mineserver_depends "${lib}")
SET(${LIB}_LIBRARY "${lib}")
ENDFOREACH()
ELSE()
IF(NOISE_DIR_IS_LIBNOISE)
ADD_DEFINITIONS(-DLIBNOISE)
ENDIF()
ENDIF()
#
# Create some directories we need
#
FILE(MAKE_DIRECTORY "${CONFIG_DIR_BIN}/plugins")
#
# subdirectories to build
#
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(plugins)
ADD_SUBDIRECTORY(files)
# In the Debug build, we provide a local config file.
#IF(CMAKE_BUILD_TYPE MATCHES Debug)
#CONFIGURE_FILE(files/config.cfg "${EXECUTABLE_OUTPUT_PATH}/config.cfg" COPYONLY)
#CONFIGURE_FILE(files/item_alias.cfg "${EXECUTABLE_OUTPUT_PATH}/item_alias.cfg" COPYONLY)
#ENDIF()
#
# install
#
install(FILES ${mineserver_configs}
DESTINATION ${CONFIG_DIR_ETC}/
)
install(DIRECTORY ${mineserver_dirs}
DESTINATION ${CONFIG_DIR_SHARE}/
)
#
# cpack
#
set(CPACK_PACKAGE_VENDOR "The Mineserver Project")
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Mineserver Developers <developers@mineserver.be>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mineserver - C++ Minecraft server software")
set(CPACK_PACKAGE_VERSION ${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_LEVEL})
set(CPACK_PACKAGE_VERSION_MAJOR ${${PROJECT_NAME}_MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${${PROJECT_NAME}_MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${${PROJECT_NAME}_PATCH_LEVEL})
set(CPACK_PACKAGE_INSTALL_DIRECTORY "/usr/local/bin")
include(CPack)
================================================
FILE: CMakeModules/FindEvent.cmake
================================================
# This module defines
# EVENT_LIBRARY
# EVENT_FOUND, if false, libevent wasn't found
# EVENT_INCLUDE_DIR, where to find the headers
FIND_PATH(EVENT_INCLUDE_DIR event.h
$ENV{EVENT_DIR}/include
$ENV{EVENT_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
FIND_LIBRARY(EVENT_LIBRARY
NAMES event libevent
PATHS
$ENV{EVENT_DIR}/lib
$ENV{EVENT_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
# handle the QUIETLY and REQUIRED arguments and set EVENT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE("FindPackageHandleStandardArgs")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EVENT REQUIRED_VARS EVENT_LIBRARY EVENT_INCLUDE_DIR)
================================================
FILE: CMakeModules/FindNoise.cmake
================================================
# NOISE_LIBRARY
# NOISE_FOUND, if false, libnoise wasn't found
# NOISE_INCLUDE_DIR, where to find the headers
# NOISE_DIR_IS_LIBNOISE, if true, include as libnoise/noise.h (Debian)
foreach(header noise/noise.h libnoise/noise.h)
FIND_PATH(NOISE_INCLUDE_DIR ${header}
$ENV{NOISE_DIR}/include
$ENV{NOISE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/include
/usr/include
/sw/include # Fink
/opt/local/include # DarwinPorts
/opt/csw/include # Blastwave
/opt/include
/usr/freeware/include
)
if(NOISE_INCLUDE_DIR)
break()
endif()
endforeach()
if(EXISTS ${NOISE_INCLUDE_DIR}/libnoise/noise.h)
set(NOISE_DIR_IS_LIBNOISE True)
endif()
IF(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
set(CMAKE_FIND_LIBRARY_SUFFIXES_ORIG ${CMAKE_FIND_LIBRARY_SUFFIXES})
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so.0")
ENDIF()
FIND_LIBRARY(NOISE_LIBRARY
NAMES noise libnoise
PATHS
$ENV{NOISE_DIR}/lib
$ENV{NOISE_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local/lib
/usr/lib
/sw/lib
/opt/local/lib
/opt/csw/lib
/opt/lib
/usr/freeware/lib64
)
IF(CMAKE_SYSTEM_NAME MATCHES FreeBSD)
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG})
ENDIF()
# handle the QUIETLY and REQUIRED arguments and set NOISE_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE("FindPackageHandleStandardArgs")
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NOISE REQUIRED_VARS NOISE_LIBRARY NOISE_INCLUDE_DIR)
================================================
FILE: CMakeModules/toolchain-i686-w64-mingw32.cmake
================================================
# the name of the target operating system
set(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
# here is the target environment located
set(CMAKE_FIND_ROOT_PATH
/usr/i686-w64-mingw32
~/i686-w64-mingw32
)
# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
================================================
FILE: Dockerfile
================================================
FROM debian:jessie
MAINTAINER Marko Viitanen <fador@iki.fi>
ENV PACKAGES libssl1.0.0 libevent-2.0 zlib1g systemd-sysv sysv-rc debconf passwd dpkg gnupg libnoise0
ENV TEMP_PACKAGES build-essential cmake git libssl-dev libevent-dev zlib1g-dev libnoise-dev ca-certificates
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --fix-missing --no-install-recommends --no-install-suggests $PACKAGES $TEMP_PACKAGES \
&& git clone --depth=1 git://github.com/fador/mineserver.git; \
cd mineserver; \
cmake .; \
make all;\
make install; \
make clean; \
AUTO_PACKAGES=`apt-mark showauto`; \
apt-get remove --purge --force-yes -y $TEMP_PACKAGES $AUTO_PACKAGES; \
apt-get clean autoclean; \
apt-get autoremove -y; \
rm -rf /var/lib/{apt,dpkg,cache,log}/ ;\
mkdir /var/mineserver; \
cp -rf files/* /var/mineserver/; \
cp -rf bin/* /var/mineserver/
EXPOSE 25565
ENV PATH /usr/local/bin:$PATH
VOLUME ["/var/mineserver"]
WORKDIR /var/mineserver
ENTRYPOINT ["mineserver"]
CMD ["/etc/mineserver/config.cfg","+system.path.home=\"/var/mineserver\"","+system.path.plugins=\"/usr/local/bin/plugins\""]
================================================
FILE: LICENSE
================================================
Copyright (c) 2016, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: README.md
================================================
# Mineserver
*by Fador & Nredor and others*
Custom Minecraft server software written in C++.
You can find the core team from [#mineserver](https://web.libera.chat/#mineserver) in [Libera.Chat](https://libera.chat/) IRC network. Also mail to developers@mineserver.be will reach us.
Copyright (c) 2010-2016, The Mineserver Project
**NOTICE:** Server still lacks features compared to original minecraft server.
**Supported platforms**
* Linux (CMake)
* Windows (VS2013 project included, CMake not tested)
Server has also been tested to build on Mac OS X and FreeBSD/PCBSD but we do not officially support those.
We are trying to minimize memory and CPU usage compared to original Java server.
*Important:* The language is C++11, so you will need a reasonably modern
C++ compiler. MS Visual C++ 12 and GCC 4.8 should be sufficient. The build system requires [cmake](http://www.cmake.org/).
### Supported Minecraft version
* Working with 1.8.9 client (protocol 47)
### Features
* Plugins (chatcommands, filelog, nether, passivemobs, etc..)
* NBT parsing/saving
* Lightmap generation
* Config file
* Normal mining/item spawning/item pickups
* Basic physics for gravel and sand
* Physics for water (currently revising this)
* Flatland and terrain map generation (Also biomegen!)
* Working chests, furnaces & signs
* User validation from minecraft.net
* Protocol Encryption
### Configuration Notes
An example `config.cfg` file is located in the `files` subdirectory.
The config file sets three path names and one file name which are relevant to the server; with their example values they are:
system.path.data = "files";
system.path.plugins = "plugins";
system.path.home = ".";
system.pid_file = "mineserver.pid";
These paths may be either absolute or relative. The server requires a set of configuration files which are located in the `files` subdirectory
of the distribution.
The plugin binaries must be manually placed in the appropriate location for the server to find them.
### Bug Tracker / To Do / Roadmap
We use GitHub issue tracker and milestones.
Please check the wiki pages for details about the project status and development plans.
Check the [fork network](https://github.com/fador/mineserver/network) for the latest development status.
### Compiling
Mineserver requires the following libraries:
* [zlib 1.2.5](http://www.zlib.org)
* [libevent 2.0.x](http://libevent.org/)
* [libnoise 1.0](http://libnoise.sourceforge.net/)
* [openssl/libssl](http://www.openssl.org/)
* [pthread](http://en.wikipedia.org/wiki/POSIX_Threads)
* Installing on Debian and Ubuntu:
`sudo apt-get install libssl libssl-dev libevent-2.0 libevent-dev zlib1g zlib1g-dev libnoise-dev`
* Installing on CentOS and RHEL
`# Install EPEL (Extra Packages for Enterprise Linux)`
`sudo su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm'`
`sudo yum install git libevent libevent-devel zlib zlib-devel libnoise-dev`
* Installing on FreeBSD / PCBSD
`sudo pkg_add -r libevent`
* Installing on Mac OS X
* Install libevent using your favourite tool, e.g., homebrew, fink or macports.
* Installing libnoise can be painful. Howerver, there is a homebrew formular
on [krono's homebrew fork](http://github.com/krono/homebrew).
So for homebrew do
`brew install libevent libnoise`
**Compiling using Linux (cmake & make & g++):**
* Download and extract source or use `git clone git://github.com/fador/mineserver.git`
* Go to mineserver directory
* Run `cmake .`
* Run `make all`
* Run server with `cd bin && ./mineserver`
**Compiling using FreeBSD / PCBSD (cmake & gmake & g++):**
* Download and extract source or use `git clone git://github.com/fador/mineserver.git`
* Go to mineserver directory
* Run `cmake .`
* Run `gmake all`
* Run server with `cd bin && ./mineserver`
**Compiling using Windows (VS2013): (Might be outdated)**
* Download and compile [zlib](http://www.zlib.org) or use [pre-built binaries](http://www.winimage.com/zLibDll/index.html)
* Add zlib libraries to project (zlibstat.lib or zlibwapi.lib which requires also zlibwapi.dll in the same dir with the executable)
* Download and compile [libevent 2.0.x](http://monkey.org/~provos/libevent/)
* Download [libnoise 1.0](http://libnoise.sourceforge.net/) and add header/library files to project
* Add libevent library to project (libevent2.lib)
* Build
* Run mineserver.exe
* [Build Pack](http://mineserver.be/downloads/mineserver-VS2013_build_pack.zip) also available for easy compiling
An example using commandline compiler available at http://www.microsoft.com/express/Windows/ Please change the ZLIB_INC_DIR, LIBEVENT_INC_DIR, ZLIB_LIB_DIR and LIBEVENT_LIB_DIR to those you keep the includes/libs.
call "%VS120COMNTOOLS%vsvars32.bat"
cl /I"ZLIB_INC_DIR;LIBEVENT_INC_DIR" /W3 /WX- /O2 /D ZLIB_WINAPI /D WIN32 /D NDEBUG /D _CRT_SECURE_NO_WARNINGS /EHsc *.cpp zlibwapi.lib libevent2.lib Ws2_32.lib /link /OUT:mineserver.exe /LIBPATH:"ZLIB_LIB_DIR;LIBEVENT_LIB_DIR"
================================================
FILE: files/CMakeLists.txt
================================================
cmake_minimum_required(VERSION 2.6)
# forbid running cmake from this subdir
if(PROJECT_NAME STREQUAL "Project")
message(FATAL_ERROR "\nplease run cmake from the project's parent directory\n")
endif()
# Get all the current config files and such from the current directory
FILE(GLOB mineserver_configs RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.txt *.cfg)
LIST(REMOVE_ITEM mineserver_configs "CMakeLists.txt")
LIST(REMOVE_DUPLICATES mineserver_configs)
# Install all the Recipes
FILE(GLOB_RECURSE mineserver_recipes RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "recipes/*")
LIST(REMOVE_DUPLICATES mineserver_recipes)
# copy configs for local usage
FOREACH(path ${mineserver_configs} ${mineserver_recipes})
SET(dest "${PROJECT_SOURCE_DIR}/bin/${path}")
IF(NOT EXISTS ${dest})
MESSAGE(STATUS "Configuring: ${dest}")
CONFIGURE_FILE(${path} ${dest} COPYONLY)
ENDIF()
ENDFOREACH()
================================================
FILE: files/ENABLED_RECIPES.cfg
================================================
#Armour
armour/helmet_leather
armour/helmet_iron
armour/helmet_gold
armour/helmet_diamond
armour/helmet_chain
armour/chestplate_leather
armour/chestplate_gold
armour/chestplate_iron
armour/chestplate_diamond
armour/chestplate_chain
armour/legging_leather
armour/legging_gold
armour/legging_iron
armour/legging_diamond
armour/legging_chain
armour/boots_leather
armour/boots_gold
armour/boots_iron
armour/boots_diamond
armour/boots_chain
#Food
food/bowls
food/mushroomstew
food/bread
food/apple_golden
food/cake
food/sugar
#Materials
materials/sticks
materials/block_iron
materials/block_gold
materials/block_diamond
materials/block_glowstone
materials/block_wool
materials/block_snow
materials/block_clay
materials/block_sandstone
materials/ingots_diamond
materials/ingots_iron
materials/ingots_gold
materials/block_brick
materials/wood_planks_acacia
materials/wood_planks_birch
materials/wood_planks_dark_oak
materials/wood_planks_jungle
materials/wood_planks_oak
materials/wood_planks_spruce
materials/tnt
materials/clay
#Mechanism
mechanism/door_wood
mechanism/door_iron
mechanism/pressure_wood
mechanism/pressure_stone
mechanism/button_stone
mechanism/torch_redstone
mechanism/lever
mechanism/dispenser
mechanism/note_block
#Misc
misc/stairs_wood
misc/stairs_stone
misc/chest
misc/fence_acacia
misc/fence_birch
misc/fence_dark_oak
misc/fence_jungle
misc/fence_oak
misc/fence_spruce
misc/furnace
misc/ladder
misc/sign
misc/torch
misc/workbench
misc/bookshelf
misc/jukebox
misc/jackolantern
misc/painting
misc/paper
misc/book
misc/bed
#Tools
tools/axe_stone
tools/axe_wood
tools/pickaxe_wood
tools/shovel_stone
tools/shovel_wood
tools/pickaxe_stone
tools/axe_iron
tools/axe_gold
tools/axe_diamond
tools/pickaxe_iron
tools/pickaxe_gold
tools/pickaxe_diamond
tools/shears
tools/shovel_iron
tools/shovel_gold
tools/shovel_diamond
tools/hoe_wood
tools/hoe_stone
tools/hoe_iron
tools/hoe_gold
tools/hoe_diamond
tools/flintsteel
tools/bucket
tools/compass
tools/clock
tools/fishingrod
#Weapons
weapons/sword_wood
weapons/sword_stone
weapons/sword_iron
weapons/sword_gold
weapons/sword_diamond
weapons/bow
weapons/arrows
#Transport
transport/minecart
transport/minecart_powered
transport/minecart_storage
transport/minecart_tracks
transport/boat
#Dyes
dyes/red
dyes/yellow
dyes/orange
dyes/cyan
dyes/lightgrey
dyes/grey
dyes/lime
dyes/pink
dyes/white
dyes/lightblue
dyes/magenta
dyes/purple
dyes/yellow
#Cloth
cloth/black
cloth/darkgreen
cloth/lightgrey
cloth/purple
cloth/blue
cloth/grey
cloth/magenta
cloth/red
cloth/brown
cloth/lightblue
cloth/orange
cloth/white
cloth/cyan
cloth/lightgreen
cloth/pink
cloth/yellow
#block
block/sand_hslab
block/smooth_hslab
block/stone_hslab
block/wood_hslab
================================================
FILE: files/banned.txt
================================================
# This is default banfile. Write nicks to be banned here one for each line
================================================
FILE: files/commands.cfg
================================================
# command permissions
# the order is: guest < member < op < admin
# e.g. "kick" is allowed for op & above (ops & admins)
load = admin
unload = admin
reload = admin
save = admin
settime = admin
regen = admin
adminonlymsg = admin
kick = op
tp = op
ctp = op
ban = op
unban = op
give = op
igive = op
mute = op
unmute = op
sethealth = op
servermsg = op
kit = member
whisper = member
gps = member
about = guest
motd = guest
help = guest
who = guest
home = guest
rules = guest
dnd = guest
emote = guest
================================================
FILE: files/config.cfg
================================================
#
# Mineserver configuration
#
# Search paths
# Note: leading tilde '~' is treated as $HOME
system.path.data = ".";
system.path.plugins = "plugins";
system.path.home = ".";
system.pid_file = "mineserver.pid";
# Include item alias config file
include "item_alias.cfg";
# Interface.
system.interface.use_cli = true;
# Server name
system.server_name = "Mineserver testserver";
# Validate usernames against minecraft.net
# false means "offline" mode
system.user_validation = true;
# Encryption required for validation
# will encrypt the whole protocol with AES/CFB8
# Offline mode will work with encryption
# Recommendation: DONT CHANGE
system.protocol_encryption = true;
# Disclose Software Version
system.show_version = true;
# Userlimit
system.user_limit = 50;
# IP
net.ip = "0.0.0.0";
# Port
net.port = 25565;
# Server administrator authentication password
# Used for core commands like shutdown and loadplugin
# using "/auth password" will make you an admin
# NOTE: default "CHANGEME" is ignored, so change this only if you want to use it.
system.admin.password = "CHANGEME";
# 0 = Normal Map
# 1 = Nether Map
# ...
# Map directory : Generator
map.storage.nbt.directories= ();
# WORLD ARE LOADED ALPHABETICALLY. you have been warned ;P
# Generators:
# 0 - old generator
# 1 - nether generator
# 2 - heaven generator
# 3 - new (biome) generator
# 4 - mapgen by Eximius
#map.storage.nbt.directories += ("B-nether":1);
#map.storage.nbt.directories += ("Cheaven":2);
map.storage.nbt.directories += ("A-world":3);
# Localization strings
strings.wrong_protocol = "Wrong protocol version";
strings.server_full = "Server is currently full";
# Physics options (water/lava)
system.physics.enabled = false;
# Redstone options (EXPERIMENTAL)
system.redstone.enabled = true;
# Enable PvP ?
system.pvp.enabled = true;
# Enable area damage?
system.damage.enabled = true;
# true = Only helmets in helmet slot, false = any block in helmet slot (fun!)
system.armour.helmet_strict = true;
furnace.items.stone = ("in":4, "out":1, "meta":0, "count":1);
furnace.items.gold = ("in":14, "out":266, "meta":0, "count":1);
furnace.items.iron = ("in":15, "out":265, "meta":0, "count":1);
furnace.items.charcoal = ("in":17, "out":263, "meta":1, "count":1);
furnace.items.diamond = ("in":56, "out":264, "meta":0, "count":1);
furnace.items.lapiz = ("in":21, "out":351, "meta":4, "count":6);
furnace.items.glass = ("in":12, "out":20, "meta":0, "count":1);
furnace.items.pork = ("in":319, "out":320, "meta":0, "count":1);
furnace.items.clay = ("in":337, "out":336, "meta":0, "count":1);
furnace.items.fish = ("in":349, "out":350, "meta":0, "count":1);
furnace.items.cactus = ("in": 81, "out":351, "meta":2, "count":1);
# Save generated chunks which are not changed?
# Will generate the chunks again if false.
map.save_unchanged_chunks = true;
# Map save interval in seconds, 0 = off
map.save_interval = 1800;
#
# Map generator parameters
#
# Generate spawn area in advance
map.generate_spawn.enabled = true;
map.generate_spawn.size = 5;
map.generate_spawn.show_progress = true;
# Threading (how many concurrent generators running) !!NOT IN USE!!
mapgen.threads = 2;
# Time that grass takes to spread to the next block, in seconds
# Please note that zero is a VERY bad idea.
mapgen.grassrate = 10;
mapgen.croprate = 10;
mapgen.cactusrate = 10;
mapgen.reedrate = 10;
# Max height
mapgen.cactusmax = 4;
mapgen.reedmax = 5;
# Generate flatgrass map instead of normal map
mapgen.flatgrass = false;
# Snow instead of grass
mapgen.winter.enabled = false;
# Sea level
mapgen.sea.level = 62;
# Add Ore
mapgen.addore = true;
# Generate trees
mapgen.trees.enabled = true;
# Generate caves
mapgen.caves.enabled = false;
# Smaller number = smaller caves
mapgen.caves.size = 15;
# Do not modify if not sure what this is
# Used in: if(caveNoise.GetValue(x,y,z) < caveTreshold)
mapgen.caves.treshold = 0.05;
mapgen.caves.lava = true;
# Expand beaches (Experimental)
mapgen.beaches.expand = false;
mapgen.beaches.extent = 10;
mapgen.beaches.height = 2;
# Plugin loading
#
# The syntax is as follows:
# system.plugins += ("<name>");
# system.plugins += ("<alias>" : "<name>");
# Alternatively you can do this:
# system.plugins.<alias> = "<name>";
#
# Plugins are to be found under 'system.path.plugins' path
#
# If you use the second syntax, you're limited to [a-zA-Z0-9_]+ for the alias.
# It's probably not a great idea to use any characters other than that anyway.
#
# <alias>
# The plugin alias is whatever you like, it will be passed to the plugin so it
# can use it as a sort of instance name. For example if you have two different
# ban lists (for some reason), you could have them both operating at once by
# giving them unique identifiers.
#
# <name>
# Plugin name. If it starts with underscore '_' character, mineserver tries to
# load it from within the main binary. Instructions on how to compile plugins
# into mineserver are pending, but it basically involves just compiling the
# plugin to an object file then linking it to the mineserver binary when it's
# built.
#
# More information on this topic will be covered on the wiki Soon (tm).
system.plugins = ();
#system.plugins += ("binlog");
#system.plugins += ("banlist");
system.plugins += ("commands");
#system.plugins += ("crapMobs");
#system.plugins += ("cursesui");
system.plugins += ("filelog");
system.plugins += ("flatpermissions");
system.plugins += ("nBreak");
system.plugins += ("nether");
system.plugins += ("passiveMobs");
#system.plugins += ("whitelist");
================================================
FILE: files/item_alias.cfg
================================================
#
# Aliases for /give and other labels
#
stone = 1
grass = 2
dirt = 3
cobblestone = 4
woodenplank = 5
sapling = 6
bedrock = 7
water = 8
statwater = 9
lava = 10
statlava = 11
sand = 12
gravel = 13
goldore = 14
ironore = 15
coalore = 16
wood = 17
leaves = 18
sponge = 19
glass = 20
lapisore = 21
lapisblock = 22
dispenser = 23
sandstone = 24
noteblock = 25
bed = 26
wool = 35
yellowflower = 37
redrose = 38
brownmushroom = 39
redmushroom = 40
goldblock = 41
ironblock = 42
doublestoneslab = 43
stoneslab = 44
brickblock = 45
tnt = 46
bookshelf = 47
mossstone = 48
obsidian = 49
torch = 50
fire = 51
monsterspawner = 52
woodenstairs = 53
chest = 54
redstonewire = 55
diamondore = 56
diamondblock = 57
workbench = 58
crops = 59
farmland = 60
furnace = 61
ladder = 65
tracks = 66
cobblestonestairs = 67
lever = 69
stonepressureplate = 70
woodenpressureplate = 72
redstoneore = 73
redstonetorch = 75
stonebutton = 77
snow = 78
ice = 79
snowblock = 80
cactus = 81
clay = 82
sugarcane = 83
jukebox = 84
fence = 85
pumpkin = 86
netherrack = 87
soulsand = 88
glowstone = 89
jackolantern = 91
cakeblock = 92
# items
ironshovel = 256
ironpickaxe = 257
ironaxe = 258
flintandsteel = 259
apple = 260
bow = 261
arrow = 262
coal = 263
diamond = 264
ironingot = 265
goldingot = 266
ironsword = 267
woodensword = 268
woodenshovel = 269
woodenpickaxe = 270
woodenaxe = 271
stonesword = 272
stoneshovel = 273
stonepickaxe = 274
stoneaxe = 275
diamondsword = 276
diamondshovel = 277
diamondpickaxe = 278
diamondaxe = 279
stick = 280
bowl = 281
mushroomsoup = 282
goldsword = 283
goldshovel = 284
goldpickaxe = 285
goldaxe = 286
string = 287
feather = 288
sulphur = 289
woodenhoe = 290
stonehoe = 291
ironhoe = 292
diamondhoe = 293
goldhoe = 294
seeds = 295
wheat = 296
bread = 297
leatherhelmet = 298
leatherchestplate = 299
leatherleggings = 300
leatherboots = 301
chainmailhelmet = 302
chainmailchestplate = 303
chainmailaleggings = 304
chainmailboots = 305
ironhelmet = 306
ironchestplate = 307
ironleggings = 308
ironboots = 309
diamondhelmet = 310
diamondchestplate = 311
diamondleggings = 312
diamondboots = 313
goldhelmet = 314
goldchestplate = 315
goldleggings = 316
goldboots = 317
flint = 318
rawporkchop = 319
grilledporkchop = 320
paintings = 312
goldenapple = 322
sign = 323
woodendoor = 324
bucket = 325
waterbucket = 326
lavabucket = 327
minecart = 328
saddle = 329
irondoor = 330
redstone = 331
snowball = 332
boat = 333
leather = 334
milk = 335
claybrick = 336
clayballs = 337
sugarcane = 338
paper = 339
book = 340
slimeball = 341
storageminecart = 342
poweredminecart = 343
egg = 344
compass = 345
fishingrod = 346
clock = 347
glowstonedust = 348
rawfish = 349
cookedfish = 350
inksac = 351
bone = 352
sugar = 353
cake = 354
bed = 355
brewingstand = 379
goldrecord = 2256
greenrecord = 2257
================================================
FILE: files/motd.txt
================================================
#
# Write message of the day here.
# Lines beginning with # are commentlines and will not be sent to player
#
> §aWelcome to Mineserver!
> §bThis is MOTD
> §fThis is third line of MOTD :E
================================================
FILE: files/permissions.txt
================================================
someMemberName:Member
someOpName:Op
someAdminName:Admin
================================================
FILE: files/recipes/armour/boots_chain.recipe
================================================
# Input
width 3
height 2
<-
51 -1 51
51 -1 51
->
# Output
outputcount 1
outputtype 305
outputhealth 0
================================================
FILE: files/recipes/armour/boots_diamond.recipe
================================================
# Input
width 3
height 2
<-
264 -1 264
264 -1 264
->
# Output
outputcount 1
outputtype 313
outputhealth 0
================================================
FILE: files/recipes/armour/boots_gold.recipe
================================================
# Input
width 3
height 2
<-
266 -1 266
266 -1 266
->
# Output
outputcount 1
outputtype 317
outputhealth 0
================================================
FILE: files/recipes/armour/boots_iron.recipe
================================================
# Input
width 3
height 2
<-
265 -1 265
265 -1 265
->
# Output
outputcount 1
outputtype 309
outputhealth 0
================================================
FILE: files/recipes/armour/boots_leather.recipe
================================================
# Input
width 3
height 2
<-
334 -1 334
334 -1 334
->
# Output
outputcount 1
outputtype 301
outputhealth 0
================================================
FILE: files/recipes/armour/chestplate_chain.recipe
================================================
# Input
width 3
height 3
<-
51 -1 51
51 51 51
51 51 51
->
# Output
outputcount 1
outputtype 303
outputhealth 0
================================================
FILE: files/recipes/armour/chestplate_diamond.recipe
================================================
# Input
width 3
height 3
<-
264 -1 264
264 264 264
264 264 264
->
# Output
outputcount 1
outputtype 311
outputhealth 0
================================================
FILE: files/recipes/armour/chestplate_gold.recipe
================================================
# Input
width 3
height 3
<-
266 -1 266
266 266 266
266 266 266
->
# Output
outputcount 1
outputtype 315
outputhealth 0
================================================
FILE: files/recipes/armour/chestplate_iron.recipe
================================================
# Input
width 3
height 3
<-
265 -1 265
265 265 265
265 265 265
->
# Output
outputcount 1
outputtype 307
outputhealth 0
================================================
FILE: files/recipes/armour/chestplate_leather.recipe
================================================
# Input
width 3
height 3
<-
334 -1 334
334 334 334
334 334 334
->
# Output
outputcount 1
outputtype 299
outputhealth 0
================================================
FILE: files/recipes/armour/helmet_chain.recipe
================================================
# Input
width 3
height 2
<-
51 51 51
51 -1 51
->
# Output
outputcount 1
outputtype 302
outputhealth 0
================================================
FILE: files/recipes/armour/helmet_diamond.recipe
================================================
# Input
width 3
height 2
<-
264 264 264
264 -1 264
->
# Output
outputcount 1
outputtype 310
outputhealth 0
================================================
FILE: files/recipes/armour/helmet_gold.recipe
================================================
# Input
width 3
height 2
<-
266 266 266
266 -1 266
->
# Output
outputcount 1
outputtype 314
outputhealth 0
================================================
FILE: files/recipes/armour/helmet_iron.recipe
================================================
# Input
width 3
height 2
<-
265 265 265
265 -1 265
->
# Output
outputcount 1
outputtype 306
outputhealth 0
================================================
FILE: files/recipes/armour/helmet_leather.recipe
================================================
# Input
width 3
height 2
<-
334 334 334
334 -1 334
->
# Output
outputcount 1
outputtype 298
outputhealth 0
================================================
FILE: files/recipes/armour/legging_chain.recipe
================================================
# Input
width 3
height 3
<-
51 51 51
51 -1 51
51 -1 51
->
# Output
outputcount 1
outputtype 304
outputhealth 0
================================================
FILE: files/recipes/armour/legging_diamond.recipe
================================================
# Input
width 3
height 3
<-
264 264 264
264 -1 264
264 -1 264
->
# Output
outputcount 1
outputtype 312
outputhealth 0
================================================
FILE: files/recipes/armour/legging_gold.recipe
================================================
# Input
width 3
height 3
<-
266 266 266
266 -1 266
266 -1 266
->
# Output
outputcount 1
outputtype 316
outputhealth 0
================================================
FILE: files/recipes/armour/legging_iron.recipe
================================================
# Input
width 3
height 3
<-
265 265 265
265 -1 265
265 -1 265
->
# Output
outputcount 1
outputtype 308
outputhealth 0
================================================
FILE: files/recipes/armour/legging_leather.recipe
================================================
# Input
width 3
height 3
<-
334 334 334
334 -1 334
334 -1 334
->
# Output
outputcount 1
outputtype 300
outputhealth 0
================================================
FILE: files/recipes/block/sand_hslab.recipe
================================================
# Input
width 3
height 1
<-
24 24 24
->
# Output
outputcount 3
outputtype 44
outputhealth 1
================================================
FILE: files/recipes/block/smooth_hslab.recipe
================================================
# Input
width 3
height 1
<-
1 1 1
->
# Output
outputcount 3
outputtype 44
outputhealth 0
================================================
FILE: files/recipes/block/stone_hslab.recipe
================================================
# Input
width 3
height 1
<-
4 4 4
->
# Output
outputcount 3
outputtype 44
outputhealth 3
================================================
FILE: files/recipes/block/wood_hslab.recipe
================================================
# Input
width 3
height 1
<-
5 5 5
->
# Output
outputcount 3
outputtype 44
outputhealth 2
================================================
FILE: files/recipes/cloth/black.recipe
================================================
# Input
width 2
height 1
<-
35 351:0
->
# Output
outputcount 1
outputtype 35
outputhealth 15
================================================
FILE: files/recipes/cloth/blue.recipe
================================================
# Input
width 2
height 1
<-
35 351:4
->
# Output
outputcount 1
outputtype 35
outputhealth 11
================================================
FILE: files/recipes/cloth/brown.recipe
================================================
# Input
width 2
height 1
<-
35 351:3
->
# Output
outputcount 1
outputtype 35
outputhealth 12
================================================
FILE: files/recipes/cloth/cyan.recipe
================================================
# Input
width 2
height 1
<-
35 351:6
->
# Output
outputcount 1
outputtype 35
outputhealth 9
================================================
FILE: files/recipes/cloth/darkgreen.recipe
================================================
# Input
width 2
height 1
<-
35 351:2
->
# Output
outputcount 1
outputtype 35
outputhealth 13
================================================
FILE: files/recipes/cloth/grey.recipe
================================================
# Input
width 2
height 1
<-
35 351:8
->
# Output
outputcount 1
outputtype 35
outputhealth 7
================================================
FILE: files/recipes/cloth/lightblue.recipe
================================================
# Input
width 2
height 1
<-
35 351:12
->
# Output
outputcount 1
outputtype 35
outputhealth 3
================================================
FILE: files/recipes/cloth/lightgreen.recipe
================================================
# Input
width 2
height 1
<-
35 351:10
->
# Output
outputcount 1
outputtype 35
outputhealth 5
================================================
FILE: files/recipes/cloth/lightgrey.recipe
================================================
# Input
width 2
height 1
<-
35 351:7
->
# Output
outputcount 1
outputtype 35
outputhealth 8
================================================
FILE: files/recipes/cloth/magenta.recipe
================================================
# Input
width 2
height 1
<-
35 351:13
->
# Output
outputcount 1
outputtype 35
outputhealth 2
================================================
FILE: files/recipes/cloth/orange.recipe
================================================
# Input
width 2
height 1
<-
35 351:14
->
# Output
outputcount 1
outputtype 35
outputhealth 1
================================================
FILE: files/recipes/cloth/pink.recipe
================================================
# Input
width 2
height 1
<-
35 351:9
->
# Output
outputcount 1
outputtype 35
outputhealth 6
================================================
FILE: files/recipes/cloth/purple.recipe
================================================
# Input
width 2
height 1
<-
35 351:5
->
# Output
outputcount 1
outputtype 35
outputhealth 10
================================================
FILE: files/recipes/cloth/red.recipe
================================================
# Input
width 2
height 1
<-
35 351:1
->
# Output
outputcount 1
outputtype 35
outputhealth 14
================================================
FILE: files/recipes/cloth/white.recipe
================================================
# Input
width 2
height 1
<-
35 351:15
->
# Output
outputcount 1
outputtype 35
outputhealth 0
================================================
FILE: files/recipes/cloth/yellow.recipe
================================================
# Input
width 2
height 1
<-
35 351:11
->
# Output
outputcount 1
outputtype 35
outputhealth 4
================================================
FILE: files/recipes/dyes/cyan.recipe
================================================
# Input
width 2
height 1
<-
351:4 351:2
->
# Output
outputcount 2
outputtype 351
outputhealth 6
================================================
FILE: files/recipes/dyes/grey.recipe
================================================
# Input
width 2
height 1
<-
351:0 351:15
->
# Output
outputcount 2
outputtype 351
outputhealth 8
================================================
FILE: files/recipes/dyes/lightblue.recipe
================================================
# Input
width 2
height 1
<-
351:4 351:15
->
# Output
outputcount 2
outputtype 351
outputhealth 12
================================================
FILE: files/recipes/dyes/lightgrey.recipe
================================================
# Input
width 2
height 1
<-
351:8 351:15
->
# Output
outputcount 2
outputtype 351
outputhealth 7
================================================
FILE: files/recipes/dyes/lime.recipe
================================================
# Input
width 2
height 1
<-
351:2 351:15
->
# Output
outputcount 2
outputtype 351
outputhealth 10
================================================
FILE: files/recipes/dyes/magenta.recipe
================================================
# Input
width 2
height 1
<-
351:5 351:9
->
# Output
outputcount 2
outputtype 351
outputhealth 13
================================================
FILE: files/recipes/dyes/orange.recipe
================================================
# Input
width 2
height 1
<-
351:1 351:11
->
# Output
outputcount 2
outputtype 351
outputhealth 14
================================================
FILE: files/recipes/dyes/pink.recipe
================================================
# Input
width 2
height 1
<-
351:1 351:15
->
# Output
outputcount 2
outputtype 351
outputhealth 9
================================================
FILE: files/recipes/dyes/purple.recipe
================================================
# Input
width 2
height 1
<-
351:4 351:1
->
# Output
outputcount 2
outputtype 351
outputhealth 5
================================================
FILE: files/recipes/dyes/red.recipe
================================================
# Input
width 1
height 1
<-
38
->
# Output
outputcount 2
outputtype 351
outputhealth 1
================================================
FILE: files/recipes/dyes/white.recipe
================================================
# Input
width 1
height 1
<-
352
->
# Output
outputcount 2
outputtype 351
outputhealth 15
================================================
FILE: files/recipes/dyes/yellow.recipe
================================================
# Input
width 1
height 1
<-
37
->
# Output
outputcount 2
outputtype 351
outputhealth 11
================================================
FILE: files/recipes/food/apple_golden.recipe
================================================
# Input
width 3
height 3
<-
41 41 41
41 260 41
41 41 41
->
# Output
outputcount 1
outputtype 322
outputhealth 0
================================================
FILE: files/recipes/food/bowls.recipe
================================================
# Input
width 3
height 2
<-
5 -1 5
-1 5 -1
->
# Output
outputcount 4
outputtype 281
outputhealth 0
================================================
FILE: files/recipes/food/bread.recipe
================================================
# Input
width 3
height 1
<-
296 296 296
->
# Output
outputcount 1
outputtype 297
outputhealth 0
================================================
FILE: files/recipes/food/cake.recipe
================================================
# Input
width 3
height 3
<-
335 335 335
353 344 353
296 296 296
->
# Output
outputcount 1
outputtype 354
outputhealth 0
================================================
FILE: files/recipes/food/mushroomstew.recipe
================================================
# Input
width 1
height 3
<-
40
39
281
->
# Output
outputcount 1
outputtype 282
outputhealth 0
================================================
FILE: files/recipes/food/sugar.recipe
================================================
# Input
width 1
height 1
<-
338
->
# Output
outputcount 1
outputtype 353
outputhealth 0
================================================
FILE: files/recipes/materials/block_brick.recipe
================================================
# Input
width 2
height 2
<-
336 336
336 336
->
# Output
outputcount 1
outputtype 45
outputhealth 0
================================================
FILE: files/recipes/materials/block_clay.recipe
================================================
# Input
width 2
height 2
<-
337 337
337 337
->
# Output
outputcount 1
outputtype 82
outputhealth 0
================================================
FILE: files/recipes/materials/block_diamond.recipe
================================================
# Input
width 3
height 3
<-
264 264 264
264 264 264
264 264 264
->
# Output
outputcount 1
outputtype 57
outputhealth 0
================================================
FILE: files/recipes/materials/block_glowstone.recipe
================================================
# Input
width 3
height 3
<-
348 348 348
348 348 348
348 348 348
->
# Output
outputcount 1
outputtype 89
outputhealth 0
================================================
FILE: files/recipes/materials/block_gold.recipe
================================================
# Input
width 3
height 3
<-
266 266 266
266 266 266
266 266 266
->
# Output
outputcount 1
outputtype 41
outputhealth 0
================================================
FILE: files/recipes/materials/block_iron.recipe
================================================
# Input
width 3
height 3
<-
265 265 265
265 265 265
265 265 265
->
# Output
outputcount 1
outputtype 42
outputhealth 0
================================================
FILE: files/recipes/materials/block_sandstone.recipe
================================================
# Input
width 2
height 2
<-
12 12
12 12
->
# Output
outputcount 1
outputtype 24
outputhealth 0
================================================
FILE: files/recipes/materials/block_snow.recipe
================================================
# Input
width 2
height 2
<-
332 332
332 332
->
# Output
outputcount 1
outputtype 80
outputhealth 0
================================================
FILE: files/recipes/materials/block_wool.recipe
================================================
# Input
width 3
height 3
<-
287 287 287
287 287 287
287 287 287
->
# Output
outputcount 1
outputtype 23
outputhealth 0
================================================
FILE: files/recipes/materials/clay.recipe
================================================
# Input
width 1
height 1
<-
82
->
# Output
outputcount 4
outputtype 337
outputhealth 0
================================================
FILE: files/recipes/materials/ingots_diamond.recipe
================================================
# Input
width 1
height 1
<-
57
->
# Output
outputcount 9
outputtype 264
outputhealth 0
================================================
FILE: files/recipes/materials/ingots_gold.recipe
================================================
# Input
width 1
height 1
<-
41
->
# Output
outputcount 9
outputtype 266
outputhealth 0
================================================
FILE: files/recipes/materials/ingots_iron.recipe
================================================
# Input
width 1
height 1
<-
42
->
# Output
outputcount 9
outputtype 265
outputhealth 0
================================================
FILE: files/recipes/materials/sticks.recipe
================================================
# Input
width 1
height 2
<-
5
5
->
# Output
outputcount 4
outputtype 280
outputhealth 0
================================================
FILE: files/recipes/materials/tnt.recipe
================================================
# Input
width 3
height 3
<-
289 12 289
12 289 12
289 12 289
->
# Output
outputcount 1
outputtype 46
outputhealth 0
================================================
FILE: files/recipes/materials/wood_planks_acacia.recipe
================================================
# Input
width 1
height 1
<-
162:0
->
# Output
outputcount 4
outputtype 5
outputhealth 4
================================================
FILE: files/recipes/materials/wood_planks_birch.recipe
================================================
# Input
width 1
height 1
<-
17:2
->
# Output
outputcount 4
outputtype 5
outputhealth 2
================================================
FILE: files/recipes/materials/wood_planks_dark_oak.recipe
================================================
# Input
width 1
height 1
<-
162:1
->
# Output
outputcount 4
outputtype 5
outputhealth 5
================================================
FILE: files/recipes/materials/wood_planks_jungle.recipe
================================================
# Input
width 1
height 1
<-
17:3
->
# Output
outputcount 4
outputtype 5
outputhealth 3
================================================
FILE: files/recipes/materials/wood_planks_oak.recipe
================================================
# Input
width 1
height 1
<-
17:0
->
# Output
outputcount 4
outputtype 5
outputhealth 0
================================================
FILE: files/recipes/materials/wood_planks_spruce.recipe
================================================
# Input
width 1
height 1
<-
17:1
->
# Output
outputcount 4
outputtype 5
outputhealth 1
================================================
FILE: files/recipes/mechanism/button_stone.recipe
================================================
# Input
width 1
height 2
<-
1
1
->
# Output
outputcount 1
outputtype 77
outputhealth 0
================================================
FILE: files/recipes/mechanism/dispenser.recipe
================================================
# Input
width 3
height 3
<-
4 4 4
4 261 4
4 55 4
->
# Output
outputcount 1
outputtype 23
outputhealth 0
================================================
FILE: files/recipes/mechanism/door_iron.recipe
================================================
# Input
width 2
height 3
<-
265 265
265 265
265 265
->
# Output
outputcount 1
outputtype 330
outputhealth 0
================================================
FILE: files/recipes/mechanism/door_wood.recipe
================================================
# Input
width 2
height 3
<-
5 5
5 5
5 5
->
# Output
outputcount 1
outputtype 324
outputhealth 0
================================================
FILE: files/recipes/mechanism/lever.recipe
================================================
# Input
width 1
height 2
<-
280
4
->
# Output
outputcount 1
outputtype 69
outputhealth 0
================================================
FILE: files/recipes/mechanism/note_block.recipe
================================================
# Input
width 3
height 3
<-
5 5 5
5 55 5
5 5 5
->
# Output
outputcount 1
outputtype 25
outputhealth 0
================================================
FILE: files/recipes/mechanism/pressure_stone.recipe
================================================
# Input
width 2
height 1
<-
1 1
->
# Output
outputcount 1
outputtype 70
outputhealth 0
================================================
FILE: files/recipes/mechanism/pressure_wood.recipe
================================================
# Input
width 2
height 1
<-
5 5
->
# Output
outputcount 1
outputtype 72
outputhealth 0
================================================
FILE: files/recipes/mechanism/torch_redstone.recipe
================================================
# Input
width 1
height 2
<-
331
280
->
# Output
outputcount 1
outputtype 76
outputhealth 0
================================================
FILE: files/recipes/misc/bed.recipe
================================================
# Input
width 3
height 2
<-
35 35 35
5 5 5
->
# Output
outputcount 1
outputtype 355
outputhealth 0
================================================
FILE: files/recipes/misc/book.recipe
================================================
# Input
width 1
height 3
<-
339 339 339
->
# Output
outputcount 1
outputtype 340
outputhealth 0
================================================
FILE: files/recipes/misc/bookshelf.recipe
================================================
# Input
width 3
height 3
<-
5 5 5
340 340 340
5 5 5
->
# Output
outputcount 1
outputtype 47
outputhealth 0
================================================
FILE: files/recipes/misc/chest.recipe
================================================
# Input
width 3
height 3
<-
5 5 5
5 -1 5
5 5 5
->
# Output
outputcount 1
outputtype 54
outputhealth 0
================================================
FILE: files/recipes/misc/fence_acacia.recipe
================================================
# Input
width 3
height 2
<-
5:4 280 5:4
5:4 280 5:4
->
# Output
outputcount 3
outputtype 192
outputhealth 0
================================================
FILE: files/recipes/misc/fence_birch.recipe
================================================
# Input
width 3
height 2
<-
5:2 280 5:2
5:2 280 5:2
->
# Output
outputcount 3
outputtype 189
outputhealth 0
================================================
FILE: files/recipes/misc/fence_dark_oak.recipe
================================================
# Input
width 3
height 2
<-
5:5 280 5:5
5:5 280 5:5
->
# Output
outputcount 3
outputtype 191
outputhealth 0
================================================
FILE: files/recipes/misc/fence_jungle.recipe
================================================
# Input
width 3
height 2
<-
5:3 280 5:3
5:3 280 5:3
->
# Output
outputcount 3
outputtype 190
outputhealth 0
================================================
FILE: files/recipes/misc/fence_oak.recipe
================================================
# Input
width 3
height 2
<-
5:0 280 5:0
5:0 280 5:0
->
# Output
outputcount 3
outputtype 85
outputhealth 0
================================================
FILE: files/recipes/misc/fence_spruce.recipe
================================================
# Input
width 3
height 2
<-
5:1 280 5:1
5:1 280 5:1
->
# Output
outputcount 3
outputtype 188
outputhealth 0
================================================
FILE: files/recipes/misc/furnace.recipe
================================================
# Input
width 3
height 3
<-
4 4 4
4 -1 4
4 4 4
->
# Output
outputcount 1
outputtype 61
outputhealth 0
================================================
FILE: files/recipes/misc/jackolantern.recipe
================================================
# Input
width 1
height 2
<-
86
50
->
# Output
outputcount 1
outputtype 91
outputhealth 0
================================================
FILE: files/recipes/misc/jukebox.recipe
================================================
# Input
width 3
height 3
<-
5 5 5
5 264 5
5 5 5
->
# Output
outputcount 1
outputtype 84
outputhealth 0
================================================
FILE: files/recipes/misc/ladder.recipe
================================================
# Input
width 3
height 3
<-
280 -1 280
280 280 280
280 -1 280
->
# Output
outputcount 2
outputtype 65
outputhealth 0
================================================
FILE: files/recipes/misc/painting.recipe
================================================
# Input
width 3
height 3
<-
280 280 280
280 26 280
280 280 280
->
# Output
outputcount 1
outputtype 321
outputhealth 0
================================================
FILE: files/recipes/misc/paper.recipe
================================================
# Input
width 3
height 1
<-
338 338 338
->
# Output
outputcount 3
outputtype 339
outputhealth 0
================================================
FILE: files/recipes/misc/sign.recipe
================================================
# Input
width 3
height 3
<-
5 5 5
5 5 5
-1 280 -1
->
# Output
outputcount 1
outputtype 323
outputhealth 0
================================================
FILE: files/recipes/misc/stairs_stone.recipe
================================================
# Input
width 3
height 3
<-
4 -1 -1
4 4 -1
4 4 4
->
# Output
outputcount 4
outputtype 67
outputhealth 0
================================================
FILE: files/recipes/misc/stairs_wood.recipe
================================================
# Input
width 3
height 3
<-
5 -1 -1
5 5 -1
5 5 5
->
# Output
outputcount 4
outputtype 53
outputhealth 0
================================================
FILE: files/recipes/misc/torch.recipe
================================================
# Input
width 1
height 2
<-
263
280
->
# Output
outputcount 4
outputtype 50
outputhealth 0
================================================
FILE: files/recipes/misc/workbench.recipe
================================================
# Input
width 2
height 2
<-
5 5
5 5
->
# Output
outputcount 1
outputtype 58
outputhealth 0
================================================
FILE: files/recipes/tools/axe_diamond.recipe
================================================
# Input
width 2
height 3
<-
264 264
264 280
-1 280
->
# Output
outputcount 1
outputtype 279
outputhealth 0
================================================
FILE: files/recipes/tools/axe_gold.recipe
================================================
# Input
width 2
height 3
<-
266 266
266 280
-1 280
->
# Output
outputcount 1
outputtype 286
outputhealth 0
================================================
FILE: files/recipes/tools/axe_iron.recipe
================================================
# Input
width 2
height 3
<-
265 265
265 280
-1 280
->
# Output
outputcount 1
outputtype 258
outputhealth 0
================================================
FILE: files/recipes/tools/axe_stone.recipe
================================================
# Input
width 2
height 3
<-
4 4
4 280
-1 280
->
# Output
outputcount 1
outputtype 275
outputhealth 0
================================================
FILE: files/recipes/tools/axe_wood.recipe
================================================
# Input
width 2
height 3
<-
5 5
5 280
-1 280
->
# Output
outputcount 1
outputtype 271
outputhealth 0
================================================
FILE: files/recipes/tools/bucket.recipe
================================================
# Input
width 3
height 2
<-
265 -1 265
-1 265 -1
->
# Output
outputcount 1
outputtype 325
outputhealth 0
================================================
FILE: files/recipes/tools/clock.recipe
================================================
# Input
width 3
height 3
<-
-1 266 -1
266 331 266
-1 266 -1
->
# Output
outputcount 1
outputtype 347
outputhealth 0
================================================
FILE: files/recipes/tools/compass.recipe
================================================
# Input
width 3
height 3
<-
-1 265 -1
265 331 265
-1 265 -1
->
# Output
outputcount 1
outputtype 345
outputhealth 0
================================================
FILE: files/recipes/tools/fishingrod.recipe
================================================
# Input
width 3
height 3
<-
-1 -1 280
-1 280 287
280 -1 286
->
# Output
outputcount 1
outputtype 346
outputhealth 0
================================================
FILE: files/recipes/tools/flintsteel.recipe
================================================
# Input
width 2
height 2
<-
265 -1
-1 318
->
# Output
outputcount 1
outputtype 259
outputhealth 0
================================================
FILE: files/recipes/tools/hoe_diamond.recipe
================================================
# Input
width 2
height 3
<-
264 264
-1 280
-1 280
->
# Output
outputcount 1
outputtype 293
outputhealth 0
================================================
FILE: files/recipes/tools/hoe_gold.recipe
================================================
# Input
width 2
height 3
<-
266 266
-1 280
-1 280
->
# Output
outputcount 1
outputtype 294
outputhealth 0
================================================
FILE: files/recipes/tools/hoe_iron.recipe
================================================
# Input
width 2
height 3
<-
265 265
-1 280
-1 280
->
# Output
outputcount 1
outputtype 292
outputhealth 0
================================================
FILE: files/recipes/tools/hoe_stone.recipe
================================================
# Input
width 2
height 3
<-
4 4
-1 280
-1 280
->
# Output
outputcount 1
outputtype 291
outputhealth 0
================================================
FILE: files/recipes/tools/hoe_wood.recipe
================================================
# Input
width 2
height 3
<-
5 5
-1 280
-1 280
->
# Output
outputcount 1
outputtype 290
outputhealth 0
================================================
FILE: files/recipes/tools/pickaxe_diamond.recipe
================================================
# Input
width 3
height 3
<-
264 264 264
-1 280 -1
-1 280 -1
->
# Output
outputcount 1
outputtype 278
outputhealth 0
================================================
FILE: files/recipes/tools/pickaxe_gold.recipe
================================================
# Input
width 3
height 3
<-
266 266 266
-1 280 -1
-1 280 -1
->
# Output
outputcount 1
outputtype 285
outputhealth 0
================================================
FILE: files/recipes/tools/pickaxe_iron.recipe
================================================
# Input
width 3
height 3
<-
265 265 265
-1 280 -1
-1 280 -1
->
# Output
outputcount 1
outputtype 257
outputhealth 0
================================================
FILE: files/recipes/tools/pickaxe_stone.recipe
================================================
# Input
width 3
height 3
<-
4 4 4
-1 280 -1
-1 280 -1
->
# Output
outputcount 1
outputtype 274
outputhealth 0
================================================
FILE: files/recipes/tools/pickaxe_wood.recipe
================================================
# Input
width 3
height 3
<-
5 5 5
-1 280 -1
-1 280 -1
->
# Output
outputcount 1
outputtype 270
outputhealth 0
================================================
FILE: files/recipes/tools/shears.recipe
================================================
# Input
width 2
height 2
<-
-1 265
265 -1
->
# Output
outputcount 1
outputtype 359
outputhealth 0
================================================
FILE: files/recipes/tools/shovel_diamond.recipe
================================================
# Input
width 1
height 3
<-
264
280
280
->
# Output
outputcount 1
outputtype 277
outputhealth 0
================================================
FILE: files/recipes/tools/shovel_gold.recipe
================================================
# Input
width 1
height 3
<-
266
280
280
->
# Output
outputcount 1
outputtype 284
outputhealth 0
================================================
FILE: files/recipes/tools/shovel_iron.recipe
================================================
# Input
width 1
height 3
<-
265
280
280
->
# Output
outputcount 1
outputtype 256
outputhealth 0
================================================
FILE: files/recipes/tools/shovel_stone.recipe
================================================
# Input
width 1
height 3
<-
4
280
280
->
# Output
outputcount 1
outputtype 273
outputhealth 0
================================================
FILE: files/recipes/tools/shovel_wood.recipe
================================================
# Input
width 1
height 3
<-
5
280
280
->
# Output
outputcount 1
outputtype 269
outputhealth 0
================================================
FILE: files/recipes/transport/boat.recipe
================================================
# Input
width 3
height 2
<-
5 -1 5
5 5 5
->
# Output
outputcount 1
outputtype 333
outputhealth 0
================================================
FILE: files/recipes/transport/minecart.recipe
================================================
# Input
width 3
height 2
<-
265 -1 265
265 265 265
->
# Output
outputcount 1
outputtype 328
outputhealth 0
================================================
FILE: files/recipes/transport/minecart_powered.recipe
================================================
# Input
width 1
height 2
<-
61
328
->
# Output
outputcount 1
outputtype 343
outputhealth 0
================================================
FILE: files/recipes/transport/minecart_storage.recipe
================================================
# Input
width 1
height 2
<-
54
328
->
# Output
outputcount 1
outputtype 342
outputhealth 0
================================================
FILE: files/recipes/transport/minecart_tracks.recipe
================================================
# Input
width 3
height 3
<-
265 -1 265
265 280 265
265 -1 265
->
# Output
outputcount 16
outputtype 66
outputhealth 0
================================================
FILE: files/recipes/weapons/arrows.recipe
================================================
# Input
width 1
height 3
<-
318
280
288
->
# Output
outputcount 4
outputtype 262
outputhealth 0
================================================
FILE: files/recipes/weapons/bow.recipe
================================================
# Input
width 3
height 3
<-
287 280 -1
287 -1 280
287 280 -1
->
# Output
outputcount 1
outputtype 261
outputhealth 0
================================================
FILE: files/recipes/weapons/sword_diamond.recipe
================================================
# Input
width 1
height 3
<-
264
264
280
->
# Output
outputcount 1
outputtype 276
outputhealth 1562
================================================
FILE: files/recipes/weapons/sword_gold.recipe
================================================
# Input
width 1
height 3
<-
266
266
280
->
# Output
outputcount 1
outputtype 283
outputhealth 33
================================================
FILE: files/recipes/weapons/sword_iron.recipe
================================================
# Input
width 1
height 3
<-
265
265
280
->
# Output
outputcount 1
outputtype 267
outputhealth 0
================================================
FILE: files/recipes/weapons/sword_stone.recipe
================================================
# Input
width 1
height 3
<-
4
4
280
->
# Output
outputcount 1
outputtype 272
outputhealth 0
================================================
FILE: files/recipes/weapons/sword_wood.recipe
================================================
# Input
width 1
height 3
<-
5
5
280
->
# Output
outputcount 1
outputtype 268
outputhealth 0
================================================
FILE: files/recipes/white.recipe
================================================
# Input
width 1
height 1
<-
35 351:15
->
# Output
outputcount 1
outputtype 35
outputhealth 0
================================================
FILE: files/roles.txt
================================================
# admins
[Server]
# ops
# members
================================================
FILE: files/rules.txt
================================================
# Server rules here
§4Server rules
1. Do not whine
2. Whine
3. Whining is required
4. ^__________^
================================================
FILE: files/test.lua
================================================
print ("Hi, enjoy hacking with Lua");
function timer200()
calltest("test1", "test2");
end;
================================================
FILE: files/whitelist.txt
================================================
# This is default whitelist file. Write nicks to be whitelisted here one for each line
================================================
FILE: init.d/mineserver.centos
================================================
#!/bin/bash
#
# mineserver Startup script for the Mineserver
#
# chkconfig: - 85 15
# description: Mineserver is a FOSS implementation of the Minecraft server from minecraft.net
# processname: mineserver
# pidfile: /usr/local/mineserver/mineserver.pid
BASEDIR=/usr/local/mineserver
pidfile=$BASEDIR/mineserver.pid
lockfile=/var/lock/subsys/mineserver
prog=mineserver
# Source function library.
. /etc/rc.d/init.d/functions
start() {
echo -n $"Starting $prog: "
cd $BASEDIR
#this doesn't seem to work
./$prog ./config.cfg &> /dev/null
RETVAL=$?
echo
[ $RETVAL = 0 ] && touch ${lockfile}
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
killproc -p ${pidfile} -d 10 $BASEDIR/$prog 2
RETVAL=$?
echo
[ $RETVAL = 0 ] && rm -f ${lockfile}
return $RETVAL
}
restart() {
stop
start
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
status)
status -p ${pidfile} $prog
;;
*)
echo $"Usage: $prog {start|stop|restart|status}"
;;
esac
================================================
FILE: plugins/CMakeLists.txt
================================================
cmake_minimum_required(VERSION 2.6)
# forbid running cmake from this subdir
if(PROJECT_NAME STREQUAL "Project")
message(FATAL_ERROR "\nplease run cmake from the project's parent directory\n")
endif()
#
# plugin sources
# RULES: each unique subdirectory is plugin name
#
set(plugins_source
commands/commands.cpp
filelog/filelog.cpp
nBreak/nBreak.cpp
nether/nether.cpp
binlog/binlog.cpp
crapMobs/crapMobs.cpp
cursesui/screen.cpp
flatpermissions/flatpermissions.cpp
passiveMobs/passiveMobs.cpp
)
#
# custom defines
#
add_definitions(-DFADOR_PLUGIN=1)
#
# dependencies
#
set(cursesui_depends
Curses
)
###############################################################################
#
# make lists from plugins_source
#
foreach(src ${plugins_source})
string(REGEX REPLACE "/.*$" "" p "${src}")
list(APPEND plugins ${p})
list(APPEND ${p}_source ${src})
endforeach()
list(REMOVE_DUPLICATES plugins)
#
# dependency check
#
set(TARGETS "")
foreach(p ${plugins})
message(STATUS "Dependency check: ${p}")
foreach(lib ${${p}_depends})
find_package(${lib})
string(TOUPPER ${lib} LIB)
if (NOT ${LIB}_FOUND)
set(${p}_error True)
break()
endif()
endforeach()
if(NOT ${p}_error)
list(APPEND TARGETS ${p})
else()
message("\t-- DISABLED: ${p}")
endif()
endforeach()
# override the build location again.
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "../${CONFIG_DIR_BIN}/plugins")
#
# build targets
#
foreach(p ${TARGETS})
message(STATUS "Target: ${p}")
add_library(${p} SHARED ${${p}_source})
set_target_properties(${p} PROPERTIES PREFIX "")
foreach(lib ${${p}_depends})
string(TOUPPER ${lib} LIB)
include_directories(${${LIB}_INCLUDE_DIR})
target_link_libraries(${p} ${${LIB}_LIBRARY})
endforeach()
endforeach()
#
# install
#
install(TARGETS ${TARGETS} DESTINATION ${CONFIG_DIR_BIN}/plugins)
================================================
FILE: plugins/binlog/binlog.cfg
================================================
system.plugins += ("binlog":"./binlog");
# Enable Transaction Logging?
enable_binary_logging = true
binary_log = "minserver.bin"
================================================
FILE: plugins/binlog/binlog.cpp
================================================
/*
Copyright (c) 2010, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//
// Mineserver binlog.cpp
//
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstring>
#include <ctime>
#include <vector>
#include "plugin_api.h"
#include "binlog.h"
Binlog::Binlog (std::string filename)
{
log_stream.open(filename.c_str(), std::fstream::in | std::fstream::out | std::fstream::binary );
if (!log_stream.is_open()) {
return;
}
}
Binlog &Binlog::get(std::string filename)
{
static Binlog instance(filename);
return instance;
}
// Log action to binary log
void Binlog::log (event_t event)
{
if(!log_stream.bad()) {
event.timestamp = time (NULL);
event.nsize = strlen(event.nick);
log_stream.seekp(0, std::ios::end);
log_stream.write((char *) &event.timestamp, sizeof(time_t));
log_stream.write((char *) &event.x, sizeof(int));
log_stream.write((char *) &event.y, sizeof(int));
log_stream.write((char *) &event.z, sizeof(int));
log_stream.write((char *) &event.otype, sizeof(unsigned char));
log_stream.write((char *) &event.ntype, sizeof(unsigned char));
log_stream.write((char *) &event.ometa, sizeof(unsigned char));
log_stream.write((char *) &event.nmeta, sizeof(unsigned char));
log_stream.write((char *) &event.nsize, sizeof(int));
log_stream.write((char *) &event.nick, event.nsize+1);
}
}
// Get logs based on nick and timestamp
bool Binlog::getLogs (time_t t, std::string &nick, std::vector<event_t> *logs)
{
event_t event;
log_stream.flush();
log_stream.seekg(0, std::ios::beg);
while(this->getEvent(&event)) {
if(event.timestamp > t && (strcmp(event.nick, nick.c_str()) == 0)) {
logs->push_back(event);
}
}
return true;
}
// Get logs based on timestamp
bool Binlog::getLogs (time_t t, std::vector<event_t> *logs)
{
event_t event;
log_stream.flush();
log_stream.seekg(0, std::ios::beg);
while(this->getEvent(&event)) {
if(event.timestamp > t) {
logs->push_back(event);
}
}
return true;
}
// Get all logs
bool Binlog::getLogs (std::vector<event_t> *logs)
{
event_t event;
log_stream.flush();
log_stream.seekg(0, std::ios::beg);
while(this->getEvent(&event)) {
logs->push_back(event);
}
return true;
}
// Get event from log
bool Binlog::getEvent (event_t *event)
{
if(!log_stream.eof()) {
log_stream.read((char *) &event->timestamp, sizeof(time_t));
log_stream.read((char *) &event->x, sizeof(int));
log_stream.read((char *) &event->y, sizeof(int));
log_stream.read((char *) &event->z, sizeof(int));
log_stream.read((char *) &event->otype, sizeof(unsigned char));
log_stream.read((char *) &event->ntype, sizeof(unsigned char));
log_stream.read((char *) &event->ometa, sizeof(unsigned char));
log_stream.read((char *) &event->nmeta, sizeof(unsigned char));
log_stream.read((char *) &event->nsize, sizeof(int));
log_stream.read((char *) &event->nick, event->nsize+1);
return true;
}
log_stream.clear();
return false;
}
Binlog::~Binlog()
{
log_stream.close();
}
mineserver_pointer_struct* mineserver;
std::string pluginName = "binlog";
std::string filename;
bool enabled;
// Rollback Transaction Logs
void rollBack (const char* user, int argc, const char** args)
{
std::vector<event_t> logs;
time_t timestamp;
if(argc > 0) {
std::stringstream ss (std::stringstream::in | std::stringstream::out);
ss << args[0];
ss >> timestamp;
}
if(argc == 2 ) {
std::string victim = args[1];
Binlog::get(filename).getLogs(timestamp, victim, &logs);
} else if (argc == 1) {
Binlog::get(filename).getLogs(timestamp, &logs);
} else {
Binlog::get(filename).getLogs(&logs);
}
std::vector<event_t>::reverse_iterator event;
if(logs.size() > 0) {
mineserver->chat.sendmsgTo(user, "Rolling back map...");
for(event = logs.rbegin(); event != logs.rend(); event++) {
mineserver->map.setBlock(event->x, event->y, event->z, event->otype, event->ometa);
}
mineserver->chat.sendmsgTo(user, "Map roll back completed!");
} else {
mineserver->chat.sendmsgTo(user, "No binary logs found!");
}
}
// Playback Transaction Logs
void playBack (const char* user, int argc, const char** args)
{
return;
std::vector<event_t> logs;
time_t timestamp;
if(argc > 0) {
std::stringstream ss (std::stringstream::in | std::stringstream::out);
ss << args[0];
ss >> timestamp;
}
if(argc == 2 ) {
std::string victim = args[1];
Binlog::get(filename).getLogs(timestamp, victim, &logs);
} else if (argc == 1) {
Binlog::get(filename).getLogs(timestamp, &logs);
} else {
Binlog::get(filename).getLogs(&logs);
}
std::vector<event_t>::reverse_iterator event;
if(logs.size() > 0) {
mineserver->chat.sendmsgTo(user, "Playing back binary log...");
for(event = logs.rbegin(); event != logs.rend(); event++) {
mineserver->map.setBlock(event->x, event->y, event->z, event->otype, event->ometa);
}
mineserver->chat.sendmsgTo(user, "Binary log playback completed!");
} else {
mineserver->chat.sendmsgTo(user, "No binary logs found!");
}
}
// Block Break Callback
bool callbackBlockBreakPre (const char* user,int x,int y,int z)
{
event_t event;
strcpy(event.nick, user);
event.x = x;
event.y = y;
event.z = z;
event.ntype = 0;
event.nmeta = 0;
mineserver->map.getBlock(x,y,z,&event.otype, &event.ometa);
Binlog::get(filename).log(event);
return true;
}
bool translateDirection(int32_t *x, int8_t *y, int32_t *z, int8_t direction)
{
switch(direction)
{
case BLOCK_BOTTOM: (*y)--; break;
case BLOCK_TOP: (*y)++; break;
case BLOCK_NORTH: (*x)++; break;
case BLOCK_SOUTH: (*x)--; break;
case BLOCK_EAST: (*z)++; break;
case BLOCK_WEST: (*z)--; break;
default: break;
}
return true;
}
// Block Place Callback
bool callbackBlockPlacePre (const char* user,int32_t x,int8_t y,int32_t z, unsigned char type, unsigned char meta)
{
event_t event;
translateDirection(&x,&y,&z,meta);
strcpy(event.nick, user);
event.x = x;
event.y = y;
event.z = z;
event.ntype = type;
event.nmeta = meta;
mineserver->map.getBlock(x,y,z,&event.otype, &event.ometa);
Binlog::get(filename).log(event);
return true;
}
// Command Registration
bool callbackPlayerChatCommand (const char* user, const char* command, int argc, const char** args)
{
if(strcmp(command, "rollback") == 0) {
rollBack(user, argc, args);
return true;
} else if (strcmp(command, "playback") == 0) {
playBack(user, argc, args);
return true;
}
return false;
}
std::string dtos( double n )
{
std::ostringstream result;
result << n;
return result.str();
}
#define LOG_INFO 6
PLUGIN_API_EXPORT void CALLCONVERSION binlog_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
enabled = mineserver->config.bData("enable_binary_logging");
filename = mineserver->config.sData("binary_log");
if (mineserver->plugin.getPluginVersion("binlog") > 0)
{
std::string msg = "binlog is already loaded v."+dtos(mineserver->plugin.getPluginVersion(pluginName.c_str()));
mineserver->logger.log(LOG_INFO, "plugin.binlog", msg.c_str());
return;
}
std::string msg = "Loaded "+pluginName+"!";
mineserver->logger.log(LOG_INFO, "plugin.binlog", msg.c_str());
mineserver->plugin.setPluginVersion("binlog", PLUGIN_VERSION);
if(enabled)
{
mineserver->plugin.addCallback("BlockPlacePre", reinterpret_cast<voidF>(callbackBlockPlacePre));
mineserver->plugin.addCallback("BlockBreakPre", reinterpret_cast<voidF>(callbackBlockBreakPre));
}
mineserver->plugin.addCallback("PlayerChatCommand", reinterpret_cast<voidF>(callbackPlayerChatCommand));
}
PLUGIN_API_EXPORT void CALLCONVERSION binlog_shutdown(void)
{
if (mineserver->plugin.getPluginVersion("binlog") <= 0)
{
mineserver->logger.log(LOG_INFO, "plugin.binlog", "binlog is not loaded!");
return;
}
}
================================================
FILE: plugins/binlog/binlog.h
================================================
/*
Copyright (c) 2010, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//
// Mineserver trxlogger.h
//
#include <string>
#include <fstream>
#include <time.h>
#include "plugin_api.h"
#ifndef _BINLOG_H
#define _BINLOG_H
#define PLUGIN_VERSION 0.1
#endif
struct event_t {
time_t timestamp;
int x;
int y;
int z;
unsigned char otype, ntype;
unsigned char ometa, nmeta;
int nsize;
char nick[17];
};
class Binlog
{
public:
void log(event_t event);
static Binlog &get(std::string filename);
bool getLogs(time_t t, std::string &nick, std::vector<event_t> *logs);
bool getLogs(time_t t, std::vector<event_t> *logs);
bool getLogs(std::vector<event_t> *logs);
bool getEvent(event_t *event);
private:
std::fstream log_stream;
Binlog(std::string filename);
~Binlog();
};
================================================
FILE: plugins/binlog/binlogdump.cpp
================================================
/*
Copyright (c) 2010, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
//
// Mineserver binlogdump.cpp
//
#include <vector>
#include <stdio.h>
#include "binlog.h"
int main (int argc, const char* argv[] )
{
if(argc != 2) {
printf("Usage: %s <filename>\n", argv[0]);
return 1;
}
std::vector<event_t> logs;
Binlog::get(argv[1]).getLogs(&logs);
std::vector<event_t>::iterator event;
for(event = logs.begin(); event != logs.end(); event++)
{
printf("{timestamp:%d, nick:%s, x:%i, y:%i, z:%i, old_type:%#x, old_meta:%#x, new_type:%#x, new_meta:%#x}\n",
event->timestamp, event->nick, event->x, event->y, event->z,
(int) event->otype, (int) event->ometa, (int) event->ntype, (int) event->nmeta );
}
return 0;
}
================================================
FILE: plugins/commands/commands.cpp
================================================
/*
Copyright (c) 2013, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <iostream>
#include <sstream>
#include <fstream> // Added for MOTD
#include <string>
#include <deque>
#include <stdint.h>
#include <cstdlib>
#include <ctime>
#include <memory>
#include <unordered_map>
#define MINESERVER_C_API
#include "plugin_api.h"
#include "commands.h"
enum { PLANE,REPLACE };
int _atoi(const std::string& str, bool* ok = 0){
if(ok){
*ok =true;
for(int i=0;i<str.size();i++)
if(str[i] < 48 || str[i] > 57){
*ok = false;
return 0;
}
}
return atoi(str.c_str());
}
#define PLUGIN_COMMANDS_VERSION 1.1
const char CHATCMDPREFIX = '/';
mineserver_pointer_struct* mineserver;
struct cuboidStruct
{
int x;
char y;
int z;
unsigned char block;
bool active;
int state;
int action;
int fromBlock;
int toBlock;
};
std::unordered_map<std::string, cuboidStruct> cuboidMap;
std::string dtos(double n)
{
std::ostringstream result;
result << n;
return result.str();
}
typedef void (*CommandCallback)(std::string nick, std::string, std::deque<std::string>);
struct Command
{
Command(std::deque<std::string> _names, std::string _arguments, std::string _description, CommandCallback _callback,
bool _needAdmin = false, bool _needOp = false, bool _needMember = false)
: names(_names),
arguments(_arguments),
description(_description),
callback(_callback),
needAdmin(_needAdmin),
needOp(_needOp),
needMember(_needMember)
{}
std::deque<std::string> names;
std::string arguments;
std::string description;
bool needAdmin;
bool needOp;
bool needMember;
CommandCallback callback;
};
typedef std::shared_ptr<Command> ComPtr;
typedef std::unordered_map<std::string, ComPtr> CommandList;
CommandList m_Commands;
void registerCommand(ComPtr command)
{
// Loop thru all the words for this command
std::string currentWord;
std::deque<std::string> words = command->names;
while(!words.empty())
{
currentWord = words.front();
words.pop_front();
m_Commands[currentWord] = command;
}
}
bool chatCommandFunction(const char* userIn,const char* cmdIn, int argc, char** argv)
{
std::string user(userIn);
std::string command(cmdIn);
std::deque<std::string> cmd(argv, argv+argc);
if(command.size() == 0)
{
return false;
}
std::string logMsg = user + ": " + command;
mineserver->logger.log(LOG_INFO, "plugin.commands", logMsg.c_str());
// User commands
CommandList::iterator iter;
if((iter = m_Commands.find(command)) != m_Commands.end())
{
if(iter->second->needAdmin)
{
if(!mineserver->permissions.isAdmin(user.c_str()))
{
mineserver->chat.sendmsgTo(user.c_str(), "Need Admin rights");
return true;
}
}
if(iter->second->needOp)
{
if(!mineserver->permissions.isOp(user.c_str()))
{
mineserver->chat.sendmsgTo(user.c_str(), "Need Operator rights");
return true;
}
}
if(iter->second->needMember)
{
if(!mineserver->permissions.isMember(user.c_str()))
{
mineserver->chat.sendmsgTo(user.c_str(), "Need Member rights");
return true;
}
}
iter->second->callback(user, command, cmd);
return true;
}
return false;
}
bool isValidItem(int id)
{
if (id < 1) // zero or negative items are all invalid
{
return false;
}
if (id > 136 && id < 256) // these are undefined blocks and items
{
return false;
}
if (id >= 2256 && id <= 2266) // records are special cased
{
return true;
}
if (id > 388) // high items are invalid
{
return false;
}
return true;
}
int roundUpTo(int x, int nearest)
{
return (((x + (nearest - 1)) / nearest) * nearest );
}
void giveItemsName(std::string userIn, int id, int count, int health)
{
if (isValidItem(id))
{
int itemCount = 1, itemStacks = 1;
if(count != 1)
{
itemCount = count;
if(itemCount>1024) itemCount=1024;
// If multiple stacks
itemStacks = roundUpTo(itemCount, 64) / 64;
itemCount -= (itemStacks-1) * 64;
}
int amount = 64;
for(int i = 0; i < itemStacks; i++)
{
// if last stack
if(i == itemStacks - 1)
{
amount = itemCount;
}
mineserver->user.addItem(userIn.c_str(), id, amount, health);
}
}
else
{
mineserver->chat.sendmsgTo(userIn.c_str(), "Not a valid item");
}
}
void giveItems(std::string userIn, std::string command, std::deque<std::string> args)
{
if (args.size() == 2 || args.size() == 3)
{
std::string user = args[0];
int itemId = 0;
//First check if item is a number
itemId = atoi(args[1].c_str());
//If item was not a number, search the name from config
if (itemId == 0)
{
itemId = mineserver->config.iData(args[1].c_str());
}
if(args.size()==2)
{
giveItemsName(user, itemId, 1,0);
}
else
{
giveItemsName(user, itemId, atoi(args[2].c_str()),0);
}
}
else
{
mineserver->chat.sendmsgTo(userIn.c_str(),"Usage: /give player item [count]");
}
}
void giveItemsSelf(std::string user, std::string command, std::deque<std::string> args)
{
if (args.size() == 1 || args.size() == 2)
{
int itemId = 0;
//First check if item is a number
itemId = atoi(args[0].c_str());
//If item was not a number, search the name from config
if (itemId == 0)
{
itemId = mineserver->config.iData(args[0].c_str());
}
if(args.size()==1)
{
giveItemsName(user, itemId, 1,0);
}
else
{
giveItemsName(user, itemId, atoi(args[1].c_str()),0);
}
}
else
{
mineserver->chat.sendmsgTo(user.c_str(),"Usage: /igive item [count]");
}
}
void home(std::string user, std::string command, std::deque<std::string> args)
{
mineserver->chat.sendmsgTo(user.c_str(),"Teleported you home!");
int x,y,z;
mineserver->map.getSpawn(&x,&y,&z);
mineserver->user.teleport(user.c_str(),x, y + 2, z);
}
void setSpawn(std::string user, std::string command, std::deque<std::string> args)
{
if(args.size() == 0) {
double x,y,z;
mineserver->user.getPosition(user.c_str(), &x,&y,&z,NULL,NULL,NULL);
mineserver->chat.sendmsgTo(user.c_str(),"Set spawn!");
mineserver->map.setSpawn(x,y,z);
mineserver->user.teleport(user.c_str(),x, y + 2, z);
}
}
void userWorld(std::string user, std::string command, std::deque<std::string> args)
{
if(args.size() == 1)
{
double x,y,z;
mineserver->user.getPosition(user.c_str(), &x,&y,&z,NULL,NULL,NULL);
mineserver->logger.log(LOG_INFO, "plugin.commands", (user + args[0]).c_str());
mineserver->user.teleportMap(user.c_str(), x,y+2,z,atoi(args[0].c_str()));
}
}
void coordinateTeleport(std::string user, std::string command, std::deque<std::string> args)
{
if(args.size() == 3)
{
double x = atof(args[0].c_str());
double y = atof(args[1].c_str());
double z = atof(args[2].c_str());
mineserver->user.teleport(user.c_str(), x, y, z);
}
else
{
mineserver->chat.sendmsgTo(user.c_str(),"Usage: /ctp x y z");
}
}
void userTeleport(std::string user, std::string command, std::deque<std::string> args)
{
if(args.size() == 1)
{
std::string tUser = args[0];
double x,y,z;
if(mineserver->user.getPosition(tUser.c_str(), &x,&y,&z,NULL,NULL,NULL))
{
mineserver->user.teleport(user.c_str(),x,y+2,z);
mineserver->chat.sendmsgTo(user.c_str(), "Teleported!");
}
else
{
std::string msg = "User " + args[0] + " not found (see /players)";
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
}
else if(args.size() == 2)
{
std::string whoUser = args[0];
std::string toUser = args[1];
double x,y,z;
if(mineserver->user.getPosition(toUser.c_str(), &x,&y,&z,NULL,NULL,NULL))
{
mineserver->user.teleport(whoUser.c_str(),x,y+2,z);
mineserver->chat.sendmsgTo(user.c_str(), "Teleported!");
}
else
{
std::string msg = "User " + args[0] + " not found (see /players)";
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
}
else
{
mineserver->chat.sendmsgTo(user.c_str(), "Usage: /tp [player] targetplayer");
}
}
void replace(std::string user, std::string command, std::deque<std::string> args)
{
if (cuboidMap.find(user) != cuboidMap.end())
{
cuboidMap.erase(user);
}
if (args.size() == 2)
{
cuboidMap[user].active = 1;
cuboidMap[user].state = 0;
cuboidMap[user].action = REPLACE;
int blockID = atoi(args[0].c_str());
//If item was not a number, search the name from config
if (blockID == 0)
{
blockID = mineserver->config.iData(args[0].c_str());
}
if(blockID < 1 || blockID > 255)
{
cuboidMap.erase(user);
return;
}
cuboidMap[user].fromBlock = blockID;
blockID = atoi(args[1].c_str());
//If item was not a number, search the name from config
if (blockID == 0 && args[1] != "0")
{
blockID = mineserver->config.iData(args[1].c_str());
}
if(blockID < 0 || blockID > 255)
{
cuboidMap.erase(user);
return;
}
cuboidMap[user].toBlock = blockID;
mineserver->chat.sendmsgTo(user.c_str(),"Cuboid replace start, hit first block");
}
}
void replacechunk(std::string user, std::string command, std::deque<std::string> args)
{
if(args.size() == 2)
{
double x,y,z;
if(mineserver->user.getPosition(user.c_str(), &x,&y,&z,NULL,NULL,NULL))
{
int fromBlock = atoi(args[0].c_str());
//If item was not a number, search the name from config
if (fromBlock == 0)
{
fromBlock = mineserver->config.iData(args[0].c_str());
}
if(fromBlock < 1 || fromBlock > 255)
{
return;
}
int toBlock = atoi(args[1].c_str());
//If item was not a number, search the name from config
if (toBlock == 0 && args[1] != "0")
{
toBlock = mineserver->config.iData(args[1].c_str());
}
if(toBlock < 0 || toBlock > 255)
{
return;
}
int chunkx,chunkz;
chunkx = ((int)x)>>4;
chunkz = ((int)z)>>4;
unsigned char* blocks = mineserver->map.getMapData_block(chunkx,chunkz);
for(int bX = 0; bX < 16; bX++)
{
for(int bZ = 0; bZ < 16; bZ++)
{
for(int bY = 0; bY < 128; bY++)
{
if(blocks[bY + ((bZ << 7) + (bX << 11))] == fromBlock)
{
blocks[bY + ((bZ << 7) + (bX << 11))] = toBlock;
}
}
}
}
// TODO: Send chunk update to all players.
mineserver->chat.sendmsgTo(user.c_str(),"Replace chunk done");
}
}
}
void flattenchunk(std::string user, std::string command, std::deque<std::string> args)
{
if(args.size() == 1)
{
double x,y,z;
if(mineserver->user.getPosition(user.c_str(), &x,&y,&z,NULL,NULL,NULL))
{
int topBlock = atoi(args[0].c_str());
//If item was not a number, search the name from config
if (topBlock == 0)
{
topBlock = mineserver->config.iData(args[0].c_str());
}
if(topBlock < 1 || topBlock > 255)
{
return;
}
int chunkx,chunkz;
chunkx = ((int)x)>>4;
chunkz = ((int)z)>>4;
unsigned char* blocks = mineserver->map.getMapData_block(chunkx,chunkz);
for(int bX = 0; bX < 16; bX++)
{
for(int bZ = 0; bZ < 16; bZ++)
{
for(int bY = 127; bY >= 0; bY--)
{
if(bY >= y)
{
blocks[bY + ((bZ << 7) + (bX << 11))] = 0;
}
else if(bY == y - 1)
{
blocks[bY + ((bZ << 7) + (bX << 11))] = topBlock;
}
else
{
// Do nothing; leave this block untouched
}
}
}
}
// TODO: Send chunk update to all players.
mineserver->chat.sendmsgTo(user.c_str(),"Flatten chunk done");
}
}
}
void cuboid(std::string user, std::string command, std::deque<std::string> args)
{
if(cuboidMap.find(user) != cuboidMap.end())
{
cuboidMap.erase(user);
}
cuboidMap[user].active = 1;
cuboidMap[user].state = 0;
cuboidMap[user].action = PLANE;
mineserver->chat.sendmsgTo(user.c_str(),"Cuboid start, place first block");
}
void playerList(std::string user, std::string command, std::deque<std::string> args)
{
mineserver->chat.sendUserlist(user.c_str());
}
void saveMap(std::string user, std::string command, std::deque<std::string> args)
{
mineserver->map.saveWholeMap();
mineserver->chat.sendmsgTo(user.c_str(),"Saved map!");
}
void setTime(std::string user, std::string command, std::deque<std::string> args)
{
if(args.size() == 1)
{
std::string timeValue = args[0];
// Check for time labels
if(timeValue == "day" || timeValue == "morning")
{
timeValue = "24000";
}
else if (timeValue == "dawn")
{
timeValue = "22500";
}
else if (timeValue == "noon")
{
timeValue = "6000";
}
else if (timeValue == "dusk")
{
timeValue = "12000";
}
else if (timeValue == "night" || timeValue == "midnight")
{
timeValue = "18000";
}
mineserver->map.setTime(atoi(timeValue.c_str()));
mineserver->chat.sendmsgTo(user.c_str(),"World time changed.");
}
else
{
mineserver->chat.sendmsgTo(user.c_str(),"Usage: /settime time (time = 0-24000)");
}
}
void getTime(std::string user, std::string command, std::deque<std::string> args)
{
std::string msg = "The current server time is " + dtos(mineserver->map.getTime());
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
bool translateDirection(int32_t *x, int8_t *y, int32_t *z, int8_t direction)
{
switch(direction)
{
case BLOCK_BOTTOM: (*y)--; break;
case BLOCK_TOP: (*y)++; break;
case BLOCK_NORTH: (*x)++; break;
case BLOCK_SOUTH: (*x)--; break;
case BLOCK_EAST: (*z)++; break;
case BLOCK_WEST: (*z)--; break;
default: break;
}
return true;
}
bool startedDiggingFunction(const char* userIn, int32_t x,int8_t y,int32_t z,int8_t direction)
{
//translateDirection(&x,&y,&z,direction);
std::string user(userIn);
int map = 0;
mineserver->user.getPositionW(userIn, NULL, NULL, NULL, &map,NULL, NULL, NULL);
if(cuboidMap.find(user) != cuboidMap.end())
{
if(cuboidMap[user].active)
{
if(cuboidMap[user].action == REPLACE)
{
if(cuboidMap[user].state == 0)
{
cuboidMap[user].state = 1;
cuboidMap[user].x = x;
cuboidMap[user].y = y;
cuboidMap[user].z = z;
mineserver->chat.sendmsgTo(user.c_str(),"First block done, now second");
}
else if(cuboidMap[user].state == 1)
{
int xstart,xend;
int ystart,yend;
int zstart,zend;
xstart=(x<cuboidMap[user].x)?x:cuboidMap[user].x;
xend=(x<cuboidMap[user].x)?cuboidMap[user].x:x;
ystart=(y<cuboidMap[user].y)?y:cuboidMap[user].y;
yend=(y<cuboidMap[user].y)?cuboidMap[user].y:y;
zstart=(z<cuboidMap[user].z)?z:cuboidMap[user].z;
zend=(z<cuboidMap[user].z)?cuboidMap[user].z:z;
unsigned char block,meta;
if((xend-xstart) * (yend-ystart) * (zend-zstart) > 10000)
{
mineserver->chat.sendmsgTo(user.c_str(),"Area too large!");
return true;
}
for(int xpos = xstart; xpos <= xend; xpos ++)
{
for(int zpos = zstart; zpos <= zend; zpos ++)
{
for(int ypos = ystart; ypos <= yend; ypos ++)
{
if(mineserver->map.getBlock(xpos,ypos,zpos,&block,&meta) && block == cuboidMap[user].fromBlock)
{
mineserver->map.setBlock(xpos,ypos,zpos,cuboidMap[user].toBlock,map);
}
}
}
}
mineserver->chat.sendmsgTo(user.c_str(),"Replace done");
cuboidMap.erase(user);
}
}
}
}
return true;
}
bool blockPlacePreFunction(const char* userIn, int32_t x,int8_t y,int32_t z,int16_t block,int8_t direction)
{
translateDirection(&x,&y,&z,direction);
std::string user(userIn);
if(cuboidMap.find(user) != cuboidMap.end())
{
if(cuboidMap[user].active)
{
if(cuboidMap[user].action == PLANE)
{
if(cuboidMap[user].state == 0)
{
cuboidMap[user].state = 1;
cuboidMap[user].x = x;
cuboidMap[user].y = y;
cuboidMap[user].z = z;
cuboidMap[user].block = block;
mineserver->chat.sendmsgTo(user.c_str(),"First block done, place second");
}
else if(cuboidMap[user].state == 1)
{
if(cuboidMap[user].block == block)
{
int xstart,xend;
int ystart,yend;
int zstart,zend;
xstart=(x<cuboidMap[user].x)?x:cuboidMap[user].x;
xend=(x<cuboidMap[user].x)?cuboidMap[user].x:x;
ystart=(y<cuboidMap[user].y)?y:cuboidMap[user].y;
yend=(y<cuboidMap[user].y)?cuboidMap[user].y:y;
zstart=(z<cuboidMap[user].z)?z:cuboidMap[user].z;
zend=(z<cuboidMap[user].z)?cuboidMap[user].z:z;
if((xend-xstart) * (yend-ystart) * (zend-zstart) > 10000)
{
mineserver->chat.sendmsgTo(user.c_str(),"Area too large!");
return true;
}
for(int xpos = xstart; xpos <= xend; xpos ++)
{
for(int zpos = zstart; zpos <= zend; zpos ++)
{
for(int ypos = ystart; ypos <= yend; ypos ++)
{
mineserver->map.setBlock(xpos,ypos,zpos,block,0);
}
}
}
mineserver->chat.sendmsgTo(user.c_str(),"Cuboid done");
cuboidMap.erase(user);
}
}
}
}
}
return true;
}
void doNotDisturb(std::string user, std::string command, std::deque<std::string> args)
{
mineserver->user.toggleDND(user.c_str());
}
void gps(std::string user, std::string command, std::deque<std::string> args)
{
double x,y,z,stance;
float yaw,pitch;
mineserver->user.getPosition(user.c_str(), &x, &y, &z, &yaw, &pitch, &stance);
std::string msg = "X: " + dtos(x) + " Y: " + dtos(y) + " Z: " + dtos(z);
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
void banUser(std::string user, std::string command, std::deque<std::string> args)
{
return;
}
void unbanUser(std::string user, std::string command, std::deque<std::string> args)
{
return;
}
void sendRules(std::string user, std::string command, std::deque<std::string> args)
{
std::string line;
std::ifstream rules("rules.txt");
if(rules.is_open()) {
while(rules.good()) {
std::getline(rules, line);
if(line.size() > 0 && line.at(0) != '#')
mineserver->chat.sendmsgTo(user.c_str(), line.c_str());
}
rules.close();
}
}
void about(std::string user, std::string command, std::deque<std::string> args)
{
if (mineserver->config.bData("system.show_version"))
{
std::string msg = std::string("§9") + std::string(mineserver->config.sData("system.server_name")) + std::string(" Running Mineserver v.") + std::string(VERSION_SIMPLE);
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
}
void sendHelp(std::string user, std::string command, std::deque<std::string> args)
{
// TODO: Add paging support, since not all commands will fit into
// the screen at once.
CommandList* commandList = &m_Commands; // defaults
//std::string commandColor = MC_COLOR_BLUE;
if (args.size() == 0)
{
bool isAdmin = mineserver->permissions.isAdmin(user.c_str());
bool isOp = mineserver->permissions.isOp(user.c_str());
bool isMember = mineserver->permissions.isMember(user.c_str());
for(CommandList::iterator it = commandList->begin();it != commandList->end();++it)
{
//Display only commands you can use and add !A!, !O! or !M! to signal who can use those
std::string msg;
if(it->second->needAdmin)
{
if(!isAdmin)
{
continue;
}
else
{
msg += "§o§c!A!§r ";
}
}
if(it->second->needOp)
{
if(!isOp)
{
continue;
}
else
{
msg += "§o§c!O!§r ";
}
}
if(it->second->needMember)
{
if(!isMember)
{
continue;
}
else
{
msg += "§o§c!M!§r ";
}
}
std::string args = it->second->arguments;
std::string description = it->second->description;
msg += /*commandColor +*/ CHATCMDPREFIX + it->first + " " + args + " : " /*+ MC_COLOR_YELLOW*/ + description;
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
}
else
{
CommandList::iterator iter;
if ((iter = commandList->find(args.front())) != commandList->end())
{
std::string args = iter->second->arguments;
std::string description = iter->second->description;
std::string msg = /*commandColor +*/ CHATCMDPREFIX + iter->first + " " + args;
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
msg = /*MC_COLOR_YELLOW + */CHATCMDPREFIX + description;
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
else
{
std::string msg = /*MC_COLOR_RED +*/ "Unknown Command: " + args.front();
mineserver->chat.sendmsgTo(user.c_str(),msg.c_str());
}
}
}
void sendMOTD(std::string user, std::string command, std::deque<std::string> args)
{
std::string line;
std::ifstream MOTDFile("motd.txt");
if (MOTDFile.is_open())
{
while (MOTDFile.good() )
{
std::getline(MOTDFile, line);
if(line.size() > 0 && line.at(0) != '#')
mineserver->chat.sendmsgTo(user.c_str(), line.c_str());
}
MOTDFile.close();
}
}
void changeGameMode(std::string user, std::string command, std::deque<std::string> args){
std::string changeUser;
if(args.size() == 2){
changeUser = args[0];
args.erase(args.begin());
}
else changeUser = user;
if(args.size() == 1){
bool ok;
int i = _atoi(args[0], &ok);
if(!ok){
if(args[0] == "survival") i=0;
else if(args[0] == "creative") i=1;
else goto printhelp;
}
if(i != 0 && i != 1) goto printhelp;
mineserver->user.setGameMode(user.c_str(), i);
std::string info = user + " set " + changeUser
+ "'s gamemode to " + ( i ? "creative" : "survival") + ".";
mineserver->logger.log(LOG_INFO, "plugin.commands", info.c_str());
return;
}
printhelp:
mineserver->chat.sendmsgTo(user.c_str(), "usage: /gamemode [player] < survival | 0 ; creative | 1 > " ) ;
}
std::string pluginName = "commands";
PLUGIN_API_EXPORT void CALLCONVERSION commands_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) > 0)
{
std::string msg = "commands is already loaded v."+dtos(mineserver->plugin.getPluginVersion(pluginName.c_str()));
mineserver->logger.log(LOG_INFO, "plugin.commands", msg.c_str());
return;
}
std::string msg = "Loaded "+pluginName+"!";
mineserver->logger.log(LOG_INFO, "plugin.commands", msg.c_str());
mineserver->plugin.setPluginVersion(pluginName.c_str(), PLUGIN_COMMANDS_VERSION);
mineserver->plugin.addCallback("PlayerChatCommand", reinterpret_cast<voidF>(chatCommandFunction));
mineserver->plugin.addCallback("BlockPlacePre", reinterpret_cast<voidF>(blockPlacePreFunction));
mineserver->plugin.addCallback("PlayerDiggingStarted", reinterpret_cast<voidF>(startedDiggingFunction));
registerCommand(ComPtr(new Command(parseCmd("about"), "", "Displays server name and software version", about)));
registerCommand(ComPtr(new Command(parseCmd("ctp"), "<x> <y> <z>", "Teleport to coordinates (eg. /ctp 100 100 100)", coordinateTeleport,false,false,true)));
registerCommand(ComPtr(new Command(parseCmd("cuboid"), "", "Type in the command and place two blocks, it will fill the space between them", cuboid,false,true)));
registerCommand(ComPtr(new Command(parseCmd("dnd"), "", "Toggles Do Not Disturb mode", doNotDisturb)));
registerCommand(ComPtr(new Command(parseCmd("flattenchunk"), "<id/alias>", "Erases all blocks above you and changes all blocks at your Y-level to your block of choice", flattenchunk, false,true)));
registerCommand(ComPtr(new Command(parseCmd("gettime"), "", "Gets the world time", getTime)));
registerCommand(ComPtr(new Command(parseCmd("give"), "<player> <id/alias> [count]", "Gives <player> [count] pieces of <id/alias>. By default [count] = 1", giveItems,false,true)));
registerCommand(ComPtr(new Command(parseCmd("gps"), "", "Display current coordinates", gps)));
registerCommand(ComPtr(new Command(parseCmd("help"), "[<commandName>]", "Display this help message.", sendHelp)));
registerCommand(ComPtr(new Command(parseCmd("home"), "", "Teleports you to this world's spawn location", home)));
registerCommand(ComPtr(new Command(parseCmd("igive i item"), "<id/alias> [count]", "Gives self [count] pieces of <id/alias>. By default [count] = 1", giveItemsSelf, false,true)));
registerCommand(ComPtr(new Command(parseCmd("motd"), "", "Displays the server's MOTD", sendMOTD)));
registerCommand(ComPtr(new Command(parseCmd("players who names list"), "", "Lists online players", playerList)));
registerCommand(ComPtr(new Command(parseCmd("replace"), "<from-id/alias> <to-id/alias>", "Type in the command and left-click two blocks, it will replace the selected blocks with the new blocks", replace, true)));
registerCommand(ComPtr(new Command(parseCmd("replacechunk"), "<from-id/alias> <to-id/alias>", "Replaces the chunk you are at with the block you specify", replacechunk, true)));
registerCommand(ComPtr(new Command(parseCmd("rules"), "", "Displays server rules", sendRules)));
registerCommand(ComPtr(new Command(parseCmd("save"), "", "Manually saves map to disc", saveMap, false, true)));
registerCommand(ComPtr(new Command(parseCmd("setspawn"), "", "Sets home to your current coordinates", setSpawn, true)));
registerCommand(ComPtr(new Command(parseCmd("settime"), "<time>", "Sets the world time. (<time> = 0-24000, 0 & 24000 = day, ~15000 = night)", setTime, false, true)));
registerCommand(ComPtr(new Command(parseCmd("tp"), "<player> [<anotherPlayer>]", "Teleport yourself to <player>'s position or <player> to <anotherPlayer>", userTeleport, false, true)));
registerCommand(ComPtr(new Command(parseCmd("world"), "<world-id>", "Moves you between worlds", userWorld, true)));
registerCommand(ComPtr(new Command(parseCmd("gamemode"), "[player] < survival | 0 ; creative | 1 >", "Changes your or someone else's gamemode.", changeGameMode, false, true)));
}
PLUGIN_API_EXPORT void CALLCONVERSION commands_shutdown(void)
{
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) <= 0)
{
mineserver->logger.log(LOG_INFO, "plugin.commands", "commands is not loaded!");
return;
}
}
std::deque<std::string> parseCmd(std::string cmd)
{
int del;
std::deque<std::string> temp;
while(cmd.length() > 0)
{
while(cmd[0] == ' ')
{
cmd = cmd.substr(1);
}
del = cmd.find(' ');
if(del > -1)
{
temp.push_back(cmd.substr(0, del));
cmd = cmd.substr(del+1);
}
else
{
temp.push_back(cmd);
break;
}
}
if(temp.empty())
{
temp.push_back("empty");
}
return temp;
}
================================================
FILE: plugins/commands/commands.h
================================================
#include <string>
#ifndef _PLUGIN_COMMANDS_H
#define _PLUGIN_COMMANDS_H
std::deque<std::string> parseCmd(std::string cmd);
#endif
================================================
FILE: plugins/crapMobs/crapMobs.cpp
================================================
/*
g++ -c crapMobs.cpp
g++ -shared crapMobs.o -o crapMobs.so
copy nether.so to Mineserver bin directory.
*/
/*
Copyright (c) 2010, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <string>
#include <deque>
#include <ctime>
#include <sstream>
#include <cstdlib>
#include <map>
#include <vector>
#include <iostream>
#include <stdint.h>
#include <math.h>
#define MINESERVER_C_API
#include "plugin_api.h"
#include "crapMobs.h"
#define PLUGIN_CRAPMOBS_VERSION 1.1
mineserver_pointer_struct* mineserver;
int myPetGiant;
int myPetGiantz;
bool blah=false;
void setBlock(const char* name,int x,int y,int z,unsigned char id)
{
int map;
mineserver->user.getPositionW(name,NULL,NULL,NULL,&map,NULL,NULL,NULL);
mineserver->map.setBlockW(x,y,z,map,(unsigned char)id,0);
}
int getBlock(const char* name,int x,int y,int z)
{
int map;
mineserver->user.getPositionW(name,NULL,NULL,NULL,&map,NULL,NULL,NULL);
unsigned char type, meta;
if(mineserver->map.getBlockW(x,y,z,map,&type,&meta))
{
return type;
}
return 0;
}
void timer200Function()
{
mineserver->mob.moveMob(myPetGiant, 0,85,0);
blah = !blah;
if(blah){
// mineserver->mob.despawnMob(myPetGiant);
}else{
mineserver->mob.spawnMob(myPetGiant);
}
myPetGiantz+=1;
if(myPetGiantz > 40)
myPetGiantz = 0;
//mineserver->logger.log(LOG_INFO, "crapMobs", dtos(myPetGiantz));
mineserver->mob.moveMob(myPetGiant, 0,85,myPetGiantz);
}
std::string pluginName = "crapMobs";
PLUGIN_API_EXPORT void CALLCONVERSION crapMobs_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) > 0)
{
std::string msg = "crapMobs is already loaded";
mineserver->logger.log(LOG_INFO, "plugin.crapMobs", msg.c_str());
return;
}
std::string msg = "Loaded "+pluginName+"!";
mineserver->logger.log(LOG_INFO, "plugin.crapMobs", msg.c_str());
mineserver->plugin.setPluginVersion(pluginName.c_str(), PLUGIN_CRAPMOBS_VERSION);
mineserver->plugin.addCallback("Timer200", reinterpret_cast<voidF>(timer200Function));
myPetGiant = mineserver->mob.createSpawnMob(MOB_GIANT_ZOMBIE);
mineserver->mob.spawnMob(myPetGiant);
mineserver->mob.moveMob(myPetGiant,0,0,0);
}
PLUGIN_API_EXPORT void CALLCONVERSION command_shutdown(void)
{
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) <= 0)
{
mineserver->logger.log(LOG_INFO, "plugin.crapMobs", "crapMobs is not loaded!");
return;
}
}
================================================
FILE: plugins/crapMobs/crapMobs.h
================================================
#include <string>
#ifndef _PLUGIN_COMMAND_H
#define _PLUGIN_COMMAND_H
std::deque<std::string> parseCmd(std::string cmd);
#endif
================================================
FILE: plugins/cursesui/screen.cpp
================================================
/*
Copyright (c) 2011, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "screen.h"
#include "logtype.h"
#define MINESERVER_C_API
#include "plugin_api.h"
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <stack>
// Constants
#define PLUGIN_NAME "cursesui"
const char* pluginName = PLUGIN_NAME;
const char* logSource = "plugin.screen";
const float pluginVersion = 1.0f;
enum
{
LOG_TITLE,
LOG_COMMAND,
LOG_GENERAL,
LOG_PLAYERS
};
// Variables
mineserver_pointer_struct* mineserver;
CursesScreen *screen;
std::string currentTimestamp(bool seconds)
{
time_t currentTime = time(NULL);
struct tm *Tm = localtime(¤tTime);
std::string timeStamp (asctime(Tm));
timeStamp = timeStamp.substr(11, seconds ? 8 : 5);
return timeStamp;
}
void CursesScreen::initWindows()
{
// Work out our dimensions
int titleHeight = 5;
int logBar = titleHeight - 1;
int commandHeight = 1;
int commandBar = LINES - commandHeight - 1;
int helpBar = commandBar - 1;
int chatBar = (commandBar - logBar)/2 + logBar + 1;
int logHeight = chatBar - logBar - 1;
int chatHeight = helpBar - chatBar - 1;
int playerWidth = 20;
int playerHeight = commandBar - logBar - 1;
// Create our windows
// CursesScreen::createWindow(int width, int height, int startx, int starty)
titleWin = createWindow(COLS, titleHeight, 0, 0);
logWin = createWindow(COLS - (playerWidth + 1),
logHeight,
0,
logBar + 1);
chatWin = createWindow(COLS - (playerWidth + 1),
chatHeight,
0,
chatBar + 1);
playerWin = createWindow(playerWidth,
playerHeight,
COLS - playerWidth,
logBar + 1);
commandWin = createWindow(COLS,
commandHeight,
0,
commandBar + 1);
// Make sure nothing waits for input
wtimeout(titleWin, 0);
wtimeout(logWin, 0);
wtimeout(chatWin, 0);
wtimeout(commandWin, 0);
wtimeout(playerWin, 0);
nodelay(titleWin, true);
nodelay(logWin, true);
nodelay(chatWin, true);
nodelay(commandWin, true);
nodelay(playerWin, true);
// Setup color if we haz it
if (has_colors())
{
start_color();
use_default_colors();
init_pair(TEXT_COLOR_RED, COLOR_RED, -1);
init_pair(TEXT_COLOR_GREEN, COLOR_GREEN, -1);
init_pair(TEXT_COLOR_YELLOW, COLOR_YELLOW, -1);
init_pair(TEXT_COLOR_BLUE, COLOR_BLUE, -1);
init_pair(TEXT_COLOR_MAGENTA, COLOR_MAGENTA, -1);
init_pair(TEXT_COLOR_CYAN, COLOR_CYAN, -1);
init_pair(TEXT_COLOR_WHITE, COLOR_WHITE, -1);
init_pair(TEXT_COLOR_INVERSE, COLOR_BLACK, COLOR_WHITE);
wattron(titleWin, COLOR_PAIR(TEXT_COLOR_CYAN));
wattron(playerWin, COLOR_PAIR(TEXT_COLOR_WHITE));
}
// Write our border lines on the regular stdscr
attron(COLOR_PAIR(TEXT_COLOR_WHITE));
/* Draw dividers */
/* These mvaddch calls are cast to void to avoid an unused return value
warning in clang. If there's a better way to do it, feel free to change
things. */
// log bar
for (int x = 0; x < COLS; x++)
(void)mvaddch(logBar, x, '=');
// chat bar
for(int x = 0; x < COLS - (playerWidth + 1); x++)
(void)mvaddch(chatBar, x, '=');
// help bar
const char* helpStr = "Help:/help History:<UP>|<DOWN> Delete:<BACKSACE> CLEAR:<HOME>";
mvaddstr(helpBar, 0, helpStr);
// command bar
for (int x = 0; x < COLS; x++)
(void)mvaddch(commandBar, x, '=');
// playerlist column divider
for (int y = logBar + 1; y < commandBar; y++)
(void)mvaddch(y, COLS - (playerWidth + 1), '|');
attroff(COLOR_PAIR(TEXT_COLOR_MAGENTA));
// Write the window labels
attron(COLOR_PAIR(TEXT_COLOR_WHITE));
attron(WA_BOLD);
mvprintw(logBar, 2, " Log ");
mvprintw(logBar, COLS - 15, " Players ");
mvprintw(chatBar, 2, " Chat ");
attroff(COLOR_PAIR(TEXT_COLOR_WHITE));
attroff(WA_BOLD);
refresh();
// Now shove our logo in at the top
log(LogType::LOG_INFO, "Title", " /\\/\\ (_)_ __ ___ ___ ___ _ ____ _____ _ __ ");
log(LogType::LOG_INFO, "Title", " / \\| | '_ \\ / _ | __|/ _ \\ '__\\ \\ / / _ \\ '__|");
log(LogType::LOG_INFO, "Title", "/ /\\/\\ \\ | | | | __|__ \\ __/ | \\ V / __/ | ");
log(LogType::LOG_INFO, "Title", "\\/ \\/_|_| |_|\\___|___/\\___|_| \\_/ \\___|_| ");
wmove(titleWin, logBar - 1, 50);
wattron(titleWin, COLOR_PAIR(TEXT_COLOR_WHITE));
wprintw(titleWin, ("v"+this->version).c_str());
wattroff(titleWin, COLOR_PAIR(TEXT_COLOR_WHITE));
wrefresh(titleWin);
keypad(commandWin, true);
}
void CursesScreen::init(std::string version)
{
this->version = version;
commandBuf = "";
initscr(); // Start NCurses
timeout(0); // Non blocking
//noecho();
echo();
refresh();
CursesScreen::initWindows();
CursesScreen::redrawPlayerList();
}
void CursesScreen::redraw()
{
timeout(0);
refresh();
CursesScreen::initWindows();
CursesScreen::redrawPlayerList();
wclear(commandWin);
waddstr(commandWin, commandBuf.c_str());
wrefresh(commandWin);
}
std::string CursesScreen::prevCommand()
{
std::string str = "";
if (prevCommands.size() > 0)
{
str = prevCommands.top();
prevCommands.pop();
nextCommands.push(str);
}
return str;
}
std::string CursesScreen::nextCommand()
{
std::string str = "";
if (nextCommands.size() > 0)
{
str = nextCommands.top();
nextCommands.pop();
prevCommands.push(str);
}
return str;
}
void CursesScreen::addCommand(std::string str)
{
while (!prevCommands.empty())
{
nextCommands.push(prevCommands.top());
prevCommands.pop();
}
nextCommands.push(str);
}
/* This is where the keyboard interactions are handled. */
bool CursesScreen::hasCommand()
{
bool running = true;
std::string str = "";
int c;
do{
c = wgetch(commandWin);
switch(c)
{
case ERR:
case KEY_RIGHT:
case KEY_END:
running = false;
break;
case KEY_RESIZE:
CursesScreen::redraw();
wdeleteln(commandWin);
wclear(commandWin);
waddstr(commandWin, commandBuf.c_str());
running = false;
break;
case KEY_UP:
case KEY_PPAGE:
str = nextCommand();
wdeleteln(commandWin);
wclear(commandWin);
if (str == "")
{
waddstr(commandWin, commandBuf.c_str());
}
else
{
waddstr(commandWin, str.c_str());
commandBuf = str;
}
break;
case KEY_DOWN:
case KEY_NPAGE:
str = prevCommand();
wdeleteln(commandWin);
wclear(commandWin);
waddstr(commandWin, str.c_str());
commandBuf = str;
break;
case KEY_ENTER:
case '\n':
case '\r':
wdeleteln(commandWin);
wclear(commandWin);
command = commandBuf;
addCommand(commandBuf);
commandBuf = "";
return true;
break;
case KEY_HOME:
wdeleteln(commandWin);
wclear(commandWin);
commandBuf = "";
running = false;
break;
case KEY_BACKSPACE:
case KEY_LEFT:
case KEY_SDC:
case KEY_DC:
case '\b':
if (commandBuf.length() > 0)
commandBuf.erase(commandBuf.length()-1,1);
wdeleteln(commandWin);
wclear(commandWin);
waddstr(commandWin, commandBuf.c_str());
running = false;
break;
default:
commandBuf += c;
}
} while(running);
return false;
}
std::string CursesScreen::getCommand()
{
std::string str = command;
command = "";
return str;
}
WINDOW* CursesScreen::createWindow(int width, int height, int startx, int starty)
{
WINDOW *local_win;
local_win = newwin(height, width, starty, startx);
scrollok(local_win, 1); // Fine to scroll
wrefresh(local_win);
return local_win;
}
void CursesScreen::destroyWindow(WINDOW *local_win)
{
/* box(local_win, ' ', ' '); : This won't produce the desired
* result of erasing the window. It will leave it's four corners
* and so an ugly remnant of window.
*/
wborder(local_win, ' ', ' ', ' ',' ',' ',' ',' ',' ');
/* The parameters taken are
* 1. win: the window on which to operate
* 2. ls: character to be used for the left side of the window
* 3. rs: character to be used for the right side of the window
* 4. ts: character to be used for the top side of the window
* 5. bs: character to be used for the bottom side of the window
* 6. tl: character to be used for the top left corner of the window
* 7. tr: character to be used for the top right corner of the window
* 8. bl: character to be used for the bottom left corner of the window
* 9. br: character to be used for the bottom right corner of the window
*/
wrefresh(local_win);
delwin(local_win);
}
void CursesScreen::end()
{
// Kill our windows
destroyWindow(titleWin);
destroyWindow(logWin);
destroyWindow(chatWin);
destroyWindow(playerWin);
// Stop NCurses
endwin();
}
void CursesScreen::log(LogType::LogType type, const std::string& source, const std::string& message)
{
WINDOW *window;
if (source == "Chat")
{
window = chatWin;
}
else if (source == "Command")
{
window = commandWin;
}
else if (source == "Players")
{
window = playerWin;
}
else if (source == "Title")
{
window = titleWin;
}
else
{
window = logWin;
}
// Set the color
if (type == LogType::LOG_ERROR)
{
wattron(window, COLOR_PAIR(TEXT_COLOR_RED));
}
// Get the cursor so we can indent a bit
int x, y;
getyx(window, y, x);
if (type != LogType::LOG_ERROR && (window == chatWin || window == logWin))
{
waddstr(window, "\n");
wattron(window, WA_BOLD);
waddstr(window, ("[" + currentTimestamp(true) + "] ").c_str());
wattroff(window, WA_BOLD);
waddstr(window, (message).c_str());
}
else if (window == titleWin || window == playerWin)
{
waddstr(window, (message).c_str());
waddstr(window, "\n");
}
else
{
waddstr(window, "\n");
waddstr(window, (message).c_str());
}
// Turn off color again
if (type == LogType::LOG_ERROR)
{
wattroff(window, COLOR_PAIR(TEXT_COLOR_RED));
}
wrefresh(window);
}
#include <algorithm>
void CursesScreen::redrawPlayerList()
{
// Clear the playerlist
wclear(playerWin);
// Now fill it up!
if(usernames.size() == 0)
{
log(LogType::LOG_INFO, "Players", "No active players");
}
else
{
for (std::vector<std::string>::const_iterator username = usernames.begin();
username != usernames.end();
++username)
{
log(LogType::LOG_INFO, "Players", *username);
}
}
}
void CursesScreen::updatePlayerList(bool joining, const char *username)
{
// Update the list
if (joining)
{
usernames.push_back(username);
}
else
{
std::vector<std::string>::iterator element = std::find(usernames.begin(), usernames.end(), std::string(username));
if (element != usernames.end())
{
usernames.erase(element);
}
}
// Redraw the list
CursesScreen::redrawPlayerList();
}
bool logPost(int type, const char* source, const char* message)
{
screen->log((LogType::LogType)type, source, message);
return false;
}
static const unsigned int SERVER_CONSOLE_UID = -1;
bool checkForCommand()
{
if (screen->hasCommand())
{
// Now handle this command as normal
mineserver->chat.handleMessage("[Server]", screen->getCommand().c_str());
}
return false;
}
bool on_player_login(const char *username)
{
screen->updatePlayerList(true, username);
return false;
}
bool on_player_quit(const char *username)
{
screen->updatePlayerList(false, username);
return false;
}
PLUGIN_API_EXPORT void CALLCONVERSION cursesui_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if (mineserver->plugin.getPluginVersion(pluginName) > 0)
{
mineserver->logger.log(LogType::LOG_INFO, logSource, "The " PLUGIN_NAME " plugin is already loaded");
return;
}
mineserver->plugin.setPluginVersion(pluginName, pluginVersion);
screen = new CursesScreen();
screen->init("1.2"); // TODO This should query mineserver for the version
mineserver->plugin.addCallback("LogPost", reinterpret_cast<voidF>(logPost));
mineserver->plugin.addCallback("Timer200", reinterpret_cast<voidF>(checkForCommand));
mineserver->plugin.addCallback("PlayerLoginPost", reinterpret_cast<voidF>(on_player_login));
mineserver->plugin.addCallback("PlayerQuitPost", reinterpret_cast<voidF>(on_player_quit));
mineserver->logger.log(LogType::LOG_INFO, logSource, "Loaded " PLUGIN_NAME);
}
PLUGIN_API_EXPORT void CALLCONVERSION cursesui_shutdown(void)
{
screen->end();
//mineserver = NULL;
}
================================================
FILE: plugins/cursesui/screen.h
================================================
/*
Copyright (c) 2011, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _CURSESSCREEN_H
#define _CURSESSCREEN_H
#ifdef WIN32
#pragma warning( disable: 4005)
#include <winsock2.h>
#include <curses.h>
#else
#include <ncurses.h>
#endif
#include <string>
#include <vector>
#include <stack>
#include "logtype.h"
enum
{
TEXT_COLOR_RED = 1,
TEXT_COLOR_GREEN,
TEXT_COLOR_YELLOW,
TEXT_COLOR_BLUE,
TEXT_COLOR_MAGENTA,
TEXT_COLOR_CYAN,
TEXT_COLOR_WHITE,
TEXT_COLOR_INVERSE
};
class CursesScreen
{
public:
void init(std::string version);
WINDOW* createWindow(int width, int height, int startx, int starty);
void destroyWindow(WINDOW *local_win);
void log(LogType::LogType type, const std::string& source, const std::string& message);
void updatePlayerList(bool joining, const char *username);
void end();
WINDOW *commandLog;
bool hasCommand();
std::string getCommand();
private:
WINDOW *titleWin;
WINDOW *logWin;
WINDOW *chatWin;
WINDOW *commandWin;
WINDOW *playerWin;
std::vector<std::string> usernames;
std::string version;
std::string command;
std::string commandBuf;
std::stack<std::string> prevCommands;
std::stack<std::string> nextCommands;
/* Helper funcions */
std::string prevCommand();
std::string nextCommand();
void addCommand(std::string str);
/* Screen Helpers */
void initWindows();
void redraw();
void redrawPlayerList();
};
#endif /* _CURSESSCREEN_H */
================================================
FILE: plugins/filelog/filelog.cpp
================================================
/*
Copyright (c) 2011, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
Feature List:
* Logging chat messages to a file
* Logging server messages to a file
* Configuration for disabling the chat and/or server features
* Configuration option for specificing the filename of the server and chat files.
Feature list todo:
* Linux Makefile
* Support for splitting chat and server log files per day
* Configration settings
** Split per day
** Support for the splitting in the filename, or just append before the .log.
** timestamp format (ie strftime format maybe? without the % part)
Options
filelog.chat.enable = true;
filelog.chat.filename = "mineserver_chat.log";
filelog.chat.daily_split = false;
filelog.server.enable = true;
filelog.server.filename = "mineserver.log";
filelog.server.daily_split = false;
*/
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <cstring>
#define MINESERVER_C_API
#include "plugin_api.h"
// This should mirror mineserver/logtype.h.
static const char* logTypeName[] = {
"EMERG",
"Alert",
"Critical",
"Error",
"Warning",
"Notice",
"Info",
"Debug"
};
// limits, defaults
#define STR_MAXLEN 80
#define FORMAT_TIME "%Y-%m-%d %H:%M:%S"
#define FILENAME_LOG "mineserver.log"
#define FILENAME_CHAT "mineserver_chat.log"
// Constants
#define PLUGIN_NAME "Filelog"
const char* pluginName = PLUGIN_NAME;
const char* logSource = "plugin.filelog";
const float pluginVersion = 1.0f;
// Variables
mineserver_pointer_struct* mineserver;
FILE* logFile;
FILE* chatFile;
const char* formatTimestamp = FORMAT_TIME;
// Configuration Helper functions
bool filelog_config_boolean(const char* key, bool defaultValue)
{
if (!mineserver->config.has(key))
{
return defaultValue;
}
return mineserver->config.bData(key);
}
const char* filelog_config_string(const char* key, const char*defaultValue)
{
if (!mineserver->config.has(key))
{
return defaultValue;
}
return mineserver->config.sData(key);
}
bool chatPost(const char* name, time_t time, const char* message)
{
char str[STR_MAXLEN];
struct tm* localTime;
localTime = localtime(&time);
strftime(str, sizeof(str), formatTimestamp, localTime);
fprintf(chatFile, "%s <%s> %s\n", str, name, message);
return false;
}
bool logPost(int type, const char* source, const char* message)
{
char str[STR_MAXLEN];
time_t t;
struct tm* tmLocal;
t = time(NULL);
tmLocal = localtime(&t);
strftime(str, sizeof(str), formatTimestamp, tmLocal);
if (type >= LOG_COUNT || type < 0) // Unknown log type
fprintf(logFile, "%s [%d] %s: %s\n", str, type, source, message);
else
fprintf(logFile, "%s [%s] %s: %s\n", str, logTypeName[type], source, message);
return false;
}
PLUGIN_API_EXPORT void CALLCONVERSION filelog_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if (mineserver->plugin.getPluginVersion(pluginName) > 0)
{
mineserver->logger.log(LOG_INFO, logSource, "The " PLUGIN_NAME " plugin is already loaded");
return;
}
mineserver->logger.log(LOG_INFO, logSource, "Loaded " PLUGIN_NAME);
mineserver->plugin.setPluginVersion(pluginName, pluginVersion);
// Check if server message logging is enabled, if the option is not specified default to true.
if (filelog_config_boolean("filelog.server.enable", true))
{
const char *filename = filelog_config_string("filelog.server.filename", FILENAME_LOG);
char *message = (char *)malloc(strlen(filename) + 12);
mineserver->plugin.addCallback("LogPost", reinterpret_cast<voidF>(logPost));
logFile = fopen(filename, "a");
sprintf(message, "Logging to %s", filename);
mineserver->logger.log(LOG_INFO, logSource, message);
free(message);
}
else
{
mineserver->logger.log(LOG_INFO, logSource, "Logging server messages to file is disabled");
}
// Check if chat logging is enabled, if the option is not specified default to true.
if (filelog_config_boolean("filelog.chat.enable", true))
{
const char* filename = filelog_config_string("filelog.chat.filename", FILENAME_CHAT);
char* message = (char *)malloc(strlen(filename) + 17);
mineserver->plugin.addCallback("PlayerChatPost", reinterpret_cast<voidF>(chatPost));
chatFile = fopen(filename, "a");
sprintf(message, "Logging chat to %s", filename);
mineserver->logger.log(LOG_INFO, logSource, message);
free(message);
}
else
{
mineserver->logger.log(LOG_INFO, logSource, "Logging chat messages to file is disabled");
}
}
PLUGIN_API_EXPORT void CALLCONVERSION filelog_shutdown(void)
{
if (mineserver->plugin.getPluginVersion(pluginName) <= 0)
{
mineserver->logger.log(LOG_INFO, logSource, PLUGIN_NAME " is not loaded!");
return;
}
mineserver->logger.log(LOG_INFO, logSource, PLUGIN_NAME " has been unloaded!");
fclose(logFile);
fclose(chatFile);
logFile = NULL;
chatFile = NULL;
}
================================================
FILE: plugins/flatpermissions/flatpermissions.cpp
================================================
/*
g++ -c flatpermissions.cpp
g++ -shared flatpermissions.o -o flatpermissions.so
*/
/*
Copyright (c) 2013, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cstdlib>
#include <string>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#define MINESERVER_C_API
#include "plugin_api.h"
#define PLUGIN_VERSION 1.1
mineserver_pointer_struct* mineserver;
std::string pluginName = "flatpermissions";
std::string dtos(double n)
{
std::stringstream result;
result << n;
return result.str();
}
void loginPost(const char* userIn){
std::ifstream file;
file.open("permissions.txt", std::ios::in);
std::string line;
if(file.is_open())
{
while(file.good())
{
std::string msg;
std::getline(file, msg);
if(msg.size()>1)
{
std::string name, rank;
std::istringstream line(msg);
std::getline(line,name,':');
std::getline(line,rank);
if(name.compare(std::string(userIn))==0)
{
std::transform(rank.begin(), rank.end(), rank.begin(), ::tolower);
if(rank.compare("admin")==0 || rank.compare("admins")==0)
{
mineserver->permissions.setAdmin(userIn);
}
else if(rank.compare("op")==0 || rank.compare("ops")==0)
{
mineserver->permissions.setOp(userIn);
}
else if(rank.compare("member")==0 || rank.compare("members")==0)
{
mineserver->permissions.setMember(userIn);
}
else
{
mineserver->permissions.setGuest(userIn);
}
break;
}
}
}
file.close();
}
}
PLUGIN_API_EXPORT void CALLCONVENSION flatpermissions_shutdown(void)
{
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) <= 0)
{
mineserver->logger.log(6, "plugin.flatpermissions", "flatpermission is not loaded!");
return;
}
}
PLUGIN_API_EXPORT void CALLCONVENSION flatpermissions_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if(mineserver->plugin.getPluginVersion(pluginName.c_str())>0){
std::string msg = "flatpermission is already loaded, v. "+dtos(mineserver->plugin.getPluginVersion(pluginName.c_str()));
mineserver->logger.log(6, "plugin.flatpermissions", msg.c_str());
return;
}
std::string msg = "Loaded "+pluginName+"!";
mineserver->logger.log(6, "plugin.flatpermissions", msg.c_str());
mineserver->plugin.setPluginVersion(pluginName.c_str(), PLUGIN_VERSION);
mineserver->plugin.addCallback("PlayerLoginPost", reinterpret_cast<voidF>(loginPost));
}
================================================
FILE: plugins/luascript/luascript.cpp
================================================
/*
Copyright (c) 2013, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <iostream>
#include <sstream>
#include <string>
#include <deque>
#include <stdint.h>
#include <cstdlib>
#include <ctime>
#include <map>
#include <vector>
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include "luawrapper.h"
struct LuaScript
{
std::string script;
lua_State* pL;
};
std::vector<LuaScript> luaScripts;
#define MINESERVER_C_API
#include "plugin_api.h"
std::deque<std::string> parseCmd(std::string cmd);
const char CHATCMDPREFIX = '/';
#define PLUGIN_LUASCRIPT_VERSION 0.1
#define MSG_PREFIX std::string("[LuaScript] ")
mineserver_pointer_struct* mineserver;
std::string dtos(double n)
{
std::ostringstream result;
result << n;
return result.str();
}
typedef void (*CommandCallback)(std::string nick, std::string, std::deque<std::string>);
struct Command
{
Command(std::deque<std::string> _names, std::string _arguments, std::string _description, CommandCallback _callback)
: names(_names),
arguments(_arguments),
description(_description),
callback(_callback)
{}
std::deque<std::string> names;
std::string arguments;
std::string description;
CommandCallback callback;
};
typedef Command* ComPtr;
typedef std::map<std::string, ComPtr> CommandList;
CommandList m_Commands;
void registerCommand(ComPtr command)
{
// Loop thru all the words for this command
std::string currentWord;
std::deque<std::string> words = command->names;
while(!words.empty())
{
currentWord = words.front();
words.pop_front();
m_Commands[currentWord] = command;
}
}
bool chatCommandFunction(const char* userIn,const char* cmdIn, int argc, char** argv)
{
std::string user(userIn);
std::string command(cmdIn);
std::deque<std::string> cmd(argv, argv+argc);
if(command.size() == 0)
{
return false;
}
// User commands
CommandList::iterator iter;
if((iter = m_Commands.find(command)) != m_Commands.end())
{
iter->second->callback(user, command, cmd);
return true;
}
return false;
}
bool startedDiggingFunction(const char* userIn, int32_t x,int8_t y,int32_t z,int8_t direction)
{
//translateDirection(&x,&y,&z,direction);
std::string user(userIn);
int map = 0;
mineserver->user.getPositionW(userIn, NULL, NULL, NULL, &map,NULL, NULL, NULL);
return true;
}
bool translateDirection(int32_t *x, int8_t *y, int32_t *z, int8_t direction)
{
switch(direction)
{
case BLOCK_BOTTOM: (*y)--; break;
case BLOCK_TOP: (*y)++; break;
case BLOCK_NORTH: (*x)++; break;
case BLOCK_SOUTH: (*x)--; break;
case BLOCK_EAST: (*z)++; break;
case BLOCK_WEST: (*z)--; break;
default: break;
}
return true;
}
bool blockPlacePreFunction(const char* userIn, int32_t x,int8_t y,int32_t z,int16_t block,int8_t direction)
{
translateDirection(&x,&y,&z,direction);
std::string user(userIn);
return true;
}
void sendHelp(std::string user, std::string command, std::deque<std::string> args)
{
if(!mineserver->permissions.isAdmin(user.c_str())) return;
CommandList* commandList = &m_Commands; // defaults
//std::string commandColor = MC_COLOR_BLUE;
if (args.size() == 0)
{
for(CommandList::iterator it = commandList->begin();it != commandList->end();++it)
{
if(it->first != "help")
{
std::string args = it->second->arguments;
std::string description = it->second->description;
std::string msg = "ic!A!r "+ CHATCMDPREFIX + it->first + " " + args + " : " + description;
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
}
}
else
{
CommandList::iterator iter;
if ((iter = commandList->find(args.front())) != commandList->end())
{
if(iter->first != "help")
{
std::string args = iter->second->arguments;
std::string description = iter->second->description;
std::string msg = CHATCMDPREFIX + iter->first + " " + args;
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
msg = CHATCMDPREFIX + description;
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
}
}
}
//Calltest, string a, string b
int lua_calltest(lua_State *pL)
{
int n = lua_gettop(pL);
if(n != 2)
{
return 0;
}
if(!lua_isstring(pL, 1) || !lua_isstring(pL, 2))
{
return 0;
}
std::string msg=lua_tostring(pL,1);
std::string msg2=lua_tostring(pL,2);
mineserver->logger.log(LOG_INFO, "plugin.luascript", msg.c_str());
return 0;
}
void registerLuaFunctions(lua_State *pL)
{
lua_register(pL, "calltest", lua_calltest);
}
void luaLoad(std::string user, std::string command, std::deque<std::string> args)
{
if (args.size() == 0)
{
std::string msg = MSG_PREFIX+"Usage: /luaload <scriptname>";
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
else
{
std::string msg = "Trying to load " + args[0];
mineserver->logger.log(LOG_INFO, "plugin.luascript", msg.c_str());
luaScripts.push_back(LuaScript());
unsigned int last = luaScripts.size()-1;
//Initialize
luaScripts[last].pL = lua_open();
luaScripts[last].script = args[0];
luaL_openlibs(luaScripts[last].pL);
//Try to open and run
if(luaL_dofile(luaScripts[last].pL, luaScripts[last].script.c_str()) != 0)
{
lua_close(luaScripts[last].pL);
luaScripts.pop_back();
std::string msg = MSG_PREFIX+"failed to load script "+args[0];
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
else
{
//Init stuff
registerLuaFunctions(luaScripts[last].pL);
std::string msg = MSG_PREFIX+"script "+args[0]+" loaded and running!";
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
}
}
void luaUnload(std::string user, std::string command, std::deque<std::string> args)
{
if (args.size() == 0)
{
std::string msg = MSG_PREFIX+"Usage: /luaunload <scriptname>";
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
else
{
bool found = false;
for(unsigned int i = 0; i < luaScripts.size(); i++)
{
if(luaScripts[i].script == args[0])
{
lua_close(luaScripts[i].pL);
luaScripts.erase(luaScripts.begin()+i);
std::string msg = MSG_PREFIX+"unloaded script "+args[0];
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
found = true;
break;
}
}
if(!found)
{
std::string msg = MSG_PREFIX+"unable to unload script "+args[0];
mineserver->chat.sendmsgTo(user.c_str(), msg.c_str());
}
}
}
void luaStatus(std::string user, std::string command, std::deque<std::string> args)
{
}
void timer200Function()
{
for(unsigned int i = 0; i < luaScripts.size(); i++)
{
lua_getglobal(luaScripts[i].pL, "timer200");
if(lua_isfunction(luaScripts[i].pL, -1))
{
lua_call(luaScripts[i].pL, 0, 0);
}
}
}
std::string pluginName = "luascript";
PLUGIN_API_EXPORT void CALLCONVERSION luascript_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) > 0)
{
std::string msg = "luascript is already loaded v."+dtos(mineserver->plugin.getPluginVersion(pluginName.c_str()));
mineserver->logger.log(LOG_INFO, "plugin.luascript", msg.c_str());
return;
}
std::string msg = "Loaded "+pluginName+"!";
mineserver->logger.log(LOG_INFO, "plugin.luascript", msg.c_str());
mineserver->plugin.setPluginVersion(pluginName.c_str(), PLUGIN_LUASCRIPT_VERSION);
mineserver->plugin.addCallback("PlayerChatCommand", reinterpret_cast<voidF>(chatCommandFunction));
mineserver->plugin.addCallback("BlockPlacePre", reinterpret_cast<voidF>(blockPlacePreFunction));
mineserver->plugin.addCallback("PlayerDiggingStarted", reinterpret_cast<voidF>(startedDiggingFunction));
mineserver->plugin.addCallback("Timer200", reinterpret_cast<voidF>(timer200Function));
registerCommand(ComPtr(new Command(parseCmd("help"), "[<commandName>]", "Display this help message.", sendHelp)));
registerCommand(ComPtr(new Command(parseCmd("luaload"), "<scriptname>", "Load Lua script", luaLoad)));
registerCommand(ComPtr(new Command(parseCmd("luaunload"), "<scriptname>", "Unload Lua script", luaUnload)));
registerCommand(ComPtr(new Command(parseCmd("luastatus"), "", "Give status of luascript", luaStatus)));
}
PLUGIN_API_EXPORT void CALLCONVERSION commands_shutdown(void)
{
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) <= 0)
{
mineserver->logger.log(LOG_INFO, "plugin.luascript", "luascript is not loaded!");
return;
}
}
std::deque<std::string> parseCmd(std::string cmd)
{
int del;
std::deque<std::string> temp;
while(cmd.length() > 0)
{
while(cmd[0] == ' ')
{
cmd = cmd.substr(1);
}
del = cmd.find(' ');
if(del > -1)
{
temp.push_back(cmd.substr(0, del));
cmd = cmd.substr(del+1);
}
else
{
temp.push_back(cmd);
break;
}
}
if(temp.empty())
{
temp.push_back("empty");
}
return temp;
}
================================================
FILE: plugins/luascript/luawrapper.cpp
================================================
/*
Copyright (c) 2012, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <iostream>
#include <sstream>
#include <string>
#include <deque>
#include <stdint.h>
#include <cstdlib>
#include <ctime>
#include <map>
#include <vector>
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#define MINESERVER_C_API
#include "plugin_api.h"
extern mineserver_pointer_struct* mineserver;
================================================
FILE: plugins/luascript/luawrapper.h
================================================
/*
Copyright (c) 2012, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
================================================
FILE: plugins/nBreak/nBreak.cpp
================================================
/*
g++ -c nBreak.cpp
g++ -shared nBreak.o -o nBreak.so
copy nether.so to Mineserver bin directory.
*/
/*
Copyright (c) 2010, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdlib.h>
#include <string>
#include <deque>
#include <ctime>
#include <sstream>
#include <cstdlib>
#include <map>
#include <vector>
#include <iostream>
#include <stdint.h>
#include <math.h>
#define MINESERVER_C_API
#include "plugin_api.h"
#include "nBreak.h"
#define PLUGIN_NBREAK_VERSION 1.1
mineserver_pointer_struct* mineserver;
void setBlock(const char* name,int x,int y,int z,unsigned char id)
{
int map;
mineserver->user.getPositionW(name,NULL,NULL,NULL,&map,NULL,NULL,NULL);
mineserver->map.setBlockW(x,y,z,map,(unsigned char)id,0);
}
int getBlock(const char* name,int x,int y,int z)
{
int map;
mineserver->user.getPositionW(name,NULL,NULL,NULL,&map,NULL,NULL,NULL);
unsigned char type, meta;
if(mineserver->map.getBlockW(x,y,z,map,&type,&meta))
{
return type;
}
return 0;
}
bool blockBreakPreFunction(const char* userIn, int32_t x, int32_t y, int32_t z,int16_t block, int8_t direction)
{
int id = getBlock(userIn,x,y,z);
int item,meta,count;
mineserver->user.getItemInHand(userIn,&item, &meta, &count);
if(id == 4 || id == 1 || id == 16 || id == 48 || id == 67)
{
if(item == 270 || item == 278 || item == 257 || item == 285 || item == 274)
{
return true;
}
else
{
setBlock(userIn,x,y,z,0);
return false;
}
}
if(id == 15)
{
if(item == 278 || item == 257 || item == 285 || item == 274)
{
return true;
}
else
{
setBlock(userIn,x,y,z,0);
return false;
}
}
if(id == 14)
{
if(item == 278 || item == 257 || item == 285)
{
return true;
}
else
{
setBlock(userIn,x,y,z,0);
return false;
}
}
if(id == 49 || id == 21 || id == 56 || id == 73 || id ==74 || id == 52)
{
if(item == 278 || item == 257)
{
return true;
}
else
{
setBlock(userIn,x,y,z,0);
return false;
}
}
return true;
}
std::string pluginName = "nBreak";
PLUGIN_API_EXPORT void CALLCONVERSION nBreak_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) > 0)
{
std::string msg = "nBreak is already loaded";
mineserver->logger.log(6, "plugin.nether", msg.c_str());
return;
}
std::string msg = "Loaded "+pluginName+"!";
mineserver->logger.log(6, "plugin.nBreak", msg.c_str());
mineserver->plugin.setPluginVersion(pluginName.c_str(), PLUGIN_NBREAK_VERSION);
mineserver->plugin.addCallback("BlockBreakPre", reinterpret_cast<voidF>(blockBreakPreFunction));
}
PLUGIN_API_EXPORT void CALLCONVERSION command_shutdown(void)
{
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) <= 0)
{
mineserver->logger.log(6, "plugin.nBreak", "nBreak is not loaded!");
return;
}
}
================================================
FILE: plugins/nBreak/nBreak.h
================================================
#include <string>
#ifndef _PLUGIN_COMMAND_H
#define _PLUGIN_COMMAND_H
std::deque<std::string> parseCmd(std::string cmd);
#endif
================================================
FILE: plugins/nether/nether.cpp
================================================
/*
g++ -c nether.cpp
g++ -shared nether.o -o nether.so
copy nether.so to Mineserver bin directory.
*/
/*
Copyright (c) 2010, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <string>
#include <deque>
#include <ctime>
#include <sstream>
#include <cstdlib>
#include <map>
#include <vector>
#include <iostream>
#include <stdint.h>
#include <cmath>
#define MINESERVER_C_API
#include "plugin_api.h"
#include "nether.h"
#define PLUGIN_NETHER_VERSION 1.1
class block
{
public:
int x,y,z;
const char* name;
block(const char* n, int xx, int yy, int zz){
x=xx;y=yy;z=zz;name=n;
}
};
std::vector<block*> blockToDo;
std::vector<block*> blockDone;
const char CHATCMDPREFIX = '/';
mineserver_pointer_struct* mineserver;
std::string dtos(double n)
{
std::ostringstream result;
result << n;
return result.str();
}
void setBlock(const char* name,int x,int y,int z,unsigned char id)
{
int map;
mineserver->user.getPositionW(name,NULL,NULL,NULL,&map,NULL,NULL,NULL);
mineserver->map.setBlockW(x,y,z,map,(unsigned char)id,0);
}
int getBlock(const char* name,int x,int y,int z)
{
int map;
mineserver->user.getPositionW(name,NULL,NULL,NULL,&map,NULL,NULL,NULL);
unsigned char type, meta;
if(mineserver->map.getBlockW(x,y,z,map,&type,&meta))
{
return type;
}
return 0;
}
void addToDo(const char* user, int x, int y, int z){
for(size_t i = 0;i<blockToDo.size();i++){
block* c=blockToDo[i];
if(x==c->x && y==c->y && z==c->z)
{
return;
}
}
for(size_t i = 0;i<blockDone.size();i++){
block* c=blockDone[i];
if(x==c->x && y==c->y && z==c->z)
{
return;
}
}
block* b = new block(user,x,y,z);
blockToDo.push_back(b);
}
void doPortalFromFrame(const char* user, int x,int y, int z)
{
bool up=false,down=false,left=false,right=false,forward=false,backward=false;
for(int c=1; c<10; c++) // Yes, we start at 1 so we DONT see the start again
{
if(getBlock(user,x,y+c,z)==49){ up=true; addToDo(user,x,y+c,z);}
if(getBlock(user,x,y-c,z)==49){ down=true; addToDo(user,x,y-c,z);}
if(getBlock(user,x+c,y,z)==49){ left=true; addToDo(user,x+c,y,z);}
if(getBlock(user,x-c,y,z)==49){ right=true; addToDo(user,x-c,y,z);}
if(getBlock(user,x,y,z+c)==49){ forward=true; addToDo(user,x,y,z+c);}
if(getBlock(user,x,y,z-c)==49){ backward=true; addToDo(user,x,y,z-c);}
}
for(int c=1; c<10; c++)
{
if(up)
{
if(getBlock(user,x,y+c,z)!=49)
{
setBlock(user,x,y+c,z,90);
}else{
up=false;
}
}
if(down)
{
if(getBlock(user,x,y-c,z)!=49)
{
setBlock(user,x,y-c,z,90);
}else{
down=false;
}
}
if(left)
{
if(getBlock(user,x+c,y,z)!=49)
{
setBlock(user,x+c,y,z,90);
}else{
left=false;
}
}
if(right)
{
if(getBlock(user,x-c,y,z)!=49)
{
setBlock(user,x-c,y,z,90);
}else{
right=false;
}
}
if(forward)
{
if(getBlock(user,x,y,z+c)!=49)
{
setBlock(user,x,y,z+c,90);
}else{
forward=false;
}
}
if(backward)
{
if(getBlock(user,x,y,z-c)!=49)
{
setBlock(user,x,y,z-c,90);
}else{
backward=false;
}
}
}
}
void doPortal(const char* user,int x,int y, int z)
{
int cx=x,cy=y,cz=z;
addToDo(user,x,y,z);
while(blockToDo.size()>0)
{
doPortalFromFrame(user, blockToDo[0]->x, blockToDo[0]->y, blockToDo[0]->z);
blockDone.push_back(blockToDo[0]);
blockToDo.erase(blockToDo.begin());
cz ++;
}
for(size_t i = 0; i < blockDone.size(); i++)
{
delete blockDone[i];
}
blockDone.clear();
}
bool blockPlacePreFunction(const char* userIn, int32_t x, int32_t y, int32_t z,int16_t block, int8_t direction)
{
if(block == 259){
// Should we trigger Portal creation?
if(getBlock(userIn,x,y,z)==49){
mineserver->logger.log(LOG_INFO, "plugin.nether", "Portal triggered");
doPortal(userIn,x,y,z);
}
}
return true;
}
void timer200Function()
{
for (int i = 0; i < mineserver->user.getCount(); i++){
const char* const name = mineserver->user.getUserNumbered(i);
double x,y,z;
int map;
mineserver->user.getPositionW(name, &x,&y,&z,&map,NULL,NULL,NULL);
if(map<0 || map > 100)
{
// Watch out for this, means uninitialized!
continue;
}
unsigned char type, meta;
mineserver->map.getBlockW((int)floor(x),(int)floor(y),(int)floor(z),map,&type,&meta);
if((int)type == 90)
{
// They're on a portal TP TIEM
if(map==0){
// Normal > Nether
double nx, nz;
nx = x /16;
nz = z /16;
mineserver->user.teleportMap(name, nx,y+1,nz,1);
}else if(map==1){
double nx, nz;
nx = x * 16;
nz = z * 16;
mineserver->user.teleportMap(name, nx,y+1,nz,0);
}
// You're on another world? FIND YOUR OWN WAY BACK
}
}
}
std::string pluginName = "nether";
PLUGIN_API_EXPORT void CALLCONVERSION nether_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) > 0)
{
std::string msg = "nether is already loaded v."+dtos(mineserver->plugin.getPluginVersion(pluginName.c_str()));
mineserver->logger.log(LOG_INFO, "plugin.nether", msg.c_str());
return;
}
std::string msg = "Loaded "+pluginName+"!";
mineserver->logger.log(LOG_INFO, "plugin.nether", msg.c_str());
mineserver->plugin.setPluginVersion(pluginName.c_str(), PLUGIN_NETHER_VERSION);
mineserver->plugin.addCallback("Timer200", reinterpret_cast<voidF>(timer200Function));
mineserver->plugin.addCallback("BlockPlacePre", reinterpret_cast<voidF>(blockPlacePreFunction));
}
PLUGIN_API_EXPORT void CALLCONVERSION command_shutdown(void)
{
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) <= 0)
{
mineserver->logger.log(LOG_INFO, "plugin.nether", "nether is not loaded!");
return;
}
}
================================================
FILE: plugins/nether/nether.h
================================================
#include <string>
#ifndef _PLUGIN_COMMAND_H
#define _PLUGIN_COMMAND_H
std::deque<std::string> parseCmd(std::string cmd);
#endif
================================================
FILE: plugins/passiveMobs/passiveMobs.cpp
================================================
/*
Copyright (c) 2010, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <string>
#include <deque>
#include <ctime>
#include <sstream>
#include <cstdlib>
#include <map>
#include <vector>
#include <iostream>
#include <ctime>
#include <stdint.h>
#include <cmath>
#include <memory>
#define MINESERVER_C_API
#include "plugin_api.h"
#include "tools.h"
#include "passiveMobs.h"
#define PLUGIN_PASSIVEMOBS_VERSION 1.1
#define PI 3.14159265
double sin_lt[3600];
double cos_lt[3600];
const char CHATCMDPREFIX = '/';
mineserver_pointer_struct* mineserver;
std::string dtos(double n)
{
std::ostringstream result;
result << n;
return result.str();
}
static const int passiveMobs[] = { MOB_SHEEP, MOB_COW, MOB_CHICKEN, MOB_PIG };
// The list of Mobs this plugin has control of
// Note that other plugins may make other mobs, and control them itself
class MyPetMob
{
public:
int ID;
int deSpawn;
int lastSay;
double velocity;
explicit MyPetMob(int ID, double velocity = 0) : ID(ID), deSpawn(0), velocity(velocity), lastSay(time(0)) { }
};
typedef std::shared_ptr<MyPetMob> MyPetMobPtr;
std::vector<MyPetMobPtr> MyMobs;
const unsigned int maxMobs = 15; // Maximum ammount of mobs allowed
time_t lastSpawn = time(NULL);
int topBlockSuitable(int x, int z, int w)
{
int y;
unsigned char block, meta;
for(y = 127; y > 0; y--)
{
mineserver->map.getBlockW(x,y,z,w,&block,&meta);
if(block!=0){break;}
}
if(block == 78 || block == 2 || block == 38 || block == 37)
{
return y;
}
return 0;
}
bool canStepIn(int type)
{
if(type == 0 || type == 6 || type == 8 || type == 9 || type == 10 ||
type == 11 || type == 37 || type == 38 || type == 39 || type == 40 ||
type == 50 || type == 51 || type == 55 || type == 59 ||
type == 69 || type == 70 || type == 72 || type == 75 || type == 76 ||
type == 77 || type == 78 || type == 83)
return true;
return false;
}
bool moveSuitable(double* x, double* y, double* z, int w)
{
unsigned char block, meta;
mineserver->map.getBlockW((int)floor(*x),(int)*y,(int)floor(*z),w,&block,&meta);
return canStepIn(block);
}
void fallMob(double* x, double* y, double* z, int w)
{
unsigned char block, meta;
for(int count = 1; count < 128; count ++)
{
mineserver->map.getBlockW((int)floor(*x),(int)(*y)-count,(int)floor(*z),w,&block,&meta);
if (!canStepIn(block))
{
*y=(1+(*y))-count;
return;
}
}
}
int defaultHealth(int mob)
{
switch (mob)
{
case MOB_PIG:
case MOB_COW:
case MOB_SHEEP:
return 10;
case MOB_CHICKEN:
return 4;
default:
return 10;
}
}
int defaultDamage(int item)
{
switch (item)
{
case ITEM_WOODEN_SWORD:
case ITEM_GOLD_SWORD:
return 5;
case ITEM_STONE_SWORD:
return 7;
case ITEM_IRON_SWORD:
return 9;
case ITEM_DIAMOND_SWORD:
return 11;
default:
return 2;
}
}
void spawn()
{
if (MyMobs.size() < maxMobs &&
time(NULL)-lastSpawn > 2 &&
mineserver->user.getCount() > 0 &&
mineserver->map.getTime() <= 18000)
{
int randomPlayer = mineserver->tools.uniformInt(0, mineserver->user.getCount() - 1);
double x,y,z;
int w;
if (mineserver->user.getPositionW(mineserver->user.getUserNumbered(randomPlayer),&x,&y,&z,&w,NULL,NULL,NULL))
{
x += mineserver->tools.uniformInt(-50, 50);
z += mineserver->tools.uniformInt(-50, 50);
y = topBlockSuitable(x,z,w);
if (y > 0)
{
y+=1;
int type = passiveMobs[mineserver->tools.uniformInt(0, sizeof(passiveMobs) / sizeof(passiveMobs[0]) - 1)];
int newMob = mineserver->mob.createMob(type);
mineserver->mob.setHealth(newMob, defaultHealth(type));
MyPetMobPtr newMobData(new MyPetMob(newMob));
MyMobs.push_back(newMobData);
mineserver->mob.moveMobW(newMob,x,y,z,w);
mineserver->mob.spawnMob(newMob);
if (type == MOB_SHEEP)
{
int color = mineserver->tools.uniformInt(0, 15);
mineserver->mob.setByteMetadata(newMob, 16, (int8_t)color);
mineserver->mob.updateMetadata(newMob);
}
lastSpawn=time(NULL);
}
}
}
}
void timer200Function()
{
spawn();
for (int i = MyMobs.size() - 1; i >= 0; i--)
{
double x,y,z;
int w;
// get position and world
mineserver->mob.getMobPositionW(MyMobs[i]->ID, &x, &y, &z, &w);
// kill dead mobs
if(mineserver->mob.getHealth(MyMobs[i]->ID) == 0)
{
if (MyMobs[i]->deSpawn < 12)
{
MyMobs[i]->deSpawn++;
}
else
{
mineserver->mob.despawnMob(MyMobs[i]->ID);
/* TODO: fix memory leak */
MyMobs.erase(MyMobs.begin()+i);
}
continue;
}
else
{
MyMobs[i]->deSpawn=0;
}
// get the nearest user
int nearest = 10000;
double nearest_x = .0, nearest_y = .0, nearest_z = .0;
for (int j = 0; j < mineserver->user.getCount(); j++)
{
const char * const name = mineserver->user.getUserNumbered(j);
double px,py,pz;
int pmap;
mineserver->user.getPositionW(name, &px,&py,&pz,&pmap,NULL,NULL,NULL);
if (w != pmap) { continue; }
int distance = abs(int(px-x)) + abs(int(py-y)) + abs(int(pz-z));
if(distance < nearest) {
nearest = distance;
nearest_x = px;
nearest_y = py;
nearest_z = pz;
}
}
if(nearest < 0 || nearest > 200)
{
// if there is no user here, despawn the mob
mineserver->mob.despawnMob(MyMobs[i]->ID);
MyMobs.erase(MyMobs.begin()+i);
continue;
}
// do something, my little mob
int action = rand() % 150;
double yaw, pitch, head_yaw;
float forward = 0;
mineserver->mob.getLook(MyMobs[i]->ID, &yaw, &pitch, &head_yaw);
if (action < 5)
{
yaw += 30;
}
else if (action < 10)
{
yaw += 15;
forward = 0.3;
}
else if (action < 15)
{
yaw -= 30;
}
else if (action < 20)
{
yaw -= 15;
forward = 0.3;
}
else if (action < 30)
{
forward = 0.6;
}
else if (action < 40)
{
// for now, just look around stupidly
head_yaw += rand() % 40;
}
else if (action < 50)
{
forward = -0.6;
// turn around!
yaw -= 180;
}
MyMobs[i]->velocity += forward;
if (MyMobs[i]->velocity > 2.0){ MyMobs[i]->velocity = 2.0; }
if (MyMobs[i]->velocity < 0.0){ MyMobs[i]->velocity = 0.0; }
forward = MyMobs[i]->velocity;
if (yaw <= 0) { yaw += 360; }
if (yaw >= 360) { yaw -= 360; }
// TODO: make it look at the player if he's near enough.
// (nearest_x, nearest_y, nearest_z).
/* if(nearest_z != z) {
head_yaw = RADIANS_TO_DEGREES(tan((nearest_x - x) / (nearest_z - z)));
}*/
if (forward>0.1 && rand()%6 == 3)
{
float incz = cos((yaw*PI)/180)* forward;
float incx = sin((yaw*PI)/180)* forward;
x-=incx; z+=incz;
if(moveSuitable(&x,&y,&z,w))
{
fallMob(&x,&y,&z,w);
mineserver->mob.moveMobW(MyMobs[i]->ID,x,y,z,w);
// Make stepping sounds
int type = mineserver->mob.getType(MyMobs[i]->ID);
if (type == MOB_SHEEP) {
mineserver->tools.namedSoundEffect("mob.sheep.step", x*32, y*32, z*32, 100.0f, 100);
} else if (type == MOB_COW) {
mineserver->tools.namedSoundEffect("mob.cow.step", x*32, y*32, z*32, 100.0f, 100);
} else if (type == MOB_CHICKEN) {
mineserver->tools.namedSoundEffect("mob.chicken.step", x*32, y*32, z*32, 100.0f, 100);
} else if (type == MOB_PIG) {
mineserver->tools.namedSoundEffect("mob.pig.step", x*32, y*32, z*32, 100.0f, 100);
}
}
fallMob(&x,&y,&z,w); // Even if they dont move, make them fall
}
mineserver->mob.setLook(MyMobs[i]->ID, yaw, pitch, head_yaw);
// Random noises
if (mineserver->tools.uniformInt(0, 255) > 240) {
if (time(NULL) - MyMobs[i]->lastSay > 2) {
MyMobs[i]->lastSay = time(NULL);
char rand = mineserver->tools.uniformInt(80,100);
int type = mineserver->mob.getType(MyMobs[i]->ID);
if (type == MOB_SHEEP) {
mineserver->tools.namedSoundEffect("mob.sheep.say", x*32, y*32, z*32, 100.0f, rand);
} else if (type == MOB_COW) {
mineserver->tools.namedSoundEffect("mob.cow.say", x*32, y*32, z*32, 100.0f, rand);
} else if (type == MOB_CHICKEN) {
mineserver->tools.namedSoundEffect("mob.chicken.say", x*32, y*32, z*32, 100.0f, rand);
} else if (type == MOB_PIG) {
mineserver->tools.namedSoundEffect("mob.pig.say", x*32, y*32, z*32, 100.0f, rand);
}
}
}
}
}
void drop(int mobID)
{
int type = mineserver->mob.getType(mobID);
double x,y,z;
int w;
mineserver->mob.getMobPositionW(mobID,&x,&y,&z,&w);
int item = 0, count = 1;
switch (type)
{
case MOB_PIG:
item = ITEM_PORK;
break;
case MOB_SHEEP:
/* sheep drops on first hit */
break;
case MOB_COW:
item = ITEM_LEATHER;
break;
case MOB_CHICKEN:
item = ITEM_FEATHER;
break;
}
if (item)
{
mineserver->map.createPickupSpawn((int)floor(x),(int)floor(y),(int)floor(z),
item, count, 0,NULL);
}
}
void gotAttacked(const char* userIn,int mobID)
{
std::string user(userIn);
int atk_item, _meta, _quant;
mineserver->user.getItemInHand(userIn, &atk_item, &_meta, &_quant);
int mobHealth = mineserver->mob.getHealth((int)mobID);
if (mobHealth <= 0) return;
mobHealth -= defaultDamage(atk_item);
int type = mineserver->mob.getType(mobID);
double x, y, z; int w;
char rand = mineserver->tools.uniformInt(100,150);
mineserver->mob.getMobPositionW(mobID, &x, &y, &z, &w);
if (type == MOB_SHEEP) {
mineserver->tools.namedSoundEffect("mob.sheep.say", x*32, y*32, z*32, 100.0f, rand);
} else if (type == MOB_COW) {
mineserver->tools.namedSoundEffect("mob.cow.say", x*32, y*32, z*32, 100.0f, rand);
} else if (type == MOB_CHICKEN) {
mineserver->tools.namedSoundEffect("mob.chicken.say", x*32, y*32, z*32, 100.0f, rand);
} else if (type == MOB_PIG) {
mineserver->tools.namedSoundEffect("mob.pig.say", x*32, y*32, z*32, 100.0f, rand);
}
if (mobHealth <= 0)
{
drop(mobID);
}
mineserver->mob.setHealth((int)mobID, (int)mobHealth);
}
void interact(const char* userIn,int mobID)
{
// Certain mobs drop something when the user interacts with them.
// Sheep drop wool.
std::string user(userIn);
int atk_item, _meta, _quant;
mineserver->user.getItemInHand(userIn, &atk_item, &_meta, &_quant);
int mobHealth = mineserver->mob.getHealth((int)mobID);
if (mobHealth <= 0) return;
int type = mineserver->mob.getType(mobID);
double x, y, z; int w;
mineserver->mob.getMobPositionW(mobID, &x, &y, &z, &w);
if (type == MOB_SHEEP)
{
// On unsheared sheeps, use a shear to obtain 1-3 wool blocks.
int8_t meta = mineserver->mob.getByteMetadata(mobID, 16);
if (atk_item == ITEM_SHEARS && !(meta & 0x10))
{
size_t amount = rand() % 3 + 1;
mineserver->map.createPickupSpawn((int)floor(x),(int)floor(y),(int)floor(z),
BLOCK_WOOL, amount, meta, NULL);
meta |= 0x10;
mineserver->mob.setByteMetadata(mobID, 16, meta);
mineserver->mob.updateMetadata(mobID);
mineserver->tools.namedSoundEffect("mob.sheep.shear", x*32, y*32, z*32, 100.0f, 100);
}
} else if(type == MOB_COW)
{
if(atk_item == ITEM_BUCKET)
{
// give him milk, take the bucket!
_quant--;
mineserver->user.setItemInHand(userIn, atk_item, _meta, _quant);
mineserver->user.addItem(userIn, ITEM_MILK_BUCKET, 1, 0);
}
}
}
std::string pluginName = "passiveMobs";
PLUGIN_API_EXPORT void CALLCONVERSION passiveMobs_init(mineserver_pointer_struct* mineserver_temp)
{
mineserver = mineserver_temp;
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) > 0)
{
std::string msg = atoi(pluginName.c_str())+ " is already loaded v."+dtos(mineserver->plugin.getPluginVersion(pluginName.c_str()));
mineserver->logger.log(6, "plugin.passiveMobs", msg.c_str());
return;
}
std::string msg = "Loaded "+pluginName+"!";
mineserver->logger.log(6, "plugin.passiveMobs", msg.c_str());
mineserver->plugin.setPluginVersion(pluginName.c_str(), PLUGIN_PASSIVEMOBS_VERSION);
for(int i=0; i<3600; i ++){
sin_lt[i] = sin(((double)(i/10)*PI/180));
cos_lt[i] = cos(((double)(i/10)*PI/180));
}
mineserver->plugin.addCallback("Timer200", reinterpret_cast<voidF>(timer200Function));
mineserver->plugin.addCallback("gotAttacked", reinterpret_cast<voidF>(gotAttacked));
mineserver->plugin.addCallback("interact", reinterpret_cast<voidF>(interact));
}
PLUGIN_API_EXPORT void CALLCONVERSION passiveMobs_shutdown(void)
{
if (mineserver->plugin.getPluginVersion(pluginName.c_str()) <= 0)
{
mineserver->logger.log(6, "plugin.passiveMobs", atoi(pluginName.c_str()) + " is not loaded!");
return;
}
}
================================================
FILE: plugins/passiveMobs/passiveMobs.h
================================================
#include <string>
#ifndef _PLUGIN_MOBS_H
#define _PLUGIN_MOBS_H
std::deque<std::string> parseCmd(std::string cmd);
#endif
================================================
FILE: src/CMakeLists.txt
================================================
cmake_minimum_required(VERSION 2.6)
# forbid running cmake from this subdir
if(PROJECT_NAME STREQUAL "Project")
message(FATAL_ERROR "\nplease run cmake from the project's parent directory\n")
endif()
#
# Get Mineserver sources
#
FILE(GLOB_RECURSE ${PROJECT_NAME}_source RELATIVE ${PROJECT_SOURCE_DIR}/src/ "*.cpp")
#
# Remove any duplicates and sort the list
#
LIST(REMOVE_DUPLICATES ${PROJECT_NAME}_source)
LIST(SORT ${PROJECT_NAME}_source)
# Exclude sources in src/plugins directory, that's compiled elsewhere
FOREACH(source ${${PROJECT_NAME}_source})
if(${source} MATCHES "plugins/*")
LIST(REMOVE_ITEM ${PROJECT_NAME}_source ${source})
ENDIF(${source} MATCHES "plugins/*")
ENDFOREACH(source ${${PROJECT_NAME}_source})
# Set the list as s source group
SOURCE_GROUP(${PROJECT_NAME} FILES ${${PROJECT_NAME}_source})
# Override the default link destination
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../${CONFIG_DIR_BIN}")
# Build Mineserver
SET(TARGET ${PROJECT_NAME})
MESSAGE(STATUS "Target: ${TARGET}")
ADD_EXECUTABLE(${TARGET} ${exe} ${${TARGET}_source})
TARGET_LINK_LIBRARIES(${TARGET} ${CMAKE_DL_LIBS} ${mineserver_depends})
# FOREACH(lib ${${TARGET}_depends})
# STRING(TOUPPER ${lib} LIB)
# INCLUDE_DIRECTORIES(${${LIB}_INCLUDE_DIR})
# TARGET_LINK_LIBRARIES(${TARGET} ${${LIB}_LIBRARY})
# ENDFOREACH()
# Where to install the target file.
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CONFIG_DIR_BIN}/
)
================================================
FILE: src/SystemExceptions.h
================================================
/*
Copyright (c) 2011-2012, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef SYSTEM_EXCEPTIONS_H
#define SYSTEM_EXCEPTIONS_H
#include <string>
#include <exception>
class CoreException : public std::exception
{
public:
// Holds the error message to be displayed
const std::string err;
// Source of the exception
const std::string source;
// Default constructor, just uses the error mesage 'Core threw an exception'.
CoreException() : err("Core threw an exception"), source("The core") { }
// This constructor can be used to specify an error message before throwing.
CoreException(const std::string &message) : err(message), source("The core") { }
// This constructor can be used to specify an error message before throwing,
// and to specify the source of the exception.
CoreException(const std::string &message, const std::string &src) : err(message), source(src) { }
// This destructor solves world hunger, cancels the world debt, and causes the world to end.
// Actually no, it does nothing. Never mind.
virtual ~CoreException() throw() { };
// Returns the reason for the exception.
// The module should probably put something informative here as the user will see this upon failure.
virtual const char* GetReason() const
{
return err.c_str();
}
virtual const char* GetSource()
{
return source.c_str();
}
};
#endif
================================================
FILE: src/blocks/basic.cpp
================================================
/*
Copyright (c) 2012, The Mineserver Project
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of the The Mineserver Project nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <cmath>
#include <cstdlib>
#include "mineserver.h"
#include "plugin.h"
#include "map.h"
#include "basic.h"
#include "protocol.h"
bool BlockBasic::isBlockStackable(const uint8_t block)
{
/* Check block below allows blocks placed on top */
switch (block)
{
case BLOCK_WORKBENCH:
case BLOCK_CHEST:
case BLOCK_JUKEBOX:
case BLOCK_TORCH:
case BLOCK_REDSTONE_TORCH_OFF:
case BLOCK_REDSTONE_TORCH_ON:
case BLOCK_REDSTONE_WIRE:
case BLOCK_WATER:
case BLOCK_STATIONARY_WATER:
case BLOCK_LAVA:
case BLOCK_STATIONARY_LAVA:
case BLOCK_AIR:
case BLOCK_MINECART_TRACKS:
case BLOCK_WOODEN_DOOR:
case BLOCK_IRON_DOOR:
case BLOCK_ICE:
case BLOCK_CAKE:
case BLOCK_BED:
case BLOCK_LEVER:
case BLOCK_STONE_BUTTON:
case BLOCK_STONE_PRESSURE_PLATE:
return false;
break;
default:
break;
}
return true;
}
bool BlockBasic::isUserOnBlock(const int32_t x, const int16_t y, const int32_t z, const int map)
{
/* TODO: Get Users by chunk rather than whole list */
for (std::set<User*>::iterator it = ServerInstance->users().begin(); it !=
gitextract_4q_cqrt4/
├── .gitignore
├── CMakeLists.txt
├── CMakeModules/
│ ├── FindEvent.cmake
│ ├── FindNoise.cmake
│ └── toolchain-i686-w64-mingw32.cmake
├── Dockerfile
├── LICENSE
├── README.md
├── files/
│ ├── CMakeLists.txt
│ ├── ENABLED_RECIPES.cfg
│ ├── banned.txt
│ ├── commands.cfg
│ ├── config.cfg
│ ├── item_alias.cfg
│ ├── motd.txt
│ ├── permissions.txt
│ ├── recipes/
│ │ ├── armour/
│ │ │ ├── boots_chain.recipe
│ │ │ ├── boots_diamond.recipe
│ │ │ ├── boots_gold.recipe
│ │ │ ├── boots_iron.recipe
│ │ │ ├── boots_leather.recipe
│ │ │ ├── chestplate_chain.recipe
│ │ │ ├── chestplate_diamond.recipe
│ │ │ ├── chestplate_gold.recipe
│ │ │ ├── chestplate_iron.recipe
│ │ │ ├── chestplate_leather.recipe
│ │ │ ├── helmet_chain.recipe
│ │ │ ├── helmet_diamond.recipe
│ │ │ ├── helmet_gold.recipe
│ │ │ ├── helmet_iron.recipe
│ │ │ ├── helmet_leather.recipe
│ │ │ ├── legging_chain.recipe
│ │ │ ├── legging_diamond.recipe
│ │ │ ├── legging_gold.recipe
│ │ │ ├── legging_iron.recipe
│ │ │ └── legging_leather.recipe
│ │ ├── block/
│ │ │ ├── sand_hslab.recipe
│ │ │ ├── smooth_hslab.recipe
│ │ │ ├── stone_hslab.recipe
│ │ │ └── wood_hslab.recipe
│ │ ├── cloth/
│ │ │ ├── black.recipe
│ │ │ ├── blue.recipe
│ │ │ ├── brown.recipe
│ │ │ ├── cyan.recipe
│ │ │ ├── darkgreen.recipe
│ │ │ ├── grey.recipe
│ │ │ ├── lightblue.recipe
│ │ │ ├── lightgreen.recipe
│ │ │ ├── lightgrey.recipe
│ │ │ ├── magenta.recipe
│ │ │ ├── orange.recipe
│ │ │ ├── pink.recipe
│ │ │ ├── purple.recipe
│ │ │ ├── red.recipe
│ │ │ ├── white.recipe
│ │ │ └── yellow.recipe
│ │ ├── dyes/
│ │ │ ├── cyan.recipe
│ │ │ ├── grey.recipe
│ │ │ ├── lightblue.recipe
│ │ │ ├── lightgrey.recipe
│ │ │ ├── lime.recipe
│ │ │ ├── magenta.recipe
│ │ │ ├── orange.recipe
│ │ │ ├── pink.recipe
│ │ │ ├── purple.recipe
│ │ │ ├── red.recipe
│ │ │ ├── white.recipe
│ │ │ └── yellow.recipe
│ │ ├── food/
│ │ │ ├── apple_golden.recipe
│ │ │ ├── bowls.recipe
│ │ │ ├── bread.recipe
│ │ │ ├── cake.recipe
│ │ │ ├── mushroomstew.recipe
│ │ │ └── sugar.recipe
│ │ ├── materials/
│ │ │ ├── block_brick.recipe
│ │ │ ├── block_clay.recipe
│ │ │ ├── block_diamond.recipe
│ │ │ ├── block_glowstone.recipe
│ │ │ ├── block_gold.recipe
│ │ │ ├── block_iron.recipe
│ │ │ ├── block_sandstone.recipe
│ │ │ ├── block_snow.recipe
│ │ │ ├── block_wool.recipe
│ │ │ ├── clay.recipe
│ │ │ ├── ingots_diamond.recipe
│ │ │ ├── ingots_gold.recipe
│ │ │ ├── ingots_iron.recipe
│ │ │ ├── sticks.recipe
│ │ │ ├── tnt.recipe
│ │ │ ├── wood_planks_acacia.recipe
│ │ │ ├── wood_planks_birch.recipe
│ │ │ ├── wood_planks_dark_oak.recipe
│ │ │ ├── wood_planks_jungle.recipe
│ │ │ ├── wood_planks_oak.recipe
│ │ │ └── wood_planks_spruce.recipe
│ │ ├── mechanism/
│ │ │ ├── button_stone.recipe
│ │ │ ├── dispenser.recipe
│ │ │ ├── door_iron.recipe
│ │ │ ├── door_wood.recipe
│ │ │ ├── lever.recipe
│ │ │ ├── note_block.recipe
│ │ │ ├── pressure_stone.recipe
│ │ │ ├── pressure_wood.recipe
│ │ │ └── torch_redstone.recipe
│ │ ├── misc/
│ │ │ ├── bed.recipe
│ │ │ ├── book.recipe
│ │ │ ├── bookshelf.recipe
│ │ │ ├── chest.recipe
│ │ │ ├── fence_acacia.recipe
│ │ │ ├── fence_birch.recipe
│ │ │ ├── fence_dark_oak.recipe
│ │ │ ├── fence_jungle.recipe
│ │ │ ├── fence_oak.recipe
│ │ │ ├── fence_spruce.recipe
│ │ │ ├── furnace.recipe
│ │ │ ├── jackolantern.recipe
│ │ │ ├── jukebox.recipe
│ │ │ ├── ladder.recipe
│ │ │ ├── painting.recipe
│ │ │ ├── paper.recipe
│ │ │ ├── sign.recipe
│ │ │ ├── stairs_stone.recipe
│ │ │ ├── stairs_wood.recipe
│ │ │ ├── torch.recipe
│ │ │ └── workbench.recipe
│ │ ├── tools/
│ │ │ ├── axe_diamond.recipe
│ │ │ ├── axe_gold.recipe
│ │ │ ├── axe_iron.recipe
│ │ │ ├── axe_stone.recipe
│ │ │ ├── axe_wood.recipe
│ │ │ ├── bucket.recipe
│ │ │ ├── clock.recipe
│ │ │ ├── compass.recipe
│ │ │ ├── fishingrod.recipe
│ │ │ ├── flintsteel.recipe
│ │ │ ├── hoe_diamond.recipe
│ │ │ ├── hoe_gold.recipe
│ │ │ ├── hoe_iron.recipe
│ │ │ ├── hoe_stone.recipe
│ │ │ ├── hoe_wood.recipe
│ │ │ ├── pickaxe_diamond.recipe
│ │ │ ├── pickaxe_gold.recipe
│ │ │ ├── pickaxe_iron.recipe
│ │ │ ├── pickaxe_stone.recipe
│ │ │ ├── pickaxe_wood.recipe
│ │ │ ├── shears.recipe
│ │ │ ├── shovel_diamond.recipe
│ │ │ ├── shovel_gold.recipe
│ │ │ ├── shovel_iron.recipe
│ │ │ ├── shovel_stone.recipe
│ │ │ └── shovel_wood.recipe
│ │ ├── transport/
│ │ │ ├── boat.recipe
│ │ │ ├── minecart.recipe
│ │ │ ├── minecart_powered.recipe
│ │ │ ├── minecart_storage.recipe
│ │ │ └── minecart_tracks.recipe
│ │ ├── weapons/
│ │ │ ├── arrows.recipe
│ │ │ ├── bow.recipe
│ │ │ ├── sword_diamond.recipe
│ │ │ ├── sword_gold.recipe
│ │ │ ├── sword_iron.recipe
│ │ │ ├── sword_stone.recipe
│ │ │ └── sword_wood.recipe
│ │ └── white.recipe
│ ├── roles.txt
│ ├── rules.txt
│ ├── test.lua
│ └── whitelist.txt
├── init.d/
│ └── mineserver.centos
├── plugins/
│ ├── CMakeLists.txt
│ ├── binlog/
│ │ ├── binlog.cfg
│ │ ├── binlog.cpp
│ │ ├── binlog.h
│ │ └── binlogdump.cpp
│ ├── commands/
│ │ ├── commands.cpp
│ │ └── commands.h
│ ├── crapMobs/
│ │ ├── crapMobs.cpp
│ │ └── crapMobs.h
│ ├── cursesui/
│ │ ├── screen.cpp
│ │ └── screen.h
│ ├── filelog/
│ │ └── filelog.cpp
│ ├── flatpermissions/
│ │ └── flatpermissions.cpp
│ ├── luascript/
│ │ ├── luascript.cpp
│ │ ├── luawrapper.cpp
│ │ └── luawrapper.h
│ ├── nBreak/
│ │ ├── nBreak.cpp
│ │ └── nBreak.h
│ ├── nether/
│ │ ├── nether.cpp
│ │ └── nether.h
│ └── passiveMobs/
│ ├── passiveMobs.cpp
│ └── passiveMobs.h
├── src/
│ ├── CMakeLists.txt
│ ├── SystemExceptions.h
│ ├── blocks/
│ │ ├── basic.cpp
│ │ ├── basic.h
│ │ ├── bed.cpp
│ │ ├── bed.h
│ │ ├── blockbrewingstand.cpp
│ │ ├── blockbrewingstand.h
│ │ ├── blockfurnace.cpp
│ │ ├── blockfurnace.h
│ │ ├── cake.cpp
│ │ ├── cake.h
│ │ ├── chest.cpp
│ │ ├── chest.h
│ │ ├── default.cpp
│ │ ├── default.h
│ │ ├── door.cpp
│ │ ├── door.h
│ │ ├── falling.cpp
│ │ ├── falling.h
│ │ ├── fire.cpp
│ │ ├── fire.h
│ │ ├── ice.cpp
│ │ ├── ice.h
│ │ ├── jackolantern.cpp
│ │ ├── jackolantern.h
│ │ ├── ladder.cpp
│ │ ├── ladder.h
│ │ ├── leaves.cpp
│ │ ├── leaves.h
│ │ ├── liquid.cpp
│ │ ├── liquid.h
│ │ ├── note.cpp
│ │ ├── note.h
│ │ ├── planks.cpp
│ │ ├── planks.h
│ │ ├── plant.cpp
│ │ ├── plant.h
│ │ ├── pumpkin.cpp
│ │ ├── pumpkin.h
│ │ ├── redstone.cpp
│ │ ├── redstone.h
│ │ ├── redstoneutil.cpp
│ │ ├── redstoneutil.h
│ │ ├── sign.cpp
│ │ ├── sign.h
│ │ ├── snow.cpp
│ │ ├── snow.h
│ │ ├── stair.cpp
│ │ ├── stair.h
│ │ ├── step.cpp
│ │ ├── step.h
│ │ ├── tnt.cpp
│ │ ├── tnt.h
│ │ ├── torch.cpp
│ │ ├── torch.h
│ │ ├── tracks.cpp
│ │ ├── tracks.h
│ │ ├── wood.cpp
│ │ ├── wood.h
│ │ ├── wool.cpp
│ │ ├── wool.h
│ │ ├── workbench.cpp
│ │ └── workbench.h
│ ├── chat.cpp
│ ├── chat.h
│ ├── chunkmap.h
│ ├── cliScreen.cpp
│ ├── cliScreen.h
│ ├── config/
│ │ ├── lexer.cpp
│ │ ├── lexer.h
│ │ ├── node.cpp
│ │ ├── node.h
│ │ ├── parser.cpp
│ │ ├── parser.h
│ │ ├── scanner.cpp
│ │ └── scanner.h
│ ├── config.h
│ ├── configure.h.in
│ ├── constants.cpp
│ ├── constants.h
│ ├── constants_num.h
│ ├── extern.h
│ ├── fastset.h
│ ├── furnace.cpp
│ ├── furnace.h
│ ├── furnaceManager.cpp
│ ├── furnaceManager.h
│ ├── inventory/
│ │ ├── inventoryBasic.cpp
│ │ ├── inventoryBrewingstand.cpp
│ │ ├── inventoryBrewingstand.h
│ │ ├── inventoryChest.cpp
│ │ ├── inventoryChest.h
│ │ ├── inventoryFurnace.cpp
│ │ ├── inventoryFurnace.h
│ │ ├── inventoryPlayer.cpp
│ │ ├── inventoryPlayer.h
│ │ ├── inventoryWorkbench.cpp
│ │ ├── inventoryWorkbench.h
│ │ └── inventorybasic.h
│ ├── inventory.cpp
│ ├── inventory.h
│ ├── items/
│ │ ├── food.cpp
│ │ ├── food.h
│ │ ├── itembasic.cpp
│ │ ├── itembasic.h
│ │ ├── projectile.cpp
│ │ └── projectile.h
│ ├── json.cpp
│ ├── json.h
│ ├── lighting.cpp
│ ├── lighting.h
│ ├── logger.cpp
│ ├── logger.h
│ ├── logtype.h
│ ├── map.cpp
│ ├── map.h
│ ├── mcregion.cpp
│ ├── mcregion.h
│ ├── metadata.cpp
│ ├── metadata.h
│ ├── mineserver.cpp
│ ├── mineserver.h
│ ├── mineserver.pro
│ ├── mob.cpp
│ ├── mob.h
│ ├── nbt.cpp
│ ├── nbt.h
│ ├── packets.cpp
│ ├── packets.h
│ ├── permissions.h
│ ├── physics.cpp
│ ├── physics.h
│ ├── plugin.cpp
│ ├── plugin.h
│ ├── plugin_api.cpp
│ ├── plugin_api.h
│ ├── plugins/
│ │ ├── PyScript/
│ │ │ ├── .gitignore
│ │ │ ├── MineServer.i
│ │ │ ├── PyScript.cpp
│ │ │ ├── PyScript.h
│ │ │ ├── makefile
│ │ │ ├── python/
│ │ │ │ └── TriggTest.py
│ │ │ ├── python_plugin_api.cpp
│ │ │ └── python_plugin_api.h
│ │ ├── banlist/
│ │ │ ├── banlist.cpp.unused
│ │ │ └── banlist.h
│ │ └── command/
│ │ ├── command.cpp.unused
│ │ └── command.h
│ ├── protocol.cpp
│ ├── protocol.h
│ ├── random.cpp
│ ├── random.h
│ ├── redstoneSimulation.cpp
│ ├── redstoneSimulation.h
│ ├── screenBase.cpp
│ ├── screenBase.h
│ ├── signalhandler.cpp
│ ├── signalhandler.h
│ ├── sockets.cpp
│ ├── sockets.h
│ ├── stdtime.h
│ ├── threadpool.cpp
│ ├── threadpool.h
│ ├── tools.cpp
│ ├── tools.h
│ ├── tree.cpp
│ ├── tree.h
│ ├── user.cpp
│ ├── user.h
│ ├── utf8.h
│ ├── vec.h
│ └── worldgen/
│ ├── biomegen.cpp
│ ├── biomegen.h
│ ├── cavegen.cpp
│ ├── cavegen.h
│ ├── eximgen.cpp
│ ├── eximgen.h
│ ├── heavengen.cpp
│ ├── heavengen.h
│ ├── mapgen.cpp
│ ├── mapgen.h
│ ├── nethergen.cpp
│ └── nethergen.h
└── win32/
├── mineserver.vcxproj
├── mineserver.vcxproj.filters
├── mineserver_VS2013.sln
└── plugins/
├── plugin_commands.vcxproj
├── plugin_filelog.vcxproj
├── plugin_flatpermissions.vcxproj
├── plugin_luascript.vcxproj
└── plugin_passivemobs.vcxproj
SYMBOL INDEX (609 symbols across 134 files)
FILE: plugins/binlog/binlog.cpp
function Binlog (line 51) | Binlog &Binlog::get(std::string filename)
function rollBack (line 152) | void rollBack (const char* user, int argc, const char** args)
function playBack (line 185) | void playBack (const char* user, int argc, const char** args)
function callbackBlockBreakPre (line 219) | bool callbackBlockBreakPre (const char* user,int x,int y,int z)
function translateDirection (line 235) | bool translateDirection(int32_t *x, int8_t *y, int32_t *z, int8_t direct...
function callbackBlockPlacePre (line 251) | bool callbackBlockPlacePre (const char* user,int32_t x,int8_t y,int32_t ...
function callbackPlayerChatCommand (line 270) | bool callbackPlayerChatCommand (const char* user, const char* command, i...
function dtos (line 282) | std::string dtos( double n )
function PLUGIN_API_EXPORT (line 290) | PLUGIN_API_EXPORT void CALLCONVERSION binlog_init(mineserver_pointer_str...
function PLUGIN_API_EXPORT (line 313) | PLUGIN_API_EXPORT void CALLCONVERSION binlog_shutdown(void)
FILE: plugins/binlog/binlog.h
type event_t (line 43) | struct event_t {
function class (line 54) | class Binlog
FILE: plugins/binlog/binlogdump.cpp
function main (line 37) | int main (int argc, const char* argv[] )
FILE: plugins/commands/commands.cpp
function _atoi (line 47) | int _atoi(const std::string& str, bool* ok = 0){
type cuboidStruct (line 63) | struct cuboidStruct
function dtos (line 78) | std::string dtos(double n)
type Command (line 87) | struct Command
method Command (line 89) | Command(std::deque<std::string> _names, std::string _arguments, std::s...
function registerCommand (line 112) | void registerCommand(ComPtr command)
function chatCommandFunction (line 125) | bool chatCommandFunction(const char* userIn,const char* cmdIn, int argc,...
function isValidItem (line 175) | bool isValidItem(int id)
function roundUpTo (line 200) | int roundUpTo(int x, int nearest)
function giveItemsName (line 205) | void giveItemsName(std::string userIn, int id, int count, int health)
function giveItems (line 236) | void giveItems(std::string userIn, std::string command, std::deque<std::...
function giveItemsSelf (line 267) | void giveItemsSelf(std::string user, std::string command, std::deque<std...
function home (line 298) | void home(std::string user, std::string command, std::deque<std::string>...
function setSpawn (line 306) | void setSpawn(std::string user, std::string command, std::deque<std::str...
function userWorld (line 318) | void userWorld(std::string user, std::string command, std::deque<std::st...
function coordinateTeleport (line 330) | void coordinateTeleport(std::string user, std::string command, std::dequ...
function userTeleport (line 345) | void userTeleport(std::string user, std::string command, std::deque<std:...
function replace (line 385) | void replace(std::string user, std::string command, std::deque<std::stri...
function replacechunk (line 434) | void replacechunk(std::string user, std::string command, std::deque<std:...
function flattenchunk (line 493) | void flattenchunk(std::string user, std::string command, std::deque<std:...
function cuboid (line 546) | void cuboid(std::string user, std::string command, std::deque<std::strin...
function playerList (line 558) | void playerList(std::string user, std::string command, std::deque<std::s...
function saveMap (line 563) | void saveMap(std::string user, std::string command, std::deque<std::stri...
function setTime (line 569) | void setTime(std::string user, std::string command, std::deque<std::stri...
function getTime (line 607) | void getTime(std::string user, std::string command, std::deque<std::stri...
function translateDirection (line 613) | bool translateDirection(int32_t *x, int8_t *y, int32_t *z, int8_t direct...
function startedDiggingFunction (line 629) | bool startedDiggingFunction(const char* userIn, int32_t x,int8_t y,int32...
function blockPlacePreFunction (line 694) | bool blockPlacePreFunction(const char* userIn, int32_t x,int8_t y,int32_...
function doNotDisturb (line 753) | void doNotDisturb(std::string user, std::string command, std::deque<std:...
function gps (line 758) | void gps(std::string user, std::string command, std::deque<std::string> ...
function banUser (line 767) | void banUser(std::string user, std::string command, std::deque<std::stri...
function unbanUser (line 772) | void unbanUser(std::string user, std::string command, std::deque<std::st...
function sendRules (line 777) | void sendRules(std::string user, std::string command, std::deque<std::st...
function about (line 791) | void about(std::string user, std::string command, std::deque<std::string...
function sendHelp (line 800) | void sendHelp(std::string user, std::string command, std::deque<std::str...
function sendMOTD (line 877) | void sendMOTD(std::string user, std::string command, std::deque<std::str...
function changeGameMode (line 892) | void changeGameMode(std::string user, std::string command, std::deque<st...
function PLUGIN_API_EXPORT (line 925) | PLUGIN_API_EXPORT void CALLCONVERSION commands_init(mineserver_pointer_s...
function PLUGIN_API_EXPORT (line 969) | PLUGIN_API_EXPORT void CALLCONVERSION commands_shutdown(void)
function parseCmd (line 979) | std::deque<std::string> parseCmd(std::string cmd)
FILE: plugins/crapMobs/crapMobs.cpp
function setBlock (line 58) | void setBlock(const char* name,int x,int y,int z,unsigned char id)
function getBlock (line 65) | int getBlock(const char* name,int x,int y,int z)
function timer200Function (line 77) | void timer200Function()
function PLUGIN_API_EXPORT (line 95) | PLUGIN_API_EXPORT void CALLCONVERSION crapMobs_init(mineserver_pointer_s...
function PLUGIN_API_EXPORT (line 116) | PLUGIN_API_EXPORT void CALLCONVERSION command_shutdown(void)
FILE: plugins/cursesui/screen.cpp
function currentTimestamp (line 58) | std::string currentTimestamp(bool seconds)
function WINDOW (line 338) | WINDOW* CursesScreen::createWindow(int width, int height, int startx, in...
function logPost (line 490) | bool logPost(int type, const char* source, const char* message)
function checkForCommand (line 498) | bool checkForCommand()
function on_player_login (line 508) | bool on_player_login(const char *username)
function on_player_quit (line 514) | bool on_player_quit(const char *username)
function PLUGIN_API_EXPORT (line 520) | PLUGIN_API_EXPORT void CALLCONVERSION cursesui_init(mineserver_pointer_s...
function PLUGIN_API_EXPORT (line 542) | PLUGIN_API_EXPORT void CALLCONVERSION cursesui_shutdown(void)
FILE: plugins/cursesui/screen.h
function class (line 56) | class CursesScreen
FILE: plugins/filelog/filelog.cpp
function filelog_config_boolean (line 91) | bool filelog_config_boolean(const char* key, bool defaultValue)
function chatPost (line 109) | bool chatPost(const char* name, time_t time, const char* message)
function logPost (line 120) | bool logPost(int type, const char* source, const char* message)
function PLUGIN_API_EXPORT (line 138) | PLUGIN_API_EXPORT void CALLCONVERSION filelog_init(mineserver_pointer_st...
function PLUGIN_API_EXPORT (line 187) | PLUGIN_API_EXPORT void CALLCONVERSION filelog_shutdown(void)
FILE: plugins/flatpermissions/flatpermissions.cpp
function dtos (line 48) | std::string dtos(double n)
function loginPost (line 55) | void loginPost(const char* userIn){
function PLUGIN_API_EXPORT (line 99) | PLUGIN_API_EXPORT void CALLCONVENSION flatpermissions_shutdown(void)
function PLUGIN_API_EXPORT (line 108) | PLUGIN_API_EXPORT void CALLCONVENSION flatpermissions_init(mineserver_po...
FILE: plugins/luascript/luascript.cpp
type LuaScript (line 47) | struct LuaScript
function dtos (line 66) | std::string dtos(double n)
type Command (line 75) | struct Command
method Command (line 77) | Command(std::deque<std::string> _names, std::string _arguments, std::s...
function registerCommand (line 93) | void registerCommand(ComPtr command)
function chatCommandFunction (line 106) | bool chatCommandFunction(const char* userIn,const char* cmdIn, int argc,...
function startedDiggingFunction (line 128) | bool startedDiggingFunction(const char* userIn, int32_t x,int8_t y,int32...
function translateDirection (line 139) | bool translateDirection(int32_t *x, int8_t *y, int32_t *z, int8_t direct...
function blockPlacePreFunction (line 154) | bool blockPlacePreFunction(const char* userIn, int32_t x,int8_t y,int32_...
function sendHelp (line 162) | void sendHelp(std::string user, std::string command, std::deque<std::str...
function lua_calltest (line 200) | int lua_calltest(lua_State *pL)
function registerLuaFunctions (line 219) | void registerLuaFunctions(lua_State *pL)
function luaLoad (line 224) | void luaLoad(std::string user, std::string command, std::deque<std::stri...
function luaUnload (line 262) | void luaUnload(std::string user, std::string command, std::deque<std::st...
function luaStatus (line 293) | void luaStatus(std::string user, std::string command, std::deque<std::st...
function timer200Function (line 298) | void timer200Function()
function PLUGIN_API_EXPORT (line 312) | PLUGIN_API_EXPORT void CALLCONVERSION luascript_init(mineserver_pointer_...
function PLUGIN_API_EXPORT (line 338) | PLUGIN_API_EXPORT void CALLCONVERSION commands_shutdown(void)
function parseCmd (line 348) | std::deque<std::string> parseCmd(std::string cmd)
FILE: plugins/nBreak/nBreak.cpp
function setBlock (line 54) | void setBlock(const char* name,int x,int y,int z,unsigned char id)
function getBlock (line 61) | int getBlock(const char* name,int x,int y,int z)
function blockBreakPreFunction (line 73) | bool blockBreakPreFunction(const char* userIn, int32_t x, int32_t y, int...
function PLUGIN_API_EXPORT (line 133) | PLUGIN_API_EXPORT void CALLCONVERSION nBreak_init(mineserver_pointer_str...
function PLUGIN_API_EXPORT (line 151) | PLUGIN_API_EXPORT void CALLCONVERSION command_shutdown(void)
FILE: plugins/nether/nether.cpp
class block (line 53) | class block
method block (line 58) | block(const char* n, int xx, int yy, int zz){
function dtos (line 69) | std::string dtos(double n)
function setBlock (line 76) | void setBlock(const char* name,int x,int y,int z,unsigned char id)
function getBlock (line 83) | int getBlock(const char* name,int x,int y,int z)
function addToDo (line 95) | void addToDo(const char* user, int x, int y, int z){
function doPortalFromFrame (line 114) | void doPortalFromFrame(const char* user, int x,int y, int z)
function doPortal (line 185) | void doPortal(const char* user,int x,int y, int z)
function blockPlacePreFunction (line 203) | bool blockPlacePreFunction(const char* userIn, int32_t x, int32_t y, int...
function timer200Function (line 216) | void timer200Function()
function PLUGIN_API_EXPORT (line 252) | PLUGIN_API_EXPORT void CALLCONVERSION nether_init(mineserver_pointer_str...
function PLUGIN_API_EXPORT (line 271) | PLUGIN_API_EXPORT void CALLCONVERSION command_shutdown(void)
FILE: plugins/passiveMobs/passiveMobs.cpp
function dtos (line 59) | std::string dtos(double n)
class MyPetMob (line 70) | class MyPetMob
method MyPetMob (line 77) | explicit MyPetMob(int ID, double velocity = 0) : ID(ID), deSpawn(0), v...
function topBlockSuitable (line 87) | int topBlockSuitable(int x, int z, int w)
function canStepIn (line 103) | bool canStepIn(int type)
function moveSuitable (line 114) | bool moveSuitable(double* x, double* y, double* z, int w)
function fallMob (line 121) | void fallMob(double* x, double* y, double* z, int w)
function defaultHealth (line 135) | int defaultHealth(int mob)
function defaultDamage (line 150) | int defaultDamage(int item)
function spawn (line 168) | void spawn()
function timer200Function (line 205) | void timer200Function()
function drop (line 361) | void drop(int mobID)
function gotAttacked (line 390) | void gotAttacked(const char* userIn,int mobID)
function interact (line 421) | void interact(const char* userIn,int mobID)
function PLUGIN_API_EXPORT (line 463) | PLUGIN_API_EXPORT void CALLCONVERSION passiveMobs_init(mineserver_pointe...
function PLUGIN_API_EXPORT (line 487) | PLUGIN_API_EXPORT void CALLCONVERSION passiveMobs_shutdown(void)
FILE: src/SystemExceptions.h
function class (line 33) | class CoreException : public std::exception
FILE: src/blocks/basic.h
function class (line 42) | class BlockBasic
FILE: src/blocks/bed.h
function class (line 35) | class BlockBed : public BlockBasic
FILE: src/blocks/blockbrewingstand.h
function class (line 38) | class BlockBrewingStand : public BlockBasic
FILE: src/blocks/blockfurnace.h
function class (line 39) | class BlockFurnace : public BlockBasic
FILE: src/blocks/cake.h
function class (line 37) | class BlockCake: public BlockBasic
FILE: src/blocks/chest.h
function class (line 39) | class BlockChest : public BlockBasic
FILE: src/blocks/default.h
function class (line 37) | class BlockDefault: public BlockBasic
FILE: src/blocks/door.h
function class (line 38) | class BlockDoor : public BlockBasic
FILE: src/blocks/falling.cpp
function printfify (line 45) | std::string printfify(const char *fmt, ...)
FILE: src/blocks/falling.h
function class (line 40) | class BlockFalling: public BlockBasic
FILE: src/blocks/fire.h
function class (line 37) | class BlockFire : public BlockBasic
FILE: src/blocks/ice.h
function class (line 38) | class BlockIce : public BlockBasic
FILE: src/blocks/jackolantern.h
function class (line 35) | class Blockjackolantern: public BlockBasic
FILE: src/blocks/ladder.h
function class (line 34) | class BlockLadder: public BlockBasic
FILE: src/blocks/leaves.cpp
function decayIt (line 68) | inline void decayIt(const Decay & decaying)
FILE: src/blocks/leaves.h
type Decay (line 36) | struct Decay
function class (line 61) | class BlockLeaves : public BlockBasic
FILE: src/blocks/liquid.h
function class (line 38) | class BlockLiquid: public BlockBasic
FILE: src/blocks/note.h
function class (line 38) | class BlockNote : public BlockBasic
FILE: src/blocks/planks.h
function class (line 33) | class BlockPlanks: public BlockBasic
FILE: src/blocks/plant.h
function class (line 42) | class PlantBlock
type std (line 49) | typedef std::shared_ptr<PlantBlock> PlantBlockPtr;
type PlantBlockFinder (line 51) | struct PlantBlockFinder
function class (line 61) | class BlockPlant: public BlockBasic
FILE: src/blocks/pumpkin.h
function class (line 35) | class BlockPumpkin: public BlockBasic
FILE: src/blocks/redstone.h
function class (line 37) | class BlockRedstone: public BlockBasic
FILE: src/blocks/redstoneutil.h
function class (line 38) | class BlockRedstoneUtil : public BlockBasic
FILE: src/blocks/sign.h
function class (line 37) | class BlockSign: public BlockBasic
FILE: src/blocks/snow.h
function class (line 37) | class BlockSnow: public BlockBasic
FILE: src/blocks/stair.h
function class (line 37) | class BlockStair: public BlockBasic
FILE: src/blocks/step.h
function class (line 35) | class BlockStep: public BlockBasic
FILE: src/blocks/tnt.h
function class (line 34) | class BlockTNT : public BlockBasic
FILE: src/blocks/torch.h
function class (line 37) | class BlockTorch: public BlockBasic
FILE: src/blocks/tracks.h
type TrackData (line 34) | struct TrackData
function class (line 44) | class BlockTracks: public BlockBasic
FILE: src/blocks/wood.h
function class (line 37) | class BlockWood: public BlockBasic
FILE: src/blocks/wool.h
function class (line 37) | class BlockWool: public BlockBasic
FILE: src/blocks/workbench.h
function class (line 39) | class BlockWorkbench : public BlockBasic
FILE: src/chat.cpp
type tm (line 124) | struct tm
FILE: src/chat.h
function class (line 36) | class Chat
FILE: src/chunkmap.h
function clearConnection (line 45) | struct spawnedItem
function large (line 95) | bool large() { return connected_chest.get() != nullptr; }
function connection_checked (line 99) | connection_checked(false)
function size (line 109) | size_t size()
function ItemVectorPtr (line 114) | ItemVectorPtr items() { return m_items; }
function items (line 115) | void items(ItemVectorPtr itemVectorPtr)
type signData (line 132) | struct signData
type furnaceData (line 143) | struct furnaceData
type std (line 166) | typedef std::shared_ptr<signData> signDataPtr;
type std (line 167) | typedef std::shared_ptr<furnaceData> furnaceDataPtr;
function userBoundary (line 173) | struct sChunk
function hash_combine (line 294) | void hash_combine(std::size_t & seed, T const & v)
type std (line 312) | typedef std::pair<int, int> Coords;
type std (line 313) | typedef std::unordered_map<Coords, sChunk*, PairHash<int, int> > ChunkMap;
FILE: src/cliScreen.cpp
function DWORD (line 46) | DWORD WINAPI CliScreen::_stdinThreadProc(LPVOID lpParameter)
function DWORD (line 51) | DWORD WINAPI CliScreen::stdinThreadProc()
FILE: src/cliScreen.h
function class (line 41) | class CliScreen : public Screen
FILE: src/config.h
function class (line 40) | class Config
FILE: src/config/lexer.h
function class (line 57) | class ConfigLexer
FILE: src/config/node.h
function class (line 45) | class ConfigNode
FILE: src/config/parser.h
function class (line 44) | class ConfigParser
FILE: src/config/scanner.h
function class (line 33) | class ConfigScanner
FILE: src/constants.cpp
function initConstants (line 55) | void initConstants()
FILE: src/constants.h
type Drop (line 46) | struct Drop
type std (line 47) | typedef std::shared_ptr<Drop> DropPtr;
type Drop (line 49) | struct Drop
FILE: src/constants_num.h
type Direction (line 85) | enum Direction
type Block (line 91) | enum Block
type Dye (line 187) | enum Dye
FILE: src/fastset.h
function typename (line 20) | typename VectorT::const_iterator find(const T& t) const{
function contains (line 27) | bool contains(const T& t) const{
FILE: src/furnace.cpp
function readConfig (line 306) | void readConfig()
FILE: src/furnace.h
function class (line 38) | class Creation
function class (line 52) | class Furnace
FILE: src/furnaceManager.cpp
function removeFurnace (line 85) | void removeFurnace(furnaceDataPtr data)
type FurnaceDataFinder (line 90) | struct FurnaceDataFinder
method FurnaceDataFinder (line 92) | FurnaceDataFinder(furnaceDataPtr d) : data(d) { }
FILE: src/furnaceManager.h
type std (line 39) | typedef std::shared_ptr<Furnace> FurnacePtr;
function class (line 41) | class FurnaceManager
FILE: src/inventory.h
function isEnchantable (line 46) | static bool isEnchantable(int16_t type)
function NBT_Value (line 60) | inline NBT_Value* getData() const { return data; }
type std (line 108) | typedef std::shared_ptr<Item> ItemPtr;
type OpenInventory (line 110) | struct OpenInventory
type std (line 123) | typedef std::shared_ptr<OpenInventory> OpenInvPtr;
function class (line 152) | class Inventory
FILE: src/inventory/inventoryBrewingstand.h
function class (line 41) | class InventoryBrewingstand : public InventoryBasic
FILE: src/inventory/inventoryChest.h
function class (line 41) | class InventoryChest : public InventoryBasic
FILE: src/inventory/inventoryFurnace.h
function class (line 41) | class InventoryFurnace : public InventoryBasic
FILE: src/inventory/inventoryPlayer.h
function class (line 42) | class InventoryPlayer : public InventoryBasic
FILE: src/inventory/inventoryWorkbench.h
function class (line 41) | class InventoryWorkbench : public InventoryBasic
FILE: src/inventory/inventorybasic.h
function class (line 40) | class InventoryBasic
FILE: src/items/food.h
function class (line 38) | class ItemFood: public ItemBasic
FILE: src/items/itembasic.h
function class (line 43) | class ItemBasic
FILE: src/items/projectile.h
function class (line 38) | class ItemProjectile: public ItemBasic
FILE: src/json.h
function class (line 37) | class JSON_Val
function JSON_type (line 139) | JSON_type getType() {
function setName (line 155) | void setName(std::string str) {
FILE: src/lighting.h
type lightInfo (line 36) | struct lightInfo
function class (line 62) | class Lighting
FILE: src/logger.h
function class (line 55) | class Logger
FILE: src/logtype.h
function namespace (line 37) | namespace LogType
FILE: src/map.cpp
type stat (line 243) | struct stat
function sChunk (line 352) | sChunk* Map::getMapData(int x, int z, bool generate)
function sChunk (line 1238) | sChunk* Map::loadMap(int x, int z, bool generate)
type stat (line 1626) | struct stat
FILE: src/map.h
type sTree (line 38) | struct sTree
function class (line 66) | class Map
FILE: src/mcregion.cpp
type stat (line 106) | struct stat
function getdir (line 422) | int getdir(std::string dir, std::vector<std::string> &files)
function isMapDir (line 469) | bool isMapDir(std::string filename)
function convertMap (line 495) | bool convertMap(std::string mapDir)
FILE: src/mcregion.h
function class (line 36) | class RegionFile
FILE: src/metadata.cpp
function Packet (line 69) | Packet& operator<<(Packet& p, const MetaData& m)
function MetaDataElemPtr (line 92) | MetaDataElemPtr MetaData::get(int8_t idx)
FILE: src/metadata.h
function class (line 36) | class MetaDataElem
function class (line 43) | class MetaDataElemByte : public MetaDataElem
function class (line 51) | class MetaDataElemShort : public MetaDataElem
function class (line 59) | class MetaDataElemSlot : public MetaDataElem
type std (line 67) | typedef std::shared_ptr<MetaDataElem> MetaDataElemPtr;
function class (line 70) | class MetaData
FILE: src/mineserver.cpp
function setnonblock (line 86) | int setnonblock(int fd)
function removeChar (line 104) | std::string removeChar(std::string str, const char* c)
function printHelp (line 116) | int printHelp(int code)
function main (line 135) | int main(int argc, char* argv[])
function event_base (line 577) | event_base* Mineserver::getEventBase()
function timer200ms (line 609) | void timer200ms(int fd, short event, void *arg) {
function timer1000ms (line 617) | void timer1000ms(int fd, short event, void *arg) {
function timer10s (line 626) | void timer10s(int fd, short event, void *arg) {
type sockaddr_in (line 738) | struct sockaddr_in
type sockaddr (line 764) | struct sockaddr
type hostent (line 787) | struct hostent
type in_addr (line 791) | struct in_addr
function Map (line 1030) | Map* Mineserver::map(size_t n) const
FILE: src/mineserver.h
type event_base (line 69) | struct event_base
function class (line 71) | class Mineserver
function mapCount (line 156) | inline size_t mapCount()
function Chat (line 161) | inline Chat* chat() const
function setChat (line 166) | inline void setChat(Chat* chat)
function Mobs (line 171) | inline Mobs* mobs() const
function Plugin (line 176) | inline Plugin* plugin() const
function setPlugin (line 181) | inline void setPlugin(Plugin* plugin)
function setScreen (line 191) | inline void setScreen(std::shared_ptr<Screen> screen)
function Physics (line 196) | inline Physics* physics(size_t n) const
function RedstoneSimulation (line 201) | inline RedstoneSimulation* redstone(size_t n) const
function setConfig (line 213) | inline void setConfig(std::shared_ptr<Config> config)
function FurnaceManager (line 218) | inline FurnaceManager* furnaceManager() const
function setFurnaceManager (line 223) | inline void setFurnaceManager(FurnaceManager* furnaceManager)
function PacketHandler (line 228) | inline PacketHandler* packetHandler() const
function setPacketHandler (line 233) | inline void setPacketHandler(PacketHandler* packetHandler)
function MapGen (line 238) | inline MapGen* mapGen(size_t n) const
function setLogger (line 249) | inline void setLogger(std::shared_ptr<Logger> logger)
function Inventory (line 254) | inline Inventory* inventory() const
function setInventory (line 260) | inline void setInventory(Inventory* inventory)
function setThreadpool (line 267) | inline void setThreadpool(ThreadPool* threadpool)
function ThreadPool (line 272) | inline ThreadPool* getThreadpool() const
FILE: src/mob.h
function class (line 46) | class Mob
type std (line 79) | typedef std::shared_ptr<Mob> MobPtr;
function class (line 81) | class Mobs
FILE: src/nbt.cpp
function NBT_Value (line 275) | NBT_Value* NBT_Value::operator[](const std::string& index)
function NBT_Value (line 290) | NBT_Value* NBT_Value::operator[](const char* index)
function NBT_Value (line 387) | NBT_Value& NBT_Value::operator =(int8_t val)
function NBT_Value (line 395) | NBT_Value& NBT_Value::operator =(int16_t val)
function NBT_Value (line 403) | NBT_Value& NBT_Value::operator =(int32_t val)
function NBT_Value (line 411) | NBT_Value& NBT_Value::operator =(int64_t val)
function NBT_Value (line 419) | NBT_Value& NBT_Value::operator =(float val)
function NBT_Value (line 427) | NBT_Value& NBT_Value::operator =(double val)
function NBT_Value (line 558) | NBT_Value* NBT_Value::LoadFromFile(const std::string& filename)
function NBT_Value (line 611) | NBT_Value* NBT_Value::LoadFromMemory(uint8_t* buffer, uint32_t len)
FILE: src/nbt.h
function class (line 41) | class NBT_Value
FILE: src/packets.cpp
function Packet (line 1583) | Packet& Packet::operator<<(const std::string& str)
function Packet (line 1589) | Packet& Packet::operator>>(std::string& str)
function Packet (line 1595) | Packet& Packet::operator<<(const MS_VarInt& varint)
function Packet (line 1600) | Packet& Packet::operator>>(MS_VarInt& varint)
function Packet (line 1606) | Packet& Packet::operator<<(const Packet& other)
FILE: src/packets.h
function _htons (line 40) | inline uint16_t _htons(uint16_t x){
function _htonl (line 49) | inline uint32_t _htonl(uint32_t x){
function _htonll (line 60) | inline uint64_t _htonll(uint64_t x){
type VarInt_internal (line 268) | struct VarInt_internal {
function class (line 276) | class Packet
type Packets (line 441) | struct Packets
FILE: src/physics.cpp
function isWaterBlock (line 41) | inline bool isWaterBlock(int id)
function isLavaBlock (line 46) | inline bool isLavaBlock(int id)
function isLiquidBlock (line 51) | inline bool isLiquidBlock(int id)
function mayFallThrough (line 56) | inline bool mayFallThrough(int id)
FILE: src/physics.h
type entity_position (line 36) | struct entity_position
type SimBlock (line 85) | struct SimBlock
type Falling (line 106) | struct Falling
FILE: src/plugin.cpp
type stat (line 211) | struct stat
FILE: src/plugin.h
type std (line 95) | typedef std::shared_ptr<BlockBasic> BlockBasicPtr;
type std (line 96) | typedef std::shared_ptr<ItemBasic> ItemBasicPtr;
type std (line 97) | typedef std::shared_ptr<InventoryBasic> InventoryBasicPtr;
type std (line 114) | typedef std::list<funcPointer> funcListType;
function class (line 116) | class Plugin
FILE: src/plugin_api.cpp
function User (line 60) | User* userFromName(std::string user)
function User (line 72) | User* anyUserFromName(std::string user)
function plugin_hasPluginVersion (line 87) | bool plugin_hasPluginVersion(const char* name)
function plugin_getPluginVersion (line 92) | float plugin_getPluginVersion(const char* name)
function plugin_setPluginVersion (line 97) | void plugin_setPluginVersion(const char* name, float version)
function plugin_remPluginVersion (line 102) | void plugin_remPluginVersion(const char* name)
function plugin_hasPointer (line 107) | bool plugin_hasPointer(const char* name)
function plugin_setPointer (line 117) | void plugin_setPointer(const char* name, void* pointer)
function plugin_remPointer (line 122) | void plugin_remPointer(const char* name)
function plugin_hasHook (line 127) | bool plugin_hasHook(const char* hookID)
function plugin_remHook (line 144) | void plugin_remHook(const char* hookID)
function hook_hasCallback (line 149) | bool hook_hasCallback(const char* hookID, voidF function)
function hook_addCallback (line 162) | void hook_addCallback(const char* hookID, voidF function)
function hook_addIdentifiedCallback (line 167) | void hook_addIdentifiedCallback(const char* hookID, void* identifier, vo...
function hook_remCallback (line 172) | void hook_remCallback(const char* hookID, voidF function)
function hook_doUntilTrue (line 185) | bool hook_doUntilTrue(const char* hookID, ...)
function hook_doUntilFalse (line 196) | bool hook_doUntilFalse(const char* hookID, ...)
function hook_doAll (line 207) | void hook_doAll(const char* hookID, ...)
function logger_log (line 216) | void logger_log(int type, const char* source, const char* message)
function chat_sendmsgTo (line 222) | bool chat_sendmsgTo(const char* user, const char* msg)
function chat_sendmsg (line 245) | bool chat_sendmsg(const char* msg)
function chat_sendUserlist (line 261) | bool chat_sendUserlist(const char* user)
function chat_handleMessage (line 276) | bool chat_handleMessage(const char* username, const char* message)
function map_setTime (line 297) | bool map_setTime(int timeValue)
function map_getTime (line 310) | int map_getTime()
function map_createPickupSpawn (line 315) | void map_createPickupSpawn(int x, int y, int z, int type, int count, int...
function map_getSpawn (line 330) | void map_getSpawn(int* x, int* y, int* z)
function map_setSpawn (line 337) | void map_setSpawn(int x, int y, int z)
function map_getBlock (line 344) | bool map_getBlock(int x, int y, int z, unsigned char* type, unsigned cha...
function map_setBlock (line 349) | bool map_setBlock(int x, int y, int z, unsigned char type, unsigned char...
function map_getBlockW (line 355) | bool map_getBlockW(int x, int y, int z, int w, unsigned char* type, unsi...
function map_setBlockW (line 360) | bool map_setBlockW(int x, int y, int z, int w, unsigned char type, unsig...
function map_saveWholeMap (line 367) | void map_saveWholeMap(void)
function user_toggleDND (line 410) | bool user_toggleDND(const char* user)
function user_getPosition (line 426) | bool user_getPosition(const char* user, double* x, double* y, double* z,...
function user_getPositionW (line 450) | bool user_getPositionW(const char* user, double* x, double* y, double* z...
function user_teleport (line 474) | bool user_teleport(const char* user, double x, double y, double z)
function user_teleportMap (line 485) | bool user_teleportMap(const char* user, double x, double y, double z, si...
function user_sethealth (line 500) | bool user_sethealth(const char* user, int userHealth)
function user_gethealth (line 511) | int user_gethealth(const char* user)
function user_getCount (line 521) | int user_getCount()
function user_getItemInHand (line 533) | bool user_getItemInHand(const char* user, int* type, int* meta, int* quant)
function user_setItemInHand (line 556) | bool user_setItemInHand(const char* user, int type, int meta, int quant)
function user_addItem (line 581) | bool user_addItem(const char* user, int item, int count, int health)
function user_hasItem (line 637) | bool user_hasItem(const char* user, int item, int count, int health)
function user_delItem (line 668) | bool user_delItem(const char* user, int item, int count, int health)
function user_kick (line 706) | bool user_kick(const char* user)
function user_getItemAt (line 717) | bool user_getItemAt(const char* user, int slotn, int* type, int* meta, i...
function user_setItemAt (line 740) | bool user_setItemAt(const char* user, int slotn, int type, int meta, int...
function user_setGameMode (line 756) | bool user_setGameMode(const char* user, int gamemode)
function config_has (line 769) | bool config_has(const char* name)
function config_iData (line 774) | int config_iData(const char* name)
function config_lData (line 779) | int64_t config_lData(const char* name)
function config_fData (line 784) | float config_fData(const char* name)
function config_dData (line 789) | double config_dData(const char* name)
function config_bData (line 799) | bool config_bData(const char* name)
function mob_createMob (line 804) | int mob_createMob(int type)
function mob_createSpawnMob (line 811) | int mob_createSpawnMob(int type)
function mob_spawnMob (line 820) | void mob_spawnMob(int uid)
function mob_despawnMob (line 826) | void mob_despawnMob(int uid)
function mob_moveMob (line 832) | void mob_moveMob(int uid, double x, double y, double z)
function mob_moveMobW (line 838) | void mob_moveMobW(int uid, double x, double y, double z, int map)
function mob_getMobID (line 844) | int mob_getMobID(int uid)
function mob_getHealth (line 850) | int mob_getHealth(int uid)
function mob_setHealth (line 856) | void mob_setHealth(int uid, int mobHealth)
function mob_moveAnimal (line 861) | void mob_moveAnimal(const char*, size_t mobID)
function mob_animateMob (line 867) | void mob_animateMob(const char*, size_t mobID, int animID)
function mob_animateDamage (line 873) | void mob_animateDamage(const char*, size_t mobID, int animID)
function mob_getType (line 879) | int mob_getType(size_t uid)
function mob_getLook (line 885) | bool mob_getLook(int uid, double* rot, double* pitch, double* head_yaw)
function mob_setLook (line 907) | bool mob_setLook(int uid, double rot, double pitch, double head_yaw)
function mob_getMobPositionW (line 920) | bool mob_getMobPositionW(int uid, double* x, double* y, double* z, int* w)
function mob_setByteMetadata (line 946) | bool mob_setByteMetadata(int uid, int8_t idx, int8_t val)
function mob_updateMetadata (line 954) | bool mob_updateMetadata(int uid)
function mob_getByteMetadata (line 962) | int8_t mob_getByteMetadata(int uid, int idx)
function permission_setAdmin (line 972) | bool permission_setAdmin(const char* name)
function permission_setOp (line 983) | bool permission_setOp(const char* name)
function permission_setMember (line 995) | bool permission_setMember(const char* name)
function permission_setGuest (line 1007) | bool permission_setGuest(const char* name)
function permission_isAdmin (line 1019) | bool permission_isAdmin(const char* name)
function permission_isOp (line 1029) | bool permission_isOp(const char* name)
function permission_isMember (line 1039) | bool permission_isMember(const char* name)
function permission_isGuest (line 1049) | bool permission_isGuest(const char* name)
function tools_uniformInt (line 1059) | int tools_uniformInt(int a, int b)
function tools_uniform01 (line 1068) | double tools_uniform01()
function tools_namedSoundEffect (line 1073) | bool tools_namedSoundEffect(const char* name, int x, int y, int z, float...
function init_plugin_api (line 1090) | void init_plugin_api(void)
FILE: src/plugin_api.h
type plugin_pointer_struct (line 56) | struct plugin_pointer_struct
type user_pointer_struct (line 94) | struct user_pointer_struct
type chat_pointer_struct (line 119) | struct chat_pointer_struct
type logger_pointer_struct (line 128) | struct logger_pointer_struct
type map_pointer_struct (line 134) | struct map_pointer_struct
type config_pointer_struct (line 153) | struct config_pointer_struct
type mob_pointer_struct (line 165) | struct mob_pointer_struct
type permission_pointer_struct (line 190) | struct permission_pointer_struct
type tools_pointer_struct (line 204) | struct tools_pointer_struct
type mineserver_pointer_struct (line 211) | struct mineserver_pointer_struct
FILE: src/plugins/PyScript/PyScript.cpp
function checkPyErr (line 29) | void checkPyErr()
function PyObject (line 93) | PyObject* Script::callPyFunc(const char* name, PyObject* Args)
function mineserver_pointer_struct (line 167) | mineserver_pointer_struct* getMineServer()
function PLUGIN_API_EXPORT (line 176) | PLUGIN_API_EXPORT void CALLCONVERSION PyScript_init(mineserver_pointer_s...
function PLUGIN_API_EXPORT (line 194) | PLUGIN_API_EXPORT void CALLCONVERSION set_name(const char* name)
function PLUGIN_API_EXPORT (line 229) | PLUGIN_API_EXPORT void CALLCONVERSION PyScript_shutdown(void)
function chatPreFunction (line 235) | bool chatPreFunction(const char* userIn, time_t timestamp, const char* m...
function timer200Function (line 252) | bool timer200Function()
function timer1000Function (line 261) | bool timer1000Function()
function timer10000Function (line 270) | bool timer10000Function()
function blockPlaceFunction (line 279) | bool blockPlaceFunction(const char* name, int32_t x, int8_t y, int32_t z,
function blockBreakFunction (line 299) | bool blockBreakFunction(const char* name, int x, int y, int z)
FILE: src/plugins/PyScript/PyScript.h
function class (line 23) | class Script
FILE: src/plugins/PyScript/python/TriggTest.py
function init (line 6) | def init():
function cb_timer200 (line 14) | def cb_timer200():
function cb_timer1000 (line 32) | def cb_timer1000():
function cb_timer10000 (line 36) | def cb_timer10000():
function cb_block_place (line 39) | def cb_block_place(name,block):
function cb_chat (line 45) | def cb_chat(name, msg):
FILE: src/plugins/PyScript/python_plugin_api.cpp
function PyMineserver (line 43) | PyMineserver* get_MS()
function mineserver_pointer_struct (line 92) | mineserver_pointer_struct* magical()
function PyLoc (line 100) | PyLoc* PymyMap::get_spawn()
function PyBlock (line 118) | PyBlock* PymyMap::get_block(int x, int y, int z)
function PyUser (line 137) | PyUser* PyMineserver::get_user(const char* player_name)
FILE: src/plugins/PyScript/python_plugin_api.h
function class (line 44) | class PyLoc
function class (line 50) | class PyBlock
function class (line 60) | class PyUser
function class (line 69) | class PyChat
function class (line 76) | class PymyMap
function class (line 86) | class PyScreen
function class (line 92) | class PyMineserver
FILE: src/plugins/banlist/banlist.h
function class (line 12) | class P_Banlist
FILE: src/plugins/command/command.h
function class (line 11) | class P_Command
FILE: src/protocol.cpp
function Packet (line 41) | Packet Protocol::encryptionRequest()
function Packet (line 53) | Packet Protocol::openWindow(uint8_t windowId, std::string windowType, st...
function Packet (line 62) | Packet Protocol::windowProperty(uint8_t windowId, int16_t property, int1...
function Packet (line 69) | Packet Protocol::confirmTransaction(uint8_t windowId, int16_t action_num...
function Packet (line 76) | Packet Protocol::animation(int eid, int aid)
function Packet (line 83) | Packet Protocol::updateSign(int32_t x, int32_t y, int32_t z,
function Packet (line 93) | Packet Protocol::openSignEditor(int32_t x, int32_t y, int32_t z)
function Packet (line 101) | Packet Protocol::entityStatus(int eid, int aid)
function Packet (line 108) | Packet Protocol::entityMetadata(int eid, MetaData& metadata)
function Packet (line 115) | Packet Protocol::entityVelocity(int eid, int16_t vel_x, int16_t vel_y,in...
function Packet (line 122) | Packet Protocol::slot(const Item &item)
function Packet (line 142) | Packet Protocol::setSlot(int8_t window_id, int16_t slotId, Item& item)
function Packet (line 150) | Packet Protocol::entityEquipment(int32_t eid, int16_t slot, Item& item)
function Packet (line 158) | Packet Protocol::mobSpawn(int eid, int8_t type, double x, double y, doub...
function Packet (line 169) | Packet Protocol::mobSpawn(Mob& mob)
function Packet (line 174) | Packet Protocol::destroyEntity(uint32_t eid)
function Packet (line 181) | Packet Protocol::entityTeleport(uint32_t eid, double x, double y, double...
function Packet (line 189) | Packet Protocol::entityRelativeMove(uint32_t eid, int8_t x, int8_t y, in...
function Packet (line 196) | Packet Protocol::entityTeleport(uint32_t eid, const position& pos)
function Packet (line 201) | Packet Protocol::namedSoundEffect(std::string name, int32_t x, int32_t y...
function Packet (line 208) | Packet Protocol::entityHeadLook(int eid, int head_yaw)
function Packet (line 215) | Packet Protocol::attachEntity(int32_t entity, int32_t vehicle, bool leash)
function Packet (line 222) | Packet Protocol::entityLook(int eid, int yaw, int pitch)
function Packet (line 229) | Packet Protocol::entityLook(int eid, float yaw, float pitch)
function Packet (line 234) | Packet Protocol::entityRelativeMove(uint32_t eid, double dx, double dy, ...
function Packet (line 239) | Packet Protocol::entityLookRelativeMove(int eid, double dx, double dy, d...
function Packet (line 248) | Packet Protocol::setCompression(int threshold)
function Packet (line 255) | Packet Protocol::loginSuccess(std::string uuid, std::string username)
function Packet (line 264) | Packet Protocol::joinGame(int eid, int8_t gamemode)
function Packet (line 275) | Packet Protocol::playerAbilities(uint8_t flags, float flying_speed, floa...
function Packet (line 284) | Packet Protocol::spawnPosition(int x, int y, int z)
function Packet (line 293) | Packet Protocol::timeUpdate(int64_t time, int64_t ageOfTheWorld)
function Packet (line 300) | Packet Protocol::disconnect(std::string msg)
function Packet (line 307) | Packet Protocol::spawnPlayer(int eid, uint8_t *uuid, std::string &nick, ...
function Packet (line 323) | Packet Protocol::spawnPlayer(int eid, uint8_t *uuid, std::string &nick, ...
function Packet (line 338) | Packet Protocol::PlayerListItemAddSingle(uint8_t *uuid, std::string &nic...
function Packet (line 360) | Packet Protocol::PlayerListItemRemoveSingle(uint8_t *uuid){
function Packet (line 369) | Packet Protocol::spawnObject(int eid, int8_t object_type, int32_t x, int...
function Packet (line 384) | Packet Protocol::entity(int eid)
function Packet (line 391) | Packet Protocol::collectItem(int itemEid, int eid)
function Packet (line 398) | Packet Protocol::blockAction(int32_t x, int16_t y, int32_t z, int8_t byt...
function Packet (line 407) | Packet Protocol::playerPositionAndLook(double x, double y, double z, flo...
function Packet (line 414) | Packet Protocol::respawn(int32_t dimension, int8_t difficulty,int8_t gam...
function Packet (line 421) | Packet Protocol::updateHealth(int health, int food)
function Packet (line 428) | Packet Protocol::keepalive(int32_t time)
function Packet (line 435) | Packet Protocol::playerlist()
function Packet (line 449) | Packet Protocol::gameMode(int8_t reason, float value){
function Packet (line 455) | Packet Protocol::chatMsg(const std::string& msg)
function Packet (line 462) | Packet Protocol::blockChange(int32_t x, int32_t y, int32_t z, int16_t bl...
function Packet (line 471) | Packet Protocol::tabComplete(const std::vector<std::string> &msgs)
function Packet (line 482) | Packet Protocol::explosion(float x, float y, float z, float radius, std:...
function Packet (line 495) | Packet Protocol::windowItems(uint8_t windowID, std::vector<Item>& slots)
function Packet (line 507) | Packet Protocol::chunkDataUnload(int32_t chunk_x, int32_t chunk_z)
FILE: src/protocol.h
function class (line 49) | class Protocol
FILE: src/random.cpp
function initPRNG (line 49) | void initPRNG()
function uniform01 (line 85) | double uniform01()
FILE: src/random.h
type std (line 39) | typedef std::mt19937 MyRNG;
type std (line 52) | typedef std::uniform_int_distribution<MyRNG::result_type> MyUniform;
type seed_type (line 57) | typedef unsigned long int seed_type;
function MyRNG (line 75) | inline MyRNG::result_type uniformUINT()
function MyRNG (line 80) | inline MyRNG::result_type uniformUINT(MyUniform::result_type min, MyUnif...
function uniformUINT8 (line 86) | inline uint8_t uniformUINT8(uint8_t min, uint8_t max)
FILE: src/redstoneSimulation.h
type Power (line 39) | enum Power { POWER_NONE, POWER_WEAK, POWER_NORMAL }
FILE: src/screenBase.cpp
type tm (line 36) | struct tm
FILE: src/screenBase.h
function class (line 36) | class Screen
FILE: src/signalhandler.cpp
function InitSignals (line 48) | void InitSignals()
function HandleSegfault (line 62) | void HandleSegfault()
function SignalHandler (line 111) | void SignalHandler(int sig)
FILE: src/sockets.cpp
function client_write (line 78) | bool client_write(User *user)
function client_callback (line 159) | void client_callback(int fd, short ev, void* arg)
function accept_callback (line 320) | void accept_callback(int fd, short ev, void* arg)
function socket_connect (line 346) | int socket_connect(char* host, int port)
FILE: src/stdtime.h
function class (line 23) | class Time {
FILE: src/threadpool.h
type ThreadType (line 39) | enum ThreadType { THREAD_MAPGEN, THREAD_LIGHTGEN, THREAD_VALIDATEUSER }
type ThreadTask (line 43) | struct ThreadTask {
function class (line 57) | class ThreadPool{
FILE: src/tools.cpp
function putSint64 (line 72) | void putSint64(uint8_t* buf, int64_t value)
function putSint32 (line 78) | void putSint32(uint8_t* buf, int32_t value)
function putSint16 (line 84) | void putSint16(uint8_t* buf, int16_t value)
function putFloat (line 90) | void putFloat(uint8_t* buf, float value)
function putDouble (line 98) | void putDouble(uint8_t* buf, double value)
function getDouble (line 106) | double getDouble(uint8_t* buf)
function getFloat (line 116) | float getFloat(uint8_t* buf)
function getSint64 (line 124) | int64_t getSint64(uint8_t* buf)
function getSint32 (line 132) | int32_t getSint32(uint8_t* buf)
function getSint16 (line 138) | int32_t getSint16(uint8_t* buf)
function base36_encode (line 145) | std::string base36_encode(int value)
function hexToByte (line 157) | uint8_t hexToByte(char hex)
function my_itoa (line 169) | void my_itoa(int value, std::string& buf, int base)
function my_itoa (line 186) | std::string my_itoa(int value, int base)
function strToLower (line 193) | std::string strToLower(std::string temp)
function dtos (line 205) | std::string dtos(double n)
function hash (line 212) | std::string hash(std::string value)
function fileExists (line 232) | bool fileExists(const std::string& filename)
function makeDirectory (line 238) | bool makeDirectory(const std::string& path)
function canonicalizePath (line 247) | std::string canonicalizePath(const std::string& pathname)
function relativeToAbsolute (line 284) | std::string relativeToAbsolute(const std::string &path)
function getHomeDir (line 297) | std::string getHomeDir()
function pathOfExecutable (line 326) | std::string pathOfExecutable()
function pathOfFile (line 369) | std::pair<std::string, std::string> pathOfFile(const std::string& filename)
function microTime (line 410) | uint64_t microTime()
FILE: src/tools.h
function ntohll (line 87) | inline uint64_t ntohll(uint64_t v)
function blockToChunk (line 94) | inline int32_t blockToChunk(int32_t value)
function blockToChunkBlock (line 100) | inline int32_t blockToChunkBlock(int32_t value)
function angleToByte (line 105) | inline int8_t angleToByte(float angle)
function positionToXYZ (line 110) | inline bool positionToXYZ(uint64_t position, int32_t &x, int16_t &y, int...
function std (line 123) | inline std::string json_esc(const std::string str)
FILE: src/tree.h
function class (line 48) | class ITree
function class (line 76) | class Trunk : public ITree
type std (line 86) | typedef std::shared_ptr<Trunk> TrunkPtr;
function class (line 89) | class Canopy : public ITree
function class (line 99) | class Tree : public ITree
FILE: src/user.cpp
type stat (line 374) | struct stat
type stat (line 449) | struct stat
class DistanceComparator (line 1079) | class DistanceComparator
method DistanceComparator (line 1084) | DistanceComparator(vec tgt) : target(tgt)
type event (line 1399) | struct event
type event (line 1404) | struct event
type event (line 1410) | struct event
type event (line 1415) | struct event
function User (line 1437) | User* User::byNick(std::string nick)
FILE: src/user.h
type UserProperty (line 52) | struct UserProperty {
type position (line 61) | struct position
function withinViewDistance (line 247) | bool withinViewDistance(int a, int b)
type event (line 252) | struct event
type event (line 253) | struct event
type event (line 255) | struct event
type event (line 256) | struct event
function writePacket (line 258) | bool writePacket(const Packet &pkt) {
FILE: src/utf8.h
type t_codepoint (line 5) | typedef union t_codepoint_tmp
function codepointToUTF8 (line 14) | inline void codepointToUTF8(unsigned int cp, t_codepoint * szOut)
function getOneCodepointFromUTF8 (line 68) | inline unsigned int getOneCodepointFromUTF8(const std::string& str, size...
function makeUCS2MessageFromUTF8 (line 187) | inline void makeUCS2MessageFromUTF8(const std::string & str, std::vector...
FILE: src/vec.h
function class (line 35) | class vec
function x (line 91) | int& x()
function y (line 95) | int& y()
function z (line 99) | int& z()
FILE: src/worldgen/biomegen.cpp
type timeval (line 380) | struct timeval
FILE: src/worldgen/biomegen.h
function class (line 33) | class BiomeGen: public MapGen
FILE: src/worldgen/cavegen.h
function class (line 33) | class CaveGen
FILE: src/worldgen/eximgen.cpp
type timeval (line 269) | struct timeval
FILE: src/worldgen/eximgen.h
function id (line 36) | struct BlockRef{
function meta (line 47) | uint8_t meta(){
function id (line 54) | void id(uint8_t id){
function meta (line 57) | void meta(uint8_t meta){
type AnvilAccessor (line 74) | struct AnvilAccessor{
type ChunkInfo (line 85) | struct ChunkInfo{
function class (line 92) | class EximGen: public MapGen
FILE: src/worldgen/heavengen.cpp
function fastrand (line 69) | static inline int fastrand()
type timeval (line 212) | struct timeval
FILE: src/worldgen/heavengen.h
function class (line 40) | class HeavenGen : public MapGen
FILE: src/worldgen/mapgen.cpp
function fastrand (line 48) | static inline int fastrand()
type timeval (line 276) | struct timeval
FILE: src/worldgen/mapgen.h
function class (line 40) | class MapGen
FILE: src/worldgen/nethergen.cpp
function fastrand (line 68) | inline int fastrand()
type timeval (line 211) | struct timeval
FILE: src/worldgen/nethergen.h
function class (line 40) | class NetherGen : public MapGen
Condensed preview — 383 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,398K chars).
[
{
"path": ".gitignore",
"chars": 215,
"preview": "# ignore kate temp files\n*~\n\n# ignore cmake crap\nCMakeFiles\nCMakeCache.txt\nsrc/configure.h\ninclude/configure.h\n\n# ignore"
},
{
"path": "CMakeLists.txt",
"chars": 6307,
"preview": "CMAKE_MINIMUM_REQUIRED(VERSION 2.6)\nPROJECT(mineserver)\nCMAKE_POLICY(SET CMP0003 NEW)\n\n#\n# project version\n#\n\n# Justasic"
},
{
"path": "CMakeModules/FindEvent.cmake",
"chars": 959,
"preview": "# This module defines\n# EVENT_LIBRARY\n# EVENT_FOUND, if false, libevent wasn't found \n# EVENT_INCLUDE_DIR, where to find"
},
{
"path": "CMakeModules/FindNoise.cmake",
"chars": 1541,
"preview": "# NOISE_LIBRARY\n# NOISE_FOUND, if false, libnoise wasn't found\n# NOISE_INCLUDE_DIR, where to find the headers\n# NOISE_DI"
},
{
"path": "CMakeModules/toolchain-i686-w64-mingw32.cmake",
"chars": 656,
"preview": "# the name of the target operating system\nset(CMAKE_SYSTEM_NAME Windows)\n\n# which compilers to use for C and C++\nset(CMA"
},
{
"path": "Dockerfile",
"chars": 1237,
"preview": "FROM debian:jessie\n\nMAINTAINER Marko Viitanen <fador@iki.fi>\n\n ENV PACKAGES libssl1.0.0 libevent-2.0 zlib1g systemd-s"
},
{
"path": "LICENSE",
"chars": 1552,
"preview": " Copyright (c) 2016, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "README.md",
"chars": 5108,
"preview": "# Mineserver\n*by Fador & Nredor and others*\n\nCustom Minecraft server software written in C++.\n\nYou can find the core tea"
},
{
"path": "files/CMakeLists.txt",
"chars": 880,
"preview": "cmake_minimum_required(VERSION 2.6)\n# forbid running cmake from this subdir\nif(PROJECT_NAME STREQUAL \"Project\")\n messag"
},
{
"path": "files/ENABLED_RECIPES.cfg",
"chars": 2701,
"preview": "#Armour\narmour/helmet_leather\narmour/helmet_iron\narmour/helmet_gold\narmour/helmet_diamond\narmour/helmet_chain\narmour/che"
},
{
"path": "files/banned.txt",
"chars": 75,
"preview": "# This is default banfile. Write nicks to be banned here one for each line\n"
},
{
"path": "files/commands.cfg",
"chars": 704,
"preview": "# command permissions\n# the order is: guest < member < op < admin\n# e.g. \"kick\" is allowed for op & above (ops & admins)"
},
{
"path": "files/config.cfg",
"chars": 5547,
"preview": "#\n# Mineserver configuration\n#\n\n# Search paths\n# Note: leading tilde '~' is treated as $HOME\nsystem.path.data = \".\";\n"
},
{
"path": "files/item_alias.cfg",
"chars": 2791,
"preview": "#\n# Aliases for /give and other labels\n#\n\nstone = 1\ngrass = 2\ndirt = 3\ncobblestone = 4\nwoodenplank = 5\nsapling = 6\nbedro"
},
{
"path": "files/motd.txt",
"chars": 188,
"preview": "#\n# Write message of the day here. \n# Lines beginning with # are commentlines and will not be sent to player\n#\n> §aWelco"
},
{
"path": "files/permissions.txt",
"chars": 56,
"preview": "someMemberName:Member\nsomeOpName:Op\nsomeAdminName:Admin\n"
},
{
"path": "files/recipes/armour/boots_chain.recipe",
"chars": 103,
"preview": "# Input\nwidth 3\nheight 2\n<-\n51 -1 51\n51 -1 51\n->\n\n# Output\noutputcount 1\noutputtype 305\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/boots_diamond.recipe",
"chars": 107,
"preview": "# Input\nwidth 3\nheight 2\n<-\n264 -1 264\n264 -1 264\n->\n\n# Output\noutputcount 1\noutputtype 313\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/boots_gold.recipe",
"chars": 107,
"preview": "# Input\nwidth 3\nheight 2\n<-\n266 -1 266\n266 -1 266\n->\n\n# Output\noutputcount 1\noutputtype 317\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/boots_iron.recipe",
"chars": 107,
"preview": "# Input\nwidth 3\nheight 2\n<-\n265 -1 265\n265 -1 265\n->\n\n# Output\noutputcount 1\noutputtype 309\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/boots_leather.recipe",
"chars": 107,
"preview": "# Input\nwidth 3\nheight 2\n<-\n334 -1 334\n334 -1 334\n->\n\n# Output\noutputcount 1\noutputtype 301\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/chestplate_chain.recipe",
"chars": 112,
"preview": "# Input\nwidth 3\nheight 3\n<-\n51 -1 51\n51 51 51\n51 51 51\n->\n\n# Output\noutputcount 1\noutputtype 303\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/chestplate_diamond.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n264 -1 264\n264 264 264\n264 264 264\n->\n\n# Output\noutputcount 1\noutputtype 311\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/chestplate_gold.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n266 -1 266\n266 266 266\n266 266 266\n->\n\n# Output\noutputcount 1\noutputtype 315\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/chestplate_iron.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n265 -1 265\n265 265 265\n265 265 265\n->\n\n# Output\noutputcount 1\noutputtype 307\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/chestplate_leather.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n334 -1 334\n334 334 334\n334 334 334\n->\n\n# Output\noutputcount 1\noutputtype 299\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/helmet_chain.recipe",
"chars": 103,
"preview": "# Input\nwidth 3\nheight 2\n<-\n51 51 51\n51 -1 51\n->\n\n# Output\noutputcount 1\noutputtype 302\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/helmet_diamond.recipe",
"chars": 108,
"preview": "# Input\nwidth 3\nheight 2\n<-\n264 264 264\n264 -1 264\n->\n\n# Output\noutputcount 1\noutputtype 310\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/helmet_gold.recipe",
"chars": 108,
"preview": "# Input\nwidth 3\nheight 2\n<-\n266 266 266\n266 -1 266\n->\n\n# Output\noutputcount 1\noutputtype 314\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/helmet_iron.recipe",
"chars": 108,
"preview": "# Input\nwidth 3\nheight 2\n<-\n265 265 265\n265 -1 265\n->\n\n# Output\noutputcount 1\noutputtype 306\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/helmet_leather.recipe",
"chars": 108,
"preview": "# Input\nwidth 3\nheight 2\n<-\n334 334 334\n334 -1 334\n->\n\n# Output\noutputcount 1\noutputtype 298\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/legging_chain.recipe",
"chars": 112,
"preview": "# Input\nwidth 3\nheight 3\n<-\n51 51 51\n51 -1 51\n51 -1 51\n->\n\n# Output\noutputcount 1\noutputtype 304\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/legging_diamond.recipe",
"chars": 119,
"preview": "# Input\nwidth 3\nheight 3\n<-\n264 264 264\n264 -1 264\n264 -1 264\n->\n\n# Output\noutputcount 1\noutputtype 312\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/legging_gold.recipe",
"chars": 119,
"preview": "# Input\nwidth 3\nheight 3\n<-\n266 266 266\n266 -1 266\n266 -1 266\n->\n\n# Output\noutputcount 1\noutputtype 316\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/legging_iron.recipe",
"chars": 119,
"preview": "# Input\nwidth 3\nheight 3\n<-\n265 265 265\n265 -1 265\n265 -1 265\n->\n\n# Output\noutputcount 1\noutputtype 308\noutputhealth 0\n"
},
{
"path": "files/recipes/armour/legging_leather.recipe",
"chars": 119,
"preview": "# Input\nwidth 3\nheight 3\n<-\n334 334 334\n334 -1 334\n334 -1 334\n->\n\n# Output\noutputcount 1\noutputtype 300\noutputhealth 0\n"
},
{
"path": "files/recipes/block/sand_hslab.recipe",
"chars": 95,
"preview": "# Input\nwidth 3\nheight 1\n<-\n24 24 24\n->\n\n# Output\noutputcount 3\noutputtype 44\noutputhealth 1\n"
},
{
"path": "files/recipes/block/smooth_hslab.recipe",
"chars": 92,
"preview": "# Input\nwidth 3\nheight 1\n<-\n1 1 1\n->\n\n# Output\noutputcount 3\noutputtype 44\noutputhealth 0\n"
},
{
"path": "files/recipes/block/stone_hslab.recipe",
"chars": 92,
"preview": "# Input\nwidth 3\nheight 1\n<-\n4 4 4\n->\n\n# Output\noutputcount 3\noutputtype 44\noutputhealth 3\n"
},
{
"path": "files/recipes/block/wood_hslab.recipe",
"chars": 92,
"preview": "# Input\nwidth 3\nheight 1\n<-\n5 5 5\n->\n\n# Output\noutputcount 3\noutputtype 44\noutputhealth 2\n"
},
{
"path": "files/recipes/cloth/black.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:0\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 15\n"
},
{
"path": "files/recipes/cloth/blue.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:4\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 11\n"
},
{
"path": "files/recipes/cloth/brown.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:3\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 12\n"
},
{
"path": "files/recipes/cloth/cyan.recipe",
"chars": 94,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:6\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 9\n"
},
{
"path": "files/recipes/cloth/darkgreen.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:2\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 13\n"
},
{
"path": "files/recipes/cloth/grey.recipe",
"chars": 94,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:8\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 7\n"
},
{
"path": "files/recipes/cloth/lightblue.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:12\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 3\n"
},
{
"path": "files/recipes/cloth/lightgreen.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:10\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 5\n"
},
{
"path": "files/recipes/cloth/lightgrey.recipe",
"chars": 94,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:7\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 8\n"
},
{
"path": "files/recipes/cloth/magenta.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:13\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 2\n"
},
{
"path": "files/recipes/cloth/orange.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:14\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 1\n"
},
{
"path": "files/recipes/cloth/pink.recipe",
"chars": 94,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:9\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 6\n"
},
{
"path": "files/recipes/cloth/purple.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:5\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 10\n"
},
{
"path": "files/recipes/cloth/red.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:1\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 14\n"
},
{
"path": "files/recipes/cloth/white.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:15\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 0\n"
},
{
"path": "files/recipes/cloth/yellow.recipe",
"chars": 95,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n35 351:11\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 4\n"
},
{
"path": "files/recipes/dyes/cyan.recipe",
"chars": 98,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:4 351:2\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 6\n"
},
{
"path": "files/recipes/dyes/grey.recipe",
"chars": 99,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:0 351:15\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 8\n"
},
{
"path": "files/recipes/dyes/lightblue.recipe",
"chars": 100,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:4 351:15\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 12\n"
},
{
"path": "files/recipes/dyes/lightgrey.recipe",
"chars": 99,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:8 351:15\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 7\n"
},
{
"path": "files/recipes/dyes/lime.recipe",
"chars": 100,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:2 351:15\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 10\n"
},
{
"path": "files/recipes/dyes/magenta.recipe",
"chars": 99,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:5 351:9\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 13\n"
},
{
"path": "files/recipes/dyes/orange.recipe",
"chars": 100,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:1 351:11\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 14\n"
},
{
"path": "files/recipes/dyes/pink.recipe",
"chars": 99,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:1 351:15\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 9\n"
},
{
"path": "files/recipes/dyes/purple.recipe",
"chars": 98,
"preview": "# Input\nwidth 2\nheight 1\n\n<-\n351:4 351:1\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 5\n"
},
{
"path": "files/recipes/dyes/red.recipe",
"chars": 89,
"preview": "# Input\nwidth 1\nheight 1\n\n<-\n38\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 1\n"
},
{
"path": "files/recipes/dyes/white.recipe",
"chars": 91,
"preview": "# Input\nwidth 1\nheight 1\n\n<-\n352\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 15\n"
},
{
"path": "files/recipes/dyes/yellow.recipe",
"chars": 90,
"preview": "# Input\nwidth 1\nheight 1\n\n<-\n37\n->\n\n# Output\noutputcount 2\noutputtype 351\noutputhealth 11\n"
},
{
"path": "files/recipes/food/apple_golden.recipe",
"chars": 114,
"preview": "# Input\nwidth 3\nheight 3\n\n<-\n41 41 41\n41 260 41\n41 41 41\n->\n\n# Output\noutputcount 1\noutputtype 322\noutputhealth 0\n"
},
{
"path": "files/recipes/food/bowls.recipe",
"chars": 100,
"preview": "# Input\nwidth 3\nheight 2\n<-\n5 -1 5\n-1 5 -1\n->\n\n# Output\noutputcount 4\noutputtype 281\noutputhealth 0\n"
},
{
"path": "files/recipes/food/bread.recipe",
"chars": 98,
"preview": "# Input\nwidth 3\nheight 1\n\n<-\n296 296 296\n->\n\n# Output\noutputcount 1\noutputtype 297\noutputhealth 0\n"
},
{
"path": "files/recipes/food/cake.recipe",
"chars": 121,
"preview": "# Input\nwidth 3\nheight 3\n<-\n335 335 335\n353 344 353\n296 296 296\n->\n\n# Output\noutputcount 1\noutputtype 354\noutputhealth 0"
},
{
"path": "files/recipes/food/mushroomstew.recipe",
"chars": 96,
"preview": "# Input\nwidth 1\nheight 3\n\n<-\n40\n39\n281\n->\n\n# Output\noutputcount 1\noutputtype 282\noutputhealth 0\n"
},
{
"path": "files/recipes/food/sugar.recipe",
"chars": 89,
"preview": "# Input\nwidth 1\nheight 1\n<-\n338\n->\n\n# Output\noutputcount 1\noutputtype 353\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_brick.recipe",
"chars": 101,
"preview": "# Input\nwidth 2\nheight 2\n\n<-\n336 336\n336 336\n->\n\n# Output\noutputcount 1\noutputtype 45\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_clay.recipe",
"chars": 101,
"preview": "# Input\nwidth 2\nheight 2\n\n<-\n337 337\n337 337\n->\n\n# Output\noutputcount 1\noutputtype 82\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_diamond.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n264 264 264\n264 264 264\n264 264 264\n->\n\n# Output\noutputcount 1\noutputtype 57\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_glowstone.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n348 348 348\n348 348 348\n348 348 348\n->\n\n# Output\noutputcount 1\noutputtype 89\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_gold.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n266 266 266\n266 266 266\n266 266 266\n->\n\n# Output\noutputcount 1\noutputtype 41\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_iron.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n265 265 265\n265 265 265\n265 265 265\n->\n\n# Output\noutputcount 1\noutputtype 42\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_sandstone.recipe",
"chars": 96,
"preview": "# Input\nwidth 2\nheight 2\n<-\n12 12\n12 12\n->\n\n# Output\noutputcount 1\noutputtype 24\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_snow.recipe",
"chars": 101,
"preview": "# Input\nwidth 2\nheight 2\n\n<-\n332 332\n332 332\n->\n\n# Output\noutputcount 1\noutputtype 80\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/block_wool.recipe",
"chars": 120,
"preview": "# Input\nwidth 3\nheight 3\n<-\n287 287 287\n287 287 287\n287 287 287\n->\n\n# Output\noutputcount 1\noutputtype 23\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/clay.recipe",
"chars": 89,
"preview": "# Input\nwidth 1\nheight 1\n\n<-\n82\n->\n\n# Output\noutputcount 4\noutputtype 337\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/ingots_diamond.recipe",
"chars": 88,
"preview": "# Input\nwidth 1\nheight 1\n<-\n57\n->\n\n# Output\noutputcount 9\noutputtype 264\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/ingots_gold.recipe",
"chars": 88,
"preview": "# Input\nwidth 1\nheight 1\n<-\n41\n->\n\n# Output\noutputcount 9\noutputtype 266\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/ingots_iron.recipe",
"chars": 88,
"preview": "# Input\nwidth 1\nheight 1\n<-\n42\n->\n\n# Output\noutputcount 9\noutputtype 265\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/sticks.recipe",
"chars": 89,
"preview": "# Input\nwidth 1\nheight 2\n<-\n5\n5\n->\n\n# Output\noutputcount 4\noutputtype 280\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/tnt.recipe",
"chars": 116,
"preview": "# Input\nwidth 3\nheight 3\n<-\n289 12 289\n12 289 12\n289 12 289\n->\n\n# Output\noutputcount 1\noutputtype 46\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/wood_planks_acacia.recipe",
"chars": 89,
"preview": "# Input\nwidth 1\nheight 1\n<-\n162:0\n->\n\n# Output\noutputcount 4\noutputtype 5\noutputhealth 4\n"
},
{
"path": "files/recipes/materials/wood_planks_birch.recipe",
"chars": 88,
"preview": "# Input\nwidth 1\nheight 1\n<-\n17:2\n->\n\n# Output\noutputcount 4\noutputtype 5\noutputhealth 2\n"
},
{
"path": "files/recipes/materials/wood_planks_dark_oak.recipe",
"chars": 89,
"preview": "# Input\nwidth 1\nheight 1\n<-\n162:1\n->\n\n# Output\noutputcount 4\noutputtype 5\noutputhealth 5\n"
},
{
"path": "files/recipes/materials/wood_planks_jungle.recipe",
"chars": 88,
"preview": "# Input\nwidth 1\nheight 1\n<-\n17:3\n->\n\n# Output\noutputcount 4\noutputtype 5\noutputhealth 3\n"
},
{
"path": "files/recipes/materials/wood_planks_oak.recipe",
"chars": 88,
"preview": "# Input\nwidth 1\nheight 1\n<-\n17:0\n->\n\n# Output\noutputcount 4\noutputtype 5\noutputhealth 0\n"
},
{
"path": "files/recipes/materials/wood_planks_spruce.recipe",
"chars": 88,
"preview": "# Input\nwidth 1\nheight 1\n<-\n17:1\n->\n\n# Output\noutputcount 4\noutputtype 5\noutputhealth 1\n"
},
{
"path": "files/recipes/mechanism/button_stone.recipe",
"chars": 88,
"preview": "# Input\nwidth 1\nheight 2\n<-\n1\n1\n->\n\n# Output\noutputcount 1\noutputtype 77\noutputhealth 0\n"
},
{
"path": "files/recipes/mechanism/dispenser.recipe",
"chars": 105,
"preview": "# Input\nwidth 3\nheight 3\n<-\n4 4 4\n4 261 4\n4 55 4\n->\n\n# Output\noutputcount 1\noutputtype 23\noutputhealth 0\n"
},
{
"path": "files/recipes/mechanism/door_iron.recipe",
"chars": 109,
"preview": "# Input\nwidth 2\nheight 3\n<-\n265 265\n265 265\n265 265\n->\n\n# Output\noutputcount 1\noutputtype 330\noutputhealth 0\n"
},
{
"path": "files/recipes/mechanism/door_wood.recipe",
"chars": 97,
"preview": "# Input\nwidth 2\nheight 3\n<-\n5 5\n5 5\n5 5\n->\n\n# Output\noutputcount 1\noutputtype 324\noutputhealth 0\n"
},
{
"path": "files/recipes/mechanism/lever.recipe",
"chars": 90,
"preview": "# Input\nwidth 1\nheight 2\n<-\n280\n4\n->\n\n# Output\noutputcount 1\noutputtype 69\noutputhealth 0\n"
},
{
"path": "files/recipes/mechanism/note_block.recipe",
"chars": 103,
"preview": "# Input\nwidth 3\nheight 3\n<-\n5 5 5\n5 55 5\n5 5 5\n->\n\n# Output\noutputcount 1\noutputtype 25\noutputhealth 0\n"
},
{
"path": "files/recipes/mechanism/pressure_stone.recipe",
"chars": 88,
"preview": "# Input\nwidth 2\nheight 1\n<-\n1 1\n->\n\n# Output\noutputcount 1\noutputtype 70\noutputhealth 0\n"
},
{
"path": "files/recipes/mechanism/pressure_wood.recipe",
"chars": 88,
"preview": "# Input\nwidth 2\nheight 1\n<-\n5 5\n->\n\n# Output\noutputcount 1\noutputtype 72\noutputhealth 0\n"
},
{
"path": "files/recipes/mechanism/torch_redstone.recipe",
"chars": 92,
"preview": "# Input\nwidth 1\nheight 2\n<-\n331\n280\n->\n\n# Output\noutputcount 1\noutputtype 76\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/bed.recipe",
"chars": 100,
"preview": "# Input\nwidth 3\nheight 2\n<-\n35 35 35\n5 5 5\n->\n\n# Output\noutputcount 1\noutputtype 355\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/book.recipe",
"chars": 98,
"preview": "# Input\nwidth 1\nheight 3\n\n<-\n339 339 339\n->\n\n# Output\noutputcount 1\noutputtype 340\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/bookshelf.recipe",
"chars": 109,
"preview": "# Input\nwidth 3\nheight 3\n\n<-\n5 5 5\n340 340 340\n5 5 5\n->\n\n# Output\noutputcount 1\noutputtype 47\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/chest.recipe",
"chars": 103,
"preview": "# Input\nwidth 3\nheight 3\n<-\n5 5 5\n5 -1 5\n5 5 5\n->\n\n# Output\noutputcount 1\noutputtype 54\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/fence_acacia.recipe",
"chars": 109,
"preview": "# Input\nwidth 3\nheight 2\n<-\n5:4 280 5:4\n5:4 280 5:4\n->\n\n# Output\noutputcount 3\noutputtype 192\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/fence_birch.recipe",
"chars": 109,
"preview": "# Input\nwidth 3\nheight 2\n<-\n5:2 280 5:2\n5:2 280 5:2\n->\n\n# Output\noutputcount 3\noutputtype 189\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/fence_dark_oak.recipe",
"chars": 109,
"preview": "# Input\nwidth 3\nheight 2\n<-\n5:5 280 5:5\n5:5 280 5:5\n->\n\n# Output\noutputcount 3\noutputtype 191\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/fence_jungle.recipe",
"chars": 109,
"preview": "# Input\nwidth 3\nheight 2\n<-\n5:3 280 5:3\n5:3 280 5:3\n->\n\n# Output\noutputcount 3\noutputtype 190\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/fence_oak.recipe",
"chars": 108,
"preview": "# Input\nwidth 3\nheight 2\n<-\n5:0 280 5:0\n5:0 280 5:0\n->\n\n# Output\noutputcount 3\noutputtype 85\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/fence_spruce.recipe",
"chars": 109,
"preview": "# Input\nwidth 3\nheight 2\n<-\n5:1 280 5:1\n5:1 280 5:1\n->\n\n# Output\noutputcount 3\noutputtype 188\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/furnace.recipe",
"chars": 103,
"preview": "# Input\nwidth 3\nheight 3\n<-\n4 4 4\n4 -1 4\n4 4 4\n->\n\n# Output\noutputcount 1\noutputtype 61\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/jackolantern.recipe",
"chars": 91,
"preview": "# Input\nwidth 1\nheight 2\n\n<-\n86\n50\n->\n\n# Output\noutputcount 1\noutputtype 91\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/jukebox.recipe",
"chars": 105,
"preview": "# Input\nwidth 3\nheight 3\n\n<-\n5 5 5\n5 264 5\n5 5 5\n->\n\n# Output\noutputcount 1\noutputtype 84\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/ladder.recipe",
"chars": 118,
"preview": "# Input\nwidth 3\nheight 3\n<-\n280 -1 280\n280 280 280\n280 -1 280\n->\n\n# Output\noutputcount 2\noutputtype 65\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/painting.recipe",
"chars": 121,
"preview": "# Input\nwidth 3\nheight 3\n\n<-\n280 280 280\n280 26 280\n280 280 280\n->\n\n# Output\noutputcount 1\noutputtype 321\noutputhealth 0"
},
{
"path": "files/recipes/misc/paper.recipe",
"chars": 98,
"preview": "# Input\nwidth 3\nheight 1\n\n<-\n338 338 338\n->\n\n# Output\noutputcount 3\noutputtype 339\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/sign.recipe",
"chars": 115,
"preview": "# Input\nwidth 3\nheight 3\n<-\n 5 5 5\n 5 5 5\n-1 280 -1\n->\n\n# Output\noutputcount 1\noutputtype 323\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/stairs_stone.recipe",
"chars": 108,
"preview": "# Input\nwidth 3\nheight 3\n<-\n4 -1 -1\n4 4 -1\n4 4 4\n->\n\n# Output\noutputcount 4\noutputtype 67\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/stairs_wood.recipe",
"chars": 108,
"preview": "# Input\nwidth 3\nheight 3\n<-\n5 -1 -1\n5 5 -1\n5 5 5\n->\n\n# Output\noutputcount 4\noutputtype 53\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/torch.recipe",
"chars": 92,
"preview": "# Input\nwidth 1\nheight 2\n<-\n263\n280\n->\n\n# Output\noutputcount 4\noutputtype 50\noutputhealth 0\n"
},
{
"path": "files/recipes/misc/workbench.recipe",
"chars": 92,
"preview": "# Input\nwidth 2\nheight 2\n<-\n5 5\n5 5\n->\n\n# Output\noutputcount 1\noutputtype 58\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/axe_diamond.recipe",
"chars": 108,
"preview": "# Input\nwidth 2\nheight 3\n<-\n264 264\n264 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 279\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/axe_gold.recipe",
"chars": 108,
"preview": "# Input\nwidth 2\nheight 3\n<-\n266 266\n266 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 286\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/axe_iron.recipe",
"chars": 108,
"preview": "# Input\nwidth 2\nheight 3\n<-\n265 265\n265 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 258\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/axe_stone.recipe",
"chars": 102,
"preview": "# Input\nwidth 2\nheight 3\n<-\n4 4\n4 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 275\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/axe_wood.recipe",
"chars": 102,
"preview": "# Input\nwidth 2\nheight 3\n<-\n5 5\n5 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 271\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/bucket.recipe",
"chars": 106,
"preview": "# Input\nwidth 3\nheight 2\n<-\n265 -1 265\n-1 265 -1\n->\n\n# Output\noutputcount 1\noutputtype 325\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/clock.recipe",
"chars": 117,
"preview": "# Input\nwidth 3\nheight 3\n<-\n-1 266 -1\n266 331 266\n-1 266 -1\n->\n\n# Output\noutputcount 1\noutputtype 347\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/compass.recipe",
"chars": 117,
"preview": "# Input\nwidth 3\nheight 3\n<-\n-1 265 -1\n265 331 265\n-1 265 -1\n->\n\n# Output\noutputcount 1\noutputtype 345\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/fishingrod.recipe",
"chars": 117,
"preview": "# Input\nwidth 3\nheight 3\n<-\n-1 -1 280\n-1 280 287\n280 -1 286\n->\n\n# Output\noutputcount 1\noutputtype 346\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/flintsteel.recipe",
"chars": 100,
"preview": "# Input\nwidth 2\nheight 2\n<-\n265 -1\n-1 318 \n->\n\n# Output\noutputcount 1\noutputtype 259\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/hoe_diamond.recipe",
"chars": 107,
"preview": "# Input\nwidth 2\nheight 3\n<-\n264 264\n-1 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 293\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/hoe_gold.recipe",
"chars": 107,
"preview": "# Input\nwidth 2\nheight 3\n<-\n266 266\n-1 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 294\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/hoe_iron.recipe",
"chars": 107,
"preview": "# Input\nwidth 2\nheight 3\n<-\n265 265\n-1 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 292\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/hoe_stone.recipe",
"chars": 103,
"preview": "# Input\nwidth 2\nheight 3\n<-\n4 4\n-1 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 291\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/hoe_wood.recipe",
"chars": 103,
"preview": "# Input\nwidth 2\nheight 3\n<-\n5 5\n-1 280\n-1 280\n->\n\n# Output\noutputcount 1\noutputtype 290\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/pickaxe_diamond.recipe",
"chars": 117,
"preview": "# Input\nwidth 3\nheight 3\n<-\n264 264 264\n-1 280 -1\n-1 280 -1\n->\n\n# Output\noutputcount 1\noutputtype 278\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/pickaxe_gold.recipe",
"chars": 117,
"preview": "# Input\nwidth 3\nheight 3\n<-\n266 266 266\n-1 280 -1\n-1 280 -1\n->\n\n# Output\noutputcount 1\noutputtype 285\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/pickaxe_iron.recipe",
"chars": 117,
"preview": "# Input\nwidth 3\nheight 3\n<-\n265 265 265\n-1 280 -1\n-1 280 -1\n->\n\n# Output\noutputcount 1\noutputtype 257\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/pickaxe_stone.recipe",
"chars": 111,
"preview": "# Input\nwidth 3\nheight 3\n<-\n4 4 4\n-1 280 -1\n-1 280 -1\n->\n\n# Output\noutputcount 1\noutputtype 274\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/pickaxe_wood.recipe",
"chars": 111,
"preview": "# Input\nwidth 3\nheight 3\n<-\n5 5 5\n-1 280 -1\n-1 280 -1\n->\n\n# Output\noutputcount 1\noutputtype 270\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/shears.recipe",
"chars": 99,
"preview": "# Input\nwidth 2\nheight 2\n<-\n-1 265\n265 -1\n->\n\n# Output\noutputcount 1\noutputtype 359\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/shovel_diamond.recipe",
"chars": 97,
"preview": "# Input\nwidth 1\nheight 3\n<-\n264\n280\n280\n->\n\n# Output\noutputcount 1\noutputtype 277\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/shovel_gold.recipe",
"chars": 97,
"preview": "# Input\nwidth 1\nheight 3\n<-\n266\n280\n280\n->\n\n# Output\noutputcount 1\noutputtype 284\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/shovel_iron.recipe",
"chars": 97,
"preview": "# Input\nwidth 1\nheight 3\n<-\n265\n280\n280\n->\n\n# Output\noutputcount 1\noutputtype 256\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/shovel_stone.recipe",
"chars": 95,
"preview": "# Input\nwidth 1\nheight 3\n<-\n4\n280\n280\n->\n\n# Output\noutputcount 1\noutputtype 273\noutputhealth 0\n"
},
{
"path": "files/recipes/tools/shovel_wood.recipe",
"chars": 95,
"preview": "# Input\nwidth 1\nheight 3\n<-\n5\n280\n280\n->\n\n# Output\noutputcount 1\noutputtype 269\noutputhealth 0\n"
},
{
"path": "files/recipes/transport/boat.recipe",
"chars": 98,
"preview": "# Input\nwidth 3\nheight 2\n<-\n5 -1 5\n5 5 5\n->\n\n# Output\noutputcount 1\noutputtype 333\noutputhealth 0\n"
},
{
"path": "files/recipes/transport/minecart.recipe",
"chars": 108,
"preview": "# Input\nwidth 3\nheight 2\n<-\n265 -1 265\n265 265 265\n->\n\n# Output\noutputcount 1\noutputtype 328\noutputhealth 0\n"
},
{
"path": "files/recipes/transport/minecart_powered.recipe",
"chars": 92,
"preview": "# Input\nwidth 1\nheight 2\n<-\n61\n328\n->\n\n# Output\noutputcount 1\noutputtype 343\noutputhealth 0\n"
},
{
"path": "files/recipes/transport/minecart_storage.recipe",
"chars": 92,
"preview": "# Input\nwidth 1\nheight 2\n<-\n54\n328\n->\n\n# Output\noutputcount 1\noutputtype 342\noutputhealth 0\n"
},
{
"path": "files/recipes/transport/minecart_tracks.recipe",
"chars": 119,
"preview": "# Input\nwidth 3\nheight 3\n<-\n265 -1 265\n265 280 265\n265 -1 265\n->\n\n# Output\noutputcount 16\noutputtype 66\noutputhealth 0\n"
},
{
"path": "files/recipes/weapons/arrows.recipe",
"chars": 97,
"preview": "# Input\nwidth 1\nheight 3\n<-\n318\n280\n288\n->\n\n# Output\noutputcount 4\noutputtype 262\noutputhealth 0\n"
},
{
"path": "files/recipes/weapons/bow.recipe",
"chars": 118,
"preview": "# Input\nwidth 3\nheight 3\n<-\n287 280 -1\n287 -1 280\n287 280 -1\n->\n\n# Output\noutputcount 1\noutputtype 261\noutputhealth 0\n"
},
{
"path": "files/recipes/weapons/sword_diamond.recipe",
"chars": 100,
"preview": "# Input\nwidth 1\nheight 3\n<-\n264\n264\n280\n->\n\n# Output\noutputcount 1\noutputtype 276\noutputhealth 1562\n"
},
{
"path": "files/recipes/weapons/sword_gold.recipe",
"chars": 98,
"preview": "# Input\nwidth 1\nheight 3\n<-\n266\n266\n280\n->\n\n# Output\noutputcount 1\noutputtype 283\noutputhealth 33\n"
},
{
"path": "files/recipes/weapons/sword_iron.recipe",
"chars": 97,
"preview": "# Input\nwidth 1\nheight 3\n<-\n265\n265\n280\n->\n\n# Output\noutputcount 1\noutputtype 267\noutputhealth 0\n"
},
{
"path": "files/recipes/weapons/sword_stone.recipe",
"chars": 93,
"preview": "# Input\nwidth 1\nheight 3\n<-\n4\n4\n280\n->\n\n# Output\noutputcount 1\noutputtype 272\noutputhealth 0\n"
},
{
"path": "files/recipes/weapons/sword_wood.recipe",
"chars": 93,
"preview": "# Input\nwidth 1\nheight 3\n<-\n5\n5\n280\n->\n\n# Output\noutputcount 1\noutputtype 268\noutputhealth 0\n"
},
{
"path": "files/recipes/white.recipe",
"chars": 95,
"preview": "# Input\nwidth 1\nheight 1\n\n<-\n35 351:15\n->\n\n# Output\noutputcount 1\noutputtype 35\noutputhealth 0\n"
},
{
"path": "files/roles.txt",
"chars": 36,
"preview": "# admins\n[Server]\n\n# ops\n\n# members\n"
},
{
"path": "files/rules.txt",
"chars": 99,
"preview": "# Server rules here\n§4Server rules\n1. Do not whine\n2. Whine\n3. Whining is required\n4. ^__________^"
},
{
"path": "files/test.lua",
"chars": 93,
"preview": "print (\"Hi, enjoy hacking with Lua\");\nfunction timer200()\n calltest(\"test1\", \"test2\");\nend;\n"
},
{
"path": "files/whitelist.txt",
"chars": 87,
"preview": "# This is default whitelist file. Write nicks to be whitelisted here one for each line\n"
},
{
"path": "init.d/mineserver.centos",
"chars": 1065,
"preview": "#!/bin/bash\n#\n# mineserver Startup script for the Mineserver\n#\n# chkconfig: - 85 15\n# description: Mineserver is "
},
{
"path": "plugins/CMakeLists.txt",
"chars": 1878,
"preview": "cmake_minimum_required(VERSION 2.6)\n# forbid running cmake from this subdir\nif(PROJECT_NAME STREQUAL \"Project\")\n messag"
},
{
"path": "plugins/binlog/binlog.cfg",
"chars": 131,
"preview": "system.plugins += (\"binlog\":\"./binlog\");\n\n# Enable Transaction Logging?\nenable_binary_logging = true\nbinary_log = \"minse"
},
{
"path": "plugins/binlog/binlog.cpp",
"chars": 9672,
"preview": "/*\n Copyright (c) 2010, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary"
},
{
"path": "plugins/binlog/binlog.h",
"chars": 2288,
"preview": "/*\n Copyright (c) 2010, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary"
},
{
"path": "plugins/binlog/binlogdump.cpp",
"chars": 2242,
"preview": "/*\n Copyright (c) 2010, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary"
},
{
"path": "plugins/commands/commands.cpp",
"chars": 29330,
"preview": "/*\n Copyright (c) 2013, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "plugins/commands/commands.h",
"chars": 134,
"preview": "#include <string>\n\n#ifndef _PLUGIN_COMMANDS_H\n#define _PLUGIN_COMMANDS_H\n\nstd::deque<std::string> parseCmd(std::string c"
},
{
"path": "plugins/crapMobs/crapMobs.cpp",
"chars": 3975,
"preview": "/*\ng++ -c crapMobs.cpp\ng++ -shared crapMobs.o -o crapMobs.so\n\ncopy nether.so to Mineserver bin directory.\n*/\n/*\n Copyri"
},
{
"path": "plugins/crapMobs/crapMobs.h",
"chars": 132,
"preview": "#include <string>\n\n#ifndef _PLUGIN_COMMAND_H\n#define _PLUGIN_COMMAND_H\n\nstd::deque<std::string> parseCmd(std::string cmd"
},
{
"path": "plugins/cursesui/screen.cpp",
"chars": 14452,
"preview": "/*\n Copyright (c) 2011, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary "
},
{
"path": "plugins/cursesui/screen.h",
"chars": 2934,
"preview": "/*\n Copyright (c) 2011, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary "
},
{
"path": "plugins/filelog/filelog.cpp",
"chars": 6450,
"preview": "/*\n Copyright (c) 2011, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary "
},
{
"path": "plugins/flatpermissions/flatpermissions.cpp",
"chars": 4088,
"preview": "/*\n\ng++ -c flatpermissions.cpp\ng++ -shared flatpermissions.o -o flatpermissions.so\n\n*/\n/*\n Copyright (c) 2013, The Mine"
},
{
"path": "plugins/luascript/luascript.cpp",
"chars": 10636,
"preview": "/*\n Copyright (c) 2013, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "plugins/luascript/luawrapper.cpp",
"chars": 1872,
"preview": "/*\n Copyright (c) 2012, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "plugins/luascript/luawrapper.h",
"chars": 1538,
"preview": "/*\n Copyright (c) 2012, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "plugins/nBreak/nBreak.cpp",
"chars": 4444,
"preview": "/*\ng++ -c nBreak.cpp\ng++ -shared nBreak.o -o nBreak.so\n\ncopy nether.so to Mineserver bin directory.\n*/\n/*\n Copyright (c"
},
{
"path": "plugins/nBreak/nBreak.h",
"chars": 132,
"preview": "#include <string>\n\n#ifndef _PLUGIN_COMMAND_H\n#define _PLUGIN_COMMAND_H\n\nstd::deque<std::string> parseCmd(std::string cmd"
},
{
"path": "plugins/nether/nether.cpp",
"chars": 7506,
"preview": "/*\ng++ -c nether.cpp\ng++ -shared nether.o -o nether.so\n\ncopy nether.so to Mineserver bin directory.\n*/\n/*\n Copyright (c"
},
{
"path": "plugins/nether/nether.h",
"chars": 132,
"preview": "#include <string>\n\n#ifndef _PLUGIN_COMMAND_H\n#define _PLUGIN_COMMAND_H\n\nstd::deque<std::string> parseCmd(std::string cmd"
},
{
"path": "plugins/passiveMobs/passiveMobs.cpp",
"chars": 14611,
"preview": "/*\n Copyright (c) 2010, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "plugins/passiveMobs/passiveMobs.h",
"chars": 126,
"preview": "#include <string>\n\n#ifndef _PLUGIN_MOBS_H\n#define _PLUGIN_MOBS_H\n\nstd::deque<std::string> parseCmd(std::string cmd);\n\n\n#"
},
{
"path": "src/CMakeLists.txt",
"chars": 1435,
"preview": "cmake_minimum_required(VERSION 2.6)\n# forbid running cmake from this subdir\nif(PROJECT_NAME STREQUAL \"Project\")\n messag"
},
{
"path": "src/SystemExceptions.h",
"chars": 2821,
"preview": "/*\n Copyright (c) 2011-2012, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and bina"
},
{
"path": "src/blocks/basic.cpp",
"chars": 9158,
"preview": "/*\n Copyright (c) 2012, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "src/blocks/basic.h",
"chars": 4165,
"preview": "/*\n Copyright (c) 2011, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "src/blocks/bed.cpp",
"chars": 4375,
"preview": "/*\n Copyright (c) 2011, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary fo"
},
{
"path": "src/blocks/bed.h",
"chars": 2687,
"preview": "/*\n Copyright (c) 2011, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary "
},
{
"path": "src/blocks/blockbrewingstand.cpp",
"chars": 4397,
"preview": "/*\n Copyright (c) 2016, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary "
},
{
"path": "src/blocks/blockbrewingstand.h",
"chars": 2140,
"preview": "/*\n Copyright (c) 2016, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary "
},
{
"path": "src/blocks/blockfurnace.cpp",
"chars": 4518,
"preview": "/*\n Copyright (c) 2011, The Mineserver Project\n All rights reserved.\n\n Redistribution and use in source and binary "
}
]
// ... and 183 more files (download for full content)
About this extraction
This page contains the full source code of the fador/mineserver GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 383 files (1.3 MB), approximately 375.6k tokens, and a symbol index with 609 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.