Skip to content

Instantly share code, notes, and snippets.

View sk89q's full-sized avatar
👋

Albert Pham sk89q

👋
View GitHub Profile
// $Id$
/*
* Copyright (C) 2010, 2011 sk89q <http://www.sk89q.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
package com.sk89q.skcraft;
import java.util.logging.Logger;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.Event.Priority;
import org.bukkit.event.Event.Type;
import org.bukkit.event.player.PlayerPortalEvent;
1 133 129 118 255 111 108 98 255 93 90 82 255 111 108 98 255
2 60 113 17 255 50 94 14 255 42 79 12 255 50 94 14 255
3 103 83 51 255 86 69 43 255 72 58 36 255 86 69 43 255
4 118 112 96 255 98 93 80 255 82 78 67 255 98 93 80 255
5 109 80 60 255 91 67 50 255 76 56 41 255 91 67 50 255
7 79 79 82 255 66 66 68 255 55 55 57 255 66 66 68 255
8 94 170 255 51 82 148 223 51 69 124 186 51 82 148 223 51
9 94 170 255 51 82 148 223 51 69 124 186 51 82 148 223 51
10 255 164 41 255 255 164 41 255 212 137 34 255 255 164 41 255
11 255 164 41 255 255 164 41 255 212 137 34 255 255 164 41 255
import re
import os.path
from glob import glob
fn_regex = re.compile(r"^c\.(\-?[a-z0-9]+)\.(\-?[a-z0-9]+)\.dat")
total = 0
to_delete = 0
for f in glob("world/*/*/c.*.dat"):
importPackage(Packages.com.sk89q.worldedit.blocks);
var session = context.remember();
var origin = player.getPosition();
var arrows = new BaseItemStack(262, 64);
for (var x = -4; x <= 4; x++) {
for (var y = -4; y <= 4; y++) {
for (var z = -4; z <= 4; z++) {
var size = args.length > 0 ? Math.max(2, parseInt(args[0])) : 30;
var affected = 0;
function chanceBlock(x, y, z, t, c) {
if (Math.random() <= c) {
minecraft.setBlock(x, y, z, t);
}
}
function makeTree(x, y, z) {
badges = ['boomerang', 'brown', 'champion', 'clean', 'green', 'handsoff',
'rodless', 'solved', 'sweep', 'unattractive', 'water']
types = ['WaterRod', 'WoodRod', 'PosMagnet', 'NegMagnet', 'UnpowWheel', 'CWWheel',
'CCWheel']
s1 = ""
s2 = ""
for badge in badges:
s1 = s1 + "local %s = 0\n" % badge
s1 = s1 + "local un%s = 0\n" % badge
-- Point values for badges
local boomerang = 0
local unboomerang = 0
local brown = 0
local unbrown = 0
local champion = 0
local unchampion = 0
local clean = 0
local unclean = 0
local green = 0
-- This example ruleset implements Hap's scoring ruleset (1.0). It also
-- generates forum emoticons for the copy and paste text!
local finalscore = 0
local paste = ""
-- Go through the list of provided designs
for _, design in pairs(params.designs) do
local score = 0
local emoticons = ""