Commit Graph
100 Commits
Author SHA1 Message Date
altrisi c2788f0f85 Allow modded structures in overlay's structure renderer (#1504) 2022-07-21 15:12:58 +02:00
altrisi 5a4ceb68c6 Fix language fallbacks for rules not being available early
Fixes #1483
2022-07-07 11:45:37 +02:00
altrisi ee4bc332e3 Remove catchall in action pack update
Resolves #1446.
2022-06-27 14:30:34 +02:00
altrisi b0c94bcebe Remove unused CarpetServer.rand field
Resolves #1429.
2022-06-27 14:11:20 +02:00
altrisi 41991b0346 Improve error message when commands fail to be added and make commands using the new system check for masking (#1404)
* Improve error message when command already exists

* Add app's name to the message

* Add app name to any command load failure and fix commands from new system masking existing ones

* Fix duplicated app name in an error

* Update to recent snapshot changes
2022-06-27 14:09:03 +02:00
altrisi 0a972d6c56 Settings rework and encapsulation (#1330)
* Settings rework and encapsulation

* Settings overhaul 3

Move everything in the new system to a new API package

Require rules using the new system to specify descriptions in their translation files

Implement temporary system on top of current translations to allow that to work properly

* Fix getRules fallback

* Final touches to settings refactor

* Mention that set shouldn't throw and remove comment

* Change translation keys to unify with translation PR

* Deprecate printAllRulesToLog to allow using any PrintStream

* Remove restriction of CarpetRules being Comparable

And fix overreaction in a deprecation message

* Bring back user input to rule observers

* Make Validator deprecation warning not spam on use

* Remove unneeded abstract methods in CarpetRule already inherited from CarpetRule

They literally do nothing, don't even force them to be implemented, and may be confusing as to why they're there or as if they are needed to be implemented

* Fix legacy SettingsManager field not being assigned correctly

* Finish fixing conflicts from future merge

* Actually fix remaining conflicts from future merge (missing imports)

* Import the newer rule in SettingsManager

* Refactor Validators

* Don't spam deprecation warnings on custom managers

* Get out the var

* Fix missing warning in old rule observers

* Update src/main/java/carpet/api/settings/Rule.java

* Remove `@ApiStatus.Experimental` annotations

* Fix incorrect `@deprecated` javadoc tags

By removing them given the class is deprecated anyway and else there's too much noise

* Add missing static import

* Remove TypedField and use a regular field

I liked that class tbh, but it's true that it wasn't really needed

* Move `field` assignment out of for removal

* Fix not following contract of `type()` returning boxed value

Previously handled by TypedField

* Fix few incorrect translation keys

* Remove resaving of comments when saving config files

Comments ignoring is still a thing when reading, so `locked` configs for example will keep comments

* Condense rule load messages in one

* Only print loaded settings message when at least one setting was changed

* Fix legacy validator detector

* Tweak and add more context to response to invalid values

* Fix strict validator not actually erroring on invalid input
2022-06-27 13:12:15 +02:00
altrisi 140cb15b53 Make newline in release message using zero-width character
(​)
2022-06-01 22:37:39 +02:00
altrisiandCrec0 c10149ba55 Publish changelogs to Discord when releasing (#1428)
Co-authored-by: Crec0 <83436716+Crec0@users.noreply.github.com>
2022-05-28 13:07:08 +02:00
altrisi d088ee477e Set mixin compatibility level to Java 17 2022-05-27 19:44:39 +02:00
altrisi f18cfb09d2 Fix more warnings and do some small optimizations (#1356)
* Fix more warnings and do some small optimizations

* Fix more warnings in ValueConversions

* Clean up some decompiler names and fix an unnecessary transformation around commands

* Use (way) more compact data structure for slot map

* Minor tweaks
Such as map directly in the collector

* I hate vanilla javac
Revert map changes in latest commit
2022-05-27 19:43:45 +02:00
altrisi e4dc080657 Bump Loader requirement in fabric.mod.json too 2022-05-24 15:26:31 +02:00
altrisi 08a65902f5 Remove updateSuppressionCrashFix and related logger (#1445) 2022-05-20 20:10:32 +02:00
altrisi bbe770184e Autogenerate refmap field in mixins json and remove empty server field
Not explicitly specifying the refmap here also removes the log entry in dev environments where Mixin complains about missing refmap.
2022-05-17 22:06:49 +02:00
altrisi 668f309f23 Change missed usage of deprecated methods from #1383 2022-05-17 21:55:22 +02:00
altrisi a60bc386cb Refactor Module into a single record type and fix system globals (#1383) 2022-05-17 20:11:49 +02:00
altrisi 4662a86121 Delete unused BiomeArrayInterface 2022-04-29 20:16:03 +02:00
altrisi 6111dece61 Ease concrete restrictions on Annotated Scarpet API and make instantiating lazy
Prevents instantiating classes with all annotated methods static, making it also more flexible in that you can put annotated functions near to other API that may be initialized
2022-04-24 13:40:09 +02:00
altrisi aafb7406fc Refactor BlockRotator (#1362)
- Removes the unused accurate block placement protocol that has been dead there for ages
- Removes the various rotate clockwise methods in favour of Direction's, that did exactly the same

No behaviour changes
2022-04-24 13:30:55 +02:00
altrisi c1141ddede Fix latest commit about publishing, forgot a few blocks... 2022-04-21 18:02:22 +02:00
altrisi 91fbb44ccb Fix publishing warn, go back to loom 0.11 as 0.12 is not yet recommended
See https://github.com/FabricMC/fabric-example-mod/commit/8adede095a379f0f18984d1ec2b4a46a4b5d29a7
2022-04-21 18:00:22 +02:00
altrisi b2cb70c133 Remove cotton maven given lQF is now on the Gradle plugin portal (#1420)
* Bump QuilfFlower version

* Remove cotton maven given loom QuiltFlower is now in the Gradle plugin portal
2022-04-20 14:57:50 +02:00
altrisi 8c2ded4c92 Simplify mod initializers and prevent extensions from mixing into Carpet just to register themselves (#1396) 2022-04-20 13:50:44 +02:00
altrisi 83b0fb1f4d Show local type in exception hover tooltips (#1397) 2022-04-20 13:29:31 +02:00
altrisi 80a5342776 Make scarpet internal and control flow exceptions stackless (#1392) 2022-04-20 13:27:25 +02:00
altrisi 76861479e0 Add support for formatted names in create_marker (#1413) 2022-04-20 13:01:58 +02:00
altrisi b6fa6579ae Highlight scarpet files with github's highlighter for python (#1407) 2022-04-15 19:39:07 +02:00
altrisi f590e9d109 Fix latest commit 2022-04-11 12:59:51 +02:00
altrisi 96bb1072c4 Remove chest boat from living entities
Fixes #1405.
2022-04-11 12:51:55 +02:00
altrisi 6ebef9b41d Simplify cache in action workflows (#1359)
* Simplify `build-on-pr` workflow

* Simplify `devbuild` workflow

* Simplify `publish-release` action
2022-04-04 10:28:08 +02:00
altrisi 330fd6f466 Make desertShrubs check for waterlogged blocks instead of just water blocks (#1388) 2022-04-03 13:06:29 +02:00
altrisi 1f0c609dc0 Remove log4j as much as possible (#1334) 2022-02-22 01:35:56 +01:00
altrisi 69574468d9 Print a warning when an extension registers late (#1333) 2022-02-20 19:24:51 +01:00
altrisi b1c934da28 Fix a few IDE warnings (#1345) 2022-02-20 19:16:12 +01:00
altrisi e011f65e75 Fix unhandled exceptions when evaluating operators (#1344) 2022-02-20 19:15:54 +01:00
altrisi 53f456320c Implement missing method in BlockValue.PlacementContext to fix exceptions in place_item (#1329) 2022-02-16 00:03:44 +01:00
altrisi d57323e14f Fix stay_loaded being false in apps with no config (#1295) 2022-01-30 19:01:21 +01:00
altrisi 50c70de7e5 Improve Annotated Scarpet runtime performance (#1273)
- Change valueConverters list to array

- Remove references to `Class.cast` and use direct casts instead
2022-01-29 23:44:50 +01:00
altrisi d2c159e59c Update to loom 0.11 to fix all issues with synthetics 2022-01-26 14:03:34 +01:00
altrisi 1af1b75dba So it turns out one mixin already was BE instead of TE
Therefore reverted it to BE again
2022-01-26 12:25:25 +01:00
altrisi a09981e807 Revert missed @Desc annotation
Those are not yet remapped on dev environment dependencies, making mods that depend on Carpet not be able to load in dev with different mappings
2022-01-26 12:16:35 +01:00
altrisi 1f1e454445 Remove missed imports at CarpetServer 2022-01-26 11:43:56 +01:00
altrisi 3b14f9d325 Revert missed Movable TE changes 2022-01-26 11:28:25 +01:00
altrisi 06af9ce8b1 Migrate the Carpet codebase to Mojang Mappings 2022-01-24 20:33:16 +01:00
altrisi ec47dea267 Make fake players compatible with adventure platform lib and minor refactor around them (#1235)
* Make fake players compatible with adventure platform and minor refactor around them

Cleaner approach

* Remove no longer needed enderpearl mixin for fake players

Their ClientConnection now has an open channel so isOpen returns true
2022-01-19 21:28:36 +01:00
altrisi 8a278e46de Fix deprecated last_tick_times (#1265) 2022-01-09 00:08:55 +01:00
altrisi 34e32973fa Use Fabric's newly exposed version APIs for app requirement parsing, expand it to allow wildcards and change load stopping to be a special exception (#1252) 2022-01-08 23:26:14 +01:00
altrisi 212b6a792e Remove a few no longer needed mixins (#1243) 2022-01-08 23:18:13 +01:00
altrisi 763abe68c9 Support more actions in Messenger (and therefore format()) (#1242)
* Support more actions in Messenger (and therefore `format()`)

* Add the new actions to docs

* New `format()` docs fixes
2022-01-08 23:16:06 +01:00
altrisi 8f265f4e52 Improve performance of player() related methods (#1240) 2022-01-08 23:11:10 +01:00
altrisi 9fb6ec91cb Minor improvements to scarpet annotation API (#1239) 2022-01-08 23:05:21 +01:00
altrisi 212eb07131 Give feedback when stepping ticks (#1234) 2022-01-08 21:12:23 +01:00
altrisi f2989d51fd Improve CarpetExpressionException error messages (#1230) 2022-01-08 21:09:15 +01:00
altrisi de305f4284 Allow apps to retrieve information about the source (#1229)
* Give information about the sources

* Document source related system_info properties
2022-01-08 21:08:26 +01:00
altrisi d8c10c6e4a Complete removal of /info entity, it's correspondent carpet and two small changes (#1047)
* Remove no longer needed language packet mixin

* Make StringArgument properly return a StringArgument supplier, so `string` isn't `term`

Fixes gnembon/fabric-carpet#1044

* Complete removal of `/info entity` and it's correspondent carpet

Resolves gnembon/fabric-carpet#1033

* Remove yet another no longer needed mixin
2021-11-27 17:43:39 +01:00
altrisi 047fdc6ada Wrap value stringifying into a try-catch block 2021-11-06 20:34:18 +01:00
altrisi 506457d878 Fix Stack Overflow in dev environment with mojmap (#1134) 2021-10-20 23:06:19 -03:00
altrisi 0910bc8779 Add badges and icons to readme (#1128) 2021-10-12 23:01:16 -03:00
altrisi 7486670918 Report stack traces through the logger (#1050) 2021-10-11 03:37:30 -03:00
altrisi d034b8945a Move some functions into system_info (#1084)
* Move some functions into `system_info`

* Add docs for new `system_info()` properties
2021-10-05 21:21:29 -03:00
altrisi eafca1c5b3 Use player.interactionManager.tryBreakBlock instead of a copy to be more compatible (#1087) 2021-09-06 23:14:33 -03:00
altrisi 19c1924a26 Fix x motion being applied to y (#1089) 2021-09-03 22:48:28 -03:00
altrisi de28982646 Make ErrorSnooper report local's values 2021-08-31 14:12:05 +02:00
altrisi 7fb5e47da5 Use newer Java features in places where it makes sense and more (#1009) 2021-08-03 07:32:40 -03:00
altrisi 2a391962ff Remove no longer needed Mixins (#1030) 2021-07-26 09:20:01 -03:00
altrisi 7ebc990ef6 Use pattern matching for instanceof (#1019) 2021-07-21 22:24:24 -03:00
altrisi cca9d2ec7e Provide script download suggestions async (#986) 2021-07-11 07:43:11 -03:00
altrisi 97e69d347e Change how resource type works, allow proper app and library installation (#956)
* Change how app store types work, allow proper app and library installation

* Add node for resources in dependencies and docs

* Fix NPE without `type`

* Fix docs trying to change location of app type resource

* Separate libraries and apps and add trash for them

* Update docs

* Create trash directory if it doesn't exist
2021-06-30 12:42:24 -03:00
altrisi d92b412c0a Document entities argument type (#968) 2021-06-30 12:30:55 -03:00
altrisi 8613ecf9d8 Fix creativeFlyDrag and creativeFlySpeed not loading from config (#969) 2021-06-30 12:29:59 -03:00
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