Skip to content

Commit 472b794

Browse files
author
Hubert
authored
Add files via upload
1 parent d36f696 commit 472b794

File tree

3 files changed

+103
-0
lines changed

3 files changed

+103
-0
lines changed

License

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2015-2016, Hubert Tournier
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
7+
8+
2. 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.
9+
10+
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
11+
12+
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.
13+

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# @(#) MinecraftShellLibrary:Makefile v1.00 (2016-09-18) / Hubert Tournier
2+
3+
VERSION=1.00
4+
5+
DEFAULTDESTDIR=/home/minecraft
6+
DEFAULTUSER=minecraft
7+
DEFAULTGROUP=minecraft
8+
9+
tarball:
10+
@tar czf MinecraftShellLibrary-${VERSION}.tar.gz License Makefile ReadMe README.md .minecraft-library .server-settings.ini Commands CronTasks
11+
12+
verifyprerequisites:
13+
@[ "`whereis screen | sed "s/screen://"`" = "" ] && echo "WARNING: GNU Screen doesn't seem to be installed. You'll need it!"
14+
@[ "`whereis nbt2yaml | sed "s/nbt2yaml://"`" = "" ] && echo "WARNING: NBT2YAML doesn't seem to be installed. You'll need it!"
15+
16+
install: verifyprerequisites
17+
@echo -n "Destination directory [$(DEFAULTDESTDIR)]: " ; \
18+
read DESTDIR ; \
19+
[ "$$DESTDIR" = "" ] && DESTDIR=$(DEFAULTDESTDIR) ; \
20+
echo -n "Minecraft user [$(DEFAULTUSER)]: " ; \
21+
read USER ; \
22+
[ "$$USER" = "" ] && USER=$(DEFAULTUSER) ; \
23+
echo -n "Minecraft group [$(DEFAULTGROUP)]: " ; \
24+
read GROUP ; \
25+
[ "$$GROUP" = "" ] && GROUP=$(DEFAULTGROUP) ; \
26+
install -m 0755 -o $$USER -g $$GROUP .minecraft-library $$DESTDIR ; \
27+
install -m 0755 -o $$USER -g $$GROUP .server-settings.ini $$DESTDIR ; \
28+
[ ! -f $$DESTDIR/.server-settings ] && cp .server-settings.ini $$DESTDIR/.server-settings ; \
29+
cp -R Commands CronTasks $$DESTDIR ; \
30+
chown -R $$USER:$$GROUP $$DESTDIR/Commands $$DESTDIR/CronTasks $$DESTDIR/.server-settings ; \
31+
chmod 0755 $$DESTDIR/Commands $$DESTDIR/CronTasks $$DESTDIR/.server-settings ; \
32+
mv $$DESTDIR/Commands/* $$DESTDIR ; \
33+
rmdir $$DESTDIR/Commands
34+

ReadMe

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
About Minecraft Shell Library
2+
=============================
3+
An API for Minecraft / Bukkit server management and scripting.
4+
5+
6+
Installation
7+
============
8+
You'll need to know the location of your Minecraft server root directory (the place where you have your server.properties file), and the operating system user and group it runs under.
9+
10+
After that just type "make install" and answer those questions.
11+
12+
For an initial installation, you'll have to tweak the settings to your taste in the .server-settings installed file.
13+
Else verify if there are new configuration items to import in your existing server configuration.
14+
15+
16+
Usage
17+
=====
18+
Include the following line near the start of your shell scripts:
19+
20+
. .minecraft-library
21+
22+
Then you can use all the functions in the library.
23+
24+
Check CronTasks/CronMonitor for a little example.
25+
26+
The functions list is located at the start of the .minecraft-library file.
27+
For parameters, check each function header.
28+
29+
30+
Further development plans
31+
=========================
32+
The library works fine for me as it is.
33+
Nonetheless, I think I'll add a function to check if a player is running a forbidden client side mod, which could then be called from a cron script to kick/ban offending players.
34+
I'm also considering to add the remaining Minecraft console commands.
35+
36+
37+
Caveats
38+
=======
39+
Developed and tested only on FreeBSD 10.1.
40+
41+
42+
Versions and changelog
43+
======================
44+
1.00 2016-09-18 Initial public release
45+
46+
47+
License
48+
=======
49+
This open source software is distributed under a BSD license (see the "License" file for details).
50+
51+
52+
Author
53+
======
54+
Hubert Tournier
55+
September, 18 2016
56+

0 commit comments

Comments
 (0)