Skip to content

Releases: Stevertus/objD

0.4.7

06 Jan 23:14
304839e
Compare
Choose a tag to compare

This version contains fixes and features from 1.20.2 - 1.20.4 update.

Quick summary:
🚀 Biggest Feature: Function Macros are supported by utilizing the context and adding arguments to File. Read more about it in this guide: https://objd.stevertus.com/basics/#macros-function-arguments

For now, Strings, ints, double, Scores, Entities and Locations arguments are supported, with room to customize it.
To write the macro line $data merge entity ${eArg} {uuid:[I;1,2,3,${iArg}]}, you can use for instance:

Widget generate(Context context) {
    final iArg = c.intArgument('iArg');
    final Entity eArg = c.argument('eArg');
    return Data.merge(eArg, nbt: {
          "uuid": UUID(1, 2, 3, iArg),
    }),
}

📦 New features, blocks, items, entities and particles from Minecraft 1.20.1 onwards are implemented: New Random Wrapper and Return Updates; Project version is now by default 1.20.4 and it is possible to override packVersion and supportedFormats
📃 Improvements to nbt serialization, in particular a new UUID object and serialization for Entity, TextComponent and Effect
🔨 Lots of fixes for critical bugs

0.4.7

  • added arguments methods on context to generate macro commands introduced in 1.20.2
  • added Random Widget
  • added Return.run and Return.fail subcommands
  • added supportedFormats and packFormat to Project, default version is now 20.4
  • added arguments field for File.execute to run functions with arguments
  • updated blocks, items, particles and entities to include content from 1.20.4 and 23w51b
  • updated documentation links to the new minecraft wiki https://minecraft.wiki (thanks @Spongecade)
  • fixed Entity to introduce a trailing comma when given empty tags
  • fixed Entity.Clone to deep copy, instead of shallow copy (thanks @CCpcalvin)

0.4.6

  • added serializable UUID object to represent uuids consisting out of 4 integers (thanks @Globbi)
  • changed TextComponent & Entity to be gson serializable, so you don't have to call toMap manually
  • refactored Title widget
  • fixed function tags load/tick generating with paths with .mcfunction (thanks @FlafyDev)
  • fixed Storage.copyScore ignoring the scale parameter
  • fixed Github testing workflows to run with Dart 3 and provide Code Coverage (thanks @Globbi)

Shoutouts to @Globbi, @Spongecade, @FlafyDev, halo jalon and @CCpcalvin for contributing and submitting bugs

0.4.5

17 Jun 22:19
Compare
Choose a tag to compare

This version contains features from the 1.19.4 and 1.20 update.

