Commit Graph
1482 Commits
Author SHA1 Message Date
gnembon d6bde212e2 Merge branch 'master' into 1.17 2021-05-25 07:45:58 -03:00
gnembon 5d00709b1f fix for downloadable zip folders 2021-05-25 07:31:22 -03:00
gnembon c720c2c935 Merge branch 'master' into 1.17
# Conflicts:
#	src/main/java/carpet/script/api/Auxiliary.java
#	src/main/java/carpet/script/utils/ShapeDispatcher.java
#	src/main/java/carpet/script/value/EntityValue.java
#	src/main/java/carpet/script/value/ListValue.java
2021-05-25 01:08:32 -03:00
gnembon 0df2b30a00 Merge pull request #883 from altrisi/annotated-edits
Allow static methods for Scarpet Functions
2021-05-25 00:51:28 -03:00
gnembon 7b4176f717 Merge pull request #882 from altrisi/not-fromItemStack
Replace usages of deprecated ListValue::fromItemStack and remove it
2021-05-25 00:50:53 -03:00
gnembon c60167405d Merge pull request #881 from altrisi/deprecate-old-booleans
Deprecate old boolean constructor and move existing usages
2021-05-25 00:50:11 -03:00
gnembon 5331d9810a Merge pull request #880 from altrisi/primitives-and-exhaustion
Use primitive doubles in `NumericValue` and allow adding exhaustion with floats
2021-05-25 00:47:26 -03:00
gnembon cab37358ed Merge branch 'master' into 1.17 2021-05-25 00:41:29 -03:00
gnembon db9039c02a added app resources for apps from appstores 2021-05-25 00:41:06 -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
gnembon 93b8d98a79 Merge branch 'master' into 1.17 2021-05-23 14:01:18 -03:00
gnembon 1b39feaab7 wrap stream before closing zip files. 2021-05-23 14:00:49 -03:00
gnembon 95d8c5fd90 Merge branch 'master' into 1.17 2021-05-22 22:14:43 -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 74cc9a39e1 Merge branch 'master' into 1.17 2021-05-21 14:14:18 -03:00
gnembon 79fb489ab7 renames 2021-05-21 14:13:50 -03:00
gnembon 1b49bfe21f updates 2021-05-21 04:45:23 -03:00
gnembon 84dd972758 Merge branch 'master' into 1.17 2021-05-21 04:42:21 -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 b80b555781 Merge branch 'master' into 1.17
# Conflicts:
#	src/main/java/carpet/script/utils/SnoopyCommandSource.java
#	src/main/java/carpet/utils/WoolTool.java
2021-05-18 21:23:15 -03:00
gnembon edc90133b2 fix run position, fixes #866 2021-05-18 21:18:53 -03:00
gnembon f67d50d3d3 Merge branch 'master' into 1.17 2021-05-17 22:23:16 -03:00
altrisi be0635de82 Use primitive specific Predicates instead of Function (#859) 2021-05-15 18:54:16 -03:00
gnembon 3d25daee1f Merge branch 'master' into 1.17 2021-05-14 03:36:24 -03:00
gnembon fd492f334c moved exception handler, fixes #861 2021-05-14 03:34:19 -03:00
gnembon fb40120460 cluenap 2021-05-13 02:00:05 -03:00
gnembon 65447f09ad Merge branch 'master' into 1.17
# Conflicts:
#	src/main/java/carpet/helpers/FeatureGenerator.java
2021-05-13 01:52:08 -03:00
gnembon a522e2ae37 fixed changed behaviour under java 16 2021-05-13 01:51:01 -03:00
gnembon 727bdd7b1a 21w19a 2021-05-12 23:40:09 -03:00
gnembon c9ff5fea34 snapshot 2021-05-12 12:12:33 -03:00
gnembon 407c117c29 Merge branch 'master' into 1.17 2021-05-10 01:50:09 -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 5ac22aa000 mapping 2021-05-05 01:50:04 -03:00
gnembon e4ebeda1d0 mapping 2021-05-05 01:44:05 -03:00
gnembon 820c9b6489 Merge branch 'master' into 1.17 2021-05-05 01:31:00 -03:00