This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
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]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Need to script something quick with PlotSquared? | |
/plot debugexec runasync fixborder.js <id> | |
The following utility classes are usable: | |
- PS | |
- TaskManager | |
- TitleManager | |
- ConsolePlayer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
------ 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
NewerOlder