Commit Graph
90 Commits
Author SHA1 Message Date
gnembon f371e2e8bd 25w36b 2025-09-04 02:08:10 +02:00
gnembon ac72645cb4 fix potential crash. Fixes #2041 2025-02-26 22:20:57 +01:00
gnembon 1a7e8b6875 yeet most of tick 2023-10-25 17:06:53 +02:00
altrisi 2c01a98216 Remove fillLimit rule and its migration code
It has been replaced by the `commandModificationBlockLimit` gamerule
2023-10-22 15:12:28 +02:00
altrisi fedccb4d61 Remove onPlayerLoggedOut with one arg method
It's never been API and but it has even been deprecated for a while so
nothing should be using it
2023-07-28 21:01:39 +02:00
altrisi fbe37017c5 Refactor spawn reporting (#1519)
Not all that could be done for now
2023-07-28 20:57:48 +02:00
altrisi ac588c3e55 Add utility method to easily run code on all SettingsManagers (#1696) 2023-07-26 19:01:03 +02:00
gnembon c6f52b3293 retire static TickSpeed. Use Server and Client synchronization agents. 2023-05-17 21:20:00 +02:00
gnembon df786605c2 moar client-server tick speed separation 2023-05-16 10:35:40 +02:00
altrisi 4801534229 Sync fillLimit rule with the equivalent gamerule 2023-03-08 20:52:44 +01:00
gnembon 2ff1f4fb71 refactored nonscarpet references yeet 2023-02-11 01:33:23 +01:00
gnembon 75d94b0570 cleanup of scarpet dependencies 2023-02-08 21:13:14 +01:00
altrisi 6adccfd46a Some minor cleanup in CarpetServer
- Fully remove late registration handling
 - That removes the reference to the command dispatcher
- Fix displaced comment
- Simplify "don't mixin to register" checking
2023-01-25 18:05:32 +01:00
altrisi 914e129f6e Merge particle caches (#1528)
* Merge particle caches

* Reset this cache on world reload
2023-01-20 13:56:16 +01:00
gnembon f7d9f662fd yeet fabric, not needed, 1.19.3-pre1 2022-11-22 18:23:31 +01:00
altrisi e9f1509a1d Fix log spam on outdated extension SettingsManager 2022-09-28 10:57:09 +02:00
altrisi b0c94bcebe Remove unused CarpetServer.rand field
Resolves #1429.
2022-06-27 14:11:20 +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 8c2ded4c92 Simplify mod initializers and prevent extensions from mixing into Carpet just to register themselves (#1396) 2022-04-20 13:50:44 +02:00
gnembon 193cf3777f fixes for 22w11a 2022-03-17 23:57:42 +01:00
gnembon 302a7b4817 fixes for 22w11a 2022-03-17 20:21:55 +01:00
gnembon 3e419d1557 assuming fixes #1354 2022-03-07 23:06:35 +01:00
altrisi 69574468d9 Print a warning when an extension registers late (#1333) 2022-02-20 19:24:51 +01:00
altrisi 1f1e454445 Remove missed imports at CarpetServer 2022-01-26 11:43:56 +01:00
altrisi 06af9ce8b1 Migrate the Carpet codebase to Mojang Mappings 2022-01-24 20:33:16 +01:00
gnembon dc38cd272f Merge branch 'master' into 1.17
# Conflicts:
#	src/main/resources/carpet.mixins.json
2021-06-13 11:47:56 -03:00
altrisi 1a92531554 Compact fabric initialization code (#918) 2021-06-12 23:02:33 -03:00
gnembon a48a7df386 added perf command support 2021-06-06 10:32:22 -03:00
gnembon 15f7d52b4c server closing for SP is signalled too late. 2021-05-28 13:37:04 -03:00
gnembon f18cc1c836 more thread safe carpet globs 2021-05-25 17:24:14 -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
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