Quick summary:
📦 7 new widgets with 1.20 features including Damage, Ride, Return, Fillbiome, Display and Interaction
🏝️ new Biome and Dimension classes + all new entities, blocks, items and particles from the updates
⏰ a new Time object for simplified time handling. No need to calculate ticks anymore, you can just write 20.seconds, 1.5.minutes and much more!
🧪 version numbering now also works for decimal versions as 19.4
📖 over 500 lines of new documentation(https://objd.stevertus.com/)

0.4.5

  • added new Time object for dealing with ticks, seconds, days and infinite Duration
  • added time extensions to number allowing to write 10.seconds, 2.ticks, 2.4.minutes etc. to generate time objects
  • added FillBiome Widget
  • added Execute.on, Execute.summon and Heightmap
  • added Damage Widget
  • added Return Widget and Score.setToFunction tranfering the return value to a score
  • added Biome and corresponding Biomes list
  • added Display Widget for spawing display objects and animate them
  • added Interaction Widget for spawing interaction entities
  • added preview images of all items and blocks in dartdoc
  • added unit tests for checking critical widgets automatically
  • added DataModify string operations
  • added CommandBuilder widget providing a abstract api to build commands with optional and varying components (mainly used internally)
  • added << Score operator as an additional "set to" operator(same as >>)
  • updated blocks, items, particles and entities to include content from 1.19.4 and 23w12a
  • updated dependencies
  • updated project to Dart 3
  • changed Score >> operator to also accept Widgets and Files
  • changed project version to also accept decimal numbers like 19.4 for 1.19.4 and react accordingly
  • fixed #25 ScoreTimerModule returning incorrect command with negative value
  • fixed Storage.getData not generating namespace properly
  • fixed log messages while using the getCommands API
  • fixed Bossbar.add generating wrong quotation #26
  • moved Builder Widget to basic

Breaking:

  • Effect, Schedule, Title, Repeat, Timer, ScoreTimer use the new Time object instead of an integer for representing time, you can just append a .ticks to the old integer: ticks: 10 => ticks: 10.ticks
  • objD now requires Dart 3, please check if you have the newest version of dart and run dart fix
  • Dimension is no longer an Enum. Execute.dimension no longer accepts strings, when using a custom dimension use Dimension(<name>)

0.4.4

03 Jan 21:26
Compare
Choose a tag to compare
  • added PlayerJoin.rejoin to only detect once joined players
  • added version aware translation of barrier and light particles when setting version to 18
  • added --clean(-c) option to easily remove all files and folders that would be generated by objD with the same options to easily clean junk
  • added experimental Multithreading option --useIsolates for saving files, let me know if you see performance improvements using it
  • added type property to Score to easily change scoreboard types and inherit right type from Scoreboard[] method
  • updated enums to use latest Dart 2.15 features
  • updated blocks and items to 1.18.1
  • updated default version to 1.18, also changing pack format
  • updated PlayerJoin to correctly handle initial joins as well(Thanks to SyntheticDev for the implementation)
  • fixed .mcfunction extension appearing in Context's file path(used by File.recursive and others)
  • fixed JsonFile not being exported
  • fixed Team Widget wrongly generate seeFriendlyInvisible when seeInvisible is set
  • removed unnessary imports

Shoutouts to @Synthetic-Dev, Dan Gaming and firecraftgaming over on Discord for reporting many of these bugs!

0.4.3

23 Oct 16:34
Compare
Choose a tag to compare

Breaking: Changed default behaviour of @Func() annotation to generate a function directly in functions/ instead of reading the path of the source file. This can be enabled again by setting path = null.

  • added InitScore Widget for initializing scoreboard values, thanks MrPlayerYork for the implementation
  • added masked argument for Condition.blocks making it generate valid code
  • added Rotation.checkNorth, Rotation.checkEast... which can be used as Range to check rotation in a specific direction
  • added run method to File to execute an existing File object
  • added Tag.add and Tag.remove constructors to make code more readable
  • updated Execute center method to optionally take a y value
  • updated ServerVersionCheck to also recognize 1.16 - 1.18 (thanks MrPlayerYork for the suggestion)
  • updated Log Widget with suggestions to add Log.debug and Log.info
  • updated blocks, items, particles and entities to include content from 21w42a
  • fixed Predicate requiring contents (Thanks to MrPlayerYork for reporting that!)
  • fixed nested Execute or If not generating a single execute command
  • fixed main and load files generating even if create was set to false(used in objd_gen)
  • Removed length limits for scoreboard, score holder and team names for 1.18

0.4.2

10 Jun 19:16
Compare
Choose a tag to compare

BREAKING

  • changed the default for If.assignTag to Entity.Self as this is more common than Entity.Player

Fixes

  • added new Marker Widget to easily create new Markers(you can use it where ever Summon can be used)
  • added Entity.Marker selector that selects all markers with an optional data field
  • added breakItem to CustomBlock to manually specify the item that should be killed if player breaks the block
  • updated all blocks, items and particles to include changes in 1.17
  • updated ReplaceItem to reflect all the changes to the /item command
  • changed the list in For to be non nullable
  • changed CustomBlock break distance to 0.5(instead of 1)
  • changed behaviour of Condition.not when used with a tag, this will generate [tag=!name] now instead of unless
  • fixed List<Widget?> is not a subtype of type Widget

0.4.1

03 Apr 20:54
Compare
Choose a tag to compare

Bugfix release fixing major problems in 0.4.0

  • updated RandomScore to support 1.16 UUIDs
  • changed order of generation: load gets generated before anything else
  • fixed files not getting generated when being registered inside another file
  • fixed empty file when extending a file that does not exist before
  • fixed path comparison (which resulted in Extend not working)
  • fixed duplicate scoreboard when using addIntoLoad
  • fixed load and tick tags being generated with .mcfunction

0.4.0

26 Mar 11:46
50ef9af
Compare
Choose a tag to compare
  • added Folder Widget to dynamically create folders. All Files and Rawfiles in the child marked with inheritFolder will choose this folder as a default
  • added Textcomponent.none for the edge case that you want to clear a previous set text
  • added predicate parameter to Selector
  • added Scoreboard.modify(whoever uses that)
  • added self, all and player getters on a Scoreboard to easily use the most common score entities
  • added path argument to Context to retrieve the current path set by Folders
  • added a check to help to not exceed the 16 char limit on scoreboards
  • added additional metrics to measure project generation
  • updated all blocks, items and particles to include additions in 21w11a
  • migrated to null safety, read more here: https://dart.dev/null-safety
  • refactored apis, arrangement of required values and nullable types
  • refactored filepaths and path concatenation
  • changed dependencies (removed meta and changed colorize to ansicolor)
  • fixed Area generating NULL instead of 0 by default
  • fixed triggering hotreload if only properties on project changed and refactored mechanics

You need at least Dart 1.12 for this version of objD and most likely have to migrate to null safety yourself (which is easy with the provided tools: https://dart.dev/go/null-safety-migration)

After doing so, ensure your version constraint is set to this to ensure all features are active:

environment:
  sdk: ">=2.12.0 <3.0.0"

0.3.6

20 Feb 22:29
Compare
Choose a tag to compare
  • added Pose class and corresponding pose argument in ArmorStand
  • added Summon.select method to easily get an entity selector
  • added a getCommands method which generates the commands of a given Widget
  • added JsonFile Widget to easily generate json files
  • added further checks for encapsulating groups when using strait functionality
  • changed Location to be immutable and providing const constructors
  • changed Summon parameters to be class fields
  • changed ArmorStand and AreaEffectCloud to inherit Summon, you can now use all possibilites of Summon
  • changed Execute.storeScore to use Score instead of two seperate parameters
  • changed Bossbar.storeResult, Entity.storeResult and Location.storeResult to accept any Widget
  • changed Command generation behaviour from List to StringBuffer
  • updated blocks, items, particles and entities to include content from 21w07a
  • fixed TextHoverEvent.item using the id as value instead of whole nbt
  • fixed giving a negative from value to RandomScore would only generate positive numbers
  • fixed Bossbar methods would override previous uses of the same object
  • fixed Item.getMap returning the id in item instead of id, added optional parameter

Thanks White Blizzard and Bonesdog for making suggestions for this version.

0.3.5

23 Jan 13:51
Compare
Choose a tag to compare

There is a new package objd_gen: https://pub.dev/packages/objd_gen
This gives you the possibility to use dart code generation with objD through annotations. This could improve the experience of writing Datapacks drastically and reduces boilerplate

@Wdg
Widget hello(String name) => Log('Hello $name!');

It basically boils down the concept of Widgets to Functions. If you are interested, read more here: https://objd.stevertus.com/cli/#objd-gen
As always I am open to suggestions and ideas to improve this idea.

Second big thing is the version argument for Projects.

Project(
  name: '...',
  version: 17,
)

Not only does this change the pack.mcmeta accordingly, but it also passes it to the Widgets as part of the Context. ReplaceItem already takes advantage of this by dynamically generating it with /replaceitem or /item depending on the version

All changes:

  • added Annotation classes to be used with objd_gen, which drastically lowers code complexity
  • added ReplaceItem.copy, ReplaceItem.clear and ReplaceItem.modify implementing 1.17 item command
  • added a version parameter to context to allow widget to generate version specific code
  • added Particle.dust and Particle.copyWith alongside with major rework of the Particle command and simplification of code
  • added Recipe Widget with ability to generate Minecraft Recipe Files of any type
  • added the possibility to use a String as an Argument for Dimensions to support custom dimensions
  • added missing toPath property to Storage.modify
  • updated ReplaceItem to adapt automatically to the projects version
  • updated blocks, items, particles and entities to include content from 21w03a
  • fixed Effect nbt Generator not using the Byte Generator correctly
  • fixed issues with having two Packs at the top level of the tree
  • removed default scale value from Data.get

0.3.4

17 Sep 20:14
Compare
Choose a tag to compare
  • added the ability to change the minecraft version by adding Project.version(changes mcmeta pack_format)
  • added spawnegg check for CustomBlock
  • added CustomBlock onPlaced and onBreak
  • added a way to override TextComponents with null -> TextComponent(null)
  • fixed issues with copying dicts
  • fixed missing toString method for Item
  • fixed missing implementation for Item.copyWith with model, name, hideFlags, lore and nbt
  • fixed that fromJson and clone were not static
  • fixed Execute.center targeting the corner of the block
  • removed unnecessary collection package