Skip to content

Instantly share code, notes, and snippets.

@DMBuce
DMBuce / README.asciidoc
Created February 9, 2012 19:06
A command line tool that uses a Minecraft server to generate square land of a specified size, measured in chunks or regions. Requires twoolie's nbt.py: https://github.com/twoolie/NBT

This Gist used to be a fork of similardilemma’s mcexplore.py script, which is used to pregenerate a minecraft world and was previously maintained at this url. Similardilemma no longer has a github account and no longer maintains mcexplore, so with his blessing I’m continuing development on GitHub over here.

@DMBuce
DMBuce / Reflector.py.patch
Created March 23, 2012 22:56
[PATCH] Add --sort=score option to reflector
--- Reflector.py.orig 2012-03-23 17:33:39.317842672 -0500
+++ Reflector.py 2012-03-23 17:52:41.385672960 -0500
@@ -34,7 +34,8 @@
# Recognized list sort types and their descriptions.
SORT_TYPES = {'age': 'last server synchronization',
'rate': 'download rate',
- 'country': 'server\'s location'}
+ 'country': 'server\'s location',
+ 'score': 'MirrorStatus score'}
# Known repositories, i.e. those that should be on each mirror.
[Unit]
Description=Home System
Documentation=man:systemd.special(7)
Requires=multi-user.target
After=multi-user.target
AllowIsolate=yes
[Install]
Alias=default.target
@DMBuce
DMBuce / PKGBUILD
Created January 21, 2021 20:32
c10t-git PKGBUILD
# Maintainer: Buce <dmbuce@gmail.com>
pkgname=c10t-git
pkgver=1.7.r242.g15d0bfe
pkgver() {
cd "$srcdir/$pkgname"
if ! git describe --tags 2>/dev/null; then
echo "0.r$(git rev-list --count HEAD).g$(git rev-parse --short HEAD)"
fi | sed 's/-/.r/; s/-/./g'
}
pkgrel=1
@DMBuce
DMBuce / barter.py
Last active July 1, 2021 01:55
Script to calculate expected number of items bartered from a stack of gold blocks in Minecraft 1.17
#!/usr/bin/python
items=[
{"name": "soul speed book", "num":1, "chance":5/459, "stacksize":1},
{"name": "soul speed boots", "num":1, "chance":8/459, "stacksize":1},
{"name": "splash fire resist potion", "num":1, "chance":8/459, "stacksize":1},
{"name": "fire resist potion", "num":1, "chance":8/459, "stacksize":1},
{"name": "water bottle", "num":1, "chance":10/459, "stacksize":1},
{"name": "iron nugget", "num":sum([10,36])/2, "chance":10/459, "stacksize":64},
{"name": "ender pearl", "num":sum([2,4])/2, "chance":10/459, "stacksize":16},