Jump to content




WorldEdit - Now with NBT support for command computers!



49 replies to this topic

#41 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 31 July 2015 - 05:10 PM

Small update 1.3.1 released.
Changes:
  • The path for all files the program uses can be changed.


#42 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 01 January 2016 - 03:33 AM

Huge update 1.4 released. Same ol' installer, new features!
Changes:
  • Added ConfigAPI, allowing for the creation and reading of config files.
  • Added distr, to see the distribution of blocks in the selection.
  • Added count, to see the amount of a single block in the selection.
  • Added size, to get the size of the selection/clipboard
  • Added config options for the paths for every file, and command line arguments to change the location of the config file and config API.
  • Re-enabled NBT support when using Immibis's Adventure Map Interface. Fixed a TON of bugs while using it due to me not testing with it. (I checked command computer compatibility too!)
  • Added pre-emptive support for unlimited position count for the poly selection type (internal changes, not too much changed user-side)
  • Fixed hpos not starting from the right position.
  • Selection now persists across reboots. I'm so sorry I didn't add this before because it's an amazing feature, and was easy to add.
  • Time it took to change blocks when running set, replace, etc. should be right now.
  • Added chunk command. It sets the selection to the chunk the player is in.
  • Added support for pos and hpos to have spaces in if desired. ("hpos1" or "hpos 1")
  • Capitalized the first letter of all commands in the help text.
  • Probably some more, too, because of the numerous internal changes.

Edited by moomoomoo309, 01 January 2016 - 03:39 AM.


#43 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 30 May 2016 - 03:25 AM

Small update 1.4.1 released.

Changes:
  • Due to 1.8.9 not having a single chat box peripheral, I added the ability to enter commands on the computer itself or over rednet.
  • Set should be a lot faster now.
I'll have another update soon which utilizes 1.8's new stuff (like the fill command, and the ability to make NBT work properly on command computers), but in case anyone wants to use this on 1.8 (or without a chat box), I thought I'd put this smaller update out.

Edited by moomoomoo309, 30 May 2016 - 12:13 PM.


#44 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 01 June 2016 - 12:17 AM

Large Update 1.5 released.

Changes:
  • Input on the computer and over rednet has been improved using lsh from Lyqyd
  • Set and replace have been sped up. (More can be done for replace, naturalize, and overlay, but that can wait for 1.5.1)
  • hpos has been implemented for command computers! Now you can select the block you're looking at using a command computer!
  • contract now works properly in the east and west direction. (I swapped them, whoops!)
  • Copy and paste now have NBT support on the command computer! (Applies to almost everything in WE_Clipboard)
  • Trusted rednet IDs and the current clipboard are now properly saved, and now persist across reboots
This release requires MC version 1.8.9 (and thus CC 1.7.9+).

Thank you to Lyqyd for lsh, and Wergat for your amazing code to get the player's looking vector!

Edited by moomoomoo309, 01 June 2016 - 12:17 AM.


#45 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,464 posts

Posted 01 June 2016 - 01:31 PM

Moved to Command Programs by request.

#46 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 25 July 2016 - 03:01 AM

Medium update 1.5.1 released.

