Commit Graph
948 Commits
Author SHA1 Message Date
gnembon 1b39feaab7 wrap stream before closing zip files. 2021-05-23 14:00:49 -03:00
gnembon c6db496a1f fixes behaviour of folder and file detections in java 16, fixes #869 2021-05-22 01:57:04 -03:00
gnembon f21897fab1 added custom context to be used in optimization evaluations that should expose all programmers issues, while allowing reporting errors to the error snooping entity. Fixes #875 2021-05-22 01:21:20 -03:00
gnembon deb4f78347 rotfl fixes #874 2021-05-21 23:08:33 -03:00
gnembon dbae5813f0 added framework for auto resource fetching for the apps 2021-05-21 22:31:02 -03:00
gnembon 79fb489ab7 renames 2021-05-21 14:13:50 -03:00
gnembon 22abf2fab6 minor docs 2021-05-21 04:40:32 -03:00
altrisi cc7a9c01be Annotated Scarpet (#772)
* Progress by now.

* Output conversions plus a few extra random things

* More progress, mostly list converting and a way to get converters

* Apply ValueConverters, refactor valueconverter getter to

accept types with annotations and generics, made listconverter pass
those params and annotations recursively. And probably more things.

* Some extra docs, the 100% most important thing

* Added MapConverter, strict Strings and Texts, some docs additions

and commented out heuristics

* Rework StrictParam to use SimpleTypeConverters and be saved in a map

* Minor changes and docs & added non-fully-functional context "converter"

* Added support for variable value count converters, multi-value eaters &

0 value eaters (Context).

* Docs update, enable Context converter, fix minor TODOs

* Move (most) parameter annotations into a single class,

remove deprecated ValueCaster#cast, update some docs.

* Small refactor of Param.Strict registering, added boolean to it

* Added PairConverter, moved Context and LV ValueConverters to Params

* Document public methods of AnnotationParser

* Add a lot more docs, make it ready for the first preview PR

* Move ValueConverter population outside of makeFunction,

check lv size for > max arguments, minor doc updates and workaround for
Mercury#28 until released

* Added optional parameters (declared using Java's Optional),

made evalAndConvert check for the presence of the next iteration,
updated test class

* Generalize Value OutputConverter

* ListConverter and MapConverter now follow ValueConverter contract of

incorrect value handling, returning a complete null for an incorrect
value anywhere. Also small fix to OptionalConverter and docs.
Getting ready for checking null in AnnotationParser!

* Change reflection's #invoke to a MethodHandle to boost speed by a lot

Commented

* Dedupe code, update and remove outdated todos, add 2 new ValueCasters

* Merge lambdas in display_title2 test function to be more accurate

* Check nulls somehow, I guess

* Move base function logic into a class to stop

passing hundreds of parameters into static functions and therefore simplify it

* Reduce visibility and fix a bug with PairConverter

* Hide Context provider in usage report

* Add support for primitive varargs

* Added TheLazyT converter

* Drop #getPrefixedTypeName and use 'something' as name of values

* Use value again because of varargs, document that

* Remove a completed TODO

* Remove old disabled heuristic value type name getter

* Fix TheLazyT

* Preparing locators before touching current Carpet infrastructure

* Add notes about non-implementedness of remaining locators

* Added APIs to register custom ValueConverters

* Mention new APIs in javadocs

* Adapt to new Carpet changes and deprecated non-implemented annotations

* Update example function for display_title()

* Better implementation for player_list example

* Fix example error message

* FunctionArgument no longer has generics

* Modernize Text converters

* OutputConverter is final, plus other small changes

* Few non-behavioural changes

* Rename LazyFunction to ScarpetFunction

* Drop LazyValue in parameters, not in return

Updating docs was a nightmare

* CARPET CHANGE - Make Fluff.AbstractLazyFunction.unpackArgs call unpackLazy (was duped)

* Make errors more like current Scarpet errors

* Allow customizing ContextType when evaluating arguments

* Add a few missing docs, comment out outdated ValueCaster doc

It's been a while, wow

* Fix for new Carpet signature :irritatered:

Please don't break API methods! Extensions may be using them, and they
will just crash the game or behave in unexpected ways else!

* Format all code to Carpet's. Powered by Eclipse

Reviewed to be sure it's ok. No functional changes, except from a small correction

* Always use full name for Context.Type

* Add parsing for all current Scarpet api and language classes

And remove test functions

* Allow void return type

* Fix no param methods

Whoops!

* Remove outdated comment and fix small javadoc linting problem

* Drop Param.TheLazyT in favour of just Context.Type type

And small performance improvement to varargs varargs since fastutil's toArray is crap

* Quote functions in error messages

* Make SimpleTypeConverter independent of ValueCaster

'Real world' usage demonstrated it can be annoying else, mostly for wrapper only values where you just want the wrapped object
2021-05-21 01:33:00 -03:00
gnembon 7fd49e0f04 fix client methods in biome, fixes #870 2021-05-21 04:22:18 -03:00
gnembon 4466c77780 small refactor, customizable appstore, minimize app calls. 2021-05-21 03:50:38 -03:00
gnembon 866f1f1497 moved downloader 2021-05-19 20:46:19 -03:00
gnembon edc90133b2 fix run position, fixes #866 2021-05-18 21:18:53 -03:00
altrisi be0635de82 Use primitive specific Predicates instead of Function (#859) 2021-05-15 18:54:16 -03:00
gnembon fd492f334c moved exception handler, fixes #861 2021-05-14 03:34:19 -03:00
gnembon a522e2ae37 fixed changed behaviour under java 16 2021-05-13 01:51:01 -03:00
gnembon 451b35b6c5 % is a proper modulus operator, not reminder. #fixes 842, #fixes 843 2021-05-10 00:49:04 -03:00
replaceitemandgnembon 6a06b0fb61 Modify look (#848)
* Added modify(e,'look',...

* Added modify(e,'look',...

* Not change yaw and pitch if vector length is 0 or straight up/down

* Added to docs

* Update docs/scarpet/api/Entities.md

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
2021-05-09 15:14:05 -03:00
gnembon cf62890a3a Merge pull request #841 from replaceitem/text-bool-fix
Fixed boolean value of FormattedText being incorrect
2021-05-05 01:28:16 -03:00
gnembon 1633cca07a better reporting 2021-05-05 01:23:17 -03:00
gnembon 8d97ab26a9 script compile time optimizations. 2021-05-05 00:25:31 -03:00
replaceitem 659ad2408e Fixed boolean value of FormattedText being incorrect 2021-05-04 20:26:20 +02:00
gnembon 06c9aea326 tracking module integrity when module composition changes 2021-04-29 02:17:02 -03:00
Ghoulboy 164122eba2 Adding query player language (#824) 2021-04-26 21:38:29 -03:00
Ghoulboy 1bc2dd94da Adding b64 and json decoder and encoder functions (#829) 2021-04-26 21:21:35 -03:00
gnembon 28101e716b lists are now properly mutable 2021-04-24 01:13:33 -03:00
gnembon d388c406fd lists are now properly mutable 2021-04-24 00:30:51 -03:00
gnembon 9e7d6b70b7 thread exceptions are printed unscrambled 2021-04-23 22:12:38 -03:00
gnembon c476e814b4 better thread handling and removal of unused code. 2021-04-23 21:42:55 -03:00
gnembon e22474156b maps unpack 2021-04-23 10:58:33 -03:00
gnembon bed9e2c60a docs 2021-04-23 01:20:42 -03:00
gnembon edca3fb131 using proper logger now 2021-04-22 22:30:45 -03:00
gnembon d072ec90c3 hold your horses 2021-04-22 22:26:35 -03:00
gnembon 5edbbe3fe2 remane 2021-04-22 22:25:46 -03:00
gnembon 77fbb3af75 Merge branch 'master' into unpacker 2021-04-22 20:37:57 -03:00
gnembon 74bd0bb81e dont be lazy refactor 2021-04-22 20:37:48 -03:00
gnembon a65d16c9ba WIP unpacking of parameters. 2021-04-21 12:21:47 -03:00
gnembon db15744737 Merge pull request #820 from altrisi/get-list
Make `get()` always return a list if requested item ends with `[]`
2021-04-21 01:43:42 -03:00
altrisi 6083b702f9 Make NBT's get() always return a list if requested item ends with [] 2021-04-21 00:25:14 +02:00
replaceitem e26e332a6d Adding getTextByValue method to replace duplicate code (#823)
* Added FormattedTextValue.getTextByValue()

* changed getBoolean() and added to display_title
2021-04-20 17:14:08 -03:00
gnembon ba89d0164f handling snooped commands properly 2021-04-19 23:40:22 -03:00
gnembon b0dafccc18 re-name 2021-04-19 23:35:13 -03:00
gnembon 3915a5d889 fixed some run command behaviours. 2021-04-19 09:23:42 -03:00
gnembon fa3505763e fix 2021-04-19 03:48:37 -03:00
altrisi 1819694d19 Make player_list take arguments one at a time and make it compatible with loggers (#819)
* Make `player_list` take arguments one at a time and make it compatible with loggers

* Update docs for `player_list` modification
2021-04-19 02:31:54 -03:00
altrisiandgnembon b7b7667484 Allow apps to specify mod version requirements (#798)
* Allow apps to specify mod version requirements

* Allow a function in requires field and move to `readConfig()`

* Add `server_mods` to system_info()

* Add prefixes and default to `=`

* Added docs for `requires` and for `system_info('server_mods')`

* Better docs for requires (mention * and available prefixes)

* Update docs/scarpet/api/Overview.md

* Update docs/scarpet/api/Overview.md

* Update docs/scarpet/api/Overview.md

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
2021-04-18 02:36:29 -03:00
gnembon 0e84ef5d65 Merge pull request #750 from replaceitem/display-title-additions
Added player_list option to display_title()
2021-04-18 01:36:49 -03:00
replaceitem eaa242c8eb Added option to only set footer, and clear both 2021-04-17 12:33:31 +02:00
replaceitem 53fc6fab9c Removed 'motd' 2021-04-17 11:47:53 +02:00
replaceitemandgnembon 794a80e4d4 update exception
Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
2021-04-17 11:42:02 +02:00
replaceitemandgnembon fad68163c2 player_list
Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
2021-04-17 11:41:33 +02:00