Tags
Creators
Details
Licensed LGPL-3.0-or-later
Published 20 months ago
Updated 4 days ago
All versions
8.1.0-26.3
Release
Wizards of Lua 8.1.0-26.3 (NeoForge)7 days ago 15
Compatibility
Minecraft: Java Edition
26.3
Platform
NeoForge
Supported environments
Server-side
Singleplayer
Changes
- New: The server's owner sets the default and the maximum
tickLimit, what a millisecond counts as, and the budget of event interceptors, inconfig/wizards-of-lua/spells.luaconf- See Configuration.
operationsPerMillisecond = 0counts only Lua operations, as before. AtickLimitabove the maximum is lowered to it, with a warning in the log. - Interceptors get
interceptorTickLimit(50000) for each call, no longer their spell'stickLimit.
- See Configuration.
- New:
Server.uptimemeasures durations by a clock that only goes forward, andServer.realtimetells the timespell.server.uptimeis the milliseconds since the server started, with microsecond precision. Unlike the wall clock it doesn't jump when the system time is set or corrected, so a spell that waits for a certain time or measures how long something takes gets it right.World.realtimeis deprecated: usespell.server.realtime, which tells the same. It goes away in the next major version.- The Discord bridge example measures its heartbeats and the gap between its logins with
uptime.
- Change: A spell's tickLimit counts the time it spends in the game's own code too
- Only its Lua operations counted, so a loop that read blocks in chunks still to be generated could take seconds of one tick, until the server stopped. Now each millisecond counts as 5000 operations by default, which gives a spell about 10 ms of each tick. Plain Lua code and compiling the modules of
requireare not affected;loadcounts the size of the code it compiles. - A spell that keeps the game busy now pauses sooner: one calling
findBlocksin a loop, or one whose events are handled by slow interceptors. Interceptors themselves still count their Lua operations only. - What a spell prints after a pause doesn't reach the reply of an RCON command (it goes to the server log) or a command block: don't rely on a spell finishing within the tick it was started in.
- Only its Lua operations counted, so a loop that read blocks in chunks still to be generated could take seconds of one tick, until the server stopped. Now each millisecond counts as 5000 operations by default, which gives a spell about 10 ms of each tick. Plain Lua code and compiling the modules of
- Change: Reading files is much faster
file:read("a")of 20 MB takes 30 ms instead of a second,io.linesa third of the time.
- Change: Functions and properties of Wizards of Lua take strings and numbers as Lua's own functions do
- A number counts as a string, so
spell.name = 5names the spell "5", and a string that stands for a number counts as that number, sospell:move("up", "2")works. Booleans, tables and enum values (by their names) are taken as before.
- A number counts as a string, so
- Change: The words before a command need no permission node of their own
/wol spell breakneededwizardsoflua.wolandwizardsoflua.wol.spelltoo, not onlywizardsoflua.wol.spell.break. Now granting a command's own node is enough, as with most mods:/woland/wol spellare there for everyone who may use a command below them. The nodeswizardsoflua.wolandwizardsoflua.wol.spellare gone. See Commands.
- Fix: A single call of a Lua library function should not hold up the server for longer than one
tickLimit- A
string.findwith a pattern that has to try many ways could run for minutes in one call, until the server stopped;string.rep,table.concat,table.move, file reads and the..operator could take seconds. Now such a call may do up to one whole tickLimit of work (about 10 ms by default), then it fails with an error thatpcallcan catch; its work counts, not its time, so a busy server doesn't make it fail. A spell that builds a huge string in one call, likestring.rep("x", 1e8), needs a highertickLimitfor it. - The same goes for the work of
string.upper,lower,reverse,sub,format,byte,tonumber,select,table.unpack, theutf8functions and comparing long strings, which counted nothing.string.byteandutf8.codepointreturn at most a million values, then fail with "string slice too long".
- A
- Fix: Item NBT that Minecraft rejects should raise an error, not turn the item into air
item:putNbt({count = 100}),item.nbt = …with a value Minecraft doesn't accept, andItem:new(id, nbt)left air behind without a word. Now they raise an error that says why, and the item stays as it was.
- Fix: Error messages about a bad argument should name the Lua type, not a Java class
spell.world = 5said "expected net.wizardsoflua.lua.classes.LuaWorld but got number", a position "expected net.sandius.rembulan.Table". Now they say "expected World", "expected Vec3".
- Fix:
PlayerChangeWorldEventcan't be canceled, so an interceptor'sfalseshould keep it from no one- The world change went ahead anyway, but the other spells' interceptors and all queues didn't get the event.
- Fix: A
searchRangeabove 2048 should raise an error, not hold up the server- A path search of a mob or bot takes memory and time that grow with the square of its
searchRange, so a large value could hold up the server for seconds or run it out of memory. 2048 is the most that Minecraft's own follow range allows.
- A path search of a mob or bot takes memory and time that grow with the square of its
- Fix: Functions that may wait should fail in an event interceptor every time, not depending on timing
Skin:lookup,Bot:getSuggestions,Bot:findPathandBot:awaitTaskworked in an interceptor when the answer happened to be there at once, and failed with "attempt to sleep" when it wasn't. Now they say that they can't be called there, asHttp:requestdoes. With atimeoutof 0,Skin:lookupandBot:awaitTaskdon't wait and still work.
- Fix: Reading
entity.extrashould add no empty data to the entity's saved data- A spell that only looked at the
extraof many entities left an empty entry in the saved data of each one.
- A spell that only looked at the
- Fix:
startup.luafiles at the same depth should run in the alphabetical order of their directories- They ran in the order the file system listed them, which differs between systems.
- Fix: The class of
PlayerDropSelectedItemEventshould be namedPlayerDropSelectedItemEvent, as documented- It was
PlayerDropSelectedItem, sotype(evt)gave that, andinstanceOf(PlayerDropSelectedItemEvent, evt)failed.
- It was
- Fix: A spell that kills itself should stop at once, end once, and get no more events
- After
spell:kill()its code went on, and every spell got its SpellFinishedEvent twice; so did an error in its own interceptor of that event. A spell killed while the spells handled an event still got that event. Now kill stops the code right there, even insidepcall, and the spell's own SpellFinishedEvent is the last one it gets, in its interceptors only.
- After
- Fix: Command blocks, the console and spells should need the permissions of
/lua,/woland spell-made commands, like players- Every source without an entity passed these checks: a permission mod or a PermissionCheckEvent interceptor couldn't deny a command block, a command block could use a spell-made command of any
level, and a/lualink in the chat ran without the question Minecraft asks for other commands. The console, RCON and spells still have every permission by their operator level, and a command block has level 2, which is enough for WoL's own commands.
- Every source without an entity passed these checks: a permission mod or a PermissionCheckEvent interceptor couldn't deny a command block, a command block could use a spell-made command of any
- Fix: Spell-made commands that begin with the same words should each need their own
level- A command made first, with a higher level, kept players below it from using, or seeing, a command made later that began with the same word.
- Fix: On NeoForge with LuckPerms, what LuckPerms leaves open about WoL's own commands should be decided by the level of the command's source, as on Fabric
- It was the player's own operator level, so a
/luathat a sign's click command runs at level 2 was refused for a player who isn't an operator.
- It was the player's own operator level, so a
- Fix: Spells should hear of joining and leaving players on the server thread, at the same moment on Fabric and NeoForge
- On Fabric, the interceptors of PlayerDisconnectedEvent could run on a network thread when a player closed the game, at the same time as the spells themselves. Now it comes on both loaders while the player is still in the world, before their data is saved, and PlayerJoinedEvent once the player is in the world; on Fabric it came before that.
- Fix: On NeoForge,
ChunkUnloadEventshould come before the chunk is saved, as on Fabric - Fix: A spell cast by a command block or over RCON should show its errors where its prints go, and late output of an RCON spell should go to the server log
- Its errors went to the server log only. Now a command block shows them, and the reply to the RCON command. What a spell cast over RCON prints, or fails with, after its first pause was lost, or showed up in the reply to a later RCON command, possibly of another connection: now it goes to the server log.
- Fix: The fields a spell stores on a player, an entity, an inventory, a world, the server or a spell should last as long as the object
- A spell that kept no reference to the object could lose them after a few minutes, when Java's garbage collector made room: a count on the players of the messages they write in the chat could start again from nothing. See the FAQ.
- Fix: A bot's path search should stop when the bot leaves or dies, or the spell that waits for it ends
- A search with
jumpswent on to its end on one of the few threads that search paths for bots, so that the other bots' searches had to wait.
- A search with
- Fix: The first spell should get the sid 1, not 2
- Fix: The Discord bridge should wait the full time between two logins to Discord, also on a server that has fallen behind
- It counted the time in ticks, and a server that catches up runs them faster, so it could log in again too soon, which Discord limits.
- Fix: Spells should reach no files outside their folder through a symbolic link
- A link that someone with access to the server's files had put into the world folder let spells read and write where it led.
- Fix: Bot:getSuggestions should offer only the commands the bot may use, as a player's client does
- A bot that isn't an operator was offered every command,
opandstopincluded.
- A bot that isn't an operator was offered every command,
- Fix: A new
tickLimitshould apply at once, not only from the next tick on - Fix: Moving a spell with
forceChunk = falseshould load no chunks- It loaded the chunk and the 8 around it, and generated them if they were new. A spell that went to the chunk of every ChunkLoadEvent so loaded more and more chunks, until the server stopped. Reading or changing a block still loads the block's chunk.
Supplementary resources
| File | Type | Size | |
|---|---|---|---|
| wizards-of-lua-neoforge-8.1.0-26.3-sources.jar | Sources jar | 614.7 KiB |
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:HW3198Ve:mSDnbgS0"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:HW3198Ve:mSDnbgS0"
}