Changes:
  • Replace and any other command which "scans" blocks, including copy (if you don't need NBT data), is now much faster (up to 4096 blocks/tick instead of 1 block/tick)
  • Command "deepcopy" and "deepcut" added, which copies or cuts an area, including its NBT data. If you don't want NBT data, just use copy or cut as normal.
  • Command "list" or "ls" added, which lists all of the schematics currently stored.
  • Command "exportVar" added for debugging purposes. If you want to play around with it, feel free. It can export any variable currently in the local or global environment and traverse tables within them. It's not perfect, but it's useful.
  • Did a little bit of cleanup with the Rednet Companion. Clear clears the text on both the companion and the computer itself now.
  • move -s has been added, so you can move your selection along with moving an area.
  • Set now reports the number of blocks changed correctly.
  • Tons of refactoring in WE_Core, now everything is in a function or within main.
  • Rotate command added. Rotate your selections 90, 180, or 270 degrees! (on any axis, or X by default)
  • Tons of bug fixes and other forgotten changes since 1.5 that I forgot about.
If anyone wants to mess around with exportVar in their own code, here it is:
local function splitStr(str,char) --#Converts str into a table given char as a delimiter.
	local tbl={}
	local findChar=str:find(char)
	local findChar2
	if findChar then
		table.insert(tbl,str:sub(1,findChar-1))
		repeat
			findChar2=str:find(char,findChar+#char)
			if findChar2~=nil then
				table.insert(tbl,str:sub(findChar+1,findChar2-1))
				findChar=findChar2
			end
		until findChar2==nil
		table.insert(tbl,str:sub(findChar+#char))
	else
		return {str}
	end
	return tbl
end

local function exportVar(varName,filePath,silent,printFct)
	printFct=type(printFct)=="function" and printFct or print
	local shortVarName=varName:sub(1,(varName:find"%." or (#varName+1))-1)
	local var=rawget(_G,shortVarName) or rawget(_ENV,shortVarName) --#Check locals and globals
	if var~=nil then --#It's allowed to be false, so an explicit nil check is needed.
		local outString=""
		if type(var)=="table" and varName:find"%." then
			local fields=splitStr(varName,"%.")
			for i=2,#fields do
				var=var[tonumber(fields[i]) or fields[i]]
			end
		end
		outString=type(var)=="table" and textutils.serialize(var) or type(var)=="function" and string.dump(var) or tostring(var)
		local success,errMessage=pcall( --#Try to write it to a file, and catch any errors if necessary.
			function()
				if type(filePath)=="string" and #filePath>0 then
					local f=fs.open(filePath,"w")
					f.write(outString)
					f.close()
				else
					error(("File path \"%s\" not a valid path!"):format(tostring(filePath)))
				end
			end
		)
		if not silent then
			if not success then
				printFct(("Error writing to file! Error message: \"%s\""):format(errMessage))
			else
				printFct(("Variable \"%s\" written to file at %svars/%s"):format(varname,ConfigFolder,varName))
			end
		end
		return outString
	elseif not silent then
		printFct(("The variable \"%s\" doesn't exist or is nil."):format(varName))
	end
end

Edited by moomoomoo3O9, 31 July 2016 - 09:37 PM.


#47 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 04 April 2017 - 04:12 PM

Since dropbox removed the pubic folder, I moved the project over to GitHub. The links should all work again.

I pushed my development code onto the repo, so there might be a few changes. It should mostly be bugfixes, but I haven't worked on the project recently, so I'm not sure what all of the changes are.

A few I can recall:
  • Support for serpent as a table serialization library added for exportVar.
  • Refactoring so IntelliJ doesn't yell at me for suspicious global creation.
  • Added support for elliptical selections.
  • Added a few extra parameters to commands from WorldEdit (move -s, for example)
  • Fixed argument parsing internally (Most commands weren't using it, so I ported a few over and realized it was broken!)
  • Moved command registration into the respective file that created the command (move is in WE_Clipboard, for example)
  • Fixed stack (it wasn't working before)
TODO:
Rewrite selectLargeArea to use coroutines? (May not be worth it, since it may end up killing servers because it's using as many resources as possible)
Polygon Selection (always)
#clipboard in block patterns?

#48 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 17 May 2017 - 08:17 PM

1.6 Released.

Changes (from commit description):

Added task system:
-"Tasks" are plugins which are put into the parallel.waitForAny() call that runs. They only have a name and a function at index 1.

Moved data into their own files:
-blocknames, MCNames, pipeblocks, ids moved into their own files.

Bug fixes:
-Fixed missing tostring() in blockHasChanged(), making set and replace report how many blocks changed correctly.
-Fixed obsolete references.
-Fixed region operations trying to reference a nil table.

Refactoring:
-Moved more variables into WE table, such as username and message.
-Made heightmap() local to sel.
-Moved makeSelection.cuboid into cuboid.

Misc:
-Made pos switch positions like hpos does.
-Fixed warning in help() so commands with missing help text actually issue a warning.
-Made sortedHelpText sort on command registry using insertion sort.
-Add tablex.walk() to GeneralAPI.
-Modified tablex.reverse() to be able to copy the table.

Edited by moomoomoo3O9, 17 May 2017 - 08:18 PM.


#49 bradster2214

  • Members
  • 3 posts

Posted 04 July 2018 - 01:50 PM

Hi.
I have no idea how the command computer works, i don't really intend on learning as it takes time and i don't intend on doing much with it. i want to be able to use a command computer to run the command "//replacenear 100 stone lava". i don't know how to do it. i did the pastebin run ku1FHyEW command but all it did was "Connecting to pastebin.com... Success." and that's it. if someone can please help i would greatly appreciate it.

#50 moomoomoo3O9

  • Members
  • 82 posts
  • LocationPork roll land

Posted 04 July 2018 - 08:13 PM

View Postbradster2214, on 04 July 2018 - 01:50 PM, said:

Hi.
I have no idea how the command computer works, i don't really intend on learning as it takes time and i don't intend on doing much with it. i want to be able to use a command computer to run the command "//replacenear 100 stone lava". i don't know how to do it. i did the pastebin run ku1FHyEW command but all it did was "Connecting to pastebin.com... Success." and that's it. if someone can please help i would greatly appreciate it.
You need to run WorldEdit.lua on the command computer, then either hook up a chat box, an ender modem and pocket computer, or enter the command on the computer itself.

However, replacenear is not implemented, mostly because it would be really slow because of how WorldEdit-CC scans for blocks. You would have to actually select the region you want replaced and then use replace.

Under "Media" in the original post is a video showing how to set it up. The only change from the video is you run WorldEdit.lua now, not WE_Core.

Edited by moomoomoo3O9, 06 July 2018 - 10:18 PM.






2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users