Commit Graph
78 Commits
Author SHA1 Message Date
altrisi cd50919a90 Filter script download suggestions according to player input (#958) 2021-06-27 22:33:13 -03:00
altrisi 7975ab65cd A bit more nio and log IO errors (#920)
* A bit more nio and log IO errors

* Use Scarpet logger
2021-06-19 11:59:56 -03:00
altrisi 1a92531554 Compact fabric initialization code (#918) 2021-06-12 23:02:33 -03:00
altrisi 8f5667c244 Fix Value detection in ValueConverter selection (#896) 2021-05-31 21:59:15 -03:00
altrisi d3c3c8e157 Add a crash report section for Scarpet apps (#892) 2021-05-31 15:53:00 -03:00
altrisi b359c6c76c Implement @Locator.Function and @Locator.Vec3d (#891)
* Implemente `@Locator.Function`

* Implement `@Locator.Vec3d`

* Small import cleanup

* Javadoc
2021-05-31 15:51:10 -03:00
altrisi adee06ad3f Mention custom converters in Param javadoc, make a few things final and remove commented out LazyValue provider 2021-05-24 14:51:14 +02:00
altrisi aeba4520d4 Fix missing type in javadoc of @Locator.Block 2021-05-24 14:18:33 +02:00
altrisi ca1828d797 Allow more parameter types in @Locator.Block 2021-05-24 14:14:03 +02:00
altrisi 7f2cb0f4a7 Implement @Locator.Block 2021-05-24 13:04:51 +02:00
altrisi 05ff870d0b Allow static methods for Scarpet Functions
What was I thinking?
2021-05-24 12:40:20 +02:00
altrisi 2b3f376871 Replace usages of deprecated ListValue::fromItemStack and remove it 2021-05-24 12:00:55 +02:00
altrisi 9d9844fd5d Deprecate old boolean constructor and move existing usages 2021-05-24 11:41:24 +02:00
altrisi f34503aa3c Use primitive doubles and allow decimal exhaustion 2021-05-24 11:21:39 +02: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
altrisi be0635de82 Use primitive specific Predicates instead of Function (#859) 2021-05-15 18:54:16 -03:00
altrisi 69e9e9b0bb Remove the number_classes set in favour of ClassUtils (#860) 2021-05-15 18:53:50 -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
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
altrisi 5247bb15a8 Inherit an exception's constructor 2021-04-06 22:33:26 +02:00
altrisi a3acaed466 Make command stacktrace mixin not required 2021-03-15 20:41:56 +01:00
altrisi 36eccbc2df Fix javadoc 2021-03-08 00:13:30 +01:00
altrisi 8a1c9f2d0b Fix symbolic links (#754) 2021-03-07 17:16:20 -04:00
altrisi b123899abd Fix run() with a locked SettingsManager (#755)
* Fix run() in locked SettingsManager

* Fix small security issue while I'm at it

* Notify command change
2021-03-07 17:14:35 -04:00
altrisi 44101ddd3d Undeprecate and filter to user-defined 2021-03-02 14:26:05 +01:00
altrisi 8c517aad91 Remove jcenter from settings.gradle 2021-02-21 15:57:45 +01:00
altrisi eb7bb70586 Implement query(e,'fire') 2021-02-21 12:38:25 +01:00
altrisi 7b1c58d81e Minor docs and visibility changes for exceptions 2021-02-21 12:34:44 +01:00
altrisi ae70529f20 Mention error in docs 2021-02-21 02:50:49 +01:00
altrisi 516de37dd2 Deprecate try without id and therefore throw without id 2021-02-21 02:23:06 +01:00
altrisi 0b86ac1a87 Add multi-catch to try block 2021-02-21 01:52:55 +01:00
altrisi 86dabe0080 Add exception hierarchy 2021-02-21 00:57:37 +01:00
altrisi a155494d11 Allow some exceptions to be handled 2021-02-19 19:54:41 +01:00
altrisi 4807e4d518 Fix rules-to-wiki and generalize some code for extension's equivalents (#696)
* Fix rules-to-wiki output

* Publicize OLD_OUT in RulePrinter to simplify extension's equivalents

And rename to CarpetRulePrinter because of the same reason
2021-02-08 23:52:49 -04:00
altrisi a83548876a Extra handling of null values (part 1) (#684) 2021-01-26 01:16:48 -04:00
altrisi ecbd7f1dd7 Fix NbtIo crash when loading appdata 2021-01-14 20:40:31 +01:00
altrisi 8bd6bd8343 Add release-curse-versions field to properties 2021-01-14 04:28:52 +01:00
altrisi 2e64ba9527 Allow custom CF versions in main branch 2021-01-14 04:25:40 +01:00
altrisi 9eea3b47a6 Actually return those lists 2021-01-14 03:08:33 +01:00
altrisi 852139d936 Make split split lists in list of single elements list without delimiter 2021-01-14 02:58:05 +01:00
altrisi 0563590fe7 Document new split functions 2021-01-11 19:53:43 +01:00
altrisi 49ffa4f109 Add new split functions 2021-01-11 19:46:39 +01:00
altrisi cdaf17ea1e JSON support tweaks 2021-01-05 02:42:02 +01:00
altrisi 706d632956 Also freeze shapes 2021-01-03 23:55:47 +01:00
altrisi 7e35877825 Save maven artifacts in the action
So they don't have to be built locally again
2021-01-02 13:23:29 +01:00
altrisi ffeee1fa9d Freeze schedules too 2021-01-02 12:57:45 +01:00
altrisi 96244dc4e2 Update Gradle and reintroduce automatic JSON version 2020-12-30 14:20:19 +01:00
altrisi 6e19c8a224 Add gradle.properties entries 2020-12-29 20:46:02 +01:00
altrisi 1d0301e44c Delete rules-to-wiki.yml 2020-12-29 17:12:39 +01:00
altrisi 5aa9c4c4b2 Delete merge-docs.yml 2020-12-29 17:12:24 +01:00
altrisi 761c1856e7 Add Publish Release Action
After over 40 iterations, it's here!
2020-12-29 17:11:56 +01:00
altrisi e38e8f74ea Better javadoc for #deeplyFrozen() 2020-12-29 16:17:59 +01:00
altrisi 6d3ac93e4c Use setters and getters for frozen state, separate superHot and
don't tick regular tick events
2020-12-29 16:00:07 +01:00
altrisi 2e19f24405 Add docs for JSON 2020-12-27 16:10:59 +01:00
altrisi 929c17da36 Fix Value mess 2020-12-27 15:53:44 +01:00
altrisi aabff1623b Reading/Writing JSON, first working version 2020-12-27 02:04:19 +01:00
altrisi 33347baaf7 Freezing Scarpet
And the client
2020-12-21 00:14:20 +01:00
altrisi a81b549360 Move FormattedText addition into a combined function 2020-12-15 10:00:09 +01:00
altrisi 6dfd64027d Add FormattedText functionality to the right of the operand 2020-12-14 19:20:21 +01:00
altrisi 7b77fb0853 Add FormattedText addition 2020-12-14 18:36:24 +01:00
altrisi bf9aa3207a Fix optimizedTNT entity behaviour (#617)
Fixes gnembon#616
2020-12-07 17:30:04 -04:00
altrisi 5dfd956ba2 Only allow globals in clients, fix potential issue and mention in docs 2020-11-29 21:45:53 +01:00
altrisi a0528ca7ed Add a way to load global configs 2020-11-29 17:34:31 +01:00
altrisi 210ad834f6 Allow loading apps from a global path 2020-11-29 15:49:28 +01:00
altrisi 29dfae0e57 Fix being unable to identify own manager 2020-11-29 03:45:03 +01:00
altrisi b4ac2c85e4 Reimplement extension sync according to suggestions 2020-11-29 02:51:01 +01:00
altrisi ce0cca4005 [Scarpet] Add display_title function (#555) 2020-11-28 21:40:16 -04:00
altrisi 39bfb51992 The tabs to spaces... yet again 2020-11-22 12:22:56 +01:00
altrisi 5bb6862a53 Make extension's rules get properly synced with clients 2020-11-22 12:07:07 +01:00
altrisiandgnembon ba1071a8d1 Javadocs, cleanup, extension's client rules, built-in BundledModules generators, etc (#544)
* Add javadocs to many methods

* Added built-in ways to generate BundledModules and documented them

* Add Eclipse launch files to .gitignore and fix 11 warnings

* Remove many unused imports

* Remove some dead and unused code around app loading

* Allow extensions to have client-side rules in their SettingsManager

Also change tabs to spaces when those changed

* Remove unnecessary classloader param in BundledModule

* Change max tickwarp duration to Integer.MAX_VALUE

* Move RulePrinter into the source so it can be managed by the IDE

* Properly reset hopperCounters when changing worlds

Also change tabs to spaces again and minor tweaks to javadocs

* Run mergedocs even if Full.md was modified

* Update src/main/java/carpet/commands/TickCommand.java

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
2020-11-16 09:30:59 -04:00
altrisi b9eee6e58b Allow rules to manage Scarpet apps (Scarpet Rules) (#519)
by altrisi
2020-11-02 21:52:21 -04:00
altrisi 9672e16241 Only run mergedocs in master 2020-10-31 15:08:56 +01:00
altrisi 2b4a381221 Add rotation to all instances of PillarBlock
Logs, hay bales, actual pillars, etc
2020-10-27 22:48:26 +01:00
altrisi 82a77f4ba8 Make rules-to-wiki Gradle 6 compatible 2020-10-25 12:48:56 +01:00
altrisi 286fdd9899 Fix merge-docs failing if nothing new to merge 2020-10-25 12:45:16 +01:00
altrisi d8009a3719 Add GitHub Actions (#496)
* Add Github actions

Using bot's mail looks better in the wiki, since in main page it shows the pusher name but in the revisions tab it shows the bot.

Allow failure is to prevent the commit appearing with a cross just because the wiki didn't change. It can probably also be fixed in the command part, but does the same

* Rules-to-wiki 1.0
2020-10-22 17:04:27 -03:00
altrisi 020866c0e9 Change load method to Loader's entrypoints (#497)
* Start moving away from noop mixins

Remove the mixin from the json list

* Change startup method to Loader entrypoints
2020-10-15 22:15:20 -03:00