-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GroovyScript Vanilla Improvements (#26)
* add modrinth links * vanilla object mappers * Add basic command support * vanilla helper categories * IIngredient docs * order * remove migrated helper file * fix outdated examples links * convert events to use index files * rename events that are subclasses to only be subclass * add spaces to event titles * remove generic event todo file * remove line numbers * Resource Location * fixing the broken links mhm yes
- Loading branch information
1 parent
3c501df
commit a0a4f76
Showing
380 changed files
with
3,380 additions
and
2,434 deletions.
There are no files selected for viewing
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 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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
|
||
# Commands | ||
|
||
GroovyScript adds a large number of commands to aid in developing. | ||
|
||
Any of these commands can be run via using `/gs`, `/grs`, or `groovyscript` interchangeably. | ||
`/gs` will typically be used as it is the shortest. | ||
|
||
|
||
## Language Server | ||
|
||
- `/gs runLS` | ||
- `/gs runLanguageServer` | ||
|
||
The [Language Server](../../getting_started/editors.md) can be started in multiple ways, one of which being this command. | ||
|
||
|
||
## Reload | ||
|
||
- `/gs reload` | ||
|
||
You can [reload](../../getting_started/reloading.md) the GroovyScript `postInit` files | ||
via this command or via a keybind. | ||
|
||
Running `/gs reload --clean` will clean up the [log](../../getting_started/groovy_log.md) file | ||
and remove all prior text. | ||
|
||
This can make it more readable and easier to identify errors with the current script instead of seeing | ||
all errors that have been experienced iin this minecraft session. | ||
These errors will still impact the game. | ||
|
||
## Clean Log | ||
|
||
- `/gs cleanLog` | ||
|
||
Additionally, cleaning the [log](../../getting_started/groovy_log.md) file can be done directly. | ||
|
||
|
||
## Check | ||
|
||
- `/gs check` | ||
|
||
Parses all script files to ensure the syntax is valid. | ||
This will not identify dynamic errors, such as those from [Object Mappers](../../getting_started/object_mappers.md) or calling methods. | ||
|
||
|
||
## [Info](./info.md) | ||
|
||
- [`/gs info`](./info.md#info) | ||
- [`/gs hand`](./info.md#hand) | ||
- [`/gs looking`](./info.md#looking) | ||
- [`/gs self`](./info.md#self) | ||
|
||
There are a large number of possible arguments for each of these commands. | ||
|
||
The most important set of commands are the set of [Info Commands](./info.md), | ||
which will help you get data from the game into a GroovyScript format. | ||
|
||
|
||
## Log | ||
|
||
- `/gs log` | ||
|
||
Prints the location of the GroovyScript log file and Minecraft log file to the chat. | ||
The locations are copyable. | ||
|
||
|
||
## Wiki | ||
|
||
- `/gs wiki` | ||
- `/gs doc` | ||
- `/gs docs` | ||
- `/gs documentation` | ||
|
||
Prints a link to this [wiki](../../index.md) to the chat. | ||
|
||
|
||
## Packmode | ||
|
||
- `/gs packmode` | ||
|
||
If packmodes are enabled, you can pass in an argument setting the packmode. | ||
|
||
|
||
## Generate Wiki | ||
|
||
- `/gs generateWiki` | ||
- `/gs generateDoc` | ||
- `/gs generateDocs` | ||
- `/gs generateDocumentation` | ||
|
||
Generates the wiki files for all mods installed in the pack. | ||
|
||
These files will be generated from the source code of the mods, and so will be relevant and accurate to your pack, | ||
regardless of any updates that happen afterwards. | ||
|
||
It will also print a link to the wiki folder to the chat. | ||
|
||
|
||
## Generate Examples | ||
|
||
- `/gs generateExamples` | ||
|
||
::: info Warning {id="warning"} | ||
|
||
Currently, generating the example files can replace already existing files. | ||
Ensure that you have your files backed up or in a subfolder to avoid this. | ||
|
||
::: | ||
|
||
Generates the examples files for all mods installed in the pack. | ||
|
||
This can be extremely useful for seeing actual examples of recipes being changed for the mods that you have installed. | ||
|
||
These files will be generated from the source code of the mods, and so will be relevant and accurate to your pack, | ||
regardless of any updates that happen afterwards. | ||
|
||
It will also print a link to the examples folder to the chat. | ||
|
||
|
||
## Creative Tabs | ||
|
||
- `/gs creativeTabs` | ||
|
||
This will print every Creative Tab that has been registered to the chat | ||
and the the `groovy.log` file. | ||
|
||
It will also print the location of the GroovyScript log file to the chat. | ||
|
||
|
||
## Delete Script Cache | ||
|
||
- `/gs deleteScriptCache` | ||
|
||
In order to improve the speed of loading scripts, GroovyScript [caches the script files](../../getting_started/reloading.md#class-caching). | ||
|
||
Sometimes this can error, and classes will not be reloaded properly. | ||
In this situation, running this command will delete the cache and force it to be entirely re-evaluated. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
|
||
# Info Commands | ||
|
||
GroovyScripts adds multiple commands to retrieve information from the game. | ||
|
||
The primary purpose is to convert components in the game into GroovyScript [Object Mappers](../../getting_started/object_mappers.md). | ||
|
||
Each command processes through information via the same steps: | ||
- Collecting information from the world, which is done by the command directly and varies by command. | ||
- Parsing this information via the `InfoParserRegistry` and all valid `InfoParser`s, | ||
depending on arguments passed into the command. | ||
- Printing the output information to the chat, or an error if nothing was found. | ||
|
||
|
||
## Syntax | ||
|
||
Each type of info command can be used with different arguments | ||
|
||
There are two basic arguments: | ||
|
||
- `all`: Ignores any arguments allowing only a specific argument to be used. | ||
- `pretty`: Some info types may have different ways in which they will be logged if pretty is true - | ||
in particular, NBT Data will appear significantly differently when enabled. | ||
|
||
And there are a large and variable number of more complex arguments: | ||
|
||
Any `InfoParser` key can be used to filter the valid outputs. | ||
This can be done in two ways, | ||
- allow: using the key directly will cause the command to only print the `InfoParser`s matching the input keys. | ||
- negate: using the key prefixed by a minus sign `-` will cause the command to skip matching `InfoParser`s. | ||
|
||
|
||
::: info External Compat {id="note"} | ||
|
||
Note that `InfoParser`s do *not* have this filtering logic enforced, and may not implement this correctly. | ||
|
||
::: | ||
|
||
## Command Options | ||
|
||
### Info | ||
|
||
- `/gs info` | ||
|
||
Runs the info operation on the first valid type from Hand, Looking, or Self types. | ||
|
||
|
||
### Hand | ||
|
||
- `/gs hand` | ||
|
||
Runs the info operation on the ItemStack in your hand. | ||
|
||
Particularly useful for getting the [`EntityEntry`](../vanilla_object_mappers.md#entity) or [`IBlockState`](../vanilla_object_mappers.md#blockstate) | ||
Object Mappers. | ||
|
||
### Looking | ||
|
||
- `/gs looking` | ||
|
||
Runs the info operation on the Entity or Block you are looking at, prioritizing entities. | ||
|
||
Target must be in range to be detected. | ||
|
||
Particularly useful for getting the [`EntityEntry`](../vanilla_object_mappers.md#entity) or [`IBlockState`](../vanilla_object_mappers.md#blockstate) | ||
Object Mappers. | ||
|
||
### Self | ||
|
||
- `/gs self` | ||
|
||
Runs the info operation on the player entity executing the command. | ||
|
||
Particularly useful for getting the [`Dimension`](../vanilla_object_mappers.md#dimension), [`Biome`](../vanilla_object_mappers.md#biome), | ||
or [`Potion`](../vanilla_object_mappers.md#potion) Object Mappers. | ||
|
||
|
||
## Vanilla Info Parsers | ||
|
||
- [`biome`](../vanilla_object_mappers.md#biome): Biome the the target is in. | ||
- [`block`](../vanilla_object_mappers.md#block): Block being targeted or representing the held item. | ||
- [`blockstate`](../vanilla_object_mappers.md#blockstate): IBlockState being looked at or representing the held item. | ||
- [`creativetab`](../vanilla_object_mappers.md#creativetab): Creative Tab the targeted ItemStack is contained by, if any. | ||
- [`dimension`](../vanilla_object_mappers.md#dimension): Dimension type the player is in. | ||
- [`enchantment`](../vanilla_object_mappers.md#enchantment): Enchantments on the held ItemStack. | ||
- [`entity`](../vanilla_object_mappers.md#entity): Entity being looked at. | ||
- [`fluid`](../vanilla_object_mappers.md#liquid-and-fluid): Fluid being looked at in world or being contained in the item being held. | ||
- [`item`](../vanilla_object_mappers.md#itemstack): ItemStack in the player's main hand, offhand, or representing the block being looked at. | ||
- [`nbt`](../vanilla_object_mappers.md#nbt): NBT data of target, trimmed if it gets too long. | ||
- [`oredict`](../vanilla_object_mappers.md#ore): Ore Dictionary values the held ItemStack is part of. | ||
- `potioneffect`: Potion Effects for the held item, active potion effects for the entity being looked at, or active potion effects on the player. | ||
- `translation`: Translation key for the target. | ||
- [`villagercareer`](../vanilla_object_mappers.md#career): The Villager Career of the villager being targeted. | ||
- [`villagerprofession`](../vanilla_object_mappers.md#profession): The Villager Profession of the villager being targeted. | ||
|
||
|
||
## Creating Info Parsers | ||
|
||
In order to register an `InfoParser`, the only thing that needs to be done | ||
is to implement the `InfoParser` interface and call `InfoParserRegistry#addInfoParser(InfoParser)`. | ||
|
||
However, the abstract class `GenericInfoParser` has a number of helpful methods already created | ||
to make creating complex `InfoParser`s easy, so extending that should be preferred. |
Oops, something went wrong.