Commit Graph
1883 Commits
Author SHA1 Message Date
gnembon 7ee313134e Pulling in from empty list container returns null like for other containers. Fixes #660 2021-06-11 00:37:45 -03:00
gnembon 8297000b88 Fixes clingon messaging with broken argument lists. Fixes #638. 2021-06-11 00:20:09 -03:00
gnembon d30af7a993 1.4.40 2021-06-08 16:28:11 -03:00
gnembon 0308124f00 just to be clean 2021-06-01 03:53:48 -03:00
altrisi 8f5667c244 Fix Value detection in ValueConverter selection (#896) 2021-05-31 21:59:15 -03:00
gnembon 8d181823d4 1.4.39 2021-05-31 17:01:52 -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
gnembon bd689b418a prevent events to be called when script server is gone. 2021-05-28 13:50:50 -03:00
gnembon 15f7d52b4c server closing for SP is signalled too late. 2021-05-28 13:37:04 -03:00
gnembon 63901ebb0c 1.4.38 2021-05-27 14:30:36 -03:00
gnembon 328ded0537 added /script remove app command 2021-05-27 01:54:26 -03:00
gnembon f2e759130a make sure player names do not cause players to get disconnected 2021-05-25 20:10:47 -03:00
Fx Morin 90c6af82d2 Added Rule updateSuppressionBlock (#877)
Pull Request for https://github.com/fxmorin/UpdateSuppressionBlock
2021-05-25 17:33:41 -03:00
gnembon eb927f5e7c Merge branch 'master' of https://github.com/gnembon/fabric-carpet 2021-05-25 17:24:29 -03:00
gnembon f18cc1c836 more thread safe carpet globs 2021-05-25 17:24:14 -03:00
Keuinandgnembon 0cb20e0795 Allow /player spawn spawn offline-mode player in online server; Code clean-up in /player spawn command (#872)
* Clean up code in PlayerCommand.spawn and EntityPlayerMPFake.createFake.

* Update src/main/java/carpet/CarpetSettings.java

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

* Update src/main/java/carpet/patches/EntityPlayerMPFake.java

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
2021-05-25 13:21:59 -03:00
gnembon c3fe5d685b Merge pull request #884 from altrisi/annotated-block-locator
Implement `@Locator.Block`
2021-05-25 13:17:28 -03:00
gnembon 5d00709b1f fix for downloadable zip folders 2021-05-25 07:31:22 -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 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 1b39feaab7 wrap stream before closing zip files. 2021-05-23 14:00:49 -03:00
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
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
Ghoulboy 5f16ffd933 Adding /script download (#826)
This reverts commit e98adb77a52d1e274ec320e0cafab34b24c1c738.

* First attempt at creating download system...

* Last try, I had uncommitted changes which I forgot to add.

If it fails now i swear imma delete my fork of fabric carpet.

* OK, this is the last chance. I have checked and double checked, this should not fail.

Todo make them more detailed, Im not the best person to do that tbh...

* Towards a suggestion builder

(Also committing stuff in ScriptDownloader incase it crashes)

* Finished first theoretically functional draft of suggestion builder

* improving suggestion building with actual github api

* Collapsing identical error messages

* Got suggestions to work!

Now gotta get the actual file to save to disk properly

* replacing whitespace with url whitespace to make it read form 'creativ building tools' etc

* Successfully downloaded script into folder location!

* only clients can access global scripts folder, so don't want to cause error message

* Compacting code and updating docs

* Fixed getting folders from file names
2021-05-19 17:30:39 -03:00
gnembon f56b22be6a 1.4.37 2021-05-19 18:19:06 -03:00
gnembon edc90133b2 fix run position, fixes #866 2021-05-18 21:18:53 -03:00
Ghoulboyandgnembon 7536edc2b9 Adding Javadocs to CounterCommand.java and relevant files (#838)
* adding class javadoc

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
2021-05-17 19:32:57 -03:00
gnembon 7380580a3e fixes #864 2021-05-17 22:20:32 -03:00
altrisi be0635de82 Use primitive specific Predicates instead of Function (#859) 2021-05-15 18:54:16 -03:00