Showing preview only (475K chars total). Download the full file or copy to clipboard to get everything.
Repository: udoprog/c10t
Branch: master
Commit: 4b9cb2e173f1
Files: 140
Total size: 441.8 KB
Directory structure:
gitextract_o4qlv98t/
├── .gitignore
├── .gitmodules
├── CMakeLists.txt
├── ChangeLog
├── LICENSE.txt
├── README.md
├── dist/
│ ├── Makefile.osx
│ ├── README.md
│ ├── all.sh
│ ├── config.mk
│ ├── make.sh
│ └── targets/
│ ├── x86-linux
│ ├── x86-windows
│ ├── x86_64-linux
│ └── x86_64-windows
├── docs/
│ ├── NBT.txt
│ ├── bigtest.nbt
│ └── test.nbt
├── gui/
│ └── c10t-tk/
│ ├── README
│ ├── c10t-tk.py
│ ├── mainwindow.py
│ └── tooltip.py
├── palette.json
├── res/
│ ├── example.html
│ └── libc10t.js
├── scripts/
│ ├── area-set.sh
│ ├── area-slice.sh
│ ├── generate-tests.sh
│ └── google-api/
│ ├── README.txt
│ ├── google-api.php
│ ├── google-api.ps1
│ ├── google-api.sh
│ ├── index.html
│ └── libc10t.google.js
├── src/
│ ├── 2d/
│ │ └── cube.hpp
│ ├── algorithm.cpp
│ ├── algorithm.hpp
│ ├── altitude_graph.cpp
│ ├── altitude_graph.hpp
│ ├── cache.hpp
│ ├── dirlist.cpp
│ ├── dirlist.hpp
│ ├── dlopen.cpp
│ ├── dlopen.hpp
│ ├── engine/
│ │ ├── CMakeLists.txt
│ │ ├── block_rotation.cpp
│ │ ├── block_rotation.hpp
│ │ ├── engine_base.hpp
│ │ ├── engine_core.hpp
│ │ ├── engine_settings.hpp
│ │ ├── fatiso_engine.cpp
│ │ ├── fatiso_engine.hpp
│ │ ├── flat_base.cpp
│ │ ├── flat_base.hpp
│ │ ├── functions.cpp
│ │ ├── functions.hpp
│ │ ├── isometric_base.cpp
│ │ ├── isometric_base.hpp
│ │ ├── isometric_engine.cpp
│ │ ├── isometric_engine.hpp
│ │ ├── oblique_engine.cpp
│ │ ├── oblique_engine.hpp
│ │ ├── obliqueangle_engine.cpp
│ │ ├── obliqueangle_engine.hpp
│ │ ├── topdown_engine.cpp
│ │ └── topdown_engine.hpp
│ ├── fileutils.cpp
│ ├── fileutils.hpp
│ ├── generate_map.cpp
│ ├── generate_map.hpp
│ ├── generate_statistics.cpp
│ ├── generate_statistics.hpp
│ ├── image/
│ │ ├── CMakeLists.txt
│ │ ├── algorithms.cpp
│ │ ├── algorithms.hpp
│ │ ├── cached_image.cpp
│ │ ├── cached_image.hpp
│ │ ├── color.cpp
│ │ ├── color.hpp
│ │ ├── format/
│ │ │ ├── base.hpp
│ │ │ └── png.hpp
│ │ ├── image_base.cpp
│ │ ├── image_base.hpp
│ │ ├── image_operations.cpp
│ │ ├── image_operations.hpp
│ │ ├── memory_image.cpp
│ │ ├── memory_image.hpp
│ │ └── virtual_image.hpp
│ ├── json.cpp
│ ├── json.hpp
│ ├── main.cpp
│ ├── main_utils.cpp
│ ├── main_utils.hpp
│ ├── marker.cpp
│ ├── marker.hpp
│ ├── mc/
│ │ ├── CMakeLists.txt
│ │ ├── blocks.cpp
│ │ ├── blocks.hpp
│ │ ├── dynamic_buffer.cpp
│ │ ├── dynamic_buffer.hpp
│ │ ├── level.cpp
│ │ ├── level.hpp
│ │ ├── level_info.cpp
│ │ ├── level_info.hpp
│ │ ├── marker.cpp
│ │ ├── marker.hpp
│ │ ├── region.cpp
│ │ ├── region.hpp
│ │ ├── region_inspect.cpp
│ │ ├── region_iterator.cpp
│ │ ├── region_iterator.hpp
│ │ ├── rotated_level_info.cpp
│ │ ├── rotated_level_info.hpp
│ │ ├── utils.cpp
│ │ ├── utils.hpp
│ │ ├── world.cpp
│ │ └── world.hpp
│ ├── nbt/
│ │ ├── CMakeLists.txt
│ │ ├── nbt.cpp
│ │ ├── nbt.hpp
│ │ ├── nbt_inspect.cpp
│ │ └── types.hpp
│ ├── nullstream.cpp
│ ├── nullstream.hpp
│ ├── players.cpp
│ ├── players.hpp
│ ├── settings_t.cpp
│ ├── settings_t.hpp
│ ├── text.cpp
│ ├── text.hpp
│ ├── threads/
│ │ ├── renderer.hpp
│ │ ├── renderer_settings.hpp
│ │ ├── threadworker.hpp
│ │ ├── threadworker_fake.hpp
│ │ └── threadworker_impl.hpp
│ ├── warps.cpp
│ ├── warps.hpp
│ └── win32/
│ └── tss_cleanup_implemented.cpp
└── test/
├── CMakeLists.txt
└── test.cpp
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
*~
*.pyc
build
*.cmake
*.a
Makefile
CMakeFiles
*.orig
*.rej
src/config.hpp
================================================
FILE: .gitmodules
================================================
[submodule "libs/unc"]
path = libs/unc
url = git://github.com/udoprog/unc.git
branch = stable
================================================
FILE: CMakeLists.txt
================================================
cmake_minimum_required(VERSION 2.6)
project(c10t)
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}")
# attempt to find out which revision we are building from
execute_process(COMMAND git rev-list HEAD -n1 --abbrev-commit
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE C10T_REVISION)
OPTION(BUILD_DEV_LIBS "Attempt to build libraries under ./libs" ON)
set(C10T_VERSION "git ${C10T_REVISION}")
set(C10T_SITE "http://github.com/udoprog/c10t")
set(C10T_CONTACT "Udoprog <johnjohn.tedro@gmail.com> et. al (see README)")
set(C10T_COMMENT "Created using c10t (http://github.com/udoprog/c10t)")
configure_file(${CMAKE_SOURCE_DIR}/src/config.hpp.cmake
${CMAKE_BINARY_DIR}/src/config.hpp)
include_directories(${CMAKE_BINARY_DIR}/src)
# output the binary to the build directory instead of in src/
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
OPTION(Boost_USE_STATIC_LIBS "Use static boost libs" TRUE)
find_package(ZLIB REQUIRED)
find_package(PNG 1.2 REQUIRED)
find_package(Freetype 2 REQUIRED)
find_package(Threads REQUIRED)
find_package(Boost 1.46 COMPONENTS thread filesystem system REQUIRED)
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${ZLIB_INCLUDE_DIR})
include_directories(${PNG_INCLUDE_DIR})
include_directories(${FREETYPE_INCLUDE_DIR_freetype2})
include_directories(${FREETYPE_INCLUDE_DIR_ft2build})
include_directories(${Boost_INCLUDE_DIR})
set(c10t_LIBRARIES
dl
# internal libraries that could/should be externalized
c10t-image
c10t-nbt
c10t-mc
c10t-engine
# external libraries
${ZLIB_LIBRARIES}
${PNG_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${Boost_LIBRARIES}
${FREETYPE_LIBRARY}
)
if (BUILD_DEV_LIBS)
include_directories("${CMAKE_SOURCE_DIR}/libs/unc/src")
add_subdirectory(libs/unc)
set(c10t_LIBRARIES ${c10t_LIBRARIES}
unc
uncdata
)
else (BUILD_DEV_LIBS)
find_package(PkgConfig)
pkg_check_modules(UNC unc)
set(c10t_LIBRARIES ${c10t_LIBRARIES} ${UNC_LIBRARIES})
endif (BUILD_DEV_LIBS)
add_subdirectory(src/image)
add_subdirectory(src/engine)
add_subdirectory(src/nbt)
add_subdirectory(src/mc)
add_subdirectory(test)
set(c10t_SOURCES
src/main.cpp
src/dlopen.cpp
src/main_utils.cpp
src/algorithm.cpp
src/players.cpp
src/fileutils.cpp
src/dirlist.cpp
src/altitude_graph.cpp
src/warps.cpp
src/text.cpp
src/json.cpp
src/generate_map.cpp
src/generate_statistics.cpp
src/marker.cpp
src/nullstream.cpp
src/settings_t.cpp
)
add_executable(c10t ${c10t_SOURCES})
add_executable(c10t-debug EXCLUDE_FROM_ALL ${c10t_SOURCES})
add_executable(nbt-inspect EXCLUDE_FROM_ALL src/nbt/nbt_inspect.cpp src/nbt/nbt.cpp)
add_executable(region-inspect EXCLUDE_FROM_ALL src/mc/region_inspect.cpp)
set_target_properties(c10t PROPERTIES COMPILE_FLAGS "-O3 -Wall -pedantic")
set_target_properties(c10t-debug PROPERTIES COMPILE_FLAGS "-Wall -pedantic -g")
set_target_properties(nbt-inspect PROPERTIES COMPILE_FLAGS "-O3 -Wall -pedantic")
set_target_properties(region-inspect PROPERTIES COMPILE_FLAGS "-O3 -Wall -pedantic")
target_link_libraries(c10t ${c10t_LIBRARIES})
target_link_libraries(c10t-debug ${c10t_LIBRARIES})
target_link_libraries(nbt-inspect ${ZLIB_LIBRARIES})
target_link_libraries(region-inspect ${c10t_LIBRARIES})
================================================
FILE: ChangeLog
================================================
Wed Nov 17 21:23:38 CET 2010
- By popular demand, including the google-api scripts by the following
individuals from minecraftforum:
Rendrik - php
Kochu - powershell
Wed Nov 3 15:16:21 CET 2010
- Show warp positions, by phlip at minecraftforum
================================================
FILE: LICENSE.txt
================================================
// BSD license. Copyright (c) 2010, John-John Tedro et al.
// 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 minecraft community 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 OR CONTRIBUTORS 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
================================================
c10t - a cartography tool for Minecraft
=======================================
I wrote c10t entirely because i liked the tool Cartograph by ZomBuster, but I wasn't too fond of a couple of aspects about how rendering was performed.
Requirements
------------
* libz (?)
* libpng (>= 1.2)
* libfreetype (>= 2)
* libboost (thread, filesystem, system and test) (>= 1.46)
Features
--------
* Pipelined rendering process (using image compositioning) which allows for
multithreaded rendering.
* Very memory friendly, you can specify a memory limit and it will switch caching to file.
* Uses proper command line options.
* Clean code, for easing further development.
* Multiplatform - yes, it does compile properly on windows and mac.
* A gui wrapper, see: http://github.com/udoprog/c10t-swt (native gui with java bindings)
I would not have done this were it not for the excellent inspiration by
ZomBuster and Firemark (the linux port of cartograph). Thank you for the
inspiration.
Building from Source (using cmake)
----------------------------------
### Ubuntu ###
1. Install dependencies:
$ sudo apt-get install build-essential cmake libpng-dev zlib1g-dev libboost-all-dev libfreetype6-dev
If libboost >= 1.46 is not available by using your package manager, you need to install it from source. To do so download and untar it from www.boost.org and perform the following operations as root:
$ ./bootstrap --prefix=/usr
$ ./b2 install
If you have troubles installing boost, consult the Getting Started Guide on the website of the boost library.
2. Clone repository
$ git clone git://github.com/udoprog/c10t.git
$ cd c10t
You need to clone the repository in order to successfully execute the commands in step three. You can get support for git on the following web page:
http://schacon.github.com/git/gittutorial.html
Just scroll to the section "Using git for collaboration".
3. Update submodules which contains some required dependencies (./libs):
$ git submodule init
$ git submodule update
4. Run:
$ mkdir build
$ cd build
$ cmake ..
$ make c10t
* CMake should generate a file called src/config.h from the input file src/config.h.cmake
* There are several targets you can make. c10t, c10t-lib, c10t-debug, and c10t-test.
* If you wish to build all of these simply run `make` which defaults to target `all`.
* If you wish to build any individual one run `make <target>` e.g. `make c10t-test`.
4. The executable `c10t` should be in the current directory.
There are a couple of available targets
* ___c10t-debug___ - debug build with symbols, nice for debugging
* ___c10t-lib___ - library that contains all c10t functions not in main or nbt_inspect
* ___nbt-inspect___ - dumps the content of an nbt data file (basically anything in the world directory). Useful for writing tools.
* ___region-inspect___ - dumps the content of a mcr region file.
Issues
------
* Issues should be posted on http://github.com/udoprog/c10t/issues
* Run the program in debug mode (c10t --debug), this will print useful information, but be much slower.
* ALWAYS include `c10t --version` information when posting issues, that way it can be determined weither the issue already has been resolved or not, if this information is missing, the issue probably cannot be resolved.
* ALWAYS include the following information: Platform (e.g. Windows, Linux, Mac) and Architecture (x86, x86_64)
* IF POSSIBLE include information which can help us reproduce the problem.
Contributors
------------
UniversE - for epic center calculation, and saving the api!
Contributions
-------------
ZomBuster and Firemark - for their original work
Guardian9979 - for his continual nagging for improvements
acleone - for his work with cmake [85e980a]
j005u - for explaining how cocoa works
jnnnnn - for limit options which are helpful when debugging (and quite cool)
mudaltsov - for mapping out the Mac OS X building process and creating a splendid package!
frozencow - for fixing boost_thread configuration for cmake
reportingjsr - for pointing out build issues
Dim-Dul - for providing a nice map to render
vostok4 - for implementing google API support
rmmh - for figuring out png compression and encouraging people to build properly.
Athemis - for fixing beta 1.2 compatibility.
sn4kebite - for implementing Wool colors.
ekryyn - for implementing the altitude graph!
================================================
FILE: dist/Makefile.osx
================================================
ARCH=intel
OS=osx
VERSION=SNAPSHOT
USR=/opt/local
CXXFLAGS=-arch i386 -arch x86_64 -Isrc -I/opt/local/include
LDFLAGS=-pthread
LDFLAGS+="/opt/local/lib/libpng.a"
LDFLAGS+="/opt/local/lib/libz.a"
LDFLAGS+="/opt/local/lib/libboost_thread-mt.a"
LDFLAGS+="/opt/local/lib/libboost_system-mt.a"
LDFLAGS+="/opt/local/lib/libboost_filesystem-mt.a"
LDFLAGS+="/opt/local/lib/libfreetype.a"
DIST=c10t
BIN=c10t
TARGET_DEBUG=c10t-debug
include config.mk
local-package:
cp LICENSE.txt ${PACKAGE}/LICENSE.txt
cp README.md ${PACKAGE}/README
cp -R scripts/google-api/ ${PACKAGE}/
cp -R res/libc10t.js ${PACKAGE}/
cp -R res/example.html ${PACKAGE}/
zip -r ${PACKAGE}-${OS}-${ARCH}.zip ${PACKAGE}
mv ${PACKAGE}-${OS}-${ARCH}.zip ${BUILD}/${PACKAGE}-${OS}-${ARCH}.zip
sha1sum ${BUILD}/${PACKAGE}-${OS}-${ARCH}.zip > ${BUILD}/${PACKAGE}-${OS}-${ARCH}.zip.sha1
================================================
FILE: dist/README.md
================================================
This little setup came out of me wanting to setup my server to build SNAPSHOTS about once very day.
These scripts generate static binaries, and they require you to have all required libraries pre-installed.
This is not meant to be used by a broad set of users, therefore it is very specialized to my system setup, but still might be useful if you want to setup something similar yourself.
This is what I do for building static binary for windows:
i686-mingw32-g++ -DBOOST_THREAD_USE_LIB -I./contrib/include \
-static-libgcc $(find src -name "*.cpp") \
./contrib/boost_thread/src/win32/thread.cpp \
./contrib/boost_thread/src/win32/tss_pe.cpp \
./contrib/tss_dummy.cpp \
-static -lpng14 -lz -lpthreadGC2 \
-o c10t.exe
Now, the only thing I havent gotten down yet is mac. I have no experience and no means to test it, so if someone would like to inform me on how it's done, I'm all ears.
If you want to run these manually, you have to be in the root directory, and issue the following command:
make -f dist/Makefile.<target-os> clean all
Please not that the 'clean' is basically compulsary, since it will probably otherwise break when doing multiple targets due to output format.
This also assumes that you've already generated the src/config.h, you do this by typing:
cmake .
My cross development setup is base of gentoo crossdev, this allows me to have multiple comilers and library setups without conflicts:
http://en.gentoo-wiki.com/wiki/Crossdev
Good luck, this is me sharing my experiences
-- Udoprog
================================================
FILE: dist/all.sh
================================================
#!/bin/sh
for dist in $(ls -1 dist/targets); do
if ! dist/make.sh $dist "$@"; then
echo "TARGET FAILED: $dist"
exit 1
fi
done
================================================
FILE: dist/config.mk
================================================
USR?=/usr/${TARGET}/usr
LIB?=${USR}/lib
SOURCES+=src/algorithm.cpp
SOURCES+=src/altitude_graph.cpp
SOURCES+=src/dirlist.cpp
SOURCES+=src/dlopen.cpp
SOURCES+=src/engine/block_rotation.cpp
SOURCES+=src/engine/fatiso_engine.cpp
SOURCES+=src/engine/flat_base.cpp
SOURCES+=src/engine/functions.cpp
SOURCES+=src/engine/isometric_base.cpp
SOURCES+=src/engine/isometric_engine.cpp
SOURCES+=src/engine/obliqueangle_engine.cpp
SOURCES+=src/engine/oblique_engine.cpp
SOURCES+=src/engine/topdown_engine.cpp
SOURCES+=src/fileutils.cpp
SOURCES+=src/generate_map.cpp
SOURCES+=src/generate_statistics.cpp
SOURCES+=src/image/algorithms.cpp
SOURCES+=src/image/cached_image.cpp
SOURCES+=src/image/color.cpp
SOURCES+=src/image/image_base.cpp
SOURCES+=src/image/image_operations.cpp
SOURCES+=src/image/memory_image.cpp
SOURCES+=src/json.cpp
SOURCES+=src/main.cpp
SOURCES+=src/main_utils.cpp
SOURCES+=src/marker.cpp
SOURCES+=src/mc/blocks.cpp
SOURCES+=src/mc/dynamic_buffer.cpp
SOURCES+=src/mc/level.cpp
SOURCES+=src/mc/level_info.cpp
SOURCES+=src/mc/marker.cpp
SOURCES+=src/mc/region.cpp
SOURCES+=src/mc/region_inspect.cpp
SOURCES+=src/mc/region_iterator.cpp
SOURCES+=src/mc/rotated_level_info.cpp
SOURCES+=src/mc/utils.cpp
SOURCES+=src/mc/world.cpp
SOURCES+=src/nbt/nbt.cpp
SOURCES+=src/nbt/nbt_inspect.cpp
SOURCES+=src/nullstream.cpp
SOURCES+=src/players.cpp
SOURCES+=src/settings_t.cpp
SOURCES+=src/text.cpp
SOURCES+=src/warps.cpp
SOURCES+=src/win32/tss_cleanup_implemented.cpp
LDFLAGS+=${LIB}/libpng.a
LDFLAGS+=${LIB}/libboost_thread.a
LDFLAGS+=${LIB}/libboost_system.a
LDFLAGS+=${LIB}/libboost_filesystem.a
LDFLAGS+=${LIB}/libfreetype.a
LDFLAGS+=${LIB}/libz.a
LDFLAGS+=${LIB}/libbz2.a
LDFLAGS+=${LIB}/libdl.a
LDFLAGS+=${LIB}/libunc.a
LDFLAGS+=${LIB}/libuncdata.a
OBJECTS=${SOURCES:.cpp=.o}
CXXFLAGS+=-Isrc -I${USR}/include/freetype2 -Wall -fomit-frame-pointer -O2
CXX=${TARGET}-g++
STRIP=${TARGET}-strip
VERSION?=SNAPSHOT
PACKAGE=c10t-${VERSION}-${OS}-${ARCH}
BUILD=./build
all: package
.SUFFIXES: .cpp .o
.cpp.o:
${CXX} ${CXXFLAGS} -c $< -o $@
${BIN}: ${OBJECTS}
${CXX} ${CXXFLAGS} ${OBJECTS} ${LDFLAGS} -o ${BIN}
${STRIP} ${BIN}
clean:
${RM} ${OBJECTS}
${RM} -rf ${PACKAGE}
pre-package: ${BIN}
echo "pre-package: ${PACKAGE}"
mkdir -p ${PACKAGE}
cp ${BIN} ${PACKAGE}/${BIN}
rm -rf ${BUILD}
mkdir -p ${BUILD}
post-package:
echo "post-package: ${PACKAGE}"
${RM} -rf ${PACKAGE}
package: pre-package local-package post-package
%.sha1:
sha1sum $* > $*.sha1
cp $@ ${BUILD}/$@
%.tar.gz:
tar -cvf $*.tar $*
gzip -f $*.tar
cp $@ ${BUILD}/$@
%.zip:
zip -r $*.zip $*
cp $@ ${BUILD}/$@
================================================
FILE: dist/make.sh
================================================
#!/bin/bash
target=$1
shift
dist_target=dist/targets/$target
build_target=build/$target
dist_config=dist/config.mk
dist_src=src
dist_scripts=scripts
dist_res=res
exit_usage() {
echo "Usage: dist/dist.sh <target> [make-opts]"
echo "<target> is one of:"
ls -1 dist/targets
exit 1
}
do_cp() {
if test $1 -nt $2; then
printf "cp %-37s -> %s\n" "$1" "$2"
cp $1 $2
fi
return 0
}
do_sync() {
src=$1
dir=$2
shift 2
echo "Syncing $src to $dir/$src \"$@\""
while read file; do
target="$dir/$file"
mkdir -p $(dirname "$target")
if test $file -nt $target; then
printf "%-40s -> %s\n" "$file" "$target"
cp -p "$file" "$target"
fi
done < <(find $src -type f "$@")
}
[[ ! -d dist/targets ]] && echo "Not in build directory" && exit 1
[[ -z $target ]] && exit_usage
[[ ! -f $dist_target ]] && exit_usage
if ! cmake .; then
echo "cmake: failed"
exit 1
fi
mkdir -p $build_target
do_cp $dist_target $build_target/Makefile
do_cp $dist_config $build_target/config.mk
do_cp LICENSE.txt $build_target/LICENSE.txt
do_cp README.md $build_target/README.md
do_sync $dist_src $build_target -name "*.cpp"
do_sync $dist_src $build_target -name "*.hpp"
do_sync $dist_scripts $build_target
do_sync $dist_res $build_target
echo "cd $build_target && make $@"
cd $build_target && make "$@"
exit $?
================================================
FILE: dist/targets/x86-linux
================================================
ARCH=x86
OS=linux
TARGET=i686-linux-gnu
LDFLAGS=-pthread -static -static-libgcc
BIN=c10t
include config.mk
local-package:
cp LICENSE.txt ${PACKAGE}/LICENSE.txt
cp README.md ${PACKAGE}/README
cp -R scripts/google-api ${PACKAGE}/
cp -R res/libc10t.js ${PACKAGE}/
cp -R res/example.html ${PACKAGE}/
make ${PACKAGE}.tar.gz
make ${PACKAGE}.tar.gz.sha1
================================================
FILE: dist/targets/x86-windows
================================================
ARCH=x86
OS=windows
TARGET=i686-mingw32
BIN=c10t.exe
CXXFLAGS=-DBOOST_THREAD_USE_LIB=1
LDFLAGS=-static -static-libgcc
include config.mk
local-package:
cp LICENSE.txt ${PACKAGE}/LICENSE.txt
cp README.md ${PACKAGE}/README.txt
cp -R scripts/google-api ${PACKAGE}/
cp -R res/libc10t.js ${PACKAGE}/
cp -R res/example.html ${PACKAGE}/
make ${PACKAGE}.zip
make ${PACKAGE}.zip.sha1
================================================
FILE: dist/targets/x86_64-linux
================================================
ARCH=x86_64
OS=linux
LDFLAGS=-pthread -static -static-libgcc
BIN=c10t
include config.mk
TARGET=x86_64-linux-gnu
USR=/usr
local-package:
cp LICENSE.txt ${PACKAGE}/LICENSE.txt
cp README.md ${PACKAGE}/README
cp -R scripts/google-api ${PACKAGE}/
cp -R res/libc10t.js ${PACKAGE}/
cp -R res/example.html ${PACKAGE}/
make ${PACKAGE}.tar.gz
make ${PACKAGE}.tar.gz.sha1
================================================
FILE: dist/targets/x86_64-windows
================================================
ARCH=x86_64
OS=windows
TARGET=x86_64-w64-mingw32
BIN=c10t.exe
CXXFLAGS=-m64 -O3 -DBOOST_THREAD_USE_LIB=1 -DBOOST_USE_WINDOWS_H
LDFLAGS=-static -static-libgcc
SOURCES=src/win32/tss_cleanup_implemented.cpp
include config.mk
local-package:
cp LICENSE.txt ${PACKAGE}/LICENSE.txt
cp README.md ${PACKAGE}/README.txt
cp -R scripts/google-api ${PACKAGE}/
cp -R res/libc10t.js ${PACKAGE}/
cp -R res/example.html ${PACKAGE}/
make ${PACKAGE}.zip
make ${PACKAGE}.zip.sha1
================================================
FILE: docs/NBT.txt
================================================
Named Binary Tag specification
NBT (Named Binary Tag) is a tag based binary format designed to carry large amounts of binary data with smaller amounts of additional data.
An NBT file consists of a single GZIPped Named Tag of type TAG_Compound.
A Named Tag has the following format:
byte tagType
TAG_String name
[payload]
The tagType is a single byte defining the contents of the payload of the tag.
The name is a descriptive name, and can be anything (eg "cat", "banana", "Hello World!"). It has nothing to do with the tagType.
The purpose for this name is to name tags so parsing is easier and can be made to only look for certain recognized tag names.
Exception: If tagType is TAG_End, the name is skipped and assumed to be "".
The [payload] varies by tagType.
Note that ONLY Named Tags carry the name and tagType data. Explicitly identified Tags (such as TAG_String above) only contains the payload.
The tag types and respective payloads are:
TYPE: 0 NAME: TAG_End
Payload: None.
Note: This tag is used to mark the end of a list.
Cannot be named! If type 0 appears where a Named Tag is expected, the name is assumed to be "".
(In other words, this Tag is always just a single 0 byte when named, and nothing in all other cases)
TYPE: 1 NAME: TAG_Byte
Payload: A single signed byte (8 bits)
TYPE: 2 NAME: TAG_Short
Payload: A signed short (16 bits, big endian)
TYPE: 3 NAME: TAG_Int
Payload: A signed short (32 bits, big endian)
TYPE: 4 NAME: TAG_Long
Payload: A signed long (64 bits, big endian)
TYPE: 5 NAME: TAG_Float
Payload: A floating point value (32 bits, big endian, IEEE 754-2008, binary32)
TYPE: 6 NAME: TAG_Double
Payload: A floating point value (64 bits, big endian, IEEE 754-2008, binary64)
TYPE: 7 NAME: TAG_Byte_Array
Payload: TAG_Int length
An array of bytes of unspecified format. The length of this array is <length> bytes
TYPE: 8 NAME: TAG_String
Payload: TAG_Short length
An array of bytes defining a string in UTF-8 format. The length of this array is <length> bytes
TYPE: 9 NAME: TAG_List
Payload: TAG_Byte tagId
TAG_Int length
A sequential list of Tags (not Named Tags), of type <typeId>. The length of this array is <length> Tags
Notes: All tags share the same type.
TYPE: 10 NAME: TAG_Compound
Payload: A sequential list of Named Tags. This array keeps going until a TAG_End is found.
TAG_End end
Notes: If there's a nested TAG_Compound within this tag, that one will also have a TAG_End, so simply reading until the next TAG_End will not work.
The names of the named tags have to be unique within each TAG_Compound
The order of the tags is not guaranteed.
Decoding example:
(Use http://www.minecraft.net/docs/test.nbt to test your implementation)
First we start by reading a Named Tag.
After unzipping the stream, the first byte is a 10. That means the tag is a TAG_Compound (as expected by the specification).
The next two bytes are 0 and 11, meaning the name string consists of 11 UTF-8 characters. In this case, they happen to be "hello world".
That means our root tag is named "hello world". We can now move on to the payload.
From the specification, we see that TAG_Compound consists of a series of Named Tags, so we read another byte to find the tagType.
It happens to be an 8. The name is 4 letters long, and happens to be "name". Type 8 is TAG_String, meaning we read another two bytes to get the length,
then read that many bytes to get the contents. In this case, it's "Bananrama".
So now we know the TAG_Compound contains a TAG_String named "name" with the content "Bananrama"
We move on to reading the next Named Tag, and get a 0. This is TAG_End, which always has an implied name of "". That means that the list of entries
in the TAG_Compound is over, and indeed all of the NBT file.
So we ended up with this:
TAG_Compound("hello world"): 1 entries
{
TAG_String("name"): Bananrama
}
For a slightly longer test, download http://www.minecraft.net/docs/bigtest.nbt
You should end up with this:
TAG_Compound("Level"): 11 entries
{
TAG_Short("shortTest"): 32767
TAG_Long("longTest"): 9223372036854775807
TAG_Float("floatTest"): 0.49823147
TAG_String("stringTest"): HELLO WORLD THIS IS A TEST STRING !
TAG_Int("intTest"): 2147483647
TAG_Compound("nested compound test"): 2 entries
{
TAG_Compound("ham"): 2 entries
{
TAG_String("name"): Hampus
TAG_Float("value"): 0.75
}
TAG_Compound("egg"): 2 entries
{
TAG_String("name"): Eggbert
TAG_Float("value"): 0.5
}
}
TAG_List("listTest (long)"): 5 entries of type TAG_Long
{
TAG_Long: 11
TAG_Long: 12
TAG_Long: 13
TAG_Long: 14
TAG_Long: 15
}
TAG_Byte("byteTest"): 127
TAG_List("listTest (compound)"): 2 entries of type TAG_Compound
{
TAG_Compound: 2 entries
{
TAG_String("name"): Compound tag #0
TAG_Long("created-on"): 1264099775885
}
TAG_Compound: 2 entries
{
TAG_String("name"): Compound tag #1
TAG_Long("created-on"): 1264099775885
}
}
TAG_Byte_Array("byteArrayTest (the first 1000 values of (n*n*255+n*7)%100, starting with n=0 (0, 62, 34, 16, 8, ...))"): [1000 bytes]
TAG_Double("doubleTest"): 0.4931287132182315
}
================================================
FILE: gui/c10t-tk/README
================================================
This is a simple GUI using Python and Tkinter.
I know Tkinter is ugly and it sucks... But it is available on the standard Python library, so this GUI works out-of-the-box on Linux and Windows and Mac (but I don't have a Mac to test).
The image previewing feature requires PIL (Python Imaging Library). If it is not available, the GUI will still work, the image will be saved to disk, but it won't be displayed.
How to run:
* cd to the project root dir (the one which will contain the c10t executable)
* run ./gui/c10t-tk/c10t-tk.py
Notice: in fact, you can run the GUI from whatever directory you want, but the suggestion above will make everything work by default.
This is what it does:
* Graphical interface to select the most common c10t options
* Runs c10t with such options
* Shows the final command-line, so it's easy to copy-paste that onto scripts
* Previews the rendered image, with zoom
What it still doesn't do:
* It don't show any output from c10t
* There is no error checking when c10t runs
* There is no progress bar (the program just hangs while c10t is running)
* The program also hangs briefly while zooming in/out the image
Possible improvements:
* Some kind of interface to select blocks
* Some kind of interface to select files/directories
* Auto-detect the correct minecraft save path on other systems
* Use a checkbutton for threads (when off, use the built-in auto-detection) instead of the quick-and-dirty hack of selecting zero threads
* Use radiobuttons (intead of checkbuttons) for selecting the rendering mode (group by (normal, oblique, obliqueangle, isometric) (normal, night, heightmap) )
* Add support for --no-alpha and --striped-terrain
* Improve the packaging?
================================================
FILE: gui/c10t-tk/c10t-tk.py
================================================
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4 sw=4 et
import re
import os.path
import subprocess
from mainwindow import MainWindow
def default_c10t_executable():
return "./c10t"
def default_minecraft_world():
return "~/.minecraft/saves/World1"
def default_output_image():
return os.path.abspath("out.png")
def quote_arg_if_needed(arg):
"""Add quotes if the argument has 'weird' characters.
This function is extremely simple, and it is not fool-proof.
Improvements are quite welcome!
WARNING: single-quotes inside the argument will break this!"""
if re.search(r'''[^-a-zA-Z0-9_.,/+=]''', arg):
return "'%s'" % (arg,)
else:
return arg
def args_to_string(args):
"""Converts a list of arguments to one string that can be copy-pasted
into a terminal and will work (hopefully)."""
return " ".join(quote_arg_if_needed(arg) for arg in args)
class Program(object):
def __init__(self):
self.win = MainWindow()
self.args = []
# Files
self.win.ui.exepath = default_c10t_executable()
self.win.ui.world = default_minecraft_world()
self.win.ui.output = default_output_image()
self.update_ui_commandline()
self.win.update_button_callback = self.update_ui_commandline
self.win.run_button_callback = self.run_command
self.win.load_button_callback = self.load_image
def run_command(self):
self.update_ui_commandline()
proc = subprocess.Popen(self.args, shell=False)
# TODO: Add a progress window/progress bar
# Meanwhile... let's just block this program until c10t finishes...
# Ugly, but better than nothing.
proc.communicate() # TODO: Check process returncode
self.load_image()
def load_image(self):
self.win.load_image_from_file(os.path.expanduser(self.win.ui.output))
def update_ui_commandline(self):
self.build_commandline()
self.win.ui.command = args_to_string(self.args)
def build_commandline(self):
ui = self.win.ui
args = [os.path.expanduser(ui.exepath)]
# Filtering
if ui.topcheck : args.extend(["--top" , str(ui.top )])
if ui.bottomcheck: args.extend(["--bottom", str(ui.bottom)])
if ui.limitscheck:
args.extend([
"--limits",
",".join(str(x) for x in (
ui.limitsnorth,
ui.limitssouth,
ui.limitseast,
ui.limitswest,
))
])
if ui.cavemodecheck: args.append("--cave-mode")
if ui.excludecheck:
for block in re.split("[ \t,;/]+", ui.exclude):
args.extend(["-e", str(block)])
if ui.includecheck:
args.append("--hide-all")
for block in re.split("[ \t,;/]+", ui.include):
args.extend(["-i", str(block)])
# Rendering
if ui.obliquecheck : args.append("--oblique")
if ui.obliqueanglecheck: args.append("--oblique-angle")
if ui.isometriccheck : args.append("--isometric")
if ui.nightcheck : args.append("--night")
if ui.heightmapcheck : args.append("--heightmap")
if ui.rotate : args.extend(["-r", str(ui.rotate)])
if int(ui.threads) != 0: args.extend(["--threads", str(ui.threads)])
# Text and fonts
args.extend(["--ttf-size" , str(ui.ttfsize)])
args.extend(["--ttf-color", str(ui.ttfcolor)])
if ui.showplayerscheck: args.append("--show-players")
if ui.showsignscheck : args.append("--show-signs")
if ui.showcoordscheck : args.append("--show-coordinates")
if ui.playercolorcheck: args.extend(["--player-color", str(ui.playercolor)])
if ui.signcolorcheck : args.extend(["--sign-color", str(ui.signcolor)])
if ui.coordcolorcheck : args.extend(["--coordinate-color", str(ui.coordcolor)])
# Adding the "Files" section to the end for readability reasons
args.extend([
"-w", os.path.expanduser(ui.world),
"-o", os.path.expanduser(ui.output),
])
self.args = args
def main(self):
self.win.mainloop()
if __name__ == "__main__":
p = Program()
p.main()
================================================
FILE: gui/c10t-tk/mainwindow.py
================================================
# -*- coding: utf-8 -*-
# vi:ts=4 sw=4 et
# Let me warn you... Tkinter sucks!
# It's so... crude... and ugly...
# But the *only* reason I'm using it is that
# it is available on the standard Python library.
#
# Also, be aware that most of this code is ugly because all it does is
# setting up the widgets at the window.
from Tkinter import *
from tooltip import ToolTip
try:
import PIL.Image
import PIL.ImageTk
PIL_NOT_AVAILABLE = False
except ImportError as e:
PIL_NOT_AVAILABLE = True
PIL_NOT_AVAILABLE_MESSAGE = repr(e)
def add_tooltip(text, widgets):
"""Adds a tooltip to multiple elements at once. Useful for setting the
same tooltip for the label/checkbox and the associated entry/spinbox.
The tooltip widget is also stored at the "tooltip" attribute."""
for w in widgets:
w.tooltip = ToolTip(w, text=text)
def cross_platform_mouse_wheel(event):
"""Abstracts all Windows/Linux/Mac differences when handling the
mouse wheel. Receives an 'event' object, and returns:
negative value ==> scrolling down
positive value ==> scrolling up
zero ==> something went wrong...
This function should be called from within "<MouseWheel>",
"<Button-4>" and "<Button-5>" event handlers.
"""
# http://infohost.nmt.edu/tcc/help/pubs/tkinter/events.html#event-handlers
# Linux maps scrolling to mouse buttons 4 and 5
if event.num == 4: # scroll up
return 1
elif event.num == 5: # scroll down
return -1
# Windows and MacOs have a MouseWheel event
elif event.delta:
# In Windows, delta is a multiple of 120
if abs(event.delta) >= 120:
return event.delta // 120
# In MacOS, delta is a multiples of 1
else:
return event.delta
return 0
class XCheckbutton(Checkbutton):
"""Tkinter requires a Tk variable for Checkbutton. This class
automatically creates such variable (as IntVar), stores it at the
widget's "var" attribute, and adds get/set methods to access that var.
"""
def __init__(self, *args, **kwargs):
self.var = IntVar()
Checkbutton.__init__(self, variable=self.var, *args, **kwargs)
def get(self):
return self.var.get()
def set(self, value):
self.var.set(value)
class XEntry(Entry):
"""For some reason, Entry supplies .get() but doesn't have a .set()
method. This class adds such simple and useful method."""
def set(self, value):
# When the state is disabled or readonly, then .delete() and
# .insert() methods do nothing. So, I change the state to NORMAL
# before calling them, and restore the state afterwards.
state = self["state"]
self["state"] = NORMAL
self.delete(0, END)
self.insert(0, value)
self["state"] = state
class XSpinbox(Spinbox):
"""As the Entry widget, Tkinter doesn't provide a .set() method to
Spinbox. This class adds that method.
In addition, it adds support for mouse-wheel."""
def __init__(self, *args, **kwargs):
Spinbox.__init__(self, *args, **kwargs)
self.bind("<MouseWheel>", self.mouse_wheel_handler)
self.bind("<Button-4>", self.mouse_wheel_handler)
self.bind("<Button-5>", self.mouse_wheel_handler)
def set(self, value):
# Adding a simple ".set()" method to spinboxes...
# http://stackoverflow.com/questions/3019800/tkinter-spinbox-widget/3024931#3024931
# So simple solution... WHY doesn't Tkinter have it already?!
self.delete(0, END)
self.insert(0, value)
def mouse_wheel_handler(self, event):
# Mouse wheel in spinboxes...
# http://www.daniweb.com/forums/post1158775.html#post1158775
dir = cross_platform_mouse_wheel(event)
while dir > 0:
self.invoke("buttonup")
dir -= 1
while dir < 0:
self.invoke("buttondown")
dir += 1
class FilesFrame(LabelFrame):
def __init__(self, master=None):
LabelFrame.__init__(self, master,
text = u"Files",
padx = 5,
pady = 5
)
self.exepath_label = Label(self, text=u"c10t path", anchor=W, justify=LEFT)
self.exepath_label.grid(column=0, row=0, columnspan=2, sticky=EW)
self.exepath_entry = XEntry(self, name="exepath")
self.exepath_entry.grid(column=2, row=0, sticky=EW)
add_tooltip(u"Path to the c10t executable", (
self.exepath_label,
self.exepath_entry,
))
self.world_label = Label(self, text=u"Input world", anchor=W, justify=LEFT)
self.world_label.grid(column=0, row=1, columnspan=2, sticky=EW)
self.world_entry = XEntry(self, name="world")
self.world_entry.grid(column=2, row=1, sticky=EW)
add_tooltip(u"Path to the World directory (the one that contains level.dat)", (
self.world_label,
self.world_entry,
))
self.output_label = Label(self, text=u"Output image", anchor=W, justify=LEFT)
self.output_label.grid(column=0, row=2, sticky=EW)
self.load_button = Button(self, padx=0, pady=0, text=u"Load")
self.load_button.grid(column=1, row=2)
self.output_entry = XEntry(self, name="output")
self.output_entry.grid(column=2, row=2, sticky=EW)
add_tooltip(u"Destination file for the generated PNG", (
self.output_label,
self.output_entry,
))
add_tooltip(u"(re)Loads this image.", (
self.load_button,
))
# Setting columns and rows to auto-expand
for i in (0,2):
self.columnconfigure(i, weight=1)
for i in xrange(3):
self.rowconfigure(i, weight=1)
class FilteringFrame(LabelFrame):
def __init__(self, master=None):
LabelFrame.__init__(self, master,
text = u"Filtering",
padx = 5,
pady = 5
)
self.top_checkbutton = XCheckbutton(self, name="topcheck", text=u"Top", anchor=W, justify=LEFT)
self.top_checkbutton.grid(column=0, row=0, sticky=EW)
self.top_spinbox = XSpinbox(self, name="top", from_=0, to=127, width=3)
self.top_spinbox.set(127)
self.top_spinbox.grid(column=1, row=0, sticky=EW)
add_tooltip(u"Splice from the top, must be <= 127", (
self.top_checkbutton,
self.top_spinbox,
))
self.bottom_checkbutton = XCheckbutton(self, name="bottomcheck", text=u"Bottom", anchor=W, justify=LEFT)
self.bottom_checkbutton.grid(column=0, row=1, sticky=EW)
self.bottom_spinbox = XSpinbox(self, name="bottom", from_=0, to=127, width=3)
self.bottom_spinbox.set(0)
self.bottom_spinbox.grid(column=1, row=1, sticky=EW)
add_tooltip(u"Splice from the bottom, must be >= 0", (
self.bottom_checkbutton,
self.bottom_spinbox,
))
# Begin "Limits" row...
self.limits_checkbutton = XCheckbutton(self, name="limitscheck", text=u"Limits", anchor=W, justify=LEFT)
self.limits_checkbutton.grid(column=0, row=2, sticky=EW)
add_tooltip(u"Limit render to certain area (North, South, East, West)", (
self.limits_checkbutton,
))
self.limits_frame = Frame(self)
self.limits_frame.grid(column=1, row=2, sticky=EW)
# This loop sets the following vars:
# self.limitsnorth_spinbox
# self.limitssouth_spinbox
# self.limitseast_spinbox
# self.limitswest_spinbox
for index, dir in enumerate(("north", "south", "east", "west")):
name="limits"+dir
widget = XSpinbox(self.limits_frame, name=name, from_=-999, to=999, width=4)
widget.set(0)
widget.grid(column=index, row=0, sticky=EW)
self.limits_frame.columnconfigure(index, weight=1)
setattr(self, name+"_spinbox", widget)
signal = u"negative" if index % 2 == 0 else u"positive"
tooltip = u"%s limit (%s)" % (dir.capitalize(), signal)
add_tooltip(tooltip, (widget,))
# End "Limits" row...
self.cavemode_checkbutton = XCheckbutton(self, name="cavemodecheck", text=u"Cave mode", anchor=W, justify=LEFT)
self.cavemode_checkbutton.grid(column=0, row=3, sticky=EW)
add_tooltip(u"Cave mode - top down until solid block found, then render bottom outlines only", (
self.cavemode_checkbutton,
))
self.exclude_checkbutton = XCheckbutton(self, name="excludecheck", text=u"Exclude", anchor=W, justify=LEFT)
self.exclude_checkbutton.grid(column=0, row=4, sticky=EW)
self.exclude_entry = XEntry(self, name="exclude")
self.exclude_entry.grid(column=1, row=4, sticky=EW)
add_tooltip(u"Exclude block-ids from render", (
self.exclude_checkbutton,
self.exclude_entry,
))
self.include_checkbutton = XCheckbutton(self, name="includecheck", text=u"Include", anchor=W, justify=LEFT)
self.include_checkbutton.grid(column=0, row=5, sticky=EW)
self.include_entry = XEntry(self, name="include")
self.include_entry.grid(column=1, row=5, sticky=EW)
add_tooltip(u"Include block-ids in render (and automatically exclude all non-listed blocks)", (
self.include_checkbutton,
self.include_entry,
))
# Setting columns to auto-expand
for i in xrange(2):
self.columnconfigure(i, weight=1)
for i in xrange(6):
self.rowconfigure(i, weight=1)
class RenderingFrame(LabelFrame):
def __init__(self, master=None):
LabelFrame.__init__(self, master,
text = u"Rendering",
padx = 5,
pady = 5
)
self.oblique_checkbutton = XCheckbutton(self, name="obliquecheck", text=u"Oblique", anchor=W, justify=LEFT)
self.oblique_checkbutton.grid(column=0, row=0, sticky=EW)
add_tooltip(u"Oblique rendering", (
self.oblique_checkbutton,
))
self.obliqueangle_checkbutton = XCheckbutton(self, name="obliqueanglecheck", text=u"Oblique angle", anchor=W, justify=LEFT)
self.obliqueangle_checkbutton.grid(column=0, row=1, sticky=EW)
add_tooltip(u"Oblique angle rendering", (
self.obliqueangle_checkbutton,
))
self.isometric_checkbutton = XCheckbutton(self, name="isometriccheck", text=u"Isometric", anchor=W, justify=LEFT)
self.isometric_checkbutton.grid(column=0, row=2, sticky=EW)
add_tooltip(u"Isometric rendering", (
self.isometric_checkbutton,
))
self.night_checkbutton = XCheckbutton(self, name="nightcheck", text=u"Night-time", anchor=W, justify=LEFT)
self.night_checkbutton.grid(column=0, row=3, sticky=EW)
add_tooltip(u"Night-time rendering", (
self.night_checkbutton,
))
self.heightmap_checkbutton = XCheckbutton(self, name="heightmapcheck", text=u"Heightmap", anchor=W, justify=LEFT)
self.heightmap_checkbutton.grid(column=0, row=4, sticky=EW)
add_tooltip(u"Heightmap rendering", (
self.heightmap_checkbutton,
))
self.rotate_label = Label(self, text=u"Rotate", anchor=W, justify=LEFT)
self.rotate_label.grid(column=0, row=5, sticky=EW)
add_tooltip(u"Rotate the rendering clockwise", (
self.rotate_label,
))
self.rotate_frame = Frame(self)
self.rotate_frame.grid(column=1, row=5, sticky=EW)
self.rotate_var = IntVar(name="rotate")
# This loop sets the following vars:
# self.rotate0_radiobutton
# self.rotate90_radiobutton
# self.rotate180_radiobutton
# self.rotate270_radiobutton
for index, angle in enumerate(("0", "90", "180", "270")):
name = "rotate"+angle
widget = Radiobutton(self.rotate_frame, text=angle, variable=self.rotate_var, value=int(angle))
widget.var = self.rotate_var
widget.grid(column=index, row=0, sticky=EW)
self.rotate_frame.columnconfigure(index, weight=1)
setattr(self, name+"_radiobutton", widget)
self.rotate_var.set(0)
self.threads_label = Label(self, text=u"Threads", anchor=W, justify=LEFT)
self.threads_label.grid(column=0, row=6, sticky=EW)
self.threads_spinbox = XSpinbox(self, name="threads", from_=0, to=999, width=3)
self.threads_spinbox.set(0)
self.threads_spinbox.grid(column=1, row=6, sticky=EW)
add_tooltip(u"Specify the amount of threads to use, for maximum efficency, this should match the amount of cores on your machine. Use zero to auto-detect the number of cores.", (
self.threads_label,
self.threads_spinbox,
))
# Setting columns to auto-expand
for i in xrange(2):
self.columnconfigure(i, weight=1)
for i in xrange(7):
self.rowconfigure(i, weight=1)
class FontFrame(LabelFrame):
def __init__(self, master=None):
LabelFrame.__init__(self, master,
text = u"Text and fonts",
padx = 5,
pady = 5
)
self.ttfsize_label = Label(self, text=u"Font size", anchor=W, justify=LEFT)
self.ttfsize_label.grid(column=0, row=0, columnspan=2, sticky=EW)
self.ttfsize_spinbox = XSpinbox(self, name="ttfsize", from_=1, to=999, width=3)
self.ttfsize_spinbox.set(12)
self.ttfsize_spinbox.grid(column=2, row=0, sticky=EW)
add_tooltip(u"Use the specified font size when drawing text", (
self.ttfsize_label,
self.ttfsize_spinbox,
))
self.ttfcolor_label = Label(self, text=u"Default color", anchor=W, justify=LEFT)
self.ttfcolor_label.grid(column=0, row=1, columnspan=2, sticky=EW)
add_tooltip(u"Use the specified color when drawing text", (
self.ttfcolor_label,
))
self.ttfcolor_entry = XEntry(self, name="ttfcolor", width=15)
self.ttfcolor_entry.set(u"0,0,0,255")
self.ttfcolor_entry.grid(column=2, row=1, sticky=EW)
self.showplayers_checkbutton = XCheckbutton(self, name="showplayerscheck", text=u"Show players", anchor=W, justify=LEFT)
self.showplayers_checkbutton.grid(column=0, row=2, sticky=EW)
add_tooltip(u"Will draw out player position and names from the players database in <world>/players", (
self.showplayers_checkbutton,
))
self.playercolor_checkbutton = XCheckbutton(self, name="playercolorcheck", text=u"Color:", anchor=W, justify=LEFT)
self.playercolor_checkbutton.grid(column=1, row=2, sticky=EW)
add_tooltip(u"Use a custom color for players", (
self.playercolor_checkbutton,
))
self.playercolor_entry = XEntry(self, name="playercolor", width=15)
self.playercolor_entry.set(u"0,0,0,255")
self.playercolor_entry.grid(column=2, row=2, sticky=EW)
self.showsigns_checkbutton = XCheckbutton(self, name="showsignscheck", text=u"Show signs", anchor=W, justify=LEFT)
self.showsigns_checkbutton.grid(column=0, row=3, sticky=EW)
add_tooltip(u"Will draw out signs from all chunks", (
self.showsigns_checkbutton,
))
self.signcolor_checkbutton = XCheckbutton(self, name="signcolorcheck", text=u"Color:", anchor=W, justify=LEFT)
self.signcolor_checkbutton.grid(column=1, row=3, sticky=EW)
add_tooltip(u"Use a custom color for signs", (
self.signcolor_checkbutton,
))
self.signcolor_entry = XEntry(self, name="signcolor", width=15)
self.signcolor_entry.set(u"0,0,0,255")
self.signcolor_entry.grid(column=2, row=3, sticky=EW)
self.showcoords_checkbutton = XCheckbutton(self, name="showcoordscheck", text=u"Show coordinates", anchor=W, justify=LEFT)
self.showcoords_checkbutton.grid(column=0, row=4, sticky=EW)
add_tooltip(u"Will draw out each chunks expected coordinates", (
self.showcoords_checkbutton,
))
self.coordcolor_checkbutton = XCheckbutton(self, name="coordcolorcheck", text=u"Color:", anchor=W, justify=LEFT)
self.coordcolor_checkbutton.grid(column=1, row=4, sticky=EW)
add_tooltip(u"Use a custom color for coordinates", (
self.coordcolor_checkbutton,
))
self.coordcolor_entry = XEntry(self, name="coordcolor", width=15)
self.coordcolor_entry.set(u"0,0,0,255")
self.coordcolor_entry.grid(column=2, row=4, sticky=EW)
add_tooltip(u"Red,Green,Blue,Alpha\n0,0,0,255 means black", (
self.playercolor_entry,
self.signcolor_entry,
self.coordcolor_entry,
self.ttfcolor_entry,
))
# Setting columns to auto-expand
for i in xrange(3):
self.columnconfigure(i, weight=1)
for i in xrange(5):
self.rowconfigure(i, weight=1)
class ConfigurationFrame(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.files_frame = FilesFrame(self)
self.files_frame.pack(fill=BOTH, expand=1)
self.filtering_frame = FilteringFrame(self)
self.filtering_frame.pack(fill=BOTH, expand=1)
self.rendering_frame = RenderingFrame(self)
self.rendering_frame.pack(fill=BOTH, expand=1)
self.font_frame = FontFrame(self)
self.font_frame.pack(fill=BOTH, expand=1)
class RunFrame(Frame):
def __init__(self, master=None):
Frame.__init__(self, master)
self.run_button = Button(self, text=u"Run!")
self.run_button.pack(side=LEFT)
self.update_button = Button(self, text=u"Update")
self.update_button.pack(side=LEFT)
add_tooltip(u"Update the command-line, without running the command. Easy for copy-and-paste into scripts.", (
self.update_button,
))
self.command_entry = XEntry(self, name="command", state="readonly")
self.command_entry.pack(side=LEFT, fill=X, expand=1)
add_tooltip(u"The full command-line that will be invoked", (
self.command_entry,
))
class ImageFrame(Frame):
"""This is just a Frame containing one Canvas, two scrollbars and some
logic for scrolling the image."""
# This class is inspired by:
# http://effbot.org/tkinterbook/photoimage.htm
# http://www.swharden.com/blog/2010-03-03-viewing-large-images-with-scrollbars-using-python-tk-and-pil/
def __init__(self, master=None):
Frame.__init__(self, master)
# Adding the widgets
self.vertical_scrollbar = Scrollbar(self, orient=VERTICAL)
self.vertical_scrollbar.pack(side=RIGHT, fill=Y)
self.horizontal_scrollbar = Scrollbar(self, orient=HORIZONTAL)
self.horizontal_scrollbar.pack(side=BOTTOM, fill=X)
self.canvas = Canvas(self)
self.canvas.pack(side=LEFT, expand=YES, fill=BOTH)
# Add an error message if needed
if PIL_NOT_AVAILABLE:
self.canvas.create_text(10, 10, anchor=NW, text=u"Python Image Library (PIL) could not be loaded.\n\nNo image will be displayed here, but\nthey will still be rendered to the disk.\n\n%s" % (PIL_NOT_AVAILABLE_MESSAGE,))
# Connecting canvas and scrollbars
self.horizontal_scrollbar["command"] = self.canvas.xview
self.vertical_scrollbar["command"] = self.canvas.yview
self.canvas["xscrollcommand"] = self.horizontal_scrollbar.set
self.canvas["yscrollcommand"] = self.vertical_scrollbar.set
# Adding the event handlers to the canvas
self.canvas.bind("<Button-1>", self.button_press_1_handler)
self.canvas.bind("<B1-Motion>", self.button_motion_1_handler)
self.canvas.bind("<ButtonRelease-1>", self.button_release_1_handler)
self.canvas.bind("<MouseWheel>", self.mouse_wheel_handler)
self.canvas.bind("<Button-4>", self.mouse_wheel_handler)
self.canvas.bind("<Button-5>", self.mouse_wheel_handler)
# Adding mouse wheel support to scrollbars
self.horizontal_scrollbar.bind("<MouseWheel>", self.hscroll_mouse_wheel_handler)
self.horizontal_scrollbar.bind("<Button-4>", self.hscroll_mouse_wheel_handler)
self.horizontal_scrollbar.bind("<Button-5>", self.hscroll_mouse_wheel_handler)
self.vertical_scrollbar.bind("<MouseWheel>", self.vscroll_mouse_wheel_handler)
self.vertical_scrollbar.bind("<Button-4>", self.vscroll_mouse_wheel_handler)
self.vertical_scrollbar.bind("<Button-5>", self.vscroll_mouse_wheel_handler)
# Internal vars for handling the image
self.pil_image = None
self.tk_resized_images = {}
self.canvas_image = None
self.zoom = 0
def hscroll_mouse_wheel_handler(self, event):
dir = cross_platform_mouse_wheel(event)
self.canvas.xview_scroll(-dir, UNITS)
def vscroll_mouse_wheel_handler(self, event):
dir = cross_platform_mouse_wheel(event)
self.canvas.yview_scroll(-dir, UNITS)
def button_press_1_handler(self, event):
self.canvas.scan_mark(event.x, event.y)
self.canvas["cursor"] = "fleur"
def button_motion_1_handler(self, event):
self.canvas.scan_dragto(event.x, event.y, gain=1)
def button_release_1_handler(self, event):
self.canvas["cursor"] = ""
def mouse_wheel_handler(self, event):
dir = cross_platform_mouse_wheel(event)
if dir == 0:
return
# Code for zooming the image (like Google Maps)
self.resize_image_to_zoom(delta=dir, center=(event.x, event.y))
def resize_image_to_zoom(self, delta=None, zoom=None, center=None, forcereload=False):
"""Parameters:
delta : How much to increase/decrease the current zoom?
zoom : Set zoom to this absolute value.
center : Uses these coordinates (x,y) as the zoom center,
scrolling the canvas as needed. These are "window
coordinates", relative to the widget's top-left
corner.
forcereload: Clears the zoom cache, forces reloading the canvas
from self.pil_image.
"""
# Sanity check
if PIL_NOT_AVAILABLE:
return
if self.pil_image is None:
return
# Calculating the new zoom value
prevzoom = self.zoom
if zoom is not None:
self.zoom = zoom
if delta is not None:
self.zoom += delta
# Clamping maximum zoom
if self.zoom > 2:
self.zoom = 2
# Clamping minimum zoom
if self.zoom < -4:
self.zoom = -4
if forcereload:
# Clearing the image cache
self.tk_resized_images = {}
# Zoom size is not cached...
if not self.tk_resized_images.has_key(self.zoom):
mult = 2 ** self.zoom
ow, oh = self.pil_image.size
w, h = int(mult * ow), int(mult * oh)
# Let's apply a nice filter when scaling down,
# but keep those lovely pixels when scaling up!
filter = PIL.Image.NEAREST if mult >=1 else PIL.Image.BICUBIC
# Resizing
pil_resized_image = self.pil_image.resize((w,h), filter)
# Converting to Tk
tk_photoimage = PIL.ImageTk.PhotoImage(pil_resized_image)
# Saving the Tk image to cache
self.tk_resized_images[self.zoom] = tk_photoimage
# Keeping the position centered
if center:
# Window coordinates, relative to widget's top-left corner
wx, wy = center
# Old canvas coordinates
ocx = self.canvas.canvasx(wx)
ocy = self.canvas.canvasy(wy)
tx = self.canvas.canvasx(0)
ty = self.canvas.canvasy(0)
# Old scroll position
osx = ocx - wx
osy = ocy - wy
# Multiplication...
deltazoom = self.zoom - prevzoom
deltamult = 2 ** deltazoom
# New canvas coordinates
ncx = ocx * deltamult
ncy = ocy * deltamult
# New scroll position
nsx = ncx - wx
nsy = ncy - wy
# Debug
#print (
# "w=({wx},{wy})\n"
# "old canvas=({ocx},{ocy})\n"
# "old scroll=({osx},{osy})\n"
# "old scroll=({tx},{ty})\n"
# "new canvas=({ncx},{ncy})\n"
# "new scroll=({nsx},{nsy})\n"
# "deltazoom={deltazoom}; deltamult={deltamult}"
# .format(**locals())
#)
# Getting the image from cache
tk_img = self.tk_resized_images[self.zoom]
# Setting it to canvas
self.canvas.itemconfigure(self.canvas_image, image=tk_img)
# Setting the size
new_width = tk_img.width()
new_height = tk_img.height()
self.canvas["scrollregion"] = (0, 0, new_width, new_height)
# Finally, scrolling in order to keep the position centered
if center:
# It was difficult to find the right formula to make
# tkinter flawlessly...
# http://stackoverflow.com/questions/3950773/how-to-scroll-a-tkinter-canvas-to-an-absolute-position
offset_x = +1 if nsx >= 0 else 0
offset_y = +1 if nsy >= 0 else 0
self.canvas.xview_moveto(float(nsx + offset_x)/new_width)
self.canvas.yview_moveto(float(nsy + offset_y)/new_height)
def load_image_from_file(self, imagepath):
if PIL_NOT_AVAILABLE:
return
# Loading the image from disk
self.pil_image = PIL.Image.open(imagepath)
# Creating the image inside the canvas
if self.canvas_image is None:
self.canvas_image = self.canvas.create_image(0, 0, anchor=NW)
# Updating the canvas image
self.resize_image_to_zoom(forcereload=True)
class ApplicationFrame(Frame):
"""The main application frame is divided like this:
+--------------+--------------------+
|Configuration | Run Frame here |
|Frame here, +--------------------+
|which contains| ^|
|sub-frames for| Image Frame here |
|each section. | |
| | |
| |< >v|
+--------------+--------------------+
"""
def __init__(self, master=None):
Frame.__init__(self, master,
padx=5,
pady=5
)
self.configuration_frame = ConfigurationFrame(self)
self.configuration_frame.grid(column=0, row=0, rowspan=2, sticky=NSEW)
self.run_frame = RunFrame(self)
self.run_frame.grid(column=1, row=0, sticky=NSEW)
self.image_frame = ImageFrame(self)
self.image_frame.grid(column=1, row=1, sticky=NSEW)
self.columnconfigure(1, weight=1)
self.rowconfigure(1, weight=1)
def find_named_widgets(widget):
"""Starting at the 'widget', scans down recursively and returns a dict
with {'name': widget_instance}, but only if the name has been set by
the user.
There is a special treatment for Radiobutton: it returns the associated
variable instead of the widget, but only if the user has set a name to
the variable and stored it at the widget's "var" attribute."""
d = {}
for name, w in widget.children.iteritems():
# If the user has set a name for this widget, and it is a valid name.
# Unnamed widgets get numbers in their name.
if name[0].isalpha() or name[0] == "_":
d[name] = w
# Special case for Radiobutton
if (
isinstance(w, Radiobutton) and
hasattr(w, "var") and
not w.var._name.startswith("PY_VAR")
):
d[w.var._name] = w.var
# Recursive call
d.update(find_named_widgets(w))
return d
class UiShortcuts(object):
"""This object is a quick and handy way of accessing widget values.
See the following small example to get an idea of how it works:
ui = UiShortcuts(root_window)
# This will call .set("bar") on a widget named "foo"
ui.foo = "bar"
# This will call .get() on a widget named "foo"
print ui.foo
"""
def __init__(self, root):
object.__setattr__(self, "widgets", find_named_widgets(root))
def __dir__(self):
# Simple method to support tab-completion
return self.__dict__.keys() + self.widgets.keys()
def __getattr__(self, name):
return self.widgets[name].get()
def __setattr__(self, name, value):
self.widgets[name].set(value)
class MainWindow(Tk):
"""Root window. Contains one ApplicationFrame at self.app, and has
shortcuts to all important widgets in self.ui.
If you want to interact with the interface, using self.ui should be
enough, and it hides all the messy toolkit-related code."""
def __init__(self):
Tk.__init__(self)
self.title("c10t GUI")
self.app = ApplicationFrame(self)
self.app.pack(fill=BOTH, expand=1)
self.ui = UiShortcuts(self)
# Global quit handlers
self.bind_all("<Control-q>", self.quit_handler)
self.protocol("WM_DELETE_WINDOW", self.quit_handler)
#self.on_change_callback = None
#self.app.configuration_frame.bind("")
# Adding an "update" button, just because I don't know how to bind
# to "on change"-like events in Tkinter.
# http://stackoverflow.com/questions/3876229/how-to-run-a-code-whenever-a-tkinter-widget-value-changes
self.update_button_callback = None
self.app.run_frame.update_button["command"] = self.update_button_handler
self.run_button_callback = None
self.app.run_frame.run_button["command"] = self.run_button_handler
self.load_button_callback = None
self.app.configuration_frame.files_frame.load_button["command"] = self.load_button_handler
def quit_handler(self, event=None):
self.destroy()
#def on_change_handler(self, event=None):
# if self.on_change_callback:
# self.on_change_callback()
def update_button_handler(self, event=None):
if self.update_button_callback:
self.update_button_callback()
def run_button_handler(self, event=None):
if self.run_button_callback:
self.run_button_callback()
def load_button_handler(self):
if self.load_button_callback:
self.load_button_callback()
def load_image_from_file(self, imagepath):
self.app.image_frame.load_image_from_file(imagepath)
================================================
FILE: gui/c10t-tk/tooltip.py
================================================
# -*- coding: utf-8 -*-
# vi:ts=4 sw=4 et
# Downloaded from:
# http://tkinter.unpythonic.net/wiki/ToolTip
'''Michael Lange <klappnase (at) freakmail (dot) de>
The ToolTip class provides a flexible tooltip widget for Tkinter; it is based on IDLE's ToolTip
module which unfortunately seems to be broken (at least the version I saw).
INITIALIZATION OPTIONS:
anchor : where the text should be positioned inside the widget, must be on of "n", "s", "e", "w", "nw" and so on;
default is "center"
bd : borderwidth of the widget; default is 1 (NOTE: don't use "borderwidth" here)
bg : background color to use for the widget; default is "lightyellow" (NOTE: don't use "background")
delay : time in ms that it takes for the widget to appear on the screen when the mouse pointer has
entered the parent widget; default is 1500 (XXX: changed to 800)
fg : foreground (i.e. text) color to use; default is "black" (NOTE: don't use "foreground")
follow_mouse : if set to 1 the tooltip will follow the mouse pointer instead of being displayed
outside of the parent widget; this may be useful if you want to use tooltips for
large widgets like listboxes or canvases; default is 0
font : font to use for the widget; default is system specific
justify : how multiple lines of text will be aligned, must be "left", "right" or "center"; default is "left"
padx : extra space added to the left and right within the widget; default is 4
pady : extra space above and below the text; default is 2
relief : one of "flat", "ridge", "groove", "raised", "sunken" or "solid"; default is "solid"
state : must be "normal" or "disabled"; if set to "disabled" the tooltip will not appear; default is "normal"
text : the text that is displayed inside the widget
textvariable : if set to an instance of Tkinter.StringVar() the variable's value will be used as text for the widget
width : width of the widget; the default is 0, which means that "wraplength" will be used to limit the widgets width
wraplength : limits the number of characters in each line; default is 150 (XXX: changed to 200)
WIDGET METHODS:
configure(**opts) : change one or more of the widget's options as described above; the changes will take effect the
next time the tooltip shows up; NOTE: follow_mouse cannot be changed after widget initialization
Other widget methods that might be useful if you want to subclass ToolTip:
enter() : callback when the mouse pointer enters the parent widget
leave() : called when the mouse pointer leaves the parent widget
motion() : is called when the mouse pointer moves inside the parent widget if follow_mouse is set to 1 and the
tooltip has shown up to continually update the coordinates of the tooltip window
coords() : calculates the screen coordinates of the tooltip window
create_contents() : creates the contents of the tooltip window (by default a Tkinter.Label)
'''
# Ideas gleaned from PySol
import Tkinter
class ToolTip:
# XXX Changed the default delay from 1500 to 800
# XXX Changed the default wraplength from 150 to 200
def __init__(self, master, text='Your text here', delay=800, **opts):
self.master = master
self._opts = {'anchor':'center', 'bd':1, 'bg':'lightyellow', 'delay':delay, 'fg':'black',\
'follow_mouse':0, 'font':None, 'justify':'left', 'padx':4, 'pady':2,\
'relief':'solid', 'state':'normal', 'text':text, 'textvariable':None,\
'width':0, 'wraplength':200}
self.configure(**opts)
self._tipwindow = None
self._id = None
self._id1 = self.master.bind("<Enter>", self.enter, '+')
self._id2 = self.master.bind("<Leave>", self.leave, '+')
self._id3 = self.master.bind("<ButtonPress>", self.leave, '+')
self._follow_mouse = 0
if self._opts['follow_mouse']:
self._id4 = self.master.bind("<Motion>", self.motion, '+')
self._follow_mouse = 1
def configure(self, **opts):
for key in opts:
if self._opts.has_key(key):
self._opts[key] = opts[key]
else:
KeyError = 'KeyError: Unknown option: "%s"' %key
raise KeyError
##----these methods handle the callbacks on "<Enter>", "<Leave>" and "<Motion>"---------------##
##----events on the parent widget; override them if you want to change the widget's behavior--##
def enter(self, event=None):
self._schedule()
def leave(self, event=None):
self._unschedule()
self._hide()
def motion(self, event=None):
if self._tipwindow and self._follow_mouse:
x, y = self.coords()
self._tipwindow.wm_geometry("+%d+%d" % (x, y))
##------the methods that do the work:---------------------------------------------------------##
def _schedule(self):
self._unschedule()
if self._opts['state'] == 'disabled':
return
self._id = self.master.after(self._opts['delay'], self._show)
def _unschedule(self):
id = self._id
self._id = None
if id:
self.master.after_cancel(id)
def _show(self):
if self._opts['state'] == 'disabled':
self._unschedule()
return
if not self._tipwindow:
self._tipwindow = tw = Tkinter.Toplevel(self.master)
# hide the window until we know the geometry
tw.withdraw()
tw.wm_overrideredirect(1)
if tw.tk.call("tk", "windowingsystem") == 'aqua':
tw.tk.call("::tk::unsupported::MacWindowStyle", "style", tw._w, "help", "none")
self.create_contents()
tw.update_idletasks()
x, y = self.coords()
tw.wm_geometry("+%d+%d" % (x, y))
tw.deiconify()
def _hide(self):
tw = self._tipwindow
self._tipwindow = None
if tw:
tw.destroy()
##----these methods might be overridden in derived classes:----------------------------------##
def coords(self):
# The tip window must be completely outside the master widget;
# otherwise when the mouse enters the tip window we get
# a leave event and it disappears, and then we get an enter
# event and it reappears, and so on forever :-(
# or we take care that the mouse pointer is always outside the tipwindow :-)
tw = self._tipwindow
twx, twy = tw.winfo_reqwidth(), tw.winfo_reqheight()
w, h = tw.winfo_screenwidth(), tw.winfo_screenheight()
# calculate the y coordinate:
if self._follow_mouse:
y = tw.winfo_pointery() + 20
# make sure the tipwindow is never outside the screen:
if y + twy > h:
y = y - twy - 30
else:
y = self.master.winfo_rooty() + self.master.winfo_height() + 3
if y + twy > h:
y = self.master.winfo_rooty() - twy - 3
# we can use the same x coord in both cases:
x = tw.winfo_pointerx() - twx / 2
if x < 0:
x = 0
elif x + twx > w:
x = w - twx
return x, y
def create_contents(self):
opts = self._opts.copy()
for opt in ('delay', 'follow_mouse', 'state'):
del opts[opt]
label = Tkinter.Label(self._tipwindow, **opts)
label.pack()
##---------demo code-----------------------------------##
def demo():
root = Tkinter.Tk(className='ToolTip-demo')
l = Tkinter.Listbox(root)
l.insert('end', "I'm a listbox")
l.pack(side='top')
t1 = ToolTip(l, follow_mouse=1, text="I'm a tooltip with follow_mouse set to 1, so I won't be placed outside my parent")
b = Tkinter.Button(root, text='Quit', command=root.quit)
b.pack(side='bottom')
t2 = ToolTip(b, text='Enough of this')
root.mainloop()
if __name__ == '__main__':
demo()
================================================
FILE: palette.json
================================================
[
{
"namespace": "minecraft",
"material": "air",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": false,
"legacy_id": 0
},
{
"namespace": "minecraft",
"material": "stone",
"mode": "block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": 1,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "granite",
"mode": "block",
"top_color": [153, 113, 98, 255],
"darken": true,
"legacy_id": 1,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "polished_granite",
"mode": "block",
"top_color": [133, 88, 75, 255],
"darken": true,
"legacy_id": 1,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "diorite",
"mode": "block",
"top_color": [162, 161, 169, 255],
"darken": true,
"legacy_id": 1,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "polished_diorite",
"mode": "block",
"top_color": [158, 158, 167, 255],
"darken": true,
"legacy_id": 1,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "andesite",
"mode": "block",
"top_color": [114, 114, 119, 255],
"darken": true,
"legacy_id": 1,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "polished_andesite",
"mode": "block",
"top_color": [119, 119, 124, 255],
"darken": true,
"legacy_id": 1,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "grass_block",
"mode": "block",
"top_color": [120, 172, 70, 255],
"side_color": [134, 96, 67, 255],
"darken": true,
"legacy_id": 2
},
{
"namespace": "minecraft",
"material": "dirt",
"mode": "block",
"top_color": [134, 96, 67, 255],
"darken": true,
"legacy_id": 3,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "coarse_dirt",
"mode": "block",
"top_color": [134, 96, 67, 255],
"darken": true,
"legacy_id": 3,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "podzol",
"mode": "block",
"top_color": [108, 67, 29, 255],
"darken": true,
"legacy_id": 3,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "cobblestone",
"mode": "block",
"top_color": [100, 100, 100, 255],
"darken": true,
"legacy_id": 4
},
{
"namespace": "minecraft",
"material": "oak_planks",
"mode": "block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": 5,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "spruce_planks",
"mode": "block",
"top_color": [102, 77, 46, 255],
"darken": true,
"legacy_id": 5,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "birch_planks",
"mode": "block",
"top_color": [193, 177, 122, 255],
"darken": true,
"legacy_id": 5,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "jungle_planks",
"mode": "block",
"top_color": [152, 109, 76, 255],
"darken": true,
"legacy_id": 5,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "acacia_planks",
"mode": "block",
"top_color": [168, 91, 50, 255],
"darken": true,
"legacy_id": 5,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "dark_oak_planks",
"mode": "block",
"top_color": [60, 39, 18, 255],
"darken": true,
"legacy_id": 5,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "oak_sapling",
"mode": "block",
"top_color": [74, 131, 66, 128],
"darken": true,
"legacy_id": 6,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "spruce_sapling",
"mode": "block",
"top_color": [50, 89, 45, 128],
"darken": true,
"legacy_id": 6,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "birch_sapling",
"mode": "block",
"top_color": [94, 167, 84, 128],
"darken": true,
"legacy_id": 6,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "jungle_sapling",
"mode": "block",
"top_color": [58, 147, 19, 128],
"darken": true,
"legacy_id": 6,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "acacia_sapling",
"mode": "block",
"top_color": [58, 145, 19, 128],
"darken": true,
"legacy_id": 6,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "dark_oak_sapling",
"mode": "block",
"top_color": [52, 131, 18, 128],
"darken": true,
"legacy_id": 6,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "bedrock",
"mode": "block",
"top_color": [84, 84, 84, 255],
"darken": true,
"legacy_id": 7
},
{
"namespace": "minecraft",
"material": "flowing_water",
"mode": "block",
"top_color": [56, 68, 127, 64],
"darken": false,
"legacy_id": 8
},
{
"namespace": "minecraft",
"material": "water",
"mode": "block",
"top_color": [56, 68, 127, 64],
"darken": false,
"legacy_id": 9
},
{
"namespace": "minecraft",
"material": "flowing_lava",
"mode": "block",
"top_color": [255, 90, 0, 255],
"darken": false,
"legacy_id": 10
},
{
"namespace": "minecraft",
"material": "lava",
"mode": "block",
"top_color": [255, 90, 0, 255],
"darken": false,
"legacy_id": 11
},
{
"namespace": "minecraft",
"material": "sand",
"mode": "block",
"top_color": [218, 210, 158, 255],
"darken": true,
"legacy_id": 12,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "red_sand",
"mode": "block",
"top_color": [186, 102, 44, 255],
"darken": true,
"legacy_id": 12,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "gravel",
"mode": "block",
"top_color": [136, 126, 126, 255],
"darken": true,
"legacy_id": 13
},
{
"namespace": "minecraft",
"material": "gold_ore",
"mode": "block",
"top_color": [143, 140, 125, 255],
"darken": true,
"legacy_id": 14
},
{
"namespace": "minecraft",
"material": "iron_ore",
"mode": "block",
"top_color": [136, 130, 127, 255],
"darken": true,
"legacy_id": 15
},
{
"namespace": "minecraft",
"material": "coal_ore",
"mode": "block",
"top_color": [115, 115, 115, 255],
"darken": true,
"legacy_id": 16
},
{
"namespace": "minecraft",
"material": "oak_log",
"mode": "log_block",
"top_color": [184, 148, 95, 255],
"side_color": [101, 80, 49, 255],
"darken": false,
"legacy_id": 17,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "spruce_log",
"mode": "log_block",
"top_color": [106, 82, 48, 255],
"side_color": [45, 28, 12, 255],
"darken": false,
"legacy_id": 17,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "birch_log",
"mode": "log_block",
"top_color": [183, 164, 118, 255],
"side_color": [201, 201, 196, 255],
"darken": false,
"legacy_id": 17,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "jungle_log",
"mode": "log_block",
"top_color": [155, 120, 75, 255],
"side_color": [86, 67, 27, 255],
"darken": false,
"legacy_id": 17,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "oak_leaves",
"mode": "legacy_leaf_block",
"top_color": [74, 131, 66, 128],
"darken": true,
"legacy_id": 18,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "spruce_leaves",
"mode": "legacy_leaf_block",
"top_color": [50, 89, 45, 128],
"darken": true,
"legacy_id": 18,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "birch_leaves",
"mode": "legacy_leaf_block",
"top_color": [94, 167, 84, 128],
"darken": true,
"legacy_id": 18,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "jungle_leaves",
"mode": "legacy_leaf_block",
"top_color": [58, 147, 19, 128],
"darken": true,
"legacy_id": 18,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "sponge",
"mode": "block",
"top_color": [195, 195, 50, 255],
"darken": true,
"legacy_id": 19
},
{
"namespace": "minecraft",
"material": "glass",
"mode": "block",
"top_color": [255, 255, 255, 48],
"darken": true,
"legacy_id": 20
},
{
"namespace": "minecraft",
"material": "lapis_ore",
"mode": "block",
"top_color": [102, 112, 134, 255],
"darken": true,
"legacy_id": 21
},
{
"namespace": "minecraft",
"material": "lapis_block",
"mode": "block",
"top_color": [29, 71, 165, 255],
"darken": true,
"legacy_id": 22
},
{
"namespace": "minecraft",
"material": "dispenser",
"mode": "block",
"top_color": [107, 107, 107, 255],
"darken": true,
"legacy_id": 23
},
{
"namespace": "minecraft",
"material": "sandstone",
"mode": "block",
"top_color": [218, 210, 158, 255],
"darken": true,
"legacy_id": 24
},
{
"namespace": "minecraft",
"material": "note_block",
"mode": "block",
"top_color": [100, 67, 50, 255],
"darken": true,
"legacy_id": 25
},
{
"namespace": "minecraft",
"material": "white_bed",
"mode": "block",
"top_color": [223, 223, 223, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "orange_bed",
"mode": "block",
"top_color": [234, 128, 55, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "magenta_bed",
"mode": "block",
"top_color": [191, 76, 201, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "light_blue_bed",
"mode": "block",
"top_color": [105, 139, 212, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "yellow_bed",
"mode": "block",
"top_color": [195, 181, 28, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "lime_bed",
"mode": "block",
"top_color": [59, 189, 48, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "pink_bed",
"mode": "block",
"top_color": [218, 132, 155, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "gray_bed",
"mode": "block",
"top_color": [67, 67, 67, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "light_gray_bed",
"mode": "block",
"top_color": [159, 166, 166, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "cyan_bed",
"mode": "block",
"top_color": [39, 117, 150, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "purple_bed",
"mode": "block",
"top_color": [130, 54, 196, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "blue_bed",
"mode": "block",
"top_color": [39, 51, 154, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "brown_bed",
"mode": "block",
"top_color": [86, 51, 28, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 12
},
{
"namespace": "minecraft",
"material": "green_bed",
"mode": "block",
"top_color": [56, 77, 24, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 13
},
{
"namespace": "minecraft",
"material": "red_bed",
"mode": "block",
"top_color": [164, 45, 41, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 14
},
{
"namespace": "minecraft",
"material": "black_bed",
"mode": "block",
"top_color": [27, 23, 23, 255],
"darken": true,
"legacy_id": 26,
"legacy_meta": 15
},
{
"namespace": "minecraft",
"material": "powered_rail",
"mode": "block",
"top_color": [120, 120, 120, 128],
"side_color": [255, 220, 0, 128],
"darken": false,
"legacy_id": 27
},
{
"namespace": "minecraft",
"material": "detector_rail",
"mode": "block",
"top_color": [120, 120, 120, 128],
"side_color": [230, 0, 0, 128],
"darken": false,
"legacy_id": 28
},
{
"namespace": "minecraft",
"material": "sticky_piston",
"mode": "block",
"top_color": [157, 192, 79, 255],
"darken": true,
"legacy_id": 29
},
{
"namespace": "minecraft",
"material": "cobweb",
"mode": "block",
"top_color": [237, 237, 237, 128],
"darken": true,
"legacy_id": 30
},
{
"namespace": "minecraft",
"material": "grass",
"mode": "block",
"top_color": [144, 188, 39, 255],
"side_color": [144, 188, 39, 255],
"darken": false,
"legacy_id": 31
},
{
"namespace": "minecraft",
"material": "dead_bush",
"mode": "block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": 32
},
{
"namespace": "minecraft",
"material": "piston",
"mode": "block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": 33
},
{
"namespace": "minecraft",
"material": "piston_head",
"mode": "block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": 34
},
{
"namespace": "minecraft",
"material": "white_wool",
"mode": "block",
"top_color": [223, 223, 223, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "orange_wool",
"mode": "block",
"top_color": [234, 128, 55, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "magenta_wool",
"mode": "block",
"top_color": [191, 76, 201, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "light_blue_wool",
"mode": "block",
"top_color": [105, 139, 212, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "yellow_wool",
"mode": "block",
"top_color": [195, 181, 28, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "lime_wool",
"mode": "block",
"top_color": [59, 189, 48, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "pink_wool",
"mode": "block",
"top_color": [218, 132, 155, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "gray_wool",
"mode": "block",
"top_color": [67, 67, 67, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "light_gray_wool",
"mode": "block",
"top_color": [159, 166, 166, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "cyan_wool",
"mode": "block",
"top_color": [39, 117, 150, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "purple_wool",
"mode": "block",
"top_color": [130, 54, 196, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "blue_wool",
"mode": "block",
"top_color": [39, 51, 154, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "brown_wool",
"mode": "block",
"top_color": [86, 51, 28, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 12
},
{
"namespace": "minecraft",
"material": "green_wool",
"mode": "block",
"top_color": [56, 77, 24, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 13
},
{
"namespace": "minecraft",
"material": "red_wool",
"mode": "block",
"top_color": [164, 45, 41, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 14
},
{
"namespace": "minecraft",
"material": "black_wool",
"mode": "block",
"top_color": [27, 23, 23, 255],
"darken": true,
"legacy_id": 35,
"legacy_meta": 15
},
{
"namespace": "minecraft",
"material": "moving_piston",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 36
},
{
"namespace": "minecraft",
"material": "dandelion",
"mode": "block",
"top_color": [255, 255, 0, 255],
"darken": true,
"legacy_id": 37
},
{
"namespace": "minecraft",
"material": "poppy",
"mode": "block",
"top_color": [209, 6, 9, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "blue_orchid",
"mode": "block",
"top_color": [28, 146, 214, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "allium",
"mode": "block",
"top_color": [191, 117, 251, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "azure_bluet",
"mode": "block",
"top_color": [216, 222, 230, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "red_tulip",
"mode": "block",
"top_color": [208, 54, 18, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "orange_tulip",
"mode": "block",
"top_color": [222, 115, 31, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "white_tulip",
"mode": "block",
"top_color": [231, 231, 231, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "pink_tulip",
"mode": "block",
"top_color": [234, 190, 234, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "oxeye_daisy",
"mode": "block",
"top_color": [210, 199, 30, 255],
"darken": true,
"legacy_id": 38,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "brown_mushroom",
"mode": "block",
"top_color": [200, 200, 0, 255],
"darken": true,
"legacy_id": 39
},
{
"namespace": "minecraft",
"material": "red_mushroom",
"mode": "block",
"top_color": [255, 0, 0, 255],
"darken": true,
"legacy_id": 40
},
{
"namespace": "minecraft",
"material": "gold_block",
"mode": "block",
"top_color": [255, 237, 140, 255],
"darken": true,
"legacy_id": 41
},
{
"namespace": "minecraft",
"material": "iron_block",
"mode": "block",
"top_color": [217, 217, 217, 255],
"darken": true,
"legacy_id": 42
},
{
"namespace": "minecraft",
"material": "stone_slab",
"mode": "legacy_slab_block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": [43, 44],
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "sandstone_slab",
"mode": "legacy_slab_block",
"top_color": [218, 210, 158, 255],
"darken": true,
"legacy_id": [43, 44],
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "petrified_oak_slab",
"mode": "legacy_slab_block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": [43, 44],
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "cobblestone_slab",
"mode": "legacy_slab_block",
"top_color": [100, 100, 100, 255],
"darken": true,
"legacy_id": [43, 44],
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "brick_slab",
"mode": "legacy_slab_block",
"top_color": [86, 35, 23, 255],
"darken": true,
"legacy_id": [43, 44],
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "stone_brick_slab",
"mode": "legacy_slab_block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": [43, 44],
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "nether_brick_slab",
"mode": "legacy_slab_block",
"top_color": [66, 32, 38, 255],
"darken": true,
"legacy_id": [43, 44],
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "quartz_slab",
"mode": "legacy_slab_block",
"top_color": [217, 213, 206, 255],
"darken": true,
"legacy_id": [43, 44],
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "bricks",
"mode": "block",
"top_color": [86, 35, 23, 255],
"darken": true,
"legacy_id": 45
},
{
"namespace": "minecraft",
"material": "tnt",
"mode": "block",
"top_color": [255, 0, 0, 255],
"darken": true,
"legacy_id": 46
},
{
"namespace": "minecraft",
"material": "bookshelf",
"mode": "block",
"top_color": [191, 169, 116, 255],
"darken": true,
"legacy_id": 47
},
{
"namespace": "minecraft",
"material": "mossy_cobblestone",
"mode": "block",
"top_color": [127, 174, 125, 255],
"darken": true,
"legacy_id": 48
},
{
"namespace": "minecraft",
"material": "obsidian",
"mode": "block",
"top_color": [17, 13, 26, 255],
"darken": true,
"legacy_id": 49
},
{
"namespace": "minecraft",
"material": "torch",
"mode": "torch_block",
"top_color": [255, 225, 96, 208],
"darken": false,
"legacy_id": 50
},
{
"namespace": "minecraft",
"material": "wall_torch",
"mode": "torch_block",
"top_color": [255, 225, 96, 208],
"darken": false
},
{
"namespace": "minecraft",
"material": "fire",
"mode": "block",
"top_color": [224, 174, 21, 255],
"darken": false,
"legacy_id": 51
},
{
"namespace": "minecraft",
"material": "spawner",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 52
},
{
"namespace": "minecraft",
"material": "oak_stairs",
"mode": "block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": 53
},
{
"namespace": "minecraft",
"material": "chest",
"mode": "block",
"top_color": [191, 135, 2, 255],
"darken": true,
"legacy_id": 54
},
{
"namespace": "minecraft",
"material": "redstone_wire",
"mode": "block",
"top_color": [111, 1, 1, 255],
"darken": true,
"legacy_id": 55
},
{
"namespace": "minecraft",
"material": "diamond_ore",
"mode": "block",
"top_color": [129, 140, 143, 255],
"darken": true,
"legacy_id": 56
},
{
"namespace": "minecraft",
"material": "diamond_block",
"mode": "block",
"top_color": [45, 166, 152, 255],
"darken": true,
"legacy_id": 57
},
{
"namespace": "minecraft",
"material": "crafting_table",
"mode": "block",
"top_color": [169, 107, 0, 255],
"darken": true,
"legacy_id": 58
},
{
"namespace": "minecraft",
"material": "wheat",
"mode": "block",
"top_color": [144, 188, 39, 255],
"darken": true,
"legacy_id": 59
},
{
"namespace": "minecraft",
"material": "farmland",
"mode": "block",
"top_color": [134, 96, 67, 255],
"darken": true,
"legacy_id": 60
},
{
"namespace": "minecraft",
"material": "furnace",
"mode": "block",
"top_color": [188, 188, 188, 255],
"darken": true,
"legacy_id": [61, 62]
},
{
"namespace": "minecraft",
"material": "sign",
"mode": "block",
"darken": false,
"legacy_id": [63, 68]
},
{
"namespace": "minecraft",
"material": "oak_door",
"mode": "block",
"darken": false,
"legacy_id": 64
},
{
"namespace": "minecraft",
"material": "ladder",
"mode": "block",
"top_color": [255, 200, 140, 0],
"darken": false,
"legacy_id": 65
},
{
"namespace": "minecraft",
"material": "rail",
"mode": "block",
"top_color": [120, 120, 120, 128],
"darken": true,
"legacy_id": 66
},
{
"namespace": "minecraft",
"material": "cobblestone_stairs",
"mode": "block",
"top_color": [120, 120, 120, 128],
"darken": true,
"legacy_id": 67
},
{
"namespace": "minecraft",
"material": "lever",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": false,
"legacy_id": 69
},
{
"namespace": "minecraft",
"material": "stone_pressure_plate",
"mode": "half_block",
"top_color": [120, 120, 120, 255],
"darken": true,
"legacy_id": 70
},
{
"namespace": "minecraft",
"material": "iron_door",
"mode": "block",
"darken": false,
"legacy_id": 71
},
{
"namespace": "minecraft",
"material": "oak_pressure_plate",
"mode": "half_block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": 72
},
{
"namespace": "minecraft",
"material": "redstone_ore",
"mode": "block",
"top_color": [163, 145, 145, 255],
"darken": true,
"legacy_id": [73, 74]
},
{
"namespace": "minecraft",
"material": "redstone_torch",
"mode": "torch_block",
"top_color": [181, 140, 64, 32],
"darken": false,
"legacy_id": [75, 76]
},
{
"namespace": "minecraft",
"material": "redstone_wall_torch",
"mode": "torch_block",
"top_color": [181, 140, 64, 32],
"darken": false
},
{
"namespace": "minecraft",
"material": "stone_button",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": false,
"legacy_id": 77
},
{
"namespace": "minecraft",
"material": "snow",
"mode": "half_block",
"top_color": [255, 255, 255, 255],
"darken": true,
"legacy_id": 78
},
{
"namespace": "minecraft",
"material": "ice",
"mode": "block",
"top_color": [120, 120, 255, 120],
"darken": true,
"legacy_id": 79
},
{
"namespace": "minecraft",
"material": "snow_block",
"mode": "block",
"top_color": [255, 255, 255, 255],
"darken": true,
"legacy_id": 80
},
{
"namespace": "minecraft",
"material": "cactus",
"mode": "block",
"top_color": [85, 107, 47, 255],
"darken": true,
"legacy_id": 81
},
{
"namespace": "minecraft",
"material": "clay",
"mode": "block",
"top_color": [144, 152, 168, 255],
"darken": true,
"legacy_id": 82
},
{
"namespace": "minecraft",
"material": "sugar_cane",
"mode": "block",
"top_color": [193, 234, 150, 200],
"darken": true,
"legacy_id": 83
},
{
"namespace": "minecraft",
"material": "jukebox",
"mode": "block",
"top_color": [125, 66, 44, 255],
"darken": true,
"legacy_id": 84
},
{
"namespace": "minecraft",
"material": "oak_fence",
"mode": "block",
"top_color": [157, 128, 79, 200],
"darken": true,
"legacy_id": 85
},
{
"namespace": "minecraft",
"material": "pumpkin",
"mode": "block",
"top_color": [227, 144, 29, 255],
"darken": true,
"legacy_id": 86
},
{
"namespace": "minecraft",
"material": "netherrack",
"mode": "block",
"top_color": [194, 115, 115, 255],
"darken": true,
"legacy_id": 87
},
{
"namespace": "minecraft",
"material": "soul_sand",
"mode": "block",
"top_color": [121, 97, 82, 255],
"darken": true,
"legacy_id": 88
},
{
"namespace": "minecraft",
"material": "glowstone",
"mode": "block",
"top_color": [255, 188, 94, 255],
"darken": true,
"legacy_id": 89
},
{
"namespace": "minecraft",
"material": "nether_portal",
"mode": "block",
"top_color": [60, 13, 106, 127],
"darken": true,
"legacy_id": 90
},
{
"namespace": "minecraft",
"material": "jack_o_lantern",
"mode": "block",
"top_color": [227, 144, 29, 255],
"darken": true,
"legacy_id": 91
},
{
"namespace": "minecraft",
"material": "cake",
"mode": "half_block",
"top_color": [228, 205, 206, 255],
"darken": true,
"legacy_id": 92
},
{
"namespace": "minecraft",
"material": "repeater",
"mode": "half_block",
"top_color": [111, 1, 1, 255],
"darken": true,
"legacy_id": [93, 94]
},
{
"namespace": "minecraft",
"material": "white_stained_glass",
"mode": "block",
"top_color": [223, 223, 223, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "orange_stained_glass",
"mode": "block",
"top_color": [234, 128, 55, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "magenta_stained_glass",
"mode": "block",
"top_color": [191, 76, 201, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "light_blue_stained_glass",
"mode": "block",
"top_color": [105, 139, 212, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "yellow_stained_glass",
"mode": "block",
"top_color": [195, 181, 28, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "lime_stained_glass",
"mode": "block",
"top_color": [59, 189, 48, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "pink_stained_glass",
"mode": "block",
"top_color": [218, 132, 155, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "gray_stained_glass",
"mode": "block",
"top_color": [67, 67, 67, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "light_stained_glass",
"mode": "block",
"top_color": [159, 166, 166, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "cyan_stained_glass",
"mode": "block",
"top_color": [39, 117, 150, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "purple_stained_glass",
"mode": "block",
"top_color": [130, 54, 196, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "blue_stained_glass",
"mode": "block",
"top_color": [39, 51, 154, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "brown_stained_glass",
"mode": "block",
"top_color": [86, 51, 28, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 12
},
{
"namespace": "minecraft",
"material": "green_stained_glass",
"mode": "block",
"top_color": [56, 77, 24, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 13
},
{
"namespace": "minecraft",
"material": "red_stained_glass",
"mode": "block",
"top_color": [164, 45, 41, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 14
},
{
"namespace": "minecraft",
"material": "black_stained_glass",
"mode": "block",
"top_color": [27, 23, 23, 127],
"darken": true,
"legacy_id": 95,
"legacy_meta": 15
},
{
"namespace": "minecraft",
"material": "oak_trapdoor",
"mode": "half_block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": 96
},
{
"namespace": "minecraft",
"material": "infested_stone",
"mode": "block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": 97,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "infested_cobblestone",
"mode": "block",
"top_color": [100, 100, 100, 255],
"darken": true,
"legacy_id": 97,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "infested_stone_bricks",
"mode": "block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": 97,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "infested_mossy_stone_bricks",
"mode": "block",
"top_color": [127, 174, 125, 255],
"darken": true,
"legacy_id": 97,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "infested_cracked_stone_bricks",
"mode": "block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": 97,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "infested_chiseled_stone_bricks",
"mode": "block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": 97,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "stone_bricks",
"mode": "block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": 98
},
{
"namespace": "minecraft",
"material": "brown_mushroom_block",
"mode": "block",
"top_color": [206, 174, 123, 255],
"darken": true,
"legacy_id": 99
},
{
"namespace": "minecraft",
"material": "red_mushroom_block",
"mode": "block",
"top_color": [183, 31, 29, 255],
"darken": true,
"legacy_id": 100
},
{
"namespace": "minecraft",
"material": "iron_bars",
"mode": "block",
"top_color": [217, 217, 217, 200],
"darken": true,
"legacy_id": 101
},
{
"namespace": "minecraft",
"material": "glass_pane",
"mode": "block",
"top_color": [255, 255, 255, 48],
"darken": true,
"legacy_id": 102
},
{
"namespace": "minecraft",
"material": "melon",
"mode": "block",
"top_color": [50, 200, 45, 255],
"darken": true,
"legacy_id": 103
},
{
"namespace": "minecraft",
"material": "pumpkin_stem",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 104
},
{
"namespace": "minecraft",
"material": "melon_stem",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 105
},
{
"namespace": "minecraft",
"material": "vine",
"mode": "block",
"top_color": [50, 89, 45, 128],
"darken": false,
"legacy_id": 106
},
{
"namespace": "minecraft",
"material": "oak_fence_gate",
"mode": "block",
"top_color": [157, 128, 79, 200],
"darken": true,
"legacy_id": 107
},
{
"namespace": "minecraft",
"material": "brick_stairs",
"mode": "block",
"top_color": [86, 35, 23, 255],
"darken": true,
"legacy_id": 108
},
{
"namespace": "minecraft",
"material": "stone_brick_stairs",
"mode": "block",
"top_color": [128, 128, 128, 255],
"darken": true,
"legacy_id": 109
},
{
"namespace": "minecraft",
"material": "mycelium",
"mode": "block",
"top_color": [110, 93, 133, 255],
"darken": true,
"legacy_id": 110
},
{
"namespace": "minecraft",
"material": "lily_pad",
"mode": "half_block",
"top_color": [50, 89, 45, 230],
"darken": false,
"legacy_id": 111
},
{
"namespace": "minecraft",
"material": "nether_bricks",
"mode": "block",
"top_color": [66, 32, 38, 255],
"darken": true,
"legacy_id": 112
},
{
"namespace": "minecraft",
"material": "nether_brick_fence",
"mode": "block",
"top_color": [66, 32, 38, 200],
"darken": true,
"legacy_id": 113
},
{
"namespace": "minecraft",
"material": "nether_brick_stairs",
"mode": "block",
"top_color": [66, 32, 38, 255],
"darken": true,
"legacy_id": 114
},
{
"namespace": "minecraft",
"material": "nether_wart",
"mode": "block",
"top_color": [149, 21, 8, 230],
"darken": true,
"legacy_id": 115
},
{
"namespace": "minecraft",
"material": "enchanting_table",
"mode": "block",
"top_color": [130, 5, 5, 255],
"darken": true,
"legacy_id": 116
},
{
"namespace": "minecraft",
"material": "brewing_stand",
"mode": "block",
"top_color": [124, 118, 51, 230],
"darken": true,
"legacy_id": 117
},
{
"namespace": "minecraft",
"material": "cauldron",
"mode": "block",
"top_color": [49, 49, 49, 255],
"darken": true,
"legacy_id": 118
},
{
"namespace": "minecraft",
"material": "end_portal",
"mode": "block",
"top_color": [35, 60, 99, 128],
"darken": true,
"legacy_id": 119
},
{
"namespace": "minecraft",
"material": "end_portal_frame",
"mode": "block",
"top_color": [62, 115, 105, 255],
"darken": true,
"legacy_id": 120
},
{
"namespace": "minecraft",
"material": "end_stone",
"mode": "block",
"top_color": [203, 206, 148, 255],
"darken": true,
"legacy_id": 121
},
{
"namespace": "minecraft",
"material": "dragon_egg",
"mode": "block",
"top_color": [72, 4, 82, 255],
"darken": true,
"legacy_id": 122
},
{
"namespace": "minecraft",
"material": "redstone_lamp",
"mode": "block",
"top_color": [145, 90, 57, 255],
"darken": true,
"legacy_id": 123
},
{
"namespace": "minecraft",
"material": "oak_slab",
"mode": "legacy_slab_block",
"top_color": [157, 128, 79, 255],
"darken": true,
"legacy_id": [125, 126],
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "spruce_slab",
"mode": "legacy_slab_block",
"top_color": [102, 77, 46, 255],
"darken": true,
"legacy_id": [125, 126],
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "birch_slab",
"mode": "legacy_slab_block",
"top_color": [193, 177, 122, 255],
"darken": true,
"legacy_id": [125, 126],
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "jungle_slab",
"mode": "legacy_slab_block",
"top_color": [152, 109, 76, 255],
"darken": true,
"legacy_id": [125, 126],
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "acacia_slab",
"mode": "legacy_slab_block",
"top_color": [168, 91, 50, 255],
"darken": true,
"legacy_id": [125, 126],
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "dark_oak_slab",
"mode": "legacy_slab_block",
"top_color": [60, 39, 18, 255],
"darken": true,
"legacy_id": [125, 126],
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "cocoa",
"mode": "block",
"top_color": [190, 116, 45, 230],
"darken": true,
"legacy_id": 127
},
{
"namespace": "minecraft",
"material": "sandstone_stairs",
"mode": "block",
"top_color": [218, 210, 158, 255],
"darken": true,
"legacy_id": 128
},
{
"namespace": "minecraft",
"material": "emerald_ore",
"mode": "block",
"top_color": [94, 124, 105, 255],
"darken": true,
"legacy_id": 129
},
{
"namespace": "minecraft",
"material": "ender_chest",
"mode": "block",
"top_color": [42, 58, 60, 255],
"side_color": [35, 49, 33, 255],
"darken": true,
"legacy_id": 130
},
{
"namespace": "minecraft",
"material": "tripwire_hook",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 131
},
{
"namespace": "minecraft",
"material": "tripwire",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 132
},
{
"namespace": "minecraft",
"material": "emerald_block",
"mode": "block",
"top_color": [84, 218, 123, 255],
"darken": true,
"legacy_id": 133
},
{
"namespace": "minecraft",
"material": "spruce_stairs",
"mode": "block",
"top_color": [102, 77, 46, 255],
"darken": true,
"legacy_id": 134
},
{
"namespace": "minecraft",
"material": "birch_stairs",
"mode": "block",
"top_color": [193, 177, 122, 255],
"darken": true,
"legacy_id": 135
},
{
"namespace": "minecraft",
"material": "jungle_stairs",
"mode": "block",
"top_color": [152, 109, 76, 255],
"darken": true,
"legacy_id": 136
},
{
"namespace": "minecraft",
"material": "command_block",
"mode": "block",
"top_color": [186, 118, 74, 255],
"darken": true,
"legacy_id": 137
},
{
"namespace": "minecraft",
"material": "beacon",
"mode": "block",
"top_color": [196, 255, 254, 230],
"darken": true,
"legacy_id": 138
},
{
"namespace": "minecraft",
"material": "cobblestone_wall",
"mode": "block",
"top_color": [100, 100, 100, 255],
"darken": true,
"legacy_id": 139
},
{
"namespace": "minecraft",
"material": "flower_pot",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 140
},
{
"namespace": "minecraft",
"material": "carrots",
"mode": "block",
"top_color": [2, 161, 0, 255],
"darken": true,
"legacy_id": 141
},
{
"namespace": "minecraft",
"material": "potatoes",
"mode": "block",
"top_color": [0, 174, 25, 255],
"darken": true,
"legacy_id": 142
},
{
"namespace": "minecraft",
"material": "oak_button",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 143
},
{
"namespace": "minecraft",
"material": "skeleton_skull",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "skeleton_wall_skull",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "wither_skeleton_skull",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "wither_skeleton_wall_skull",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "zombie_head",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "zombie_wall_head",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "player_head",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "player_wall_head",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "creeper_head",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "creeper_wall_head",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "dragon_head",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "dragon_wall_head",
"mode": "block",
"top_color": [255, 255,255, 0],
"darken": true,
"legacy_id": 144,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "anvil",
"mode": "block",
"top_color": [66, 62, 62, 255],
"darken": true,
"legacy_id": 145,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "chipped_anvil",
"mode": "block",
"top_color": [66, 62, 62, 255],
"darken": true,
"legacy_id": 145,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "damaged_anvil",
"mode": "block",
"top_color": [66, 62, 62, 255],
"darken": true,
"legacy_id": 145,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "trapped_chest",
"mode": "block",
"top_color": [191, 135, 2, 255],
"darken": true,
"legacy_id": 146
},
{
"namespace": "minecraft",
"material": "light_weighted_pressure_plate",
"mode": "half_block",
"top_color": [255, 237, 140, 255],
"darken": true,
"legacy_id": 147
},
{
"namespace": "minecraft",
"material": "heavy_weighted_pressure_plate",
"mode": "half_block",
"top_color": [217, 217, 217, 255],
"darken": true,
"legacy_id": 148
},
{
"namespace": "minecraft",
"material": "comparator",
"mode": "half_block",
"top_color": [111, 1, 1, 255],
"darken": true,
"legacy_id": 149
},
{
"namespace": "minecraft",
"material": "daylight_detector",
"mode": "half_block",
"top_color": [194, 179, 158, 255],
"side_color": [29, 23, 14, 255],
"darken": true,
"legacy_id": 151
},
{
"namespace": "minecraft",
"material": "redstone_block",
"mode": "block",
"top_color": [150, 24, 7, 255],
"darken": true,
"legacy_id": 152
},
{
"namespace": "minecraft",
"material": "nether_quartz_ore",
"mode": "block",
"top_color": [190, 143, 136, 255],
"darken": true,
"legacy_id": 153
},
{
"namespace": "minecraft",
"material": "hopper",
"mode": "block",
"top_color": [55, 55, 55, 255],
"darken": true,
"legacy_id": 154
},
{
"namespace": "minecraft",
"material": "quartz_block",
"mode": "block",
"top_color": [217, 213, 206, 255],
"darken": true,
"legacy_id": 155
},
{
"namespace": "minecraft",
"material": "quartz_stairs",
"mode": "block",
"top_color": [217, 213, 206, 255],
"darken": true,
"legacy_id": 156
},
{
"namespace": "minecraft",
"material": "activator_rail",
"mode": "block",
"top_color": [120, 120, 120, 128],
"side_color": [255, 220, 0, 128],
"darken": false,
"legacy_id": 157
},
{
"namespace": "minecraft",
"material": "dropper",
"mode": "block",
"top_color": [107, 107, 107, 255],
"darken": true,
"legacy_id": 158
},
{
"namespace": "minecraft",
"material": "white_terracotta",
"mode": "block",
"top_color": [210, 177, 161, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "orange_terracotta",
"mode": "block",
"top_color": [162, 82, 36, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "magenta_terracotta",
"mode": "block",
"top_color": [149, 89, 110, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "light_blue_terracotta",
"mode": "block",
"top_color": [117, 111, 140, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "yellow_terracotta",
"mode": "block",
"top_color": [186, 134, 36, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "lime_terracotta",
"mode": "block",
"top_color": [102, 115, 48, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "pink_terracotta",
"mode": "block",
"top_color": [163, 80, 80, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "gray_terracotta",
"mode": "block",
"top_color": [57, 42, 35, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "light_gray_terracotta",
"mode": "block",
"top_color": [135, 107, 98, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "cyan_terracotta",
"mode": "block",
"top_color": [91, 95, 94, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "purple_terracotta",
"mode": "block",
"top_color": [119, 72, 87, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "blue_terracotta",
"mode": "block",
"top_color": [76, 62, 92, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "brown_terracotta",
"mode": "block",
"top_color": [77, 51, 36, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 12
},
{
"namespace": "minecraft",
"material": "green_terracotta",
"mode": "block",
"top_color": [76, 84, 43, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 13
},
{
"namespace": "minecraft",
"material": "red_terracotta",
"mode": "block",
"top_color": [142, 61, 47, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 14
},
{
"namespace": "minecraft",
"material": "black_terracotta",
"mode": "block",
"top_color": [39, 24, 17, 255],
"darken": true,
"legacy_id": 159,
"legacy_meta": 15
},
{
"namespace": "minecraft",
"material": "white_stained_glass_pane",
"mode": "block",
"top_color": [223, 223, 223, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "orange_stained_glass_pane",
"mode": "block",
"top_color": [234, 128, 55, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "magenta_stained_glass_pane",
"mode": "block",
"top_color": [191, 76, 201, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "light_blue_stained_glass_pane",
"mode": "block",
"top_color": [105, 139, 212, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "yellow_stained_glass_pane",
"mode": "block",
"top_color": [195, 181, 28, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "lime_stained_glass_pane",
"mode": "block",
"top_color": [59, 189, 48, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "pink_stained_glass_pane",
"mode": "block",
"top_color": [218, 132, 155, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "gray_stained_glass_pane",
"mode": "block",
"top_color": [67, 67, 67, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "light_stained_glass_pane",
"mode": "block",
"top_color": [159, 166, 166, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "cyan_stained_glass_pane",
"mode": "block",
"top_color": [39, 117, 150, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "purple_stained_glass_pane",
"mode": "block",
"top_color": [130, 54, 196, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "blue_stained_glass_pane",
"mode": "block",
"top_color": [39, 51, 154, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "brown_stained_glass_pane",
"mode": "block",
"top_color": [86, 51, 28, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 12
},
{
"namespace": "minecraft",
"material": "green_stained_glass_pane",
"mode": "block",
"top_color": [56, 77, 24, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 13
},
{
"namespace": "minecraft",
"material": "red_stained_glass_pane",
"mode": "block",
"top_color": [164, 45, 41, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 14
},
{
"namespace": "minecraft",
"material": "black_stained_glass_pane",
"mode": "block",
"top_color": [27, 23, 23, 127],
"darken": true,
"legacy_id": 160,
"legacy_meta": 15
},
{
"namespace": "minecraft",
"material": "acacia_leaves",
"mode": "legacy_leaf_block",
"top_color": [58, 145, 19, 128],
"darken": true,
"legacy_id": 161,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "dark_oak_leaves",
"mode": "legacy_leaf_block",
"top_color": [52, 131, 18, 128],
"darken": true,
"legacy_id": 161,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "acacia_log",
"mode": "log_block",
"top_color": [155, 90, 62, 255],
"side_color": [104, 98, 88, 255],
"darken": false,
"legacy_id": 162,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "dark_oak_log",
"mode": "log_block",
"top_color": [79, 63, 41, 255],
"side_color": [51, 40, 23, 255],
"darken": false,
"legacy_id": 162,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "acacia_stairs",
"mode": "block",
"top_color": [168, 91, 50, 255],
"darken": true,
"legacy_id": 163
},
{
"namespace": "minecraft",
"material": "dark_oak_stairs",
"mode": "block",
"top_color": [60, 39, 18, 255],
"darken": true,
"legacy_id": 164
},
{
"namespace": "minecraft",
"material": "slime_block",
"mode": "block",
"top_color": [114, 188, 105, 230],
"darken": true,
"legacy_id": 165
},
{
"namespace": "minecraft",
"material": "barrier",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": true,
"legacy_id": 166
},
{
"namespace": "minecraft",
"material": "iron_trapdoor",
"mode": "half_block",
"top_color": [217, 217, 217, 255],
"darken": true,
"legacy_id": 167
},
{
"namespace": "minecraft",
"material": "prismarine",
"mode": "block",
"top_color": [69, 122, 123, 255],
"darken": true,
"legacy_id": 168,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "prismarine_bricks",
"mode": "block",
"top_color": [69, 123, 108, 255],
"darken": true,
"legacy_id": 168,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "dark_prismarine",
"mode": "block",
"top_color": [59, 87, 75, 255],
"darken": true,
"legacy_id": 168,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "sea_lantern",
"mode": "block",
"top_color": [68, 121, 104, 255],
"darken": true,
"legacy_id": 169
},
{
"namespace": "minecraft",
"material": "hay_block",
"mode": "block",
"top_color": [192, 160, 14, 255],
"darken": true,
"legacy_id": 170
},
{
"namespace": "minecraft",
"material": "white_carpet",
"mode": "half_block",
"top_color": [223, 223, 223, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "orange_carpet",
"mode": "half_block",
"top_color": [234, 128, 55, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "magenta_carpet",
"mode": "half_block",
"top_color": [191, 76, 201, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "light_blue_carpet",
"mode": "half_block",
"top_color": [105, 139, 212, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "yellow_carpet",
"mode": "half_block",
"top_color": [195, 181, 28, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "lime_carpet",
"mode": "half_block",
"top_color": [59, 189, 48, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "pink_carpet",
"mode": "half_block",
"top_color": [218, 132, 155, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "gray_carpet",
"mode": "half_block",
"top_color": [67, 67, 67, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "light_gray_carpet",
"mode": "half_block",
"top_color": [159, 166, 166, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "cyan_carpet",
"mode": "half_block",
"top_color": [39, 117, 150, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "purple_carpet",
"mode": "half_block",
"top_color": [130, 54, 196, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "blue_carpet",
"mode": "half_block",
"top_color": [39, 51, 154, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "brown_carpet",
"mode": "half_block",
"top_color": [86, 51, 28, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 12
},
{
"namespace": "minecraft",
"material": "green_carpet",
"mode": "half_block",
"top_color": [56, 77, 24, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 13
},
{
"namespace": "minecraft",
"material": "red_carpet",
"mode": "half_block",
"top_color": [164, 45, 41, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 14
},
{
"namespace": "minecraft",
"material": "black_carpet",
"mode": "half_block",
"top_color": [27, 23, 23, 255],
"darken": true,
"legacy_id": 171,
"legacy_meta": 15
},
{
"namespace": "minecraft",
"material": "terracotta",
"mode": "block",
"top_color": [140, 86, 63, 255],
"darken": true,
"legacy_id": 172
},
{
"namespace": "minecraft",
"material": "coal_block",
"mode": "block",
"top_color": [20, 20, 20, 255],
"darken": true,
"legacy_id": 173
},
{
"namespace": "minecraft",
"material": "packed_ice",
"mode": "block",
"top_color": [120, 120, 255, 180],
"darken": true,
"legacy_id": 174
},
{
"namespace": "minecraft",
"material": "sunflower",
"mode": "large_plant_block",
"top_color": [230, 187, 33, 255],
"side_color": [66, 108, 43, 255],
"darken": false,
"legacy_id": 175,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "lilac",
"mode": "large_plant_block",
"top_color": [159, 120, 164, 255],
"darken": false,
"legacy_id": 175,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "tall_grass",
"mode": "large_plant_block",
"top_color": [144, 188, 39, 255],
"darken": false,
"legacy_id": 175,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "large_fern",
"mode": "large_plant_block",
"top_color": [144, 188, 39, 255],
"darken": false,
"legacy_id": 175,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "rose_bush",
"mode": "large_plant_block",
"top_color": [190, 26, 18, 255],
"darken": false,
"legacy_id": 175,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "peony",
"mode": "large_plant_block",
"top_color": [222, 165, 247, 255],
"side_color": [69, 96, 73, 255],
"darken": false,
"legacy_id": 175,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "red_sandstone",
"mode": "block",
"top_color": [166, 85, 30, 255],
"darken": true,
"legacy_id": 179
},
{
"namespace": "minecraft",
"material": "red_sandstone_stairs",
"mode": "block",
"top_color": [166, 85, 30, 255],
"darken": true,
"legacy_id": 180
},
{
"namespace": "minecraft",
"material": "red_sandstone_slab",
"mode": "legacy_slab_block",
"top_color": [166, 85, 30, 255],
"darken": true,
"legacy_id": [
181,
182
]
},
{
"namespace": "minecraft",
"material": "spruce_fence_gate",
"mode": "block",
"top_color": [102, 77, 46, 200],
"darken": true,
"legacy_id": 183
},
{
"namespace": "minecraft",
"material": "birch_fence_gate",
"mode": "block",
"top_color": [193, 177, 122, 200],
"darken": true,
"legacy_id": 184
},
{
"namespace": "minecraft",
"material": "jungle_fence_gate",
"mode": "block",
"top_color": [152, 109, 76, 200],
"darken": true,
"legacy_id": 185
},
{
"namespace": "minecraft",
"material": "dark_oak_fence_gate",
"mode": "block",
"top_color": [60, 39, 18, 200],
"darken": true,
"legacy_id": 186
},
{
"namespace": "minecraft",
"material": "acacia_fence_gate",
"mode": "block",
"top_color": [168, 91, 50, 200],
"darken": true,
"legacy_id": 187
},
{
"namespace": "minecraft",
"material": "spruce_fence",
"mode": "block",
"top_color": [102, 77, 46, 200],
"darken": true,
"legacy_id": 188
},
{
"namespace": "minecraft",
"material": "birch_fence",
"mode": "block",
"top_color": [193, 177, 122, 200],
"darken": true,
"legacy_id": 189
},
{
"namespace": "minecraft",
"material": "jungle_fence",
"mode": "block",
"top_color": [152, 109, 76, 200],
"darken": true,
"legacy_id": 190
},
{
"namespace": "minecraft",
"material": "dark_oak_fence",
"mode": "block",
"top_color": [60, 39, 18, 200],
"darken": true,
"legacy_id": 191
},
{
"namespace": "minecraft",
"material": "acacia_fence",
"mode": "block",
"top_color": [168, 91, 50, 200],
"darken": true,
"legacy_id": 192
},
{
"namespace": "minecraft",
"material": "spruce_door",
"mode": "block",
"darken": false,
"legacy_id": 193
},
{
"namespace": "minecraft",
"material": "birch_door",
"mode": "block",
"darken": false,
"legacy_id": 194
},
{
"namespace": "minecraft",
"material": "jungle_door",
"mode": "block",
"darken": false,
"legacy_id": 195
},
{
"namespace": "minecraft",
"material": "acacia_door",
"mode": "block",
"darken": false,
"legacy_id": 196
},
{
"namespace": "minecraft",
"material": "dark_oak_door",
"mode": "block",
"darken": false,
"legacy_id": 197
},
{
"namespace": "minecraft",
"material": "end_rod",
"mode": "block",
"top_color": [94, 73, 131, 140],
"darken": false,
"legacy_id": 198
},
{
"namespace": "minecraft",
"material": "chorus_plant",
"mode": "block",
"top_color": [116, 70, 124, 255],
"darken": true,
"legacy_id": 199
},
{
"namespace": "minecraft",
"material": "chorus_flower",
"mode": "block",
"top_color": [108, 84, 108, 255],
"darken": true,
"legacy_id": 200
},
{
"namespace": "minecraft",
"material": "purpur_block",
"mode": "block",
"top_color": [104, 58, 103, 255],
"darken": true,
"legacy_id": 201
},
{
"namespace": "minecraft",
"material": "purpur_pillar",
"mode": "block",
"top_color": [166, 124, 166, 255],
"darken": true,
"legacy_id": 202
},
{
"namespace": "minecraft",
"material": "purpur_stairs",
"mode": "block",
"top_color": [140, 105, 142, 255],
"darken": true,
"legacy_id": 203
},
{
"namespace": "minecraft",
"material": "purpur_slab",
"mode": "legacy_slab_block",
"top_color": [104, 58, 103, 255],
"darken": true,
"legacy_id": [204, 205]
},
{
"namespace": "minecraft",
"material": "end_stone_bricks",
"mode": "block",
"top_color": [223, 229, 170, 255],
"darken": true,
"legacy_id": 206
},
{
"namespace": "minecraft",
"material": "beetroots",
"mode": "block",
"top_color": [76, 108, 49, 255],
"darken": true,
"legacy_id": 207
},
{
"namespace": "minecraft",
"material": "grass_path",
"mode": "block",
"top_color": [149, 125, 71, 255],
"darken": true,
"legacy_id": 208
},
{
"namespace": "minecraft",
"material": "end_gateway",
"mode": "block",
"top_color": [15, 15, 25, 255],
"darken": true,
"legacy_id": 209
},
{
"namespace": "minecraft",
"material": "repeating_command_block",
"mode": "block",
"top_color": [135, 122, 152, 255],
"darken": true,
"legacy_id": 210
},
{
"namespace": "minecraft",
"material": "chain_command_block",
"mode": "block",
"top_color": [114, 135, 131, 255],
"darken": true,
"legacy_id": 211
},
{
"namespace": "minecraft",
"material": "frosted_ice",
"mode": "block",
"top_color": [120, 120, 255, 120],
"darken": true,
"legacy_id": 212
},
{
"namespace": "minecraft",
"material": "magma_block",
"mode": "block",
"top_color": [132, 64, 26, 255],
"darken": true,
"legacy_id": 213
},
{
"namespace": "minecraft",
"material": "nether_wart_block",
"mode": "block",
"top_color": [107, 60, 60, 255],
"darken": true,
"legacy_id": 214
},
{
"namespace": "minecraft",
"material": "red_nether_bricks",
"mode": "block",
"top_color": [106, 59, 62, 255],
"darken": true,
"legacy_id": 215
},
{
"namespace": "minecraft",
"material": "bone_block",
"mode": "block",
"top_color": [218, 214, 193, 255],
"darken": true,
"legacy_id": 216
},
{
"namespace": "minecraft",
"material": "structure_void",
"mode": "block",
"top_color": [255, 255, 255, 0],
"darken": false,
"legacy_id": 217
},
{
"namespace": "minecraft",
"material": "observer",
"mode": "block",
"top_color": [107, 107, 107, 255],
"darken": true,
"legacy_id": 218
},
{
"namespace": "minecraft",
"material": "white_shulker_box",
"mode": "block",
"top_color": [205, 210, 210, 255],
"darken": true,
"legacy_id": 219
},
{
"namespace": "minecraft",
"material": "orange_shulker_box",
"mode": "block",
"top_color": [228, 104, 9, 255],
"darken": true,
"legacy_id": 220
},
{
"namespace": "minecraft",
"material": "magenta_shulker_box",
"mode": "block",
"top_color": [168, 52, 158, 255],
"darken": true,
"legacy_id": 221
},
{
"namespace": "minecraft",
"material": "light_blue_shulker_box",
"mode": "block",
"top_color": [46, 156, 206, 255],
"darken": true,
"legacy_id": 222
},
{
"namespace": "minecraft",
"material": "yellow_shulker_box",
"mode": "block",
"top_color": [241, 182, 27, 255],
"darken": true,
"legacy_id": 223
},
{
"namespace": "minecraft",
"material": "lime_shulker_box",
"mode": "block",
"top_color": [94, 163, 22, 255],
"darken": true,
"legacy_id": 224
},
{
"namespace": "minecraft",
"material": "pink_shulker_box",
"mode": "block",
"top_color": [221, 114, 150, 255],
"darken": true,
"legacy_id": 225
},
{
"namespace": "minecraft",
"material": "gray_shulker_box",
"mode": "block",
"top_color": [56, 59, 63, 255],
"darken": true,
"legacy_id": 226
},
{
"namespace": "minecraft",
"material": "light_gray_shulker_box",
"mode": "block",
"top_color": [117, 117, 108, 255],
"darken": true,
"legacy_id": 227
},
{
"namespace": "minecraft",
"material": "cyan_shulker_box",
"mode": "block",
"top_color": [20, 116, 130, 255],
"darken": true,
"legacy_id": 228
},
{
"namespace": "minecraft",
"material": "purple_shulker_box",
"mode": "block",
"top_color": [148, 103, 148, 255],
"darken": true,
"legacy_id": 229
},
{
"namespace": "minecraft",
"material": "blue_shulker_box",
"mode": "block",
"top_color": [42, 44, 135, 255],
"darken": true,
"legacy_id": 230
},
{
"namespace": "minecraft",
"material": "brown_shulker_box",
"mode": "block",
"top_color": [103, 64, 35, 255],
"darken": true,
"legacy_id": 231
},
{
"namespace": "minecraft",
"material": "green_shulker_box",
"mode": "block",
"top_color": [76, 96, 32, 255],
"darken": true,
"legacy_id": 232
},
{
"namespace": "minecraft",
"material": "red_shulker_box",
"mode": "block",
"top_color": [138, 30, 29, 255],
"darken": true,
"legacy_id": 233
},
{
"namespace": "minecraft",
"material": "black_shulker_box",
"mode": "block",
"top_color": [23, 24, 28, 255],
"darken": true,
"legacy_id": 234
},
{
"namespace": "minecraft",
"material": "white_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 235
},
{
"namespace": "minecraft",
"material": "orange_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 236
},
{
"namespace": "minecraft",
"material": "magenta_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 237
},
{
"namespace": "minecraft",
"material": "light_blue_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 238
},
{
"namespace": "minecraft",
"material": "yellow_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 239
},
{
"namespace": "minecraft",
"material": "lime_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 240
},
{
"namespace": "minecraft",
"material": "pink_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 241
},
{
"namespace": "minecraft",
"material": "gray_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 242
},
{
"namespace": "minecraft",
"material": "silver_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 243
},
{
"namespace": "minecraft",
"material": "cyan_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 244
},
{
"namespace": "minecraft",
"material": "purple_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 245
},
{
"namespace": "minecraft",
"material": "blue_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 246
},
{
"namespace": "minecraft",
"material": "brown_glazed_terracotta ",
"mode": "block",
"darken": true,
"legacy_id": 247
},
{
"namespace": "minecraft",
"material": "green_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 248
},
{
"namespace": "minecraft",
"material": "red_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 249
},
{
"namespace": "minecraft",
"material": "black_glazed_terracotta",
"mode": "block",
"darken": true,
"legacy_id": 250
},
{
"namespace": "minecraft",
"material": "white_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "orange_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "magenta_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "light_blue_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "yellow_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "lime_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "pink_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "gray_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "light_gray_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "cyan_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "purple_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "blue_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "brown_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 12
},
{
"namespace": "minecraft",
"material": "green_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 13
},
{
"namespace": "minecraft",
"material": "red_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 14
},
{
"namespace": "minecraft",
"material": "black_concrete",
"mode": "block",
"darken": true,
"legacy_id": 251,
"legacy_meta": 15
},
{
"namespace": "minecraft",
"material": "white_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 0
},
{
"namespace": "minecraft",
"material": "orange_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 1
},
{
"namespace": "minecraft",
"material": "magenta_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 2
},
{
"namespace": "minecraft",
"material": "light_blue_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 3
},
{
"namespace": "minecraft",
"material": "yellow_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 4
},
{
"namespace": "minecraft",
"material": "lime_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 5
},
{
"namespace": "minecraft",
"material": "pink_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 6
},
{
"namespace": "minecraft",
"material": "gray_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 7
},
{
"namespace": "minecraft",
"material": "light_gray_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 8
},
{
"namespace": "minecraft",
"material": "cyan_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 9
},
{
"namespace": "minecraft",
"material": "purple_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 10
},
{
"namespace": "minecraft",
"material": "blue_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 11
},
{
"namespace": "minecraft",
"material": "brown_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 12
},
{
"namespace": "minecraft",
"material": "green_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 13
},
{
"namespace": "minecraft",
"material": "red_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 14
},
{
"namespace": "minecraft",
"material": "black_concrete_powder",
"mode": "block",
"darken": true,
"legacy_id": 252,
"legacy_meta": 15
},
{
"namespace": "minecraft",
"material": "structure_block",
"mode": "block",
"top_color": [98, 74, 98, 255],
"darken": true,
"legacy_id": 255
}
]
================================================
FILE: res/example.html
================================================
<html>
<head>
<script type="text/javascript" src="libc10t.js"></script>
<script type="text/javascript" src="c10t_json.js"></script>
<script type="text/javascript">
if (window.c10t_json == undefined) {
alert("There is no c10t_json.js available, render one with `--write-js <output>'");
}
else {
var c = new c10t(c10t_json);
// try out a projection
var p = {"X":-123,"Y":5,"Z":19,"text":"Protected","type":"player","x":4610,"y":2444}
alert(c.project(p.X, p.Y, p.Z));
}
</script>
</head>
<body></body>
</html>
================================================
FILE: res/libc10t.js
================================================
function c10t(json) {
this.MapX = json.st.MapX;
this.MapY = json.st.MapY;
this.MapZ = json.st.MapZ;
this.mx_x = json.world.mx_x;
this.mn_x = json.world.mn_x;
this.mx_z = json.world.mx_z;
this.mn_z = json.world.mn_z;
this.mx_y = this.MapY;
this.mn_y = 0;
this.cx = json.world.cx;
this.cy = json.world.cy;
this.dx = json.world.dx;
this.dz = json.world.dz;
this.dy = this.MapY;
this.mode = this.modes[json.world.mode];
this.projection = this.projections[this.mode];
this.project = function (x, y, z)
{
cropCompensation = this.projection(0, 0, 0);
coordinates = this.projection(x, y, z);
coordinates[0] -= cropCompensation[0] - this.cx;
coordinates[1] -= cropCompensation[1] - this.cy;
return coordinates;
}
}
c10t.prototype.modes = {
0x0: "top",
0x1: "oblique",
0x2: "obliqueangle",
0x3: "isometric"
};
c10t.prototype.projections = {
'top': function(x, y, z) {
x -= this.mn_x;
z -= this.mn_z;
return [(this.dz - z - 1), x];
},
'oblique': function(x, y, z) {
x -= this.mn_x;
z -= this.mn_z;
return [(this.dz - z - 1) + x, x];
},
'obliqueangle': function(x, y, z) {
x -= this.mn_x;
z -= this.mn_z;
return [(this.dz - z - 1) + x, (this.dy - y - 1) + z + x];
},
'isometric': function(x, y, z) {
x -= this.mn_x;
z -= this.mn_z;
return [2 * ((this.dz - z - 1) + x), 2 * (this.dy - y - 1) + z + x];
}
};
================================================
FILE: scripts/area-set.sh
================================================
#!/bin/bash
basics=" -w /home/j/.minecraft/saves/World1"
prefix='./images/area'
threads=2
for i in $(seq -150 -20)
do
imgfile="$prefix$i.png"
echo "Rendering $i..."
./c10t $basics -o $imgfile -L -150,$i,-100,150 -q -s &
# Wait for threads to finish...
let mod=$i%$threads
if [ $mod = 0 ]; then
wait
fi
done
echo Trimming...
# Make all images the same size (assuming last image largest)
mogrify -bordercolor white -border 1x1 -trim $prefix*.png
newsize=$(identify -format '%wx%h' $imgfile)
mogrify -extent $newsize -background white +repage $prefix*.png
#Animate into a gif...
echo Animating...
convert -delay 20 -loop -1 $prefix*.png $prefix-animated.gif
================================================
FILE: scripts/area-slice.sh
================================================
#!/bin/bash
basics=" -w /home/j/.minecraft/saves/World1"
prefix='./images/areaslice'
threads=2
for i in $(seq -150 -20)
do
imgfile="$prefix$i.png"
let j=i-2
echo "Rendering $i..."
./c10t $basics -o $imgfile -L $j,$i,-100,150 -q -s &
# Wait for threads to finish...
let mod=$i%$threads
if [ $mod = 0 ]; then
wait
fi
done
echo Trimming...
# Make all images the same size (assuming last image largest)
mogrify -bordercolor white -border 1x1 -trim $prefix*.png
newsize=$(identify -format '%wx130' $imgfile)
mogrify -gravity south -extent $newsize -background white +repage $prefix*.png
#Animate into a gif...
echo Animating...
sleep 1
convert -delay 20 -loop -1 $prefix*.png $prefix-animated.gif
================================================
FILE: scripts/generate-tests.sh
================================================
#!/bin/bash
set -e
world=$1
dir=$2
C10T=./c10t
C10T_ARGS="-w $world -L -70,-60,5,20"
if [[ ! -d $world ]]; then
echo "Not a directory: $world"
exit 1;
fi
if [[ ! -d $dir ]]; then
echo "Not a directory: $dir"
exit 1;
fi
echo_palette() {
cat << END
Wood 0,255,0
Stone 0,0,0,20
Leaves 0,0,255,20
END
}
echo_html() {
cat << END
<html>
<head>
<title>c10t - showroom</title>
<style type="text/css">
.desc {
font-size: 120%;
padding: 20px;
}
.images {
padding: 10px;
}
</style>
</head>
<body>
<h1>c10t Showroom</h1>
<p class="desc">
Normal map
</p>
<div class="images">
<img src="n.png" />
<img src="n-n.png" />
<img src="n-H.png" />
<img src="n-C.png" />
<img src="n-A.png" />
<img src="n-P.png" />
</div>
<p class="desc">
Oblique map
</p>
<div class="images">
<img src="q.png" />
<img src="q-n.png" />
<img src="q-H.png" />
<img src="q-C.png" />
<img src="q-A.png" />
<img src="q-P.png" />
</div>
<p class="desc">
Oblique angled map
</p>
<div class="images">
<img src="y.png" />
<img src="y-n.png" />
<img src="y-H.png" />
<img src="y-C.png" />
<img src="y-A.png" />
<img src="y-P.png" />
</div>
<p class="desc">
Isometric
</p>
<div class="images">
<img src="z.png" />
<img src="z-n.png" />
<img src="z-H.png" />
<img src="z-C.png" />
<img src="z-A.png" />
<img src="z-P.png" />
</div>
</body>
</html>
END
}
echo_html > $dir/index.html
motion() {
$C10T $C10T_ARGS $1 -o $dir/$2.png
$C10T $C10T_ARGS $1 --night -o $dir/$2-n.png
$C10T $C10T_ARGS $1 --heightmap -o $dir/$2-H.png
$C10T $C10T_ARGS $1 --cave-mode -o $dir/$2-C.png
$C10T $C10T_ARGS $1 --no-alpha -o $dir/$2-A.png
$C10T $C10T_ARGS $1 -P <(echo_palette;) -o $dir/$2-P.png
}
motion "" "n"
motion "-q" "q"
motion "-y" "y"
motion "-z" "z"
================================================
FILE: scripts/google-api/README.txt
================================================
There has been a couple of variants of this script popping out recently, I took the liberty of consolidating them into the master branch.
-- Udoprog - Nov 17 2010
=== google-api.ps1 ===
Originally authored by Kochu
"""
Usage is the same as with the .sh: google-api.ps1 "world" "target"
You may need to change the path to the c10t executable in the script, add its location to the PATH variable, or install it into system32.
To run it, you will need to enable script execution by powershell - it is off by default.
To do this, you will need to run powershell as an admin and type "set-executionpolicy unrestricted", then "y" to confirm
You'll have to do it only once.
Hope it works.
""" -- Kochu @ http://www.minecraftforum.net/viewtopic.php?f=25&t=33803&start=570
=== google-api.php ===
Originally authored by Rendrik
"""
I've ported the google-api script to PHP, mainly for use in a windows environment. I haven't tested this in Linux.
It uses GD to resize the images.
The script must be placed in the same directory as c10t.exe
Usage is:
php google-api.php [world path]* [image output directory]* [c10t args in quotes]
For example:
php google-api.php world\ gmap_images\ "--isometric -r 270"
or
php google-api.php world\ tiles\ "--oblique-angle --show-signs"
Make sure you have the trailing slash for directorys.
This will create the following files:
map.html
options.js
(image dir)\(lots of images).png
Just open map.html to test it out.
If there is any issue, you can open the PHP file and change the VERBOSE constant to true. This will output the c10t commands and responses.
""" -- Rendrik @ http://www.minecraftforum.net/viewtopic.php?f=25&t=33803&start=570
================================================
FILE: scripts/google-api/google-api.php
================================================
<?php
ini_set("memory_limit", "200M");
define("VERBOSE", false);
/**
* google-api.php
*
* author - Ben Rice (dashiva@dashiva.com)
*
* The function of this script is to render several Minecraft maps using the
* map generator "c10t". A googlemap is then created using the tiles, and output.
*
* Usage:
* php google-api.php [world] [output] [c10t args in quotes]
* e.x.: php google-api.php myworld gmap "-isometric -r 270"
*/
# Required args
if(empty($argv[1]) || empty($argv[2]) ) {
echo("google-api.php (Minecraft map parsing script)\r\nScriped by Ben Rice (dashiva@dashiva.com)\r\n\r\nUsage:\r\nphp google-api.php [world path]* [output directory]* [c10t args in quotes]\r\n *Required");
exit();
}
$outHTML = "map.html";
$inPath = $argv[1]; # World files directory
$outDir = $argv[2]; # Tile directory
if( isset($argv[3]) ) { # c10t args
$c10tArgs = $argv[3]; //"--isometric";
}
$scale = array( 4096 => .0625, # 6.25%
2048 => .125, # 12.5%
1024 => .25, # 25%
512 => .5, # 50%
256 => 1, # 100%
128 => 2 ); # 200%
$zoom = array( 4096 => 0,
2048 => 1,
1024 => 2,
512 => 3,
256 => 4,
128 => 5);
$tileSizes = array(0 => 4096, 1 => 2048, 2=> 1024, 3=> 512, 4 => 256, 5 => 128);
# Verify world directory is valid
if( !is_dir($inPath) || !file_exists($inPath."level.dat") ) {
echo("Invalid world directory: ".$inPath."\r\n");
exit();
}
else
echo("World directory...OK\r\n");
# Verify the executable
exec("c10t", $output);
if( empty($output) ) {
echo("Cannot find c10t.exe!\r\n");
exit();
}
else
echo("c10t.exe...OK\r\n");
if (extension_loaded('gd') && function_exists('gd_info')) {
echo("PHP GD extension...OK\r\n");
}
else {
echo("GD extension is not installed or loaded!\r\nSee php.ini and be sure it contains extension=php_gd2.dll\r\n");
exit();
}
# check / create output dir for images
if( !is_dir($outDir) ) {
mkdir($outDir);
echo("Creating folder ".$outDir."\r\n");
}
else
echo("Folder ".$outDir." already exists.\r\n");
/**
* function resizeImage
*
* This will use GD to resize an image.
*/
function resizeImage($file, $scale) {
list($width, $height) = getimagesize($file);
$newheight = $height * $scale;
$newwidth = $newheight;
if(VERBOSE)
echo("Resizing " . $file . "\told(".$height.")". "\tnew(".$newheight.")" . "\tscale(" . $scale . ")\r\n");
echo(".");
$src = imagecreatefrompng($file);
$dst = imagecreatetruecolor($newwidth, $newheight);
$img = imagecopyresampled($dst, $src, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
imagealphablending( $dst, false );
imagesavealpha( $dst, true );
imagepng( $dst, $file, 9 );
}
/**
* function generate
*
* This will execute c10t with the proper parameters.
*/
function generate($arg1, $name, $tile, $zoom, $scale) {
$start = time();
global $inPath;
global $outDir;
global $c10tArgs;
echo("Generating: ".$name."\t Tile Size:".$tile."\t Zoom:".$zoom."...");
# generate a set of split files
$run = "c10t ".$c10tArgs." ".$arg1." --split ".$tile." -w ".$inPath." -o ".$outDir.$name.".%d.%d.".$zoom.".png --write-json ".$outDir.$name.".json";
# Uncomment for details
if(VERBOSE)
echo("\r\n".$run."\r\n");
exec($run, $output);
if(VERBOSE)
var_dump($output);
$end = time();
$elapsed = $end - $start;
echo("Done in ".getTimeStr($elapsed)."\r\n");
}
/**
* function read
*
* This will open a file and return it's contents.
*/
function read($file) {
if(file_exists($file)) {
$in = fopen ($file, "r");
if (!$in)
return false;
$raw = "";
if(filesize($file) <= 0)
return false;
else
$raw = fread($in, filesize($file));
fclose($in);
return $raw;
}
return false;
}
/**
* function write
*
* This will write contents to a file.
*/
function write($file, $content) {
if( empty($file) || empty($content) )
return false;
$fl = fopen($file, "w+");
fputs($fl, $content);
fclose($fl);
return true;
}
/**
* function getTimeStr
*
* Return text for how many seconds is passed in.
*/
function getTimeStr($durationInSeconds)
{
$week = floor($durationInSeconds / 86400 / 7);
$day = $durationInSeconds / 86400 % 7;
$hour = $durationInSeconds / 3600 % 24;
$min = $durationInSeconds / 60 % 60;
$sec = $durationInSeconds % 60;
if($week != 0)
{
$time = $week . isPlural($week, " week");
if($day != 0)
$time .= ", " . $day . isPlural($day, " day");
}
else if($day != 0)
{
$time = $day . isPlural($day, " day");
if($hour != 0)
$time .= ", " . $hour . isPlural($hour, " hour");
}
else if($hour != 0)
{
$time = $hour . isPlural($hour, " hour");
if($min != 0)
$time .= ", " . $min . isPlural($min, " minute");
}
else if($min != 0)
{
$time = $min . isPlural($min, " minute");
if($sec != 0)
$time .= ", " . $sec . isPlural($sec, " second");
}
else if($sec != 0)
{
$time = $sec . isPlural($sec, " second");
}
return $time;
}
/**
* function isPlural
*
* Return pluralized text.
*/
function isPlural($num, $word){
if($num > 1)
return $word."s";
else
return $word;
}
$_start = time();
$fl = fopen($outHTML, "w+");
fputs($fl, $output);
fclose($fl);
# Loop and call generate for day/night and each zoom level
foreach($tileSizes as $t) {
$z = $zoom[$t];
$s = $scale[$t];
generate("", "day", $t, $z, $s);
generate("-n", "ngt", $t, $z, $s);
}
# convert the files to the appropriate sizes using GD module
$validExtensions = array("png");
$files = array();
if(is_dir($outDir)) {
if($handle = opendir($outDir)) {
while(($file = readdir($handle)) !== false) {
## List
$extension = end(explode(".", $file));
if( in_array($extension, $validExtensions) )
array_push($files, $file);
}
closedir($handle);
}
echo("Resizing images");
foreach($files as $file) {
$zoomLevel = substr($file, -5, 1);
resizeImage($outDir.$file, $scale[$tileSizes[$zoomLevel]]);
}
echo(" Done.\r\n");
}
else {
echo($outDir." is not a valid directory... Somehow. Quitting.");
exit();
}
$output = '
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function extend(t , o) {
for (k in o) { if (o[k] != null) { t[k] = o[k]; } }
return t;
}
function keys(o) {
var a = [];
for (m in modes) { a[a.length] = m; };
return a;
}
// The maximum width/height of the grid in regions (must be a power of two)
var GRID_WIDTH_IN_REGIONS = 4096;
// Map from a GRID_WIDTH_IN_REGIONS x GRID_WIDTH_IN_REGIONS square to Lat/Long (0, 0),(-90, 90)
var SCALE_FACTOR = 90.0 / GRID_WIDTH_IN_REGIONS;
// Override the default Mercator projection with Euclidean projection
// (insert oblig. Flatland reference here)
function EuclideanProjection() {};
EuclideanProjection.prototype.fromLatLngToPoint = function(latLng, opt_point) {
var point = opt_point || new google.maps.Point(0, 0);
point.x = latLng.lng() / SCALE_FACTOR;
point.y = latLng.lat() / SCALE_FACTOR;
return point;
};
EuclideanProjection.prototype.fromPointToLatLng = function(point) {
var lng = point.x * SCALE_FACTOR;
var lat = point.y * SCALE_FACTOR;
return new google.maps.LatLng(lat, lng, true);
};
function new_map_type(m, o, ob) {
return extend(
{
getTileUrl: function(c, z) {
return o.host + m + "." + c.x + "." + c.y + "." + z + ".png";
},
isPng: true,
name : "none",
alt : "none",
minZoom: 0, maxZoom: 5,
tileSize: new google.maps.Size(256, 256)
},
ob
);
}
function initialize(id, opt, modes) {
var element = document.getElementById(id);
opt = extend(opt, {
mapTypeControlOptions: {
mapTypeIds: keys(modes),
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}});
var map = new google.maps.Map(element, opt);
var firstMode = null;
for (m in modes) {
var imt = new google.maps.ImageMapType(new_map_type(m, opt, modes[m]));
imt.projection = new EuclideanProjection();
// Now attach the grid map type to the maps registry
map.mapTypes.set(m, imt);
if (firstMode == null) firstMode = m;
}
map.setMapTypeId(firstMode);
var globaldata = modes[firstMode].data;
{
var world = globaldata.world;
var center = new google.maps.Point(world["cx"] / 16, world["cy"] / 16);
var latlng = EuclideanProjection.prototype.fromPointToLatLng(center)
map.setCenter(latlng);
map.setZoom(0);
}
for (var i = 0; i < globaldata.markers.length; i++)
{
var m = globaldata.markers[i];
var point = new google.maps.Point(m.x / 16, m.y / 16);
var latlng = EuclideanProjection.prototype.fromPointToLatLng(point)
new google.maps.Marker({
position: latlng,
map: map,
title: m.text
});
}
if (window.attachEvent) {
window.attachEvent("onresize", function() {this.map.onResize()} );
} else {
window.addEventListener("resize", function() {this.map.onResize()} , false);
}
}
</script>
<!-- Make the document body take up the full screen -->
<style type="text/css">
v\:* {behavior:url(#default#VML);}
html, body {width: 100%; height: 100%}
body {margin-top: 0px; margin-right: 0px; margin-left: 0px; margin-bottom: 0px}
</style>
<script type="text/javascript" src="options.js"></script>
</head>
<body onload="initialize(\'map_canvas\', options, modes)">
<div id="map_canvas" style="width: 100%; height: 100%;"></div>
</body>
</html>';
echo("Writing ".$outHTML."...");
if( !write($outHTML, $output) ) {
echo("Error writing ".$outHTML);
exit();
}
echo("Done.\r\n");
# Googlemap options JS
if( !$jsonDay = read($outDir."day.json") ) {
echo("Error opening day.json");
exit();
}
if( !$jsonNgt = read($outDir."ngt.json") ) {
echo("Error opening ngt.json");
exit();
}
# '.$outDir.'\ This extra slash below is intended for escaping
$js = 'var options = {
host: "'.$outDir.'\",
scaleControl: false,
navigationControl: true,
streetViewControl: false,
noClear: false,
backgroundColor: "#000000",
isPng: true,
}
var modes = {
\'day\': { name: "Day", alt: "Day Mode", data: '.$jsonDay.'},
\'ngt\': { name: "Night", alt: "Night Mode", data: '.$jsonNgt.'},
}';
echo("Writing options.js...");
if( !write("options.js", $js) ) {
echo("Error writing options.js");
exit();
}
echo("Done.\r\n");
$_end = time();
echo("Complete in ".getTimeStr($_end - $_start) );
?>
================================================
FILE: scripts/google-api/google-api.ps1
================================================
$CONVERT="convert"
$C10T="c10t.exe"
$C10T_OPTS=""
$C10T_OUT="c10t.out.txt"
$TILE_SIZES="4096", "2048", "1024", "512", "256", "128"
$SCALE = @{"4096"="6.25%"; "2048"="12.5%"; "1024"="25%"; "512"="50%"; "256"="100%"; "128"="200%"}
$ZOOM = @{"4096"="0"; "2048"="1"; "1024"="2"; "512"="3"; "256"="4"; "128"="5"}
$FACTOR=16
$current= [IO.Directory]::GetCurrentDirectory()
$world=$args[0]
$target=$args[1]
$tiles="tiles"
$hostn=""
$C10T_OPTS="$C10T_OPTS -w $world"
if ( !($world) -or !(test-path $world -pathtype container) )
{
write-host "Directory does not exist: $world";
return 1
}
if ((!($C10T -match ".exe$")) -or (!(test-path $C10T -pathtype leaf)) )
{
write-host "Not an executable: $C10T"
return 1
}
if(!(test-path $target -pathtype container)){new-item -type directory -path $target}
if(!(test-path "$target\$tiles" -pathtype container)){new-item -type directory -path "$target\$tiles"}
set-content -Path $target/index.html -Value @"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function extend(t , o) {
for (k in o) { if (o[k] != null) { t[k] = o[k]; } }
return t;
}
function keys(o) {
var a = [];
for (m in modes) { a[a.length] = m; };
return a;
}
// The maximum width/height of the grid in regions (must be a power of two)
var GRID_WIDTH_IN_REGIONS = 4096;
// Map from a GRID_WIDTH_IN_REGIONS x GRID_WIDTH_IN_REGIONS square to Lat/Long (0, 0),(-90, 90)
var SCALE_FACTOR = 90.0 / GRID_WIDTH_IN_REGIONS;
// Override the default Mercator projection with Euclidean projection
// (insert oblig. Flatland reference here)
function EuclideanProjection() {};
EuclideanProjection.prototype.fromLatLngToPoint = function(latLng, opt_point) {
var point = opt_point || new google.maps.Point(0, 0);
point.x = latLng.lng() / SCALE_FACTOR;
point.y = latLng.lat() / SCALE_FACTOR;
return point;
};
EuclideanProjection.prototype.fromPointToLatLng = function(point) {
var lng = point.x * SCALE_FACTOR;
var lat = point.y * SCALE_FACTOR;
return new google.maps.LatLng(lat, lng, true);
};
function new_map_type(m, o, ob) {
return extend(
{
getTileUrl: function(c, z) {
return o.host + m + "." + c.x + "." + c.y + "." + z + ".png";
},
isPng: true,
name : "none",
alt : "none",
minZoom: 0, maxZoom: 5,
tileSize: new google.maps.Size(256, 256)
},
ob
);
}
function initialize(id, opt, modes) {
var element = document.getElementById(id);
opt = extend(opt, {
mapTypeControlOptions: {
mapTypeIds: keys(modes),
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}});
var map = new google.maps.Map(element, opt);
var firstMode = null;
for (m in modes) {
var imt = new google.maps.ImageMapType(new_map_type(m, opt, modes[m]));
imt.projection = new EuclideanProjection();
// Now attach the grid map type to the map's registry
map.mapTypes.set(m, imt);
if (firstMode == null) firstMode = m;
}
map.setMapTypeId(firstMode);
var globaldata = modes[firstMode].data;
{
var world = globaldata.world;
var center = new google.maps.Point(world["cx"] / $FACTOR, world["cy"] / $FACTOR);
var latlng = EuclideanProjection.prototype.fromPointToLatLng(center)
map.setCenter(latlng);
map.setZoom(0);
}
for (var i = 0; i < globaldata.markers.length; i++)
{
var m = globaldata.markers[i];
var point = new google.maps.Point(m.x / $FACTOR, m.y / $FACTOR);
var latlng = EuclideanProjection.prototype.fromPointToLatLng(point)
new google.maps.Marker({
position: latlng,
map: map,
title: m.text
});
}
if (window.attachEvent) {
window.attachEvent("onresize", function() {this.map.onResize()} );
} else {
window.addEventListener("resize", function() {this.map.onResize()} , false);
}
}
</script>
<!-- Make the document body take up the full screen -->
<style type="text/css">
v\:* {behavior:url(#default#VML);}
html, body {width: 100%; height: 100%}
body {margin-top: 0px; margin-right: 0px; margin-left: 0px; margin-bottom: 0px}
</style>
<script type="text/javascript" src="options.js"></script>
</head>
<body onload="initialize('map_canvas', options, modes)">
<div id="map_canvas" style="width: 100%; height: 100%;"></div>
</body>
</html>
"@
write-host "NOTE: if something goes wrong, check out $C10T_OUT"
write-host "" > $C10T_OUT
function generate
{
Param ($x_opts, $name, $pixelsplit, $zoom, $scale)
# generate a set of split files
$src="$target\$tiles\$name.`%d.`%d.$zoom.png"
write-host "$C10T $C10T_OPTS $x_opts --pixelsplit=$pixelsplit -o $src --write-json=$target\$name.json"
"$C10T $C10T_OPTS $x_opts --pixelsplit=$pixelsplit -o $src --write-json=`"$target\$name.json`" "
invoke-expression "$C10T $C10T_OPTS $x_opts --pixelsplit=$pixelsplit -o $src --write-json=`"$target\$name.json`" "
# convert the files to the appropriate sizes
foreach ($file in Get-ChildItem "$target\$tiles\$name.*.*.$zoom.png")
{
$tg=$file.FullName
write-host "$CONVERT $file -scale $scale $tg"
invoke-expression "$CONVERT $file -scale $scale $file"
}
write-host "done!"
Get-ChildItem "$target\$tiles\$name.*.*.$zoom.png"
}
echo 1
foreach ($t in $TILE_SIZES)
{
$z=$ZOOM.Get_Item("$t")
$s=$SCALE.Get_Item("$t")
generate -x_opts " " -name "day" -pixelsplit $t -zoom $z -scale $s
generate -x_opts "-n" -name "night" -pixelsplit $t -zoom $z -scale $s
}
set-content $target\options.js @"
var options = {
host: "$hostn$tiles/",
scaleControl: false,
navigationControl: true,
streetViewControl: false,
noClear: false,
backgroundColor: "#000000",
isPng: true,
}
var modes = {
'day': { name: "Day", alt: "Day Mode", data: $(cat $target/day.json)},
'night': { name: "Night", alt: "Night Mode", data: $(cat $target/night.json)},
}
"@
================================================
FILE: scripts/google-api/google-api.sh
================================================
#!/bin/bash
C10T=c10t
[[ -x ./$C10T ]] && C10T=./$C10T
scriptdir=$(dirname $(readlink -f $0))
world=""
output=""
host=""
zoom=5
factor=4
base=256
res=$scriptdir
opts=""
exit_usage() {
echo "Usage: google-api -w <world> -o <output> [options]"
echo "-H <host> - Host prefix to use for all scripts"
echo "-z <levels> - Number of zoom levels to generate (default: 5)"
echo "-b <res> - Resolution for the base tile (default: 256px)"
echo "-r <dir> - Directory to look for reasources (defaults to script directory)"
echo "-O <opts> - Extra options to pass directly to c10t"
exit 1
}
while getopts "w:o:H:z:b:O:h" opt; do
case $opt in
w) world=$OPTARG ;;
o) output=$OPTARG ;;
H) host=$OPTARG ;;
O) opts=$OPTARG ;;
h) exit_usage ;;
z)
zoom=$OPTARG
factor=$[$zoom - 1]
;;
b) base=$OPTARG ;;
\?) exit 1 ;;
esac
done
shift $OPTIND
[ -z $world ] && exit_usage
[ -z $output ] && exit_usage
[ ! -d $world ] && {
echo "$0: -w: directory does not exist: $world";
exit_usage
}
[ ! -d $output ] && {
echo "$0: -o: directory does not exist: $output";
exit_usage
}
[ $zoom -lt 2 ] && {
echo "$0: -z: must be a numberic value greater than 2, but was '$zoom'";
exit_usage
}
[ $base -lt 32 ] && {
echo "$0: -b: must be a numberic value greater than 32, but was '$base'";
exit_usage
}
if ! $C10T -h &> /dev/null; then
echo "Could not find executable: $C10T"
exit_usage
fi
google_js=$res/libc10t.google.js
index_html=$res/index.html
[ ! -f $google_js ] && {
echo "could not find: $google_js"
exit 1;
}
[ ! -f $index_html ] && {
echo "could not find: $index_html"
exit 1;
}
host_google_js="${host}$(basename $google_js)"
host_options_js="${host}options.js"
create_tile_sizes() {
b=$base
i=$[$zoom - 1]
echo -n $[$b / 2]
while [[ $i -gt 0 ]]; do
echo -n " $b"
b=$[$b*2]
i=$[$i - 1]
done
}
splits=$(create_tile_sizes)
# this is what each tile will be resized to
tiles=$output/tiles
c10t_opts="$opts -w $world"
if [[ -z $world ]] || [[ ! -d $world ]]; then
echo "Directory does not exist: $world";
exit 1;
fi
[ ! -d $target ] && mkdir -p $target
[ ! -d $tiles ] && mkdir -p $tiles
generate() {
x_opts=$1
name=$2
pixelsplit="$3"
# generate a set of split files
tile=$tiles/$name.%d.%d.%d.png
echo "$C10T $c10t_opts $x_opts --split=\"$pixelsplit\" --split-base=$base -o $tile --write-json=$output/$name.json"
if ! $C10T $c10t_opts $x_opts --split="$pixelsplit" --split-base=$base -o $tile --write-json="$output/$name.json"; then
exit 1
fi
echo "done!"
}
echo "Copying $index_html"
cat $index_html | \
sed -r "s/\bC10T_GOOGLE_JS\b/$host_google_js/" | \
sed "s/\bC10T_OPTIONS_JS\b/$host_options_js/" > $output/index.html
echo "Copying $google_js"
cp $google_js $output
generate "" "day" "$splits"
generate "-n" "night" "$splits"
cat > $output/options.js << ENDL
var options = {
factor: $factor,
host: "${host}tiles/",
scaleControl: false,
navigationControl: true,
streetViewControl: false,
noClear: false,
backgroundColor: "#000000",
isPng: true,
}
var modes = {
'day': { name: "Day", alt: "Day Mode", data: $(cat $output/day.json)},
'night': { name: "Night", alt: "Night Mode", data: $(cat $output/night.json)},
}
ENDL
================================================
FILE: scripts/google-api/index.html
================================================
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="C10T_GOOGLE_JS"></script>
<script type="text/javascript" src="C10T_OPTIONS_JS"></script>
<!-- Make the document body take up the full screen -->
<style type="text/css">
v\:* {behavior:url(#default#VML);}
html, body {width: 100%; height: 100%}
body {margin-top: 0px; margin-right: 0px; margin-left: 0px; margin-bottom: 0px}
</style>
</head>
<body onload="initialize('map_canvas', options, modes)">
<div id="map_canvas" style="width: 100%; height: 100%;"></div>
</body>
</html>
================================================
FILE: scripts/google-api/libc10t.google.js
================================================
function extend(t , o) {
for (k in o) { if (o[k] != null) { t[k] = o[k]; } }
return t;
}
function keys(o) {
var a = [];
for (m in modes) { a[a.length] = m; };
return a;
}
// Direct Link Feature
var _globalDefaults = {
lat : 0,
lng : 0,
zoom : 1,
type : "day",
}
function get_parameters() {
var lat = _globalDefaults.lat;
var lng = _globalDefaults.lng;
var zoom = _globalDefaults.zoom;
var type = _globalDefaults.type;
var query = location.search.substring(1);
var pairs = query.split("&");
for (var i=0; i<pairs.length; i++) {
var pos = pairs[i].indexOf("=");
var argname = pairs[i].substring(0,pos).toLowerCase();
var value = pairs[i].substring(pos+1).toLowerCase();
if (argname == "lat") {lat = parseFloat(value);}
if (argname == "lng") {lng = parseFloat(value);}
if (argname == "zoom") {zoom = parseInt(value);}
if (argname == "type") {type = value;}
}
return {
lat: lat,
lng: lng,
zoom: zoom,
type: type,
};
}
function retrieveLink(map) {
var latlng = EuclideanProjection.prototype.fromPointToLatLng(_globalCenter);
var lat = map.getCenter().lat() - latlng.lat();
var lng = map.getCenter().lng() - latlng.lng();
var pos = window.location.href.indexOf("?");
var base = pos > -1 ? window.location.href.substring(0,pos) : window.location.href;
var ret = base
+ "?lat=" + lat.toFixed(6)
+ "&lng=" + lng.toFixed(6);
if (map.getZoom() != _globalDefaults.zoom)
ret += "&zoom=" + map.getZoom();
if (map.getMapTypeId() != _globalDefaults.type)
ret += "&type=" + map.getMapTypeId();
return ret;
}
function refreshLink(map, control) {
var link = retrieveLink(map);
if (!(control.innerHTML.replace(/&/gi,"&") == link)) {
control.innerHTML = link;
}
}
function createLinkControl(map) {
var controlDiv = document.createElement('DIV');
controlDiv.style.padding = '5px';
var controlUI = document.createElement('DIV');
controlUI.style.backgroundColor = 'white';
controlUI.style.borderStyle = 'solid';
controlUI.style.borderWidth = '1px';
controlUI.style.textAlign = 'center';
controlUI.title = 'The link to the current position';
controlDiv.appendChild(controlUI);
var controlText = document.createElement('DIV');
controlText.name = "linkControl";
controlText.style.fontFamily = 'Arial,sans-serif';
controlText.style.fontSize = '12px';
controlText.style.paddingLeft = '4px';
controlText.style.paddingRight = '4px';
controlUI.appendChild(controlText);
if (controlDiv.attachEvent) {
controlDiv.attachEvent("onclick", function() {window.location.href = retrieveLink(map)});
} else {
controlDiv.addEventListener("click", function() {window.location.href = retrieveLink(map)} , false);
}
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(controlDiv);
refreshLink(map, controlText);
return controlText;
}
// The maximum width/height of the grid in regions (must be a power of two)
var GRID_WIDTH_IN_REGIONS = 4096;
// Map from a GRID_WIDTH_IN_REGIONS x GRID_WIDTH_IN_REGIONS square to Lat/Long (0, 0),(-90, 90)
var SCALE_FACTOR = 90.0 / GRID_WIDTH_IN_REGIONS;
// Override the default Mercator projection with Euclidean projection
// (insert oblig. Flatland reference here)
function EuclideanProjection() {};
EuclideanProjection.prototype.fromLatLngToPoint = function(latLng, opt_point) {
var point = opt_point || new google.maps.Point(0, 0);
point.x = latLng.lng() / SCALE_FACTOR;
point.y = latLng.lat() / SCALE_FACTOR;
return point;
};
EuclideanProjection.prototype.fromPointToLatLng = function(point) {
var lng = point.x * SCALE_FACTOR;
var lat = point.y * SCALE_FACTOR;
return new google.maps.LatLng(lat, lng, true);
};
function new_map_type(m, o, ob) {
var world = ob.data.world;
return extend(
{
getTileUrl: function(c, z) {
var img = o.host + m + "." + (world.split - z) + "." + c.x + "." + c.y + ".png";
return img
},
isPng: true,
name : "none",
alt : "none",
minZoom: 1, maxZoom: world.split,
tileSize: new google.maps.Size(world.split_base, world.split_base)
},
ob
);
}
function initialize(id, opt, modes) {
var element = document.getElementById(id);
opt = extend(opt, {
mapTypeControlOptions: {
mapTypeIds: keys(modes),
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU}});
var map = new google.maps.Map(element, opt);
var firstMode = null;
for (m in modes) {
var imt = new google.maps.ImageMapType(new_map_type(m, opt, modes[m]));
imt.projection = new EuclideanProjection();
// Now attach the grid map type to the map's registry
map.mapTypes.set(m, imt);
if (firstMode == null) firstMode = m;
}
map.setMapTypeId(firstMode);
var globaldata = modes[firstMode].data;
var world = globaldata.world;
var factor = Math.pow(2, opt.factor);
{
var parameters = get_parameters();
var latlng;
_globalCenter = new google.maps.Point(world.cx / factor, world.cy / factor);
latlng = EuclideanProjection.prototype.fromPointToLatLng(_globalCenter)
parameters.lat += latlng.lat();
parameters.lng += latlng.lng();
latlng = new google.maps.LatLng(parameters.lat, parameters.lng, true);
map.setZoom(parameters.zoom);
map.setMapTypeId(parameters.type);
map.setCenter(latlng);
}
for (var i = 0; i < globaldata.markers.length; i++)
{
var m = globaldata.markers[i];
var point = new google.maps.Point(m.x / factor, m.y / factor);
var latlng = EuclideanProjection.prototype.fromPointToLatLng(point)
new google.maps.Marker({
position: latlng,
map: map,
title: m.text
});
}
var linkControl = createLinkControl(map);
if (window.attachEvent) {
window.attachEvent("onresize", function() {this.map.onResize()} );
window.attachEvent("onmousemove", function() {refreshLink(map, linkControl)} );
} else {
window.addEventListener("resize", function() {this.map.onResize()} , false);
window.addEventListener("mousemove", function() {refreshLink(map, linkControl)} , false);
}
}
================================================
FILE: src/2d/cube.hpp
================================================
// Distributed under the BSD License, see accompanying LICENSE.txt
// (C) Copyright 2010 John-John Tedro et al.
#ifndef _CUBE_H_
#define _CUBE_H_
#include <stdlib.h>
#include <stdint.h>
struct point {
typedef uint64_t pos_t;
pos_t x;
pos_t y;
pos_t z;
inline point(pos_t x, pos_t y, pos_t z) : x(x), y(y), z(z) {}
};
class point2 {
public:
typedef uint64_t pos_t;
const pos_t x;
const pos_t y;
point2(const pos_t x, const pos_t y) : x(x), y(y) {}
bool operator<(const point2& oth) const {
if (y < oth.y) {
return true;
}
if (y == oth.y && x < oth.x) {
return true;
}
return false;
}
};
class top_cube {
public:
typedef uint64_t pos_t;
top_cube(const pos_t x, const pos_t y, const pos_t z) : x(x), y(y), z(z) {}
inline void project(point &p, pos_t &rx, pos_t &ry) const
{
rx = z - p.z - 1;
ry = p.x;
}
inline void limits(pos_t &rx, pos_t &ry) const
{
rx = z;
ry = x;
}
private:
const pos_t x;
const pos_t y;
const pos_t z;
};
class oblique_cube {
public:
typedef uint64_t pos_t;
oblique_cube(const pos_t x, const pos_t y, const pos_t z) : x(x), y(y), z(z) {}
inline void project(point &p, pos_t &rx, pos_t &ry) const
{
rx = z - p.z - 1;
ry = p.x + (y - p.y - 1);
}
inline void limits(pos_t &rx, pos_t &ry) const
{
rx = z;
ry = x + y;
}
private:
const pos_t x;
const pos_t y;
const pos_t z;
};
template<int F1 = 1, int F2 = 1, int F3 = 1>
class angle_cube {
public:
typedef uint64_t pos_t;
angle_cube(const pos_t x, const pos_t y, const pos_t z) : x(x), y(y), z(z) {}
inline void project(point &p, pos_t &rx, pos_t &ry) const
{
rx = F1 * ((z - p.z - 1) + p.x);
ry = F2 * (y - p.y - 1) + F3 * p.z + F3 * p.x;
}
inline void limits(pos_t &rx, pos_t &ry) const
{
rx = F1 * (z + x);
ry = F2 * y + F3 * z + F3 * x;
}
private:
const pos_t x;
const pos_t y;
const pos_t z;
};
#endif /* _CUBE_H_ */
================================================
FILE: src/algorithm.cpp
================================================
#include <string>
#include <vector>
#include <sstream>
namespace nonstd {
// hackish split
}
================================================
FILE: src/algorithm.hpp
================================================
#ifndef NONSTD_ALGORITHM
#define NONSTD_ALGORITHM
#include <stdlib.h>
#include <ostream>
namespace nonstd
{
template<typename T>
class reporting
{
public:
virtual void add(T) = 0;
virtual void done(T) = 0;
};
template<typename T, typename O = std::ostream>
class continious : public reporting<T>
{
public:
const static uintmax_t LINE_WIDTH = 30;
typedef void (*progress_func)(O&, T);
typedef void (*endline_func)(O&, T);
continious(O& out,
T progress_threshold,
progress_func progress_f,
endline_func endline_f)
: out(out),
chunks(0),
total(0),
progress_threshold(progress_threshold),
line(0),
progress_f(progress_f),
endline_f(endline_f)
{
}
virtual void add(T parts)
{
chunks += parts;
while (chunks > progress_threshold)
{
chunks -= progress_threshold;
total += progress_threshold;
progress_f(out, total);
if (!(line++ < LINE_WIDTH)) {
endline_f(out, total);
line = 0;
}
}
}
void done(T last_part)
{
total += chunks + last_part;
endline_f(out, total);
}
private:
O& out;
T chunks;
T total;
T progress_threshold;
unsigned int line;
progress_func progress_f;
endline_func endline_f;
};
template<typename T, typename O = std::ostream>
class limited : public reporting<T>
{
public:
const static uintmax_t LINE_WIDTH = 30;
typedef void (*progress_func)(O&, T);
typedef void (*endline_func)(O&, T, T);
limited(O& out,
T progress_threshold,
T total_limit,
progress_func progress_f,
endline_func endline_f)
: out(out),
chunks(0),
total(0),
progress_threshold(progress_threshold),
line(0),
progress_f(progress_f),
endline_f(endline_f),
total_limit(total_limit)
{
}
virtual void add(T parts)
{
chunks += parts;
while (chunks > progress_threshold)
{
chunks -= progress_threshold;
total += progress_threshold;
progress_f(out, total);
if (line++ >= LINE_WIDTH)
{
endline_f(out, total, total_limit);
line = 0;
}
}
}
void done(T last)
{
total += last;
endline_f(out, total_limit, total_limit);
}
private:
O& out;
T chunks;
T total;
T progress_threshold;
unsigned int line;
progress_func progress_f;
endline_func endline_f;
T total_limit;
};
}
#endif /* NONSTD_ALGORITHM */
================================================
FILE: src/altitude_graph.cpp
================================================
#include "altitude_graph.hpp"
#include "text.hpp"
using namespace std;
namespace fs = boost::filesystem;
#define BORDER_X 50
#define BORDER_Y 50
AltitudeGraph::AltitudeGraph(settings_t& _s)
: s(_s), width(800), height(600)
{
altitudeRegistry.reset(new long[mc::MapY]);
for(int i = 0; i < mc::MapY; i++)
{
altitudeRegistry[i] = 0;
}
}
void AltitudeGraph::createGraph()
{
image_ptr graphImg;
memory_image* image = new memory_image(width, height);
graphImg.reset(image);
color bgcolor(255, 255, 255, 255);
color fgcolor(150,0,0,255);
color axiscolor(0,0,0,255);
color seacolor(0,0,255,255);
text::font_face ffsea(s.ttf_path, 8, seacolor);
ffsea.init();
text::font_face ff12(s.ttf_path, 12, axiscolor);
ff12.init();
// fill background
graphImg->fill(bgcolor);
int _w = width - BORDER_X;
int _h = height - BORDER_Y;
long maxVal = this->getMax();
int x_step = _w / mc::MapY;
std::stringstream maxss;
maxss << "MAX = " << maxVal;
ff12.draw(graphImg, "NB of blocks", BORDER_X - 30 , BORDER_Y - 25);
ff12.draw(graphImg, maxss.str(), BORDER_X - 20 , BORDER_Y - 10);
ff12.draw(graphImg, "Altitude", _w - 2*BORDER_X , _h + 17);
int x=0, y=0, x0=BORDER_X, y0=_h;
for(int i = 0; i < mc::MapY; i++)
{
x = BORDER_X + x_step*i;
if (maxVal == 0) {
y = _h;
} else {
y = _h - (int)( ( (float)altitudeRegistry[i] / (float)maxVal ) * (_h-BORDER_Y) );
}
graphImg->draw_line(x, y, x0, y0, fgcolor);
x0 = x;
y0 = y;
}
// draw axis
graphImg->draw_line(BORDER_X, BORDER_Y, BORDER_X, _h, axiscolor);
graphImg->draw_line(BORDER_X, _h, _w, _h, axiscolor);
// draw axis labels
for(int i=0; i < mc::MapY; i++)
{
color _axiscolor = axiscolor;
x = BORDER_X + x_step*i;
int size = 2;
if(i == 63)
{
_axiscolor = seacolor;
ffsea.draw(graphImg, "Sea", x+4, _h+25);
size = 25;
}
if(i%10 == 0)
{
size = 5;
}
graphImg->draw_line(x, _h, x, _h+size, _axiscolor);
}
png_format::opt_type opts;
graphImg->save<png_format>(s.statistics_path.string() + "_graph.png", opts);
}
void AltitudeGraph::registerBloc(mc::MaterialT *material, int altitude)
{
altitudeRegistry[altitude] += 1;
}
long AltitudeGraph::getMax()
{
long max = 0;
for(int i = 0; i < mc::MapY; i++)
{
if(max < altitudeRegistry[i])
max = altitudeRegistry[i];
}
return max;
}
================================================
FILE: src/altitude_graph.hpp
================================================
#ifndef STATISTICS_HPP
#define STATISTICS_HPP
// Include this first, to evade setjmp header bug
#include "image/format/png.hpp"
#include <string>
#include <vector>
#include <set>
#include <exception>
#include <boost/scoped_array.hpp>
#include "settings_t.hpp"
#include "players.hpp"
#include "image/image_base.hpp"
#include "image/memory_image.hpp"
#include "image/cached_image.hpp"
#include "image/algorithms.hpp"
#include "image/format/png.hpp"
#include "mc/world.hpp"
#include "mc/blocks.hpp"
#include "mc/utils.hpp"
#include "nbt/nbt.hpp"
class AltitudeGraph
{
public:
AltitudeGraph(settings_t& _s);
void createGraph();
/* call this to register block information */
void registerBloc(mc::MaterialT *material, int altitude);
long getMax();
private:
settings_t s;
int width;
int height;
boost::scoped_array<long> altitudeRegistry;
};
#endif // STATISTICS_HPP
================================================
FILE: src/cache.hpp
================================================
#ifndef _CACHE_H_
#define _CACHE_H_
#include <fstream>
#include <ctime>
#include <boost/filesystem.hpp>
#include <zlib.h>
#include "image/image_operations.hpp"
namespace fs = boost::filesystem;
#define CACHE_MAGIC "CMap"
struct cache_hdr {
bool compressed;
std::time_t mod;
size_t max_x, max_y;
size_t size;
};
class cache_file {
private:
const fs::path cache_dir;
const uint32_t source_write_time;
const bool cache_compress;
const fs::path cache_path;
typedef std::vector<image_operation>::size_type v_size_type;
public:
cache_file(const fs::path cache_dir, std::string basename, const uint32_t source_write_time, bool cache_compress)
: cache_dir(cache_dir), source_write_time(source_write_time),
cache_compress(cache_compress),
cache_path(cache_dir / basename)
{
}
bool create_directories() {
return fs::create_directories(cache_dir);
}
bool exists() {
return fs::is_regular_file(cache_path)
&& fs::last_write_time(cache_path) >= source_write_time;
}
void clear() {
fs::remove(cache_path);
}
bool gzreadall(gzFile gzf, char* buf, unsigned int len) {
unsigned int read = 0;
while (read < len) {
int have = gzread(gzf, buf + read, len - read);
if (have == 0) {
int errnum;
const char* errorstr = gzerror(gzf, &errnum);
if (errnum != 0) {
std::cerr << errorstr << std::endl;
gzclose(gzf);
return false;
}
if (gzeof(gzf)) {
gzclose(gzf);
return false;
}
}
if (have < 0) {
gzclose(gzf);
return false;
}
read += have;
}
return true;
}
bool gzwriteall(gzFile gzf, const char* buf, unsigned int len) {
unsigned int written = 0;
while (written < len) {
int have = gzwrite(gzf, buf + written, len - written);
if (have <= 0) {
int errnum;
const char* errorstr = gzerror(gzf, &errnum);
if (errnum != 0) {
std::cerr << errorstr << std::endl;
gzclose(gzf);
return false;
}
gzclose(gzf);
return false;
}
written += have;
}
return true;
}
bool read(boost::shared_ptr<image_operations> oper) {
gzFile gzf = gzopen(cache_path.string().c_str(), "r");
if (gzf == Z_NULL) {
return false;
}
//std::ifstream fs(cache_path.string().c_str());
cache_hdr hdr;
{
char m[4];
//fs.read(m, 4);
//if (fs.fail()) return false;
if (!gzreadall(gzf, m, 4)) {
return false;
}
if (
m[0] != CACHE_MAGIC[0]
|| m[1] != CACHE_MAGIC[1]
|| m[2] != CACHE_MAGIC[2]
|| m[3] != CACHE_MAGIC[3]
) return false;
//fs.read(reinterpret_cast<char*>(&hdr), sizeof(cache_hdr));
//if (fs.fail()) return false;
if (!gzreadall(gzf, reinterpret_cast<char*>(&hdr), sizeof(cache_hdr))) {
return false;
}
}
if (hdr.compressed != cache_co
gitextract_o4qlv98t/
├── .gitignore
├── .gitmodules
├── CMakeLists.txt
├── ChangeLog
├── LICENSE.txt
├── README.md
├── dist/
│ ├── Makefile.osx
│ ├── README.md
│ ├── all.sh
│ ├── config.mk
│ ├── make.sh
│ └── targets/
│ ├── x86-linux
│ ├── x86-windows
│ ├── x86_64-linux
│ └── x86_64-windows
├── docs/
│ ├── NBT.txt
│ ├── bigtest.nbt
│ └── test.nbt
├── gui/
│ └── c10t-tk/
│ ├── README
│ ├── c10t-tk.py
│ ├── mainwindow.py
│ └── tooltip.py
├── palette.json
├── res/
│ ├── example.html
│ └── libc10t.js
├── scripts/
│ ├── area-set.sh
│ ├── area-slice.sh
│ ├── generate-tests.sh
│ └── google-api/
│ ├── README.txt
│ ├── google-api.php
│ ├── google-api.ps1
│ ├── google-api.sh
│ ├── index.html
│ └── libc10t.google.js
├── src/
│ ├── 2d/
│ │ └── cube.hpp
│ ├── algorithm.cpp
│ ├── algorithm.hpp
│ ├── altitude_graph.cpp
│ ├── altitude_graph.hpp
│ ├── cache.hpp
│ ├── dirlist.cpp
│ ├── dirlist.hpp
│ ├── dlopen.cpp
│ ├── dlopen.hpp
│ ├── engine/
│ │ ├── CMakeLists.txt
│ │ ├── block_rotation.cpp
│ │ ├── block_rotation.hpp
│ │ ├── engine_base.hpp
│ │ ├── engine_core.hpp
│ │ ├── engine_settings.hpp
│ │ ├── fatiso_engine.cpp
│ │ ├── fatiso_engine.hpp
│ │ ├── flat_base.cpp
│ │ ├── flat_base.hpp
│ │ ├── functions.cpp
│ │ ├── functions.hpp
│ │ ├── isometric_base.cpp
│ │ ├── isometric_base.hpp
│ │ ├── isometric_engine.cpp
│ │ ├── isometric_engine.hpp
│ │ ├── oblique_engine.cpp
│ │ ├── oblique_engine.hpp
│ │ ├── obliqueangle_engine.cpp
│ │ ├── obliqueangle_engine.hpp
│ │ ├── topdown_engine.cpp
│ │ └── topdown_engine.hpp
│ ├── fileutils.cpp
│ ├── fileutils.hpp
│ ├── generate_map.cpp
│ ├── generate_map.hpp
│ ├── generate_statistics.cpp
│ ├── generate_statistics.hpp
│ ├── image/
│ │ ├── CMakeLists.txt
│ │ ├── algorithms.cpp
│ │ ├── algorithms.hpp
│ │ ├── cached_image.cpp
│ │ ├── cached_image.hpp
│ │ ├── color.cpp
│ │ ├── color.hpp
│ │ ├── format/
│ │ │ ├── base.hpp
│ │ │ └── png.hpp
│ │ ├── image_base.cpp
│ │ ├── image_base.hpp
│ │ ├── image_operations.cpp
│ │ ├── image_operations.hpp
│ │ ├── memory_image.cpp
│ │ ├── memory_image.hpp
│ │ └── virtual_image.hpp
│ ├── json.cpp
│ ├── json.hpp
│ ├── main.cpp
│ ├── main_utils.cpp
│ ├── main_utils.hpp
│ ├── marker.cpp
│ ├── marker.hpp
│ ├── mc/
│ │ ├── CMakeLists.txt
│ │ ├── blocks.cpp
│ │ ├── blocks.hpp
│ │ ├── dynamic_buffer.cpp
│ │ ├── dynamic_buffer.hpp
│ │ ├── level.cpp
│ │ ├── level.hpp
│ │ ├── level_info.cpp
│ │ ├── level_info.hpp
│ │ ├── marker.cpp
│ │ ├── marker.hpp
│ │ ├── region.cpp
│ │ ├── region.hpp
│ │ ├── region_inspect.cpp
│ │ ├── region_iterator.cpp
│ │ ├── region_iterator.hpp
│ │ ├── rotated_level_info.cpp
│ │ ├── rotated_level_info.hpp
│ │ ├── utils.cpp
│ │ ├── utils.hpp
│ │ ├── world.cpp
│ │ └── world.hpp
│ ├── nbt/
│ │ ├── CMakeLists.txt
│ │ ├── nbt.cpp
│ │ ├── nbt.hpp
│ │ ├── nbt_inspect.cpp
│ │ └── types.hpp
│ ├── nullstream.cpp
│ ├── nullstream.hpp
│ ├── players.cpp
│ ├── players.hpp
│ ├── settings_t.cpp
│ ├── settings_t.hpp
│ ├── text.cpp
│ ├── text.hpp
│ ├── threads/
│ │ ├── renderer.hpp
│ │ ├── renderer_settings.hpp
│ │ ├── threadworker.hpp
│ │ ├── threadworker_fake.hpp
│ │ └── threadworker_impl.hpp
│ ├── warps.cpp
│ ├── warps.hpp
│ └── win32/
│ └── tss_cleanup_implemented.cpp
└── test/
├── CMakeLists.txt
└── test.cpp
SYMBOL INDEX (551 symbols across 85 files)
FILE: gui/c10t-tk/c10t-tk.py
function default_c10t_executable (line 11) | def default_c10t_executable():
function default_minecraft_world (line 14) | def default_minecraft_world():
function default_output_image (line 17) | def default_output_image():
function quote_arg_if_needed (line 21) | def quote_arg_if_needed(arg):
function args_to_string (line 34) | def args_to_string(args):
class Program (line 41) | class Program(object):
method __init__ (line 42) | def __init__(self):
method run_command (line 57) | def run_command(self):
method load_image (line 66) | def load_image(self):
method update_ui_commandline (line 69) | def update_ui_commandline(self):
method build_commandline (line 73) | def build_commandline(self):
method main (line 127) | def main(self):
FILE: gui/c10t-tk/mainwindow.py
function add_tooltip (line 24) | def add_tooltip(text, widgets):
function cross_platform_mouse_wheel (line 34) | def cross_platform_mouse_wheel(event):
class XCheckbutton (line 63) | class XCheckbutton(Checkbutton):
method __init__ (line 69) | def __init__(self, *args, **kwargs):
method get (line 73) | def get(self):
method set (line 76) | def set(self, value):
class XEntry (line 80) | class XEntry(Entry):
method set (line 84) | def set(self, value):
class XSpinbox (line 95) | class XSpinbox(Spinbox):
method __init__ (line 101) | def __init__(self, *args, **kwargs):
method set (line 108) | def set(self, value):
method mouse_wheel_handler (line 115) | def mouse_wheel_handler(self, event):
class FilesFrame (line 128) | class FilesFrame(LabelFrame):
method __init__ (line 129) | def __init__(self, master=None):
class FilteringFrame (line 175) | class FilteringFrame(LabelFrame):
method __init__ (line 176) | def __init__(self, master=None):
class RenderingFrame (line 263) | class RenderingFrame(LabelFrame):
method __init__ (line 264) | def __init__(self, master=None):
class FontFrame (line 340) | class FontFrame(LabelFrame):
method __init__ (line 341) | def __init__(self, master=None):
class ConfigurationFrame (line 423) | class ConfigurationFrame(Frame):
method __init__ (line 424) | def __init__(self, master=None):
class RunFrame (line 440) | class RunFrame(Frame):
method __init__ (line 441) | def __init__(self, master=None):
class ImageFrame (line 460) | class ImageFrame(Frame):
method __init__ (line 468) | def __init__(self, master=None):
method hscroll_mouse_wheel_handler (line 513) | def hscroll_mouse_wheel_handler(self, event):
method vscroll_mouse_wheel_handler (line 517) | def vscroll_mouse_wheel_handler(self, event):
method button_press_1_handler (line 521) | def button_press_1_handler(self, event):
method button_motion_1_handler (line 525) | def button_motion_1_handler(self, event):
method button_release_1_handler (line 528) | def button_release_1_handler(self, event):
method mouse_wheel_handler (line 531) | def mouse_wheel_handler(self, event):
method resize_image_to_zoom (line 539) | def resize_image_to_zoom(self, delta=None, zoom=None, center=None, for...
method load_image_from_file (line 651) | def load_image_from_file(self, imagepath):
class ApplicationFrame (line 666) | class ApplicationFrame(Frame):
method __init__ (line 680) | def __init__(self, master=None):
function find_named_widgets (line 699) | def find_named_widgets(widget):
class UiShortcuts (line 728) | class UiShortcuts(object):
method __init__ (line 740) | def __init__(self, root):
method __dir__ (line 743) | def __dir__(self):
method __getattr__ (line 747) | def __getattr__(self, name):
method __setattr__ (line 750) | def __setattr__(self, name, value):
class MainWindow (line 754) | class MainWindow(Tk):
method __init__ (line 761) | def __init__(self):
method quit_handler (line 790) | def quit_handler(self, event=None):
method update_button_handler (line 797) | def update_button_handler(self, event=None):
method run_button_handler (line 801) | def run_button_handler(self, event=None):
method load_button_handler (line 805) | def load_button_handler(self):
method load_image_from_file (line 809) | def load_image_from_file(self, imagepath):
FILE: gui/c10t-tk/tooltip.py
class ToolTip (line 48) | class ToolTip:
method __init__ (line 51) | def __init__(self, master, text='Your text here', delay=800, **opts):
method configure (line 68) | def configure(self, **opts):
method enter (line 79) | def enter(self, event=None):
method leave (line 82) | def leave(self, event=None):
method motion (line 86) | def motion(self, event=None):
method _schedule (line 93) | def _schedule(self):
method _unschedule (line 99) | def _unschedule(self):
method _show (line 105) | def _show(self):
method _hide (line 124) | def _hide(self):
method coords (line 132) | def coords(self):
method create_contents (line 159) | def create_contents(self):
function demo (line 168) | def demo():
FILE: res/libc10t.js
function c10t (line 1) | function c10t(json) {
FILE: scripts/google-api/google-api.php
function resizeImage (line 87) | function resizeImage($file, $scale) {
function generate (line 111) | function generate($arg1, $name, $tile, $zoom, $scale) {
function read (line 139) | function read($file) {
function write (line 161) | function write($file, $content) {
function getTimeStr (line 176) | function getTimeStr($durationInSeconds)
function isPlural (line 221) | function isPlural($num, $word){
FILE: scripts/google-api/libc10t.google.js
function extend (line 1) | function extend(t , o) {
function keys (line 6) | function keys(o) {
function get_parameters (line 20) | function get_parameters() {
function retrieveLink (line 48) | function retrieveLink(map) {
function refreshLink (line 68) | function refreshLink(map, control) {
function createLinkControl (line 76) | function createLinkControl(map) {
function EuclideanProjection (line 117) | function EuclideanProjection() {}
function new_map_type (line 132) | function new_map_type(m, o, ob) {
function initialize (line 151) | function initialize(id, opt, modes) {
FILE: src/2d/cube.hpp
type point (line 9) | struct point {
method point (line 16) | inline point(pos_t x, pos_t y, pos_t z) : x(x), y(y), z(z) {}
class point2 (line 19) | class point2 {
method point2 (line 26) | point2(const pos_t x, const pos_t y) : x(x), y(y) {}
class top_cube (line 41) | class top_cube {
method top_cube (line 45) | top_cube(const pos_t x, const pos_t y, const pos_t z) : x(x), y(y), z(...
method project (line 47) | inline void project(point &p, pos_t &rx, pos_t &ry) const
method limits (line 53) | inline void limits(pos_t &rx, pos_t &ry) const
class oblique_cube (line 64) | class oblique_cube {
method oblique_cube (line 68) | oblique_cube(const pos_t x, const pos_t y, const pos_t z) : x(x), y(y)...
method project (line 70) | inline void project(point &p, pos_t &rx, pos_t &ry) const
method limits (line 76) | inline void limits(pos_t &rx, pos_t &ry) const
class angle_cube (line 88) | class angle_cube {
method angle_cube (line 92) | angle_cube(const pos_t x, const pos_t y, const pos_t z) : x(x), y(y), ...
method project (line 94) | inline void project(point &p, pos_t &rx, pos_t &ry) const
method limits (line 100) | inline void limits(pos_t &rx, pos_t &ry) const
FILE: src/algorithm.cpp
type nonstd (line 5) | namespace nonstd {
FILE: src/algorithm.hpp
type nonstd (line 7) | namespace nonstd
class reporting (line 10) | class reporting
class continious (line 18) | class continious : public reporting<T>
method continious (line 26) | continious(O& out,
method add (line 40) | virtual void add(T parts)
method done (line 58) | void done(T last_part)
class limited (line 76) | class limited : public reporting<T>
method limited (line 84) | limited(O& out,
method add (line 100) | virtual void add(T parts)
method done (line 119) | void done(T last)
FILE: src/altitude_graph.hpp
class AltitudeGraph (line 30) | class AltitudeGraph
FILE: src/cache.hpp
type cache_hdr (line 15) | struct cache_hdr {
class cache_file (line 22) | class cache_file {
method cache_file (line 33) | cache_file(const fs::path cache_dir, std::string basename, const uint3...
method create_directories (line 40) | bool create_directories() {
method exists (line 44) | bool exists() {
method clear (line 49) | void clear() {
method gzreadall (line 53) | bool gzreadall(gzFile gzf, char* buf, unsigned int len) {
method gzwriteall (line 84) | bool gzwriteall(gzFile gzf, const char* buf, unsigned int len) {
method read (line 108) | bool read(boost::shared_ptr<image_operations> oper) {
method write (line 161) | bool write(boost::shared_ptr<image_operations> oper) {
FILE: src/dirlist.hpp
class dirlist (line 11) | class dirlist {
FILE: src/dlopen.cpp
type dl_t (line 18) | struct dl_t {
function dl_t (line 34) | dl_t* dl_open(const char *name)
function dl_close (line 67) | bool dl_close(dl_t* dl)
FILE: src/dlopen.hpp
type dl_t (line 4) | struct dl_t
FILE: src/engine/block_rotation.hpp
class block_rotation (line 11) | class block_rotation {
FILE: src/engine/engine_base.hpp
class engine_base (line 14) | class engine_base : public engine_core {
method engine_base (line 16) | engine_base(engine_settings engine_s, mc::world& world) :
method project_limits (line 25) | void project_limits(pos_t& image_width, pos_t& image_height) {
method project_position (line 29) | void project_position(point& p, pos_t& image_x, pos_t& image_y) {
method get_boundaries (line 33) | void get_boundaries(pos_t& width, pos_t& height) {
method get_level_boundaries (line 37) | void get_level_boundaries(pos_t& width, pos_t& height) {
method w2pt (line 41) | void w2pt(int xPos, int zPos, pos_t& x, pos_t& y) {
method wp2pt (line 50) | void wp2pt(int xPos, int yPos, int zPos, pos_t& x, pos_t& y) {
method reset_image_limits (line 57) | void reset_image_limits() {
method update_image_limits (line 64) | void update_image_limits(pos_t x, pos_t y, pos_t max_x, pos_t max_y) {
method engine_settings (line 71) | const engine_settings& get_settings() {
method pos_t (line 79) | pos_t get_min_x() {
method pos_t (line 83) | pos_t get_max_x() {
method pos_t (line 87) | pos_t get_min_y() {
method pos_t (line 91) | pos_t get_max_y() {
FILE: src/engine/engine_core.hpp
class engine_core (line 10) | class engine_core
class engine_core (line 14) | class engine_core {
FILE: src/engine/engine_settings.hpp
type engine_settings (line 6) | struct engine_settings {
FILE: src/engine/fatiso_engine.hpp
class fatiso_engine (line 8) | class fatiso_engine : public isometric_base<fatiso_cube> {
FILE: src/engine/flat_base.hpp
class flat_base (line 11) | class flat_base : public engine_base<C> {
method flat_base (line 17) | flat_base(engine_settings& s, mc::world& world)
method render (line 22) | void render(level_ptr level, image_operations_ptr oper)
FILE: src/engine/functions.cpp
function apply_shading (line 3) | void apply_shading(
FILE: src/engine/functions.hpp
function is_open (line 20) | inline bool is_open(mc::MaterialT*& m) {
function is_open (line 28) | inline bool is_open(int bt) {
function cave_ignore_block (line 41) | inline bool cave_ignore_block(int y, int bt, block_rotation& b_r, bool &...
function hell_ignore_block (line 59) | inline bool hell_ignore_block(int y, int bt, block_rotation& b_r, bool &...
FILE: src/engine/isometric_base.hpp
class isometric_base (line 11) | class isometric_base : public engine_base<C> {
method isometric_base (line 17) | isometric_base(engine_settings& s, mc::world& world)
method render (line 22) | void render(level_ptr level, image_operations_ptr oper)
FILE: src/engine/isometric_engine.hpp
class isometric_engine (line 8) | class isometric_engine : public isometric_base<isometric_cube> {
FILE: src/engine/oblique_engine.hpp
class oblique_engine (line 6) | class oblique_engine : public engine_base<oblique_cube> {
method oblique_engine (line 8) | oblique_engine(engine_settings& s, mc::world& world) : engine_base<obl...
FILE: src/engine/obliqueangle_engine.hpp
class obliqueangle_engine (line 8) | class obliqueangle_engine : public isometric_base<obliqueangle_cube> {
FILE: src/engine/topdown_engine.hpp
class topdown_engine (line 6) | class topdown_engine : public flat_base<top_cube> {
FILE: src/fileutils.hpp
function path_string (line 15) | inline std::string path_string(fs::path path) {
FILE: src/generate_map.cpp
function dot (line 47) | void dot(std::ostream& out, T total)
function parts_endl (line 59) | void parts_endl(std::ostream& out, unsigned int total)
function parts_perc_endl (line 64) | void parts_perc_endl(std::ostream& out, unsigned int progress, unsigned ...
function mb_endl (line 71) | void mb_endl(std::ostream& out, streampos progress, streampos total)
function load_warps (line 82) | inline void load_warps(ostream& out, fs::path warps_path, T& warps)
function load_players (line 100) | inline void load_players(ostream& out, fs::path show_players_path, T& pl...
function push_player_markers (line 133) | void push_player_markers(settings_t& s, text::font_face base_font, P& pl...
function push_sign_markers (line 155) | void push_sign_markers(settings_t& s, text::font_face base_font, S& sign...
function push_coordinate_markers (line 185) | void push_coordinate_markers(
function push_warp_markers (line 228) | inline void push_warp_markers(
function populate_markers (line 258) | void populate_markers(
function overlay_markers (line 295) | inline void overlay_markers(
function write_json_file (line 335) | void write_json_file(
function generate_map (line 410) | bool generate_map(
FILE: src/generate_statistics.cpp
function dot (line 22) | void dot(std::ostream& out, T total)
function uint_endl (line 32) | void uint_endl(std::ostream& out, unsigned int total)
function generate_statistics (line 37) | bool generate_statistics(
FILE: src/image/algorithms.cpp
type image (line 3) | namespace image {
function image_ptr (line 4) | image_ptr crop(image_ptr base, pos_t min_x, pos_t max_x, pos_t min_y, ...
FILE: src/image/algorithms.hpp
type image (line 13) | namespace image {
function split (line 18) | void split(image_ptr base, int pixels, M& map)
FILE: src/image/cached_image.hpp
class cached_image (line 20) | class cached_image : public image_base {
method build (line 34) | void build(R& reporter)
FILE: src/image/color.cpp
function alpha_over_c (line 48) | inline float alpha_over_c(float ac, float aa, float bc, float ba) {
FILE: src/image/color.hpp
type color (line 18) | struct color{
method color (line 25) | color(color *c)
method color (line 34) | color()
method color (line 43) | color(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
method color (line 52) | color(int r, int g, int b, int a)
method color (line 61) | color(float r, float g, float b, float a)
method is_opaque (line 70) | bool is_opaque() const {
method is_transparent (line 74) | bool is_transparent() const {
method is_invisible (line 78) | bool is_invisible() const {
method read (line 91) | inline void read(color *buf) {
method write (line 98) | inline void write(color *buf) {
FILE: src/image/format/base.hpp
class format_exception (line 6) | class format_exception : public std::exception
method format_exception (line 11) | format_exception(const char* why) : why(why) { }
FILE: src/image/format/png.hpp
type png_config (line 12) | struct png_config {
class png_format (line 17) | class png_format {
method save (line 21) | static void save(image_base* image, const std::string& path, opt_type&...
FILE: src/image/image_base.hpp
class image_base (line 15) | class image_base
method image_base (line 27) | image_base(pos_t width, pos_t height)
method pos_t (line 38) | inline pos_t get_width() { return width; }
method pos_t (line 39) | inline pos_t get_height() { return height; }
method get_offset (line 43) | inline std::streampos get_offset(std::streampos x, std::streampos y) {
method get_line (line 50) | void get_line(pos_t y, color *c) {
method save (line 55) | void save(const std::string str, typename T::opt_type opts) {
class image_base (line 20) | class image_base
method image_base (line 27) | image_base(pos_t width, pos_t height)
method pos_t (line 38) | inline pos_t get_width() { return width; }
method pos_t (line 39) | inline pos_t get_height() { return height; }
method get_offset (line 43) | inline std::streampos get_offset(std::streampos x, std::streampos y) {
method get_line (line 50) | void get_line(pos_t y, color *c) {
method save (line 55) | void save(const std::string str, typename T::opt_type opts) {
FILE: src/image/image_operations.cpp
function BOOST_REVERSE_FOREACH (line 54) | BOOST_REVERSE_FOREACH(image_operation operation, operations) {
FILE: src/image/image_operations.hpp
class image_operations (line 16) | class image_operations
type image_operation (line 20) | struct image_operation {
class image_operations (line 25) | class image_operations
FILE: src/image/memory_image.hpp
class memory_image (line 9) | class memory_image : public image_base {
FILE: src/image/virtual_image.hpp
class virtual_image (line 10) | class virtual_image : public image_base {
method virtual_image (line 15) | virtual_image(pos_t w, pos_t h, image_ptr base, pos_t x, pos_t y) : im...
method blend_pixel (line 19) | void blend_pixel(pos_t x, pos_t y, color &c) {
method set_pixel (line 23) | void set_pixel(pos_t x, pos_t y, color& c) {
method get_pixel (line 27) | void get_pixel(pos_t x, pos_t y, color& c) {
method get_line (line 31) | void get_line(pos_t y, pos_t x, pos_t width, color* c) {
FILE: src/json.cpp
type json (line 5) | namespace json {
function encode_string (line 6) | void encode_string(std::ostream& os, std::string s) {
FILE: src/json.hpp
type json (line 10) | namespace json {
type json_type (line 11) | enum json_type {
class string (line 19) | class string
method json_type (line 63) | json_type get_type() { return Trait<string>::type; }
method string (line 65) | string(std::string s) : s(s) {}
method write (line 66) | void write(std::ostream& os) {
class number (line 20) | class number
method json_type (line 76) | json_type get_type() { return Trait<number>::type; }
method number (line 78) | number(int v) : v(v) {}
method write (line 79) | void write(std::ostream& os) {
class object (line 21) | class object
method json_type (line 89) | json_type get_type() { return Trait<object>::type; }
method put (line 91) | void put(std::string k, basic_json* o) {
method write (line 95) | void write(std::ostream& os) {
class array (line 22) | class array
method json_type (line 131) | json_type get_type() { return Trait<array>::type; }
method push (line 133) | void push(basic_json* o) { a.push_back(o); }
method push (line 134) | void push(basic_json& o) { a.push_back(&o); }
method write (line 136) | void write(std::ostream& os) {
type Trait (line 25) | struct Trait {
type Trait<string> (line 30) | struct Trait<string> {
type json_type (line 31) | enum json_type
type Trait<number> (line 35) | struct Trait<number> {
type json_type (line 36) | enum json_type
type Trait<object> (line 40) | struct Trait<object> {
type json_type (line 41) | enum json_type
type Trait<array> (line 45) | struct Trait<array> {
type json_type (line 46) | enum json_type
class basic_json (line 51) | class basic_json {
class string (line 58) | class string : public basic_json {
method json_type (line 63) | json_type get_type() { return Trait<string>::type; }
method string (line 65) | string(std::string s) : s(s) {}
method write (line 66) | void write(std::ostream& os) {
class number (line 71) | class number : public basic_json {
method json_type (line 76) | json_type get_type() { return Trait<number>::type; }
method number (line 78) | number(int v) : v(v) {}
method write (line 79) | void write(std::ostream& os) {
class object (line 84) | class object : public basic_json {
method json_type (line 89) | json_type get_type() { return Trait<object>::type; }
method put (line 91) | void put(std::string k, basic_json* o) {
method write (line 95) | void write(std::ostream& os) {
class array (line 126) | class array : public basic_json {
method json_type (line 131) | json_type get_type() { return Trait<array>::type; }
method push (line 133) | void push(basic_json* o) { a.push_back(o); }
method push (line 134) | void push(basic_json& o) { a.push_back(&o); }
method write (line 136) | void write(std::ostream& os) {
function T (line 165) | T* cast(basic_json *b) {
FILE: src/main.cpp
function cout_error (line 47) | inline void cout_error(const string& message) {
function cout_end (line 52) | inline void cout_end() {
function do_help (line 57) | int do_help(ostream& out) {
function do_version (line 248) | int do_version(ostream& out) {
function main (line 261) | int main(int argc, char *argv[]){
FILE: src/main_utils.cpp
function boost_split (line 39) | void boost_split(C& collection, const string& s)
function get_blocktype (line 50) | bool get_blocktype(const std::string& block_string, mc::MaterialT*& bloc...
function parse_color (line 76) | bool parse_color(const string value, color& c)
function parse_set (line 118) | bool parse_set(const char* set_str, mc::MaterialT*& block_type, color& c)
function do_base_color_set (line 137) | bool do_base_color_set(const char *set_str)
function do_side_color_set (line 149) | bool do_side_color_set(const char *set_str)
function parse_limits (line 163) | bool parse_limits(const string& limits_str, settings_t& s)
function parse_tuple (line 187) | bool parse_tuple(const string& str, settings_t& s, int& a, int& b)
function read_set (line 209) | bool read_set(std::set<string>& set, const string s)
function do_write_palette (line 221) | bool do_write_palette(settings_t& s, const fs::path& path)
function do_colors (line 275) | int do_colors(std::ostream& out)
function int_vector_from_json (line 297) | std::vector<int> int_vector_from_json(boost::property_tree::ptree parsed...
function color (line 318) | color color_from_json(const boost::property_tree::ptree color_json)
type color_translator (line 347) | struct color_translator
method get_value (line 352) | boost::optional<color> get_value(const boost::property_tree::ptree &pt) {
function do_read_palette (line 361) | bool do_read_palette(settings_t& s, const fs::path& path)
type option (line 427) | struct option
function read_opts (line 493) | bool read_opts(settings_t& s, int argc, char* argv[])
FILE: src/main_utils.hpp
class application_error (line 16) | class application_error : std::exception
method application_error (line 21) | application_error(const char* message) : message(message) {}
FILE: src/marker.hpp
type marker (line 20) | struct marker {
FILE: src/mc/blocks.cpp
type mc (line 10) | namespace mc {
function reload_palette (line 26) | void reload_palette() {
function initialize_constants (line 64) | void initialize_constants() {
function deinitialize_constants (line 67) | void deinitialize_constants() {
FILE: src/mc/blocks.hpp
type mc (line 13) | namespace mc {
type MaterialMode (line 14) | enum MaterialMode {
type LegacyBlocks (line 24) | enum LegacyBlocks {
type MaterialMode_tr_to_string (line 38) | struct MaterialMode_tr_to_string {
method get_value (line 42) | boost::optional<std::string> get_value(const MaterialMode &m) {
type MaterialMode_tr_from_string (line 71) | struct MaterialMode_tr_from_string {
method get_value (line 75) | boost::optional<MaterialMode> get_value(const std::string &s) {
function get_material_legacy (line 120) | inline boost::optional<MaterialT*> get_material_legacy(int material, i...
function color (line 144) | inline color get_color_legacy(int material, int data) {
function color (line 153) | inline color get_side_color_legacy(int material, int data) {
function color (line 162) | inline color get_color_legacy(int material) {
function color (line 166) | inline color get_side_color_legacy(int material) {
FILE: src/mc/dynamic_buffer.cpp
type mc (line 5) | namespace mc {
FILE: src/mc/dynamic_buffer.hpp
type mc (line 6) | namespace mc {
class dynamic_buffer (line 14) | class dynamic_buffer {
FILE: src/mc/level.cpp
type mc (line 35) | namespace mc {
type section_name (line 36) | enum section_name {
type level_context (line 42) | struct level_context {
method level_context (line 54) | level_context() : error(false), error_where(0), error_why("")
function in_level_section (line 61) | inline bool in_level_section(level_context* C) {
function begin_compound (line 69) | void begin_compound(level_context* C, nbt::String name) {
function end_compound (line 83) | void end_compound(level_context* C, nbt::String name) {
function begin_list (line 108) | void begin_list(level_context* C, nbt::String name, nbt::Byte type, nb...
function end_list (line 117) | void end_list(level_context* C, nbt::String name) {
function register_string (line 121) | void register_string(level_context* C, nbt::String name, nbt::String v...
function register_byte (line 124) | void register_byte(level_context* C, nbt::String name, nbt::Byte value) {
function register_int (line 134) | void register_int(level_context* C, nbt::String name, nbt::Int i) {
function register_int_array (line 137) | void register_int_array(level_context* C, nbt::String name, nbt::IntAr...
function register_byte_array (line 140) | void register_byte_array(level_context* C, nbt::String name, nbt::Byte...
function register_long_array (line 167) | void register_long_array(level_context* C, nbt::String name, nbt::Long...
function error_handler (line 172) | void error_handler(level_context* C, size_t where, const char *why) {
function time_t (line 191) | time_t level::modification_time()
FILE: src/mc/level.hpp
type mc (line 16) | namespace mc {
class level_info (line 19) | class level_info
class level (line 20) | class level
class region (line 21) | class region
class invalid_file (line 27) | class invalid_file : std::exception {
method invalid_file (line 31) | invalid_file(const char* message) : message(message) {}
type Section_Compound (line 38) | struct Section_Compound {
type Level_Compound (line 46) | struct Level_Compound {
class level (line 53) | class level
FILE: src/mc/level_info.cpp
type mc (line 4) | namespace mc {
function time_t (line 23) | time_t level_info::modification_time() {
function region_ptr (line 27) | region_ptr level_info::get_region() {
function level_info (line 35) | level_info level_info::rotate(int degrees) {
FILE: src/mc/level_info.hpp
type mc (line 10) | namespace mc {
class level_info (line 11) | class level_info
class region (line 12) | class region
class level_info (line 14) | class level_info {
FILE: src/mc/marker.cpp
type mc (line 3) | namespace mc {
FILE: src/mc/marker.hpp
type mc (line 6) | namespace mc {
class marker (line 14) | class marker {
FILE: src/mc/region.cpp
type mc (line 8) | namespace mc {
class zerror (line 9) | class zerror : public std::exception {
method zerror (line 13) | zerror(const char* message)
class zstream (line 25) | class zstream
method zstream (line 28) | zstream() : strm(new z_stream)
method get_avail_out (line 41) | uint32_t get_avail_out()
method get_avail_in (line 46) | uint32_t get_avail_in()
method set_in (line 51) | void set_in(Bytef* b, uint32_t len)
method set_out (line 57) | void set_out(Bytef* b, uint32_t len)
method in_empty (line 63) | bool in_empty()
method out_empty (line 68) | bool out_empty()
method inflate (line 73) | void inflate()
function chunk_offset (line 125) | chunk_offset region::read_chunk_offset(unsigned int x, unsigned int z)...
function time_t (line 145) | time_t region::read_modification_time(unsigned int x, unsigned int z) ...
FILE: src/mc/region.hpp
type mc (line 20) | namespace mc {
class bad_region (line 21) | class bad_region : public std::exception {
method bad_region (line 26) | bad_region(const fs::path path, const char* message)
method where (line 37) | const fs::path where() {
type chunk_offset (line 42) | struct chunk_offset {
class region (line 47) | class region
method read_coords (line 74) | void read_coords(T& coll) const
class region (line 51) | class region {
method read_coords (line 74) | void read_coords(T& coll) const
FILE: src/mc/region_inspect.cpp
type inspect_context (line 14) | struct inspect_context {
function begin_compound (line 18) | void begin_compound(inspect_context* inspect, nbt::String name) {
function end_compound (line 24) | void end_compound(inspect_context* inspect, nbt::String name) {
function begin_list (line 30) | void begin_list(inspect_context* inspect, nbt::String name, nbt::Byte ty...
function end_list (line 36) | void end_list(inspect_context* inspect, nbt::String name) {
function register_long (line 42) | void register_long(inspect_context* inspect, nbt::String name, nbt::Long...
function register_short (line 47) | void register_short(inspect_context* inspect, nbt::String name, nbt::Sho...
function register_string (line 52) | void register_string(inspect_context* inspect, nbt::String name, nbt::St...
function register_float (line 57) | void register_float(inspect_context* inspect, nbt::String name, nbt::Flo...
function register_double (line 62) | void register_double(inspect_context* inspect, nbt::String name, nbt::Do...
function register_int (line 67) | void register_int(inspect_context* inspect, nbt::String name, nbt::Int v...
function register_byte (line 72) | void register_byte(inspect_context* inspect, nbt::String name, nbt::Byte...
function register_byte_array (line 77) | void register_byte_array(inspect_context* inspect, nbt::String name, nbt...
function register_int_array (line 83) | void register_int_array(inspect_context* inspect, nbt::String name, nbt:...
function register_long_array (line 89) | void register_long_array(inspect_context* inspect, nbt::String name, nbt...
function error_handler (line 95) | void error_handler(inspect_context* ctx, size_t where, const char* why) {
function main (line 99) | int main(int argc, char* argv[]) {
FILE: src/mc/region_iterator.cpp
function dir_filter (line 5) | bool dir_filter(const std::string& name)
function file_filter (line 12) | bool file_filter(const std::string& name) {
type mc (line 19) | namespace mc {
function region_ptr (line 36) | region_ptr region_iterator::next() {
FILE: src/mc/region_iterator.hpp
class dirlist (line 9) | class dirlist
type mc (line 13) | namespace mc {
class level_info (line 14) | class level_info
class region (line 15) | class region
class region_iterator (line 20) | class region_iterator {
FILE: src/mc/rotated_level_info.cpp
type mc (line 4) | namespace mc {
FILE: src/mc/rotated_level_info.hpp
type mc (line 8) | namespace mc {
class level_info (line 9) | class level_info
class rotated_level_info (line 11) | class rotated_level_info {
FILE: src/mc/utils.cpp
type mc (line 10) | namespace mc {
type utils (line 11) | namespace utils {
function split (line 14) | void split(std::vector<std::string>& v, const std::string& str, char...
function string (line 26) | string b36encode(int number) {
function b36decode (line 53) | int b36decode(const string num) {
function b10decode (line 60) | int b10decode(const string num) {
function level_dir (line 67) | fs::path level_dir(const fs::path base, int x, int z)
function level_path (line 76) | fs::path level_path(const fs::path base, int x, int z, const string ...
function level_coord (line 81) | level_coord path_to_level_coord(const fs::path path) {
function level_coord (line 102) | level_coord path_to_region_coord(const fs::path path) {
FILE: src/mc/utils.hpp
type mc (line 12) | namespace mc {
type utils (line 13) | namespace utils {
class invalid_argument (line 22) | class invalid_argument : public std::exception {
method invalid_argument (line 26) | invalid_argument(const char* message) : message(message) {}
class bad_cast (line 33) | class bad_cast : public std::exception {}
type level_coord (line 44) | struct level_coord {
method level_coord (line 49) | level_coord() : x(0), z(0) {}
method level_coord (line 50) | level_coord(int x, int z) : x(x), z(z) {}
method get_x (line 52) | int get_x() const { return x; }
method get_z (line 53) | int get_z() const { return z; }
method level_coord (line 55) | level_coord add_x(int x)
method level_coord (line 60) | level_coord add_z(int z)
method level_coord (line 65) | level_coord rotate(int rotation) const {
FILE: src/mc/world.cpp
type mc (line 11) | namespace mc {
function region_iterator (line 16) | region_iterator world::get_iterator() {
FILE: src/mc/world.hpp
type mc (line 21) | namespace mc {
class level_info (line 24) | class level_info
class region_iterator (line 25) | class region_iterator
class iterator_error (line 27) | class iterator_error : public std::exception {
method iterator_error (line 31) | iterator_error(const char* message)
class world (line 43) | class world {
FILE: src/nbt/nbt.hpp
type nbt (line 24) | namespace nbt {
class bad_grammar (line 25) | class bad_grammar : std::exception {}
class input_buffer (line 47) | class input_buffer {
class memory_buffer (line 64) | class memory_buffer : public input_buffer {
method memory_buffer (line 70) | memory_buffer(const char* buffer, pos_t size) : buffer(buffer), offs...
method pos_t (line 73) | virtual pos_t read(void* target, pos_t len)
method pos_t (line 84) | virtual pos_t tell()
method pos_t (line 89) | virtual pos_t flush(pos_t len)
method empty (line 100) | virtual bool empty()
method ok (line 105) | virtual bool ok()
class gzfile_buffer (line 111) | class gzfile_buffer : public input_buffer {
method gzfile_buffer (line 125) | gzfile_buffer(const char* path)
method pos_t (line 144) | virtual pos_t read(void* target, pos_t len)
method pos_t (line 172) | virtual pos_t tell()
method pos_t (line 182) | virtual pos_t flush(pos_t len)
method empty (line 201) | virtual bool empty()
method ok (line 221) | virtual bool ok()
function default_begin_compound (line 274) | void default_begin_compound(C* context, nbt::String name) {
function default_end_compound (line 278) | void default_end_compound(C* context, String name) {
function default_begin_list (line 282) | void default_begin_list(C* context, nbt::String name, nbt::Byte type, ...
function default_end_list (line 286) | void default_end_list(C* context, nbt::String name) {
function default_error_handler (line 290) | void default_error_handler(C* context, size_t where, const char *why) {
class Parser (line 296) | class Parser {
method Byte (line 302) | inline Byte read_byte(input_buffer_ptr file) {
method Short (line 308) | inline Short read_short(input_buffer_ptr file) {
method Int (line 315) | inline Int read_int(input_buffer_ptr file) {
method String (line 333) | inline String read_string(input_buffer_ptr file) {
method flush_string (line 343) | inline void flush_string(input_buffer_ptr file) {
method Float (line 348) | inline Float read_float(input_buffer_ptr file)
method Long (line 367) | inline Long read_long(input_buffer_ptr file) {
method Double (line 389) | inline Double read_double(input_buffer_ptr file) {
method Byte (line 411) | inline Byte read_tagType(input_buffer_ptr file) {
method flush_byte_array (line 420) | inline void flush_byte_array(input_buffer_ptr file) {
method handle_byte_array (line 427) | inline void handle_byte_array(String name, input_buffer_ptr file) {
method flush_int_array (line 440) | inline void flush_int_array(input_buffer_ptr file) {
method handle_int_array (line 447) | inline void handle_int_array(String name, input_buffer_ptr file) {
method flush_long_array (line 461) | inline void flush_long_array(input_buffer_ptr file) {
method handle_long_array (line 468) | inline void handle_long_array(String name, input_buffer_ptr file) {
method Parser (line 517) | Parser() :
method Parser (line 537) | Parser(C *context) :
method stop (line 558) | void stop() {
method parse (line 562) | void parse(input_buffer_ptr file)
method parse_buffer (line 733) | void parse_buffer(const char* buffer, unsigned int size)
method parse_file (line 739) | void parse_file(const char *path)
FILE: src/nbt/nbt_inspect.cpp
type inspect_context (line 10) | struct inspect_context {
function begin_compound (line 14) | void begin_compound(inspect_context* inspect, nbt::String name) {
function end_compound (line 20) | void end_compound(inspect_context* inspect, nbt::String name) {
function begin_list (line 26) | void begin_list(inspect_context* inspect, nbt::String name, nbt::Byte ty...
function end_list (line 32) | void end_list(inspect_context* inspect, nbt::String name) {
function register_long (line 38) | void register_long(inspect_context* inspect, nbt::String name, nbt::Long...
function register_short (line 43) | void register_short(inspect_context* inspect, nbt::String name, nbt::Sho...
function register_string (line 48) | void register_string(inspect_context* inspect, nbt::String name, nbt::St...
function register_float (line 53) | void register_float(inspect_context* inspect, nbt::String name, nbt::Flo...
function register_double (line 58) | void register_double(inspect_context* inspect, nbt::String name, nbt::Do...
function register_int (line 63) | void register_int(inspect_context* inspect, nbt::String name, nbt::Int v...
function register_byte (line 68) | void register_byte(inspect_context* inspect, nbt::String name, nbt::Byte...
function register_byte_array (line 73) | void register_byte_array(inspect_context* inspect, nbt::String name, nbt...
function register_long_array (line 79) | void register_long_array(inspect_context* inspect, nbt::String name, nbt...
function main (line 85) | int main(int argc, char* argv[]) {
FILE: src/nbt/types.hpp
type nbt (line 7) | namespace nbt {
type ByteArray (line 16) | struct ByteArray {
type IntArray (line 24) | struct IntArray {
type LongArray (line 33) | struct LongArray {
type stack_entry (line 41) | struct stack_entry {
FILE: src/nullstream.hpp
type nullstream (line 7) | struct nullstream : std::ostream {
FILE: src/players.cpp
function error_handler (line 8) | void error_handler(player *p, size_t where, const char* why) {
function begin_list (line 14) | void begin_list(player *p, std::string name, nbt::Byte, nbt::Int) {
function end_list (line 20) | void end_list(player *p, std::string name) {
function register_double (line 26) | void register_double(player *p, std::string name, nbt::Double value) {
FILE: src/players.hpp
class players_db_exception (line 18) | class players_db_exception : public std::exception {
method players_db_exception (line 22) | players_db_exception(const char* message) : message(message) { }
class player (line 28) | class player {
class players_db (line 43) | class players_db {
FILE: src/settings_t.hpp
type mode (line 12) | enum mode {
type action (line 20) | enum action {
type settings_t (line 30) | struct settings_t {
type mode (line 71) | enum mode
type action (line 111) | enum action
FILE: src/text.cpp
type text (line 6) | namespace text {
FILE: src/text.hpp
type text (line 20) | namespace text {
class text_error (line 21) | class text_error : public std::exception {
method text_error (line 25) | text_error(const std::string error) : error(error) {}
class font_face (line 35) | class font_face {
FILE: src/threads/renderer.hpp
type render_result (line 23) | struct render_result {
method render_result (line 33) | render_result() : fatal(false), fatal_why("(no error)") {}
type render_job (line 40) | struct render_job {
class renderer (line 48) | class renderer : public threadworker<render_job, render_result> {
method renderer (line 52) | renderer(renderer_settings r, int n, int total)
method render_result (line 56) | render_result work(render_job job) {
FILE: src/threads/renderer_settings.hpp
type renderer_settings (line 8) | struct renderer_settings {
FILE: src/threads/threadworker_fake.hpp
class threadworker (line 5) | class threadworker
method threadworker (line 12) | threadworker(int c) : thread_count(c) {
method give (line 18) | void give(I t) {
method start (line 22) | void start() {
method run (line 25) | void run(int id) {
method O (line 30) | O get() {
method join (line 36) | void join() {
FILE: src/threads/threadworker_impl.hpp
class interrupted_exception (line 10) | class interrupted_exception : public std::exception {}
class sync_queue (line 13) | class sync_queue {
method sync_queue (line 21) | sync_queue() : count(0), interrupted(false) {}
method add (line 23) | void add(T o) {
method T (line 29) | T take(int& pos) throw(interrupted_exception) {
method empty (line 45) | bool empty() {
method interrupt (line 50) | void interrupt() {
class threadworker (line 58) | class threadworker
method threadworker (line 78) | threadworker(int c, int total) : total(total), thread_count(c),
method give (line 103) | void give(I t) {
method start (line 107) | void start() {
method internal_work (line 113) | void internal_work() throw(interrupted_exception) {
method run (line 128) | void run(int id) {
method O (line 152) | O get() {
method join (line 157) | void join() {
FILE: src/warps.hpp
class warps_db_exception (line 16) | class warps_db_exception : public std::exception {
method warps_db_exception (line 20) | warps_db_exception(const char* why) : why(why) { }
class warp (line 27) | class warp {
class warps_db (line 33) | class warps_db {
method warps_db (line 37) | warps_db(const fs::path path) : path(path) {}
FILE: src/win32/tss_cleanup_implemented.cpp
type boost (line 1) | namespace boost {
function tss_cleanup_implemented (line 2) | void tss_cleanup_implemented() {}
FILE: test/test.cpp
function BOOST_AUTO_TEST_CASE (line 12) | BOOST_AUTO_TEST_CASE( test_cube_projection_1 )
function BOOST_AUTO_TEST_CASE (line 53) | BOOST_AUTO_TEST_CASE( test_cube_projection_2 )
Condensed preview — 140 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (489K chars).
[
{
"path": ".gitignore",
"chars": 75,
"preview": "*~\n*.pyc\nbuild\n*.cmake\n*.a\nMakefile\nCMakeFiles\n*.orig\n*.rej\nsrc/config.hpp\n"
},
{
"path": ".gitmodules",
"chars": 98,
"preview": "[submodule \"libs/unc\"]\n\tpath = libs/unc\n\turl = git://github.com/udoprog/unc.git\n branch = stable\n"
},
{
"path": "CMakeLists.txt",
"chars": 3249,
"preview": "cmake_minimum_required(VERSION 2.6)\nproject(c10t)\n\nset(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")\n\n# attempt to find out "
},
{
"path": "ChangeLog",
"chars": 251,
"preview": "Wed Nov 17 21:23:38 CET 2010\n\t- By popular demand, including the google-api scripts by the following\n\tindividuals from m"
},
{
"path": "LICENSE.txt",
"chars": 1601,
"preview": "// BSD license. Copyright (c) 2010, John-John Tedro et al.\n// All rights reserved.\n// \n// Redistribution and use in sour"
},
{
"path": "README.md",
"chars": 4665,
"preview": "c10t - a cartography tool for Minecraft\r\n=======================================\r\n\r\nI wrote c10t entirely because i like"
},
{
"path": "dist/Makefile.osx",
"chars": 852,
"preview": "ARCH=intel\nOS=osx\nVERSION=SNAPSHOT\n\nUSR=/opt/local\nCXXFLAGS=-arch i386 -arch x86_64 -Isrc -I/opt/local/include\nLDFLAGS=-"
},
{
"path": "dist/README.md",
"chars": 1562,
"preview": "This little setup came out of me wanting to setup my server to build SNAPSHOTS about once very day.\nThese scripts genera"
},
{
"path": "dist/all.sh",
"chars": 139,
"preview": "#!/bin/sh\n\nfor dist in $(ls -1 dist/targets); do\n if ! dist/make.sh $dist \"$@\"; then\n echo \"TARGET FAILED: $dist\"\n "
},
{
"path": "dist/config.mk",
"chars": 2595,
"preview": "USR?=/usr/${TARGET}/usr\nLIB?=${USR}/lib\n\nSOURCES+=src/algorithm.cpp\nSOURCES+=src/altitude_graph.cpp\nSOURCES+=src/dirlist"
},
{
"path": "dist/make.sh",
"chars": 1344,
"preview": "#!/bin/bash\n\ntarget=$1\n\nshift\n\ndist_target=dist/targets/$target\nbuild_target=build/$target\ndist_config=dist/config.mk\ndi"
},
{
"path": "dist/targets/x86-linux",
"chars": 358,
"preview": "ARCH=x86\nOS=linux\n\nTARGET=i686-linux-gnu\n\nLDFLAGS=-pthread -static -static-libgcc\nBIN=c10t\n\ninclude config.mk\n\nlocal-pac"
},
{
"path": "dist/targets/x86-windows",
"chars": 385,
"preview": "ARCH=x86\nOS=windows\n\nTARGET=i686-mingw32\n\nBIN=c10t.exe\nCXXFLAGS=-DBOOST_THREAD_USE_LIB=1\nLDFLAGS=-static -static-libgcc\n"
},
{
"path": "dist/targets/x86_64-linux",
"chars": 372,
"preview": "ARCH=x86_64\nOS=linux\n\nLDFLAGS=-pthread -static -static-libgcc\nBIN=c10t\n\ninclude config.mk\n\nTARGET=x86_64-linux-gnu\nUSR=/"
},
{
"path": "dist/targets/x86_64-windows",
"chars": 471,
"preview": "ARCH=x86_64\nOS=windows\n\nTARGET=x86_64-w64-mingw32\n\nBIN=c10t.exe\nCXXFLAGS=-m64 -O3 -DBOOST_THREAD_USE_LIB=1 -DBOOST_USE_W"
},
{
"path": "docs/NBT.txt",
"chars": 5611,
"preview": "Named Binary Tag specification\n\nNBT (Named Binary Tag) is a tag based binary format designed to carry large amounts of b"
},
{
"path": "gui/c10t-tk/README",
"chars": 1702,
"preview": "This is a simple GUI using Python and Tkinter.\n\nI know Tkinter is ugly and it sucks... But it is available on the standa"
},
{
"path": "gui/c10t-tk/c10t-tk.py",
"chars": 4346,
"preview": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n# vi:ts=4 sw=4 et\n\nimport re\nimport os.path\nimport subprocess\nfrom mainwin"
},
{
"path": "gui/c10t-tk/mainwindow.py",
"chars": 31022,
"preview": "# -*- coding: utf-8 -*-\n# vi:ts=4 sw=4 et\n\n# Let me warn you... Tkinter sucks!\n# It's so... crude... and ugly...\n# But t"
},
{
"path": "gui/c10t-tk/tooltip.py",
"chars": 8149,
"preview": "# -*- coding: utf-8 -*-\n# vi:ts=4 sw=4 et\n\n# Downloaded from:\n# http://tkinter.unpythonic.net/wiki/ToolTip\n\n'''Michael L"
},
{
"path": "palette.json",
"chars": 78457,
"preview": "[\n {\n \"namespace\": \"minecraft\",\n \"material\": \"air\",\n \"mode\": \"block\",\n \"top_color\": [255, 255, 255, 0],\n "
},
{
"path": "res/example.html",
"chars": 592,
"preview": "<html>\n <head>\n <script type=\"text/javascript\" src=\"libc10t.js\"></script>\n <script type=\"text/javascript\" src=\"c1"
},
{
"path": "res/libc10t.js",
"chars": 1445,
"preview": "function c10t(json) {\n this.MapX = json.st.MapX;\n this.MapY = json.st.MapY;\n this.MapZ = json.st.MapZ;\n \n this.mx_x"
},
{
"path": "scripts/area-set.sh",
"chars": 660,
"preview": "#!/bin/bash\nbasics=\" -w /home/j/.minecraft/saves/World1\"\nprefix='./images/area'\nthreads=2\nfor i in $(seq -150 -20)\ndo\nim"
},
{
"path": "scripts/area-slice.sh",
"chars": 695,
"preview": "#!/bin/bash\nbasics=\" -w /home/j/.minecraft/saves/World1\"\nprefix='./images/areaslice'\nthreads=2\nfor i in $(seq -150 -20)\n"
},
{
"path": "scripts/generate-tests.sh",
"chars": 2007,
"preview": "#!/bin/bash\n\nset -e\n\nworld=$1\ndir=$2\n\nC10T=./c10t\nC10T_ARGS=\"-w $world -L -70,-60,5,20\"\n\nif [[ ! -d $world ]]; then\n ec"
},
{
"path": "scripts/google-api/README.txt",
"chars": 1721,
"preview": "There has been a couple of variants of this script popping out recently, I took the liberty of consolidating them into t"
},
{
"path": "scripts/google-api/google-api.php",
"chars": 11767,
"preview": "<?php\r\nini_set(\"memory_limit\", \"200M\");\r\ndefine(\"VERBOSE\", false);\r\n/**\r\n * google-api.php\r\n *\r\n * author - Ben Rice (da"
},
{
"path": "scripts/google-api/google-api.ps1",
"chars": 6884,
"preview": "$CONVERT=\"convert\"\n$C10T=\"c10t.exe\"\n$C10T_OPTS=\"\"\n$C10T_OUT=\"c10t.out.txt\"\n\n$TILE_SIZES=\"4096\", \"2048\", \"1024\", \"512\", \""
},
{
"path": "scripts/google-api/google-api.sh",
"chars": 3307,
"preview": "#!/bin/bash\n\nC10T=c10t\n[[ -x ./$C10T ]] && C10T=./$C10T\n\nscriptdir=$(dirname $(readlink -f $0))\n\nworld=\"\"\noutput=\"\"\nhost"
},
{
"path": "scripts/google-api/index.html",
"chars": 908,
"preview": "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmln"
},
{
"path": "scripts/google-api/libc10t.google.js",
"chars": 6174,
"preview": "function extend(t , o) {\n for (k in o) { if (o[k] != null) { t[k] = o[k]; } }\n return t;\n}\n\nfunction keys(o) {\n var a"
},
{
"path": "src/2d/cube.hpp",
"chars": 1999,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/algorithm.cpp",
"chars": 96,
"preview": "#include <string>\n#include <vector>\n#include <sstream>\n\nnamespace nonstd {\n // hackish split\n}\n"
},
{
"path": "src/algorithm.hpp",
"chars": 2961,
"preview": "#ifndef NONSTD_ALGORITHM\n#define NONSTD_ALGORITHM\n\n#include <stdlib.h>\n#include <ostream>\n\nnamespace nonstd\n{\n template"
},
{
"path": "src/altitude_graph.cpp",
"chars": 2627,
"preview": "#include \"altitude_graph.hpp\"\n#include \"text.hpp\"\n\nusing namespace std;\nnamespace fs = boost::filesystem;\n\n#define BORDE"
},
{
"path": "src/altitude_graph.hpp",
"chars": 910,
"preview": "#ifndef STATISTICS_HPP\n#define STATISTICS_HPP\n\n// Include this first, to evade setjmp header bug\n#include \"image/format/"
},
{
"path": "src/cache.hpp",
"chars": 4847,
"preview": "#ifndef _CACHE_H_\n#define _CACHE_H_\n\n#include <fstream>\n#include <ctime>\n#include <boost/filesystem.hpp>\n#include <zlib."
},
{
"path": "src/dirlist.cpp",
"chars": 1193,
"preview": "#include \"dirlist.hpp\"\n#include \"fileutils.hpp\"\n\ndirlist::dirlist(const fs::path path) {\n if (fs::is_directory(path))\n "
},
{
"path": "src/dirlist.hpp",
"chars": 493,
"preview": "#ifndef _DIRLIST_HPP\n#define _DIRLIST_HPP\n\n#include <queue>\n#include <string>\n\n#include <boost/filesystem.hpp>\n\nnamespac"
},
{
"path": "src/dlopen.cpp",
"chars": 1284,
"preview": "#include \"dlopen.hpp\"\n\n/**\n * Concept shamelessly stolen from;\n * http://www.codeproject.com/KB/architecture/plat_ind_co"
},
{
"path": "src/dlopen.hpp",
"chars": 165,
"preview": "#ifndef _DLOPEN_HPP\n#define _DLOPEN_HPP\n\nstruct dl_t;\n\ndl_t* dl_open(const char*);\nvoid* dl_sym(dl_t*, const char*);\nboo"
},
{
"path": "src/engine/CMakeLists.txt",
"chars": 300,
"preview": "add_library(\n c10t-engine\n isometric_base.cpp\n flat_base.cpp\n topdown_engine.cpp\n oblique_engine.cpp\n obliqueangle"
},
{
"path": "src/engine/block_rotation.cpp",
"chars": 1078,
"preview": "#include \"engine/block_rotation.hpp\"\n\nblock_rotation::block_rotation(\n int rotation,\n boost::shared_ptr<nbt::ByteA"
},
{
"path": "src/engine/block_rotation.hpp",
"chars": 530,
"preview": "#ifndef _ENGINE_BLOCK_ROTATION_HPP\n#define _ENGINE_BLOCK_ROTATION_HPP\n\n#include <stdint.h>\n\n#include <boost/shared_ptr.h"
},
{
"path": "src/engine/engine_base.hpp",
"chars": 2709,
"preview": "#ifndef _ENGINE_ENGINE_BASE_HPP\n#define _ENGINE_ENGINE_BASE_HPP\n\n#include \"engine/engine_settings.hpp\"\n#include \"engine/"
},
{
"path": "src/engine/engine_core.hpp",
"chars": 1065,
"preview": "#ifndef _ENGINE_ENGINE_CORE_HPP\n#define _ENGINE_ENGINE_CORE_HPP\n\n#include <stdint.h>\n#include <boost/shared_ptr.hpp>\n\n#i"
},
{
"path": "src/engine/engine_settings.hpp",
"chars": 309,
"preview": "#ifndef _ENGINE_ENGINE_SETTINGS_HPP\n#define _ENGINE_ENGINE_SETTINGS_HPP\n\n#include <boost/shared_array.hpp>\n\nstruct engin"
},
{
"path": "src/engine/fatiso_engine.cpp",
"chars": 3183,
"preview": "#include \"engine/fatiso_engine.hpp\"\n\nfatiso_engine::fatiso_engine(\n engine_settings& s,\n mc::world& world\n )\n "
},
{
"path": "src/engine/fatiso_engine.hpp",
"chars": 1078,
"preview": "#ifndef FATISO_ENGINE\n#define FATISO_ENGINE\n\n#include \"engine/isometric_base.hpp\"\n\ntypedef angle_cube<4,5,2> fatiso_cube"
},
{
"path": "src/engine/flat_base.cpp",
"chars": 33,
"preview": "#include \"engine/flat_base.hpp\"\n\n"
},
{
"path": "src/engine/flat_base.hpp",
"chars": 7373,
"preview": "#ifndef _ENGINE_FLAT_BASE_HPP\n#define _ENGINE_FLAT_BASE_HPP\n\n#include \"engine/engine_base.hpp\"\n#include \"engine/block_ro"
},
{
"path": "src/engine/functions.cpp",
"chars": 600,
"preview": "#include \"engine/functions.hpp\"\n\nvoid apply_shading(\n const engine_settings& s,\n int block_light,\n "
},
{
"path": "src/engine/functions.hpp",
"chars": 1362,
"preview": "#ifndef _ENGINE_FUNCTIONS_HPP\n#define _ENGINE_FUNCTIONS_HPP\n\n#include \"engine/block_rotation.hpp\"\n#include \"engine/engin"
},
{
"path": "src/engine/isometric_base.cpp",
"chars": 38,
"preview": "#include \"engine/isometric_base.hpp\"\n\n"
},
{
"path": "src/engine/isometric_base.hpp",
"chars": 7081,
"preview": "#ifndef _ENGINE_ISOMETRIC_BASE_HPP\n#define _ENGINE_ISOMETRIC_BASE_HPP\n\n#include \"engine/engine_base.hpp\"\n#include \"engin"
},
{
"path": "src/engine/isometric_engine.cpp",
"chars": 1900,
"preview": "#include \"engine/isometric_engine.hpp\"\n\nisometric_engine::isometric_engine(\n engine_settings& s,\n mc::world& world"
},
{
"path": "src/engine/isometric_engine.hpp",
"chars": 729,
"preview": "#ifndef ISOMETRIC_ENGINE\n#define ISOMETRIC_ENGINE\n\n#include \"engine/isometric_base.hpp\"\n\ntypedef angle_cube<2,2,1> isome"
},
{
"path": "src/engine/oblique_engine.cpp",
"chars": 326,
"preview": "#include \"engine/oblique_engine.hpp\"\n#include \"engine/block_rotation.hpp\"\n#include \"engine/functions.hpp\"\n\n#include <boo"
},
{
"path": "src/engine/oblique_engine.hpp",
"chars": 362,
"preview": "#ifndef OBLIQUE_ENGINE\n#define OBLIQUE_ENGINE\n\n#include \"engine/engine_base.hpp\"\n\nclass oblique_engine : public engine_b"
},
{
"path": "src/engine/obliqueangle_engine.cpp",
"chars": 1110,
"preview": "#include \"engine/obliqueangle_engine.hpp\"\n\nobliqueangle_engine::obliqueangle_engine(\n engine_settings& s,\n mc::wor"
},
{
"path": "src/engine/obliqueangle_engine.hpp",
"chars": 745,
"preview": "#ifndef OBLIQUEANGLE_ENGINE\n#define OBLIQUEANGLE_ENGINE\n\n#include \"engine/isometric_base.hpp\"\n\ntypedef angle_cube<1,1,1>"
},
{
"path": "src/engine/topdown_engine.cpp",
"chars": 713,
"preview": "#include \"engine/topdown_engine.hpp\"\n\ntopdown_engine::topdown_engine(\n engine_settings& s,\n mc::world& world\n )"
},
{
"path": "src/engine/topdown_engine.hpp",
"chars": 660,
"preview": "#ifndef TOPDOWN_ENGINE\n#define TOPDOWN_ENGINE\n\n#include \"engine/flat_base.hpp\"\n\nclass topdown_engine : public flat_base<"
},
{
"path": "src/fileutils.cpp",
"chars": 138,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/fileutils.hpp",
"chars": 473,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/generate_map.cpp",
"chars": 25461,
"preview": "#include \"config.hpp\"\n#include \"image/format/png.hpp\"\n\n#include \"generate_map.hpp\"\n\n#include \"text.hpp\"\n#include \"player"
},
{
"path": "src/generate_map.hpp",
"chars": 441,
"preview": "#ifndef __GENERATE_MAP_HPP__\n#define __GENERATE_MAP_HPP__\n\n#include <ostream>\n#include <vector>\n#include <string>\n#inclu"
},
{
"path": "src/generate_statistics.cpp",
"chars": 6564,
"preview": "#include \"altitude_graph.hpp\"\n\n#include \"generate_statistics.hpp\"\n\n#include \"mc/blocks.hpp\"\n#include \"mc/region_iterator"
},
{
"path": "src/generate_statistics.hpp",
"chars": 470,
"preview": "#ifndef __GENERATE_STATISTICS_HPP__\n#define __GENERATE_STATISTICS_HPP__\n\n#include <ostream>\n#include <vector>\n#include <"
},
{
"path": "src/image/CMakeLists.txt",
"chars": 254,
"preview": "add_library(c10t-image \n image_operations.cpp\n image_base.cpp\n memory_image.cpp\n cached_image.cpp\n color.cpp\n algo"
},
{
"path": "src/image/algorithms.cpp",
"chars": 250,
"preview": "#include \"image/algorithms.hpp\"\n\nnamespace image {\n image_ptr crop(image_ptr base, pos_t min_x, pos_t max_x, pos_t min_"
},
{
"path": "src/image/algorithms.hpp",
"chars": 834,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/image/cached_image.cpp",
"chars": 3157,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n\n#includ"
},
{
"path": "src/image/cached_image.hpp",
"chars": 2841,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/image/color.cpp",
"chars": 3796,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/image/color.hpp",
"chars": 2129,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/image/format/base.hpp",
"chars": 324,
"preview": "#ifndef _IMAGE_FORMAT_BASE_HPP_\n#define _IMAGE_FORMAT_BASE_HPP_\n\n#include <exception>\n\nclass format_exception : public s"
},
{
"path": "src/image/format/png.hpp",
"chars": 4017,
"preview": "#ifndef FILEFORMAT_PNG\n#define FILEFORMAT_PNG\n\n#include <png.h>\n#include <zlib.h>\n\n#include \"image/format/base.hpp\"\n#inc"
},
{
"path": "src/image/image_base.cpp",
"chars": 2764,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/image/image_base.hpp",
"chars": 1772,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/image/image_operations.cpp",
"chars": 1618,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/image/image_operations.hpp",
"chars": 921,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/image/memory_image.cpp",
"chars": 1254,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/image/memory_image.hpp",
"chars": 572,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/image/virtual_image.hpp",
"chars": 1403,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/json.cpp",
"chars": 808,
"preview": "#include \"json.hpp\"\n\n#include <unc/unc.hpp>\n\nnamespace json {\n void encode_string(std::ostream& os, std::string s) {\n "
},
{
"path": "src/json.hpp",
"chars": 3637,
"preview": "#ifndef _JSON_H_\n#define _JSON_H_\n\n#include <map>\n#include <string>\n#include <vector>\n\n#include <ostream>\n\nnamespace jso"
},
{
"path": "src/main.cpp",
"chars": 23874,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/main_utils.cpp",
"chars": 32464,
"preview": "#include \"main_utils.hpp\"\n\n#include <getopt.h>\n\n#include <unistd.h>\n\n#include <sstream>\n#include <fstream>\n#include <iom"
},
{
"path": "src/main_utils.hpp",
"chars": 1042,
"preview": "#ifndef __MAIN_UTILS_HPP__\n#define __MAIN_UTILS_HPP__\n\n#include <string>\n#include <set>\n#include <sstream>\n#include <vec"
},
{
"path": "src/marker.cpp",
"chars": 478,
"preview": "#include \"marker.hpp\"\n\nmarker::marker(std::string text, std::string type, text::font_face font, int x, int y, int z)\n "
},
{
"path": "src/marker.hpp",
"chars": 699,
"preview": "#ifndef __MARKER_HPP__\n#define __MARKER_HPP__\n\n#include <string>\n#include <ostream>\n\n#include <boost/foreach.hpp>\n\n#incl"
},
{
"path": "src/mc/CMakeLists.txt",
"chars": 267,
"preview": "add_library(\n c10t-mc\n blocks.cpp\n level.cpp\n utils.cpp\n world.cpp\n region.cpp\n level_info.cpp\n region_iterator."
},
{
"path": "src/mc/blocks.cpp",
"chars": 3164,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n\n#includ"
},
{
"path": "src/mc/blocks.hpp",
"chars": 5668,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/mc/dynamic_buffer.cpp",
"chars": 1072,
"preview": "#include \"mc/dynamic_buffer.hpp\"\n\n#include <string.h>\n\nnamespace mc {\n dynamic_buffer::dynamic_buffer(size_t size)\n "
},
{
"path": "src/mc/dynamic_buffer.hpp",
"chars": 822,
"preview": "#ifndef _MC_DYNAMIC_BUFFER_HPP\n#define _MC_DYNAMIC_BUFFER_HPP\n\n#include <unistd.h>\n\nnamespace mc {\n /*\n * A dynamic b"
},
{
"path": "src/mc/level.cpp",
"chars": 5748,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/mc/level.hpp",
"chars": 1907,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/mc/level_info.cpp",
"chars": 1292,
"preview": "#include \"mc/level_info.hpp\"\n#include \"mc/region.hpp\"\n\nnamespace mc {\n level_info::level_info() : coord() {\n }\n\n leve"
},
{
"path": "src/mc/level_info.hpp",
"chars": 884,
"preview": "#ifndef _MC_LEVEL_INFO_HPP\n#define _MC_LEVEL_INFO_HPP\n\n#include <sstream>\n\n#include \"mc/utils.hpp\"\n\n#include <boost/shar"
},
{
"path": "src/mc/marker.cpp",
"chars": 330,
"preview": "#include \"mc/marker.hpp\"\n\nnamespace mc {\n marker::marker(std::string text, int x, int y, int z) :\n text(text), x(x"
},
{
"path": "src/mc/marker.hpp",
"chars": 478,
"preview": "#ifndef _MC_MARKER_HPP\n#define _MC_MARKER_HPP\n\n#include <string>\n\nnamespace mc {\n /*\n * designates a text related to "
},
{
"path": "src/mc/region.cpp",
"chars": 5243,
"preview": "#include \"mc/region.hpp\"\n\n#include <zlib.h>\n\n#include <fstream>\n#include <boost/scoped_ptr.hpp>\n\nnamespace mc {\n class "
},
{
"path": "src/mc/region.hpp",
"chars": 2128,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/mc/region_inspect.cpp",
"chars": 4691,
"preview": "#include \"mc/region.hpp\"\n#include \"mc/utils.hpp\"\n\n#include \"nbt/nbt.hpp\"\n\n#include <list>\n\n#include <boost/foreach.hpp>\n"
},
{
"path": "src/mc/region_iterator.cpp",
"chars": 889,
"preview": "#include \"mc/region_iterator.hpp\"\n#include \"mc/region.hpp\"\n#include \"dirlist.hpp\"\n\nbool dir_filter(const std::string& na"
},
{
"path": "src/mc/region_iterator.hpp",
"chars": 779,
"preview": "#ifndef _MC_REGION_ITERATOR_HPP\n#define _MC_REGION_ITERATOR_HPP\n\n#include <list>\n\n#include <boost/shared_ptr.hpp>\n#inclu"
},
{
"path": "src/mc/rotated_level_info.cpp",
"chars": 531,
"preview": "#include \"mc/rotated_level_info.hpp\"\n#include \"mc/level_info.hpp\"\n\nnamespace mc {\n rotated_level_info::rotated_level_in"
},
{
"path": "src/mc/rotated_level_info.hpp",
"chars": 585,
"preview": "#ifndef _MC_ROTATED_LEVEL_INFO_HPP\n#define _MC_ROTATED_LEVEL_INFO_HPP\n\n#include <boost/shared_ptr.hpp>\n\n#include \"mc/uti"
},
{
"path": "src/mc/utils.cpp",
"chars": 3414,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/mc/utils.hpp",
"chars": 2871,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/mc/world.cpp",
"chars": 888,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/mc/world.hpp",
"chars": 1199,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/nbt/CMakeLists.txt",
"chars": 135,
"preview": "add_library(c10t-nbt\n nbt.cpp\n ${ZLIB_LIBRARIES})\n\nset_target_properties(c10t-nbt PROPERTIES COMPILE_FLAGS \"-O3 -Wall "
},
{
"path": "src/nbt/nbt.cpp",
"chars": 213,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/nbt/nbt.hpp",
"chars": 21720,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/nbt/nbt_inspect.cpp",
"chars": 3478,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/nbt/types.hpp",
"chars": 749,
"preview": "#ifndef _NBT_TYPES_HPP\n#define _NBT_TYPES_HPP\n\n#include <stdint.h>\n#include <string>\n\nnamespace nbt {\n typedef int8_t B"
},
{
"path": "src/nullstream.cpp",
"chars": 88,
"preview": "#include \"nullstream.hpp\"\n\nnullstream::nullstream()\n : std::ios(0), std::ostream(0)\n{\n}\n"
},
{
"path": "src/nullstream.hpp",
"chars": 181,
"preview": "#ifndef __NULLSTREAM_HPP__\n#define __NULLSTREAM_HPP__\n\n#include <ostream>\n#include <iomanip>\n\nstruct nullstream : std::o"
},
{
"path": "src/players.cpp",
"chars": 1874,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n\n#includ"
},
{
"path": "src/players.hpp",
"chars": 1146,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/settings_t.cpp",
"chars": 2459,
"preview": "#include \"settings_t.hpp\"\n\n#include \"mc/blocks.hpp\"\n\nsettings_t::settings_t(fs::path& install_path)\n{\n this->excluded.p"
},
{
"path": "src/settings_t.hpp",
"chars": 2516,
"preview": "#ifndef __SETTINGS_T_HPP__\n#define __SETTINGS_T_HPP__\n\n#include <string>\n#include <set>\n\n#include <boost/filesystem.hpp>"
},
{
"path": "src/text.cpp",
"chars": 2640,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#include"
},
{
"path": "src/text.hpp",
"chars": 1250,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/threads/renderer.hpp",
"chars": 2541,
"preview": "#ifndef __THREADS__RENDERER_HPP__\n#define __THREADS__RENDERER_HPP__\n\n#include \"mc/utils.hpp\"\n#include \"mc/world.hpp\"\n#in"
},
{
"path": "src/threads/renderer_settings.hpp",
"chars": 285,
"preview": "#ifndef _THREADS_RENDERER_SETTINGS_HPP\n#define _THREADS_RENDERER_SETTINGS_HPP\n\n#include <boost/filesystem.hpp>\n\nnamespac"
},
{
"path": "src/threads/threadworker.hpp",
"chars": 513,
"preview": "// Distributed under the BSD License, see accompanying LICENSE.txt\n// (C) Copyright 2010 John-John Tedro et al.\n#ifndef "
},
{
"path": "src/threads/threadworker_fake.hpp",
"chars": 521,
"preview": "#ifndef __THREADWORKER_SUB_HPP__\n#define __THREADWORKER_SUB_HPP__\n\ntemplate <class I, class O>\nclass threadworker\n{\npriv"
},
{
"path": "src/threads/threadworker_impl.hpp",
"chars": 3172,
"preview": "#ifndef __THREADWORKER_SUB_HPP__\n#define __THREADWORKER_SUB_HPP__\n\n#include <boost/detail/atomic_count.hpp>\n#include <bo"
},
{
"path": "src/warps.cpp",
"chars": 1020,
"preview": "#include \"warps.hpp\"\n\n#include <fstream>\n\n#include <boost/algorithm/string.hpp>\n#include <boost/lexical_cast.hpp>\n\nusing"
},
{
"path": "src/warps.hpp",
"chars": 720,
"preview": "#ifndef _WARPS_H_\n#define _WARPS_H_\n\n#include <string>\n#include <vector>\n#include <exception>\n\n#include <boost/filesyste"
},
{
"path": "src/win32/tss_cleanup_implemented.cpp",
"chars": 57,
"preview": "namespace boost {\n void tss_cleanup_implemented() {}\n};\n"
},
{
"path": "test/CMakeLists.txt",
"chars": 205,
"preview": "add_executable(c10t-test EXCLUDE_FROM_ALL test.cpp)\n\ntarget_link_libraries(c10t-test c10t-lib)\ntarget_link_libraries(c10"
},
{
"path": "test/test.cpp",
"chars": 2303,
"preview": "#include \"color.hpp\"\n#include \"image.hpp\"\n#include \"2d/cube.hpp\"\n\n#define BOOST_TEST_DYN_LINK\n#define BOOST_TEST_MODULE "
}
]
// ... and 2 more files (download for full content)
About this extraction
This page contains the full source code of the udoprog/c10t GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 140 files (441.8 KB), approximately 129.1k tokens, and a symbol index with 551 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.