Some notes on changes from Denizen to Denizen2.
Posted: August 6th, 2016, 6:49 am
So the burning question is:
What's the difference between Denizen2 and good ol' Denizen for Bukkit?
In no particular order, here are a few:
What's the difference between Denizen2 and good ol' Denizen for Bukkit?
In no particular order, here are a few:
- Denizen2 is for Sponge primarily (whereas Denizen 1 was for Bukkit and Spigot).
- Denizen2 is a total internal rewrite, with no shared code at all.
- Denizen2 is designed to be more abstracted and generic, in such a way that it can be reimplemented into other projects (EG even a different game entirely) with ease.
- Denizen2 removes the following syntax:
%def%
but adds a similar syntax<[def]>
.- Note that the
%def%
syntax was removed due to it being unnecessary and producing oddities. It may be readded if deemed useful. - It was originally added just for the quick syntax, but carried with it a strange pre-parsed implementation that is at-odds with the existing tag system.
- The new syntax works within the existing tag system much better.
- Note that the
- Denizen2 is expected to be much faster. What Denizen1 does in a minute of pure CPU cycling, Denizen2 can do in under a second! This is actually the key reason for the total rewrite. We knew how to make it faster, but didn't have room to do that within the existing setup.
- FAIR WARNING: Denizen2 makes no attempt to match minor details of Denizen1, EG a command may easily have entirely different syntax or even command name in one version compared to the other. This is due to it being a total rewrite: We might as well improve the details while we're improving the general system.
- The
if x { ... }
notation is nowif x:
, same for loop commands and anything else that used braces. Note that braces still function, but are discouraged. - The
/denizen
command is gone, in favor of using/ex
exclusively. Also, /ex received a bump in power. Including such things as/ex command one - command two - command three
to specify multiple commands at once, and/ex reload
to call thereload
command, which is equivalent to the old/denizen reload scripts
. - The event
<context...>
tag is now<[context].[...]>
to work with the definition system better. (UPDATE: Old style now works too!) - Queue ID's are now a simple number that counts up, rather than nonsense text.
- Waitable is now
- &waitable command here
where the&
replaces the previous~
symbol from Denizen1. - Determine format is different, now
determine cancelled false
instead ofdetermine cancelled:false
. Determinations are now handled as a map of values, rather than a list of text. - Procedure scripts are now accessed like so:
<procedure[script:myscript|mycontext:mydata]>
where you can add as much context as you please. Also, procedure tags now return a map as mentioned above. - There are a variety of tag types available. Where Denizen1 has "element", Denizen2 has "numbertag", "integertag", "booleantag". Where Denizen1 abused dList for maps, we have a separate "listtag" and "maptag".
- There is no longer an inherent command delay, or any need for
^
in front of commands. If you wish to induce delays, add thewait
command wherever needed. - Cuboid logic is modified a bit. In particular, blocks are considered minicuboids (1x1x1 cuboids) for all mathematical purposes, as opposed to assuming their cornermost point is the entirety of a block. Thus, a cuboid from 0,0,0 to 16,256,16 will exactly encompass one minecraft chunk. (Whereas in Denizen-Bukkit it's sometimes that and sometimes 15,255,15 depending on random variation details). Also, none of that multi-part cuboid nonsense.
- All sorts of other minor differences that may not be listed currently. Do not expect this to be a complete list.