Commit Graph
60 Commits
Author SHA1 Message Date
gnembon fb4c40c951 separated properly client disconnect from server shutdown allowing for retaining carpet settings till world is gone. Fixes #854 2021-05-22 22:14:16 -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 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
gnembon d6d3167bcf hopper counters pretty 2021-04-15 03:06:32 -03:00
gnembon 0a45778e4a scarpet and carpet close handler now triggers with players still online in SP 2021-02-08 18:06:49 -04:00
ramidzkh 566d2a7bca Use WorldRenderEvents if available (#680)
* Use WorldRenderEvents if available

Fixes an issue when Canvas is installed

* Improve code

* Depend only on fabric-rendering-v1

* Use fabricApi.module
2021-01-26 01:19:44 -04:00
altrisi 33347baaf7 Freezing Scarpet
And the client
2020-12-21 00:14:20 +01:00
gnembon 522d971688 added startup and shutdown events. fixes #586 2020-12-07 01:11:55 -04:00
gnembon d29f49967f rework of the event system, allowing apps to function more independently and allowing for player scoped apps to handle global events. fixes #596 2020-12-02 01:02:36 -04: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 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
gnembon 0e21942df7 Merge branch 'master' into 1.16 2020-07-13 00:41:34 -03:00
gnembon 3140a4fe53 Callback for extensions to contribute information to HUD loggers. 2020-07-12 22:34:10 -03:00
gnembon 86c3b001ca Merge branch 'master' into 1.16 2020-06-20 23:44:12 -03:00
gnembon be7d7ed46e moving loading of scripts to after worlds are loaded, fixes #331 2020-06-20 23:29:50 -03:00
gnembon 838ed4748d last remnants of dim issues, fixes #336 2020-06-20 22:11:00 -03:00
gnembon f29153c3d2 Merge branch 'master' into 1.16
# Conflicts:
#	src/main/java/carpet/CarpetSettings.java
#	src/main/java/carpet/script/CarpetScriptServer.java
#	src/main/java/carpet/script/bundled/Module.java
2020-06-07 01:59:15 -03:00
gnembon b3484fd012 fixed missing client side server references. fixes #311 2020-06-06 20:39:25 -03:00
gnembon c5841408a6 extensions trigger for resource reload. Apps will reload upon reload 2020-06-05 23:23:47 -03:00
gnembon d6845487ce changes in 1.16 require to re-register commands after datapack reload. May affect extensions with custom CMs - doubt there is any. 2020-06-02 21:05:44 -03:00
gnembon 1c46393c4d Merge branch 'master' into 1.16
# Conflicts:
#	src/main/java/carpet/utils/Messenger.java
2020-05-31 02:54:14 -03:00
gnembon e540f9e238 carpet client synchronizations and protocols 2020-05-28 00:06:28 -03:00
DeadlyMC 2522884da3 Client-server syncing (#295)
* Sync carpet settings

* Sync tick rate
2020-05-27 16:23:52 -03:00
gnembon 70350d7dca bye bye to /c /s due to F3F4 and change in F3+N to mimic exactly /c /s usecase 2020-05-27 02:05:46 -03:00
gnembon 291268c14f reset tick rate when changing worlds in SP 2020-04-27 18:05:08 -03:00
gnembon fe63334509 enabled some client side command interpretation. 2020-03-30 17:14:16 -03:00
DeadlyMC 6c0653e477 register carpet test command only in dev 2020-03-25 16:57:35 +05:30
gnembon c0e72fe669 extra npe when world fails to load anyways. 2020-03-15 02:41:06 -03:00
gnembon 72a7bed11a fixed logger issues #156 and #155 2020-02-23 02:25:51 -04:00
gnembon 85a34fdefa added profile command 2020-02-06 09:33:46 -04:00
gnembon 6ac249968a remove a few warnings 2020-01-06 21:26:44 -04:00
gnembon f9b51ef141 extremeBehaviours 2019-12-11 00:30:46 -04:00
gnembon 55065a38a6 moved CarpetSettings up from settings manager, should be easier to find later. 2019-12-10 23:08:40 -04:00
gnembon 8b1286f8af fixed missed command registration for extension, 1.3.0, added optional version. 2019-12-10 23:01:30 -04:00
gnembon 6524725245 fixes to scarpet 1.5 2019-10-15 09:37:50 -03:00
gnembon 701a717135 reworked container access (never throw, multi-field access, return values, operator), added package storage 2019-10-13 02:54:18 -03:00
gnembon 65d2208e9e loggers can now be configured to start with different default configurations. 2019-09-27 08:34:43 -05:00
gnembon b89bb3e503 added rule autoloadScripts to load scripts at startup. 2019-09-17 14:21:36 -03:00
gnembon 3c96345a60 tracking and tracing 2019-07-20 18:53:17 -03:00
gnembon 17a23f14dd onclosed 2019-07-17 22:36:56 -03:00
gnembon 4c031ba2ef mark chunks for resend 2019-07-09 16:51:18 -03:00
gnembon 800b26bf18 portal suffocation and antiCheat disabled. 2019-07-07 18:52:56 -03:00
gnembon 76334f9a68 missing tools and motd fixed 2019-07-06 02:22:00 -03:00
gnembon 54f1d62192 better 2019-07-04 09:30:15 -03:00
gnembon 95d556a978 rule management and extensibility 2019-07-04 01:54:13 -03:00
gnembon 9bbaaccb3e freekin egyptian braces 2019-06-12 01:03:34 -03:00
gnembon 734dc95dab settings ported to the annotation based system 2019-06-11 23:01:09 -03:00
gnembon 92f40c36b8 settings system 2019-06-11 02:08:50 -03:00