Skip to content

Instantly share code, notes, and snippets.

View boy0001's full-sized avatar

Jesse Boyd boy0001

  • Melbourne, Australia
View GitHub Profile
@boy0001
boy0001 / build.js
Last active April 14, 2019 12:45
build.js
/*
* Build Commands for WorldEdit
* Copyright (C) 2015 inHaze <http://inhaze.net>
*
* 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,
@boy0001
boy0001 / idk
Created April 10, 2019 17:52
fawe features
probably a bunch I'm forgetting
clipboard/history on disk
- uses numeric ids (basically block state ordinal)
- The way I've implemented it has some issues
- when undoing an edit the order it undoes blocks is reversed
- Downside of compression algorithm being one way
- If no compression is used, then edits take up multi-gb on disk, which is unfeasible
Per world history
{
var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
var ARGUMENT_NAMES = /([^\s,]+)/g;
function getParamNames(func) {
var a = func.toString().replace(STRIP_COMMENTS, '');
var r = a.slice(a.indexOf('(')+1, a.indexOf(')')).match(ARGUMENT_NAMES);
var l = new java.util.ArrayList();
if(r !== null) {
for (var i = 0; i < r.length; i++) {
l.add(r[i]);
package com.boydti.buildoff.util;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Chunk;
/*
This script will fix all signs in the world.
*/
var plots = PS.sortPlotsByTemp(PS.getPlots());
for (var i = 0; i < plots.size(); i++) {
var plot = plots.get(i);
if (plot.isBasePlot()) {
plot.setSign();
PS.class.static.log('&cSetting sign for: ' + plot);
}
/*
Need to script something quick with PlotSquared?
/plot debugexec runasync fixborder.js <id>
The following utility classes are usable:
- PS
- TaskManager
- TitleManager
- ConsolePlayer
Region region = new CuboidRegion(pos1, pos2);
Vector to /* = where you want to paste */;
String worldName;
boolean pasteAir = true;
boolean skipEntities = false;
boolean copyBiomes = false;
EditSession editSession = new EditSessionBuilder(worldName).fastmode(true).build();
WorldData worldData = editSession.getWorldData();
@boy0001
boy0001 / Block and biome color codes
Created January 9, 2018 12:57
Block and biome color codes
------ Blocks ------
minecraft:stained_hardened_clay:brown => #4d3323
minecraft:prismarine => #63988d
minecraft:dirt:coarse_dirt => #77553b
minecraft:red_mushroom_block => #b62524
minecraft:white_glazed_terracotta => #bcd4ca
minecraft:purpur_block => #a679a6
minecraft:concrete:silver => #7d7d73
minecraft:wool:orange => #f07613
minecraft:dirt:podzol => #5a3f1c
@boy0001
boy0001 / Config.java
Last active June 5, 2016 00:03
example config for plotsquared
package com.intellectualcrafters.plot.config;
import com.intellectualcrafters.configuration.MemorySection;
import com.intellectualcrafters.configuration.file.YamlConfiguration;
import com.intellectualcrafters.plot.PS;
import com.intellectualcrafters.plot.util.StringMan;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.annotation.ElementType;
var Runnable = Java.type('java.lang.Runnable');
var iter = PS.getBasePlots().iterator();
var timout = 1;
var countEntities = Java.extend(Runnable, {
run: function() {
var plot = iter.next();
plot.setSign();
var entities = MainUtil.class.static.countEntities(plot);