Commit Graph
238 Commits
Author SHA1 Message Date
replaceitem 24b9c386ec [Scarpet] Added ability to cancel events (#1497)
* Added ability to cancel events

* Made more events cancellable

* Added event_priority to __config

* Check for string values for performance

* Made player_finishes_using_item cancellable

* Made player_chooses_recipe cancellable

* Made player_swaps_hands cancellable

* Made player_message cancellable

* Added __on_player_placing_block (#1498)

* Added event to docs, keywords, event_test

* Added docs for event cancellation
2022-10-15 13:30:53 +02:00
gnembon c6b1f53b44 shapes 'facing' now defaults to player and player is correctly rendered facing player face, not camera plane. 2022-10-15 12:49:18 +02:00
Sensei 059fda49a4 Make client net handling run on main thread 2022-10-10 20:30:25 +02:00
gnembon 36aff8f9d3 cleanup and tilt-lean fixes for new shapes 2022-09-12 02:08:43 +02:00
ch-yx 179f5a6006 adding a shape that can display a item or a block (#1365)
added 'polygon', 'item' and 'block' to scarpet rendered shapes
2022-09-12 00:38:52 +02:00
altrisi 2a4d678aa7 Remove the last few File usages
Barring one, given I've heard in hot code `Files.exists()` is slower than toFile().exists() if in the default `FileSystem`
2022-08-28 18:34:39 +02:00
altrisi c6941b840f Map from id in system_info('server_mods') 2022-08-19 07:32:46 +02:00
altrisi 97c4cc9c7d Simplify threading and networking in download suggester (#1512)
* Simplify threading in download suggester
This also makes it more robust against race conditions

* Simplify network requests around app store
2022-07-25 21:59:50 +02:00
altrisi c08d857821 Don't refresh local app store repo on world change
Relates to #1508.
2022-07-23 23:56:13 +02:00
gnembon 6d3c4fa508 1.19.1-rc2 2022-07-22 18:25:43 +02:00
gnembon 544857d323 1.19.1-pre4 2022-07-14 00:57:49 +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 a60bc386cb Refactor Module into a single record type and fix system globals (#1383) 2022-05-17 20:11:49 +02:00
gnembon 217567c037 22w18a 2022-05-04 21:34:22 +02:00
gnembon 746c8548e9 22w16b with massive Component changes 2022-04-21 00:26:39 +02:00
gnembon 812d361af2 22w14a 2022-04-06 22:16:05 +02:00
gnembon 79f994f2da enable_hidden_dimensions is ded :( 2022-03-30 07:52:44 +02:00
gnembon 842370f68d Merge branch 'master' into future
# Conflicts:
#	src/main/java/carpet/script/api/Auxiliary.java
2022-03-30 07:49:07 +02:00
gnembon c33c53c8c2 enable_hidden_dimensions is ded :( 2022-03-30 07:44:37 +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
altrisi b1c934da28 Fix a few IDE warnings (#1345) 2022-02-20 19:16:12 +01:00
gnembon c01ad9ce9d 1.18.2-pre 2022-02-20 01:50:46 +01:00
gnembon fa1e6ce086 22w07a
- disabled "sample_noise"
2022-02-16 22:23:52 +01:00
gnembon aaea11d82d removed ability to query for entire system_info in one go. 2022-02-16 00:25:35 +01:00
gnembon 212814f46d 22w06a 2022-02-10 03:15:53 +01:00
gnembon ac7da0c2ca 22w05a 2022-02-02 19:55:54 +01:00
gnembon 82bdd5e61c Merge pull request #1292 from FieryRobot/ScriptDownloadFix
Always reset the app store root in the validator (#1275).
2022-01-29 23:11:45 +01:00
Ed Voas e4cb807899 Always reset the app store root in the validator (#1275).
The validator used to clear the sealed flag and the children in the validator. But it did not clear the count down latch. This led to a situation where we would throw an IOException from fillChildren because we did have the latch, but it was zero, and the sealed flag was cleared. This simply resets the node every time, which I think is the safest solution as setting the childrenProgress to null in the validator might end poorly if someone was waiting on it. Another solution was to just remove the throw inside fillChildren. This felt like the cleanest solution.
2022-01-25 18:26:50 -08:00
altrisi 06af9ce8b1 Migrate the Carpet codebase to Mojang Mappings 2022-01-24 20:33:16 +01:00
gnembon 77f8d2cbd7 update issues 2022-01-11 23:57:50 +01:00
gnembon 529a5b358d Merge branch 'master' into future
# Conflicts:
#	gradle.properties
#	src/main/java/carpet/script/annotation/AnnotationParser.java
#	src/main/java/carpet/script/utils/BiomeInfo.java
#	src/main/resources/fabric.mod.json
2022-01-11 23:44:52 +01:00
Ghoulboy f697924d30 Used wrong method to query world border size (#1236) 2022-01-11 23:29:03 +01:00
altrisi 212b6a792e Remove a few no longer needed mixins (#1243) 2022-01-08 23:18:13 +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
gnembon 5be52c993c Merge branch 'master' into future 2021-11-30 03:29:24 +01:00
gnembon 1cefef82f7 no-bs world height info 2021-11-30 03:28:44 +01:00
Ghoulboyandgnembon 6c776b6131 Adding min_y, max_y and world_border_info to system_info (#1168)
* Adding min_y and max_y

* Making it return all dimensions

* Adding world_border_info as well, cos y not

* Update docs/scarpet/api/Auxiliary.md

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
2021-11-30 03:03:15 +01:00
gnembon 90964e2e57 1.18-pre4 2021-11-17 20:45:25 +01:00
gnembon 5a6fc19bb0 1.18-pre1 2021-11-11 22:49:26 +01:00
gnembon 1642976d0d 21w44a 2021-11-04 00:34:40 +01:00
gnembon 81f0b8a8da mappings 2021-10-27 23:28:44 -03:00
gnembon 074fd910cf 21w42a 2021-10-20 23:05:27 -03:00
gnembon 543a4aa38f 21w41a 2021-10-13 19:36:28 -03:00
gnembon 6a03675b4f Merge branch 'master' into future 2021-10-12 23:24:41 -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
gnembon 7b9e5e6feb mappings 2021-09-22 21:12:11 -03:00
gnembon bc175509a2 21w37a 2021-09-18 08:46:27 -03:00
gnembon 9dad47d7a0 Merge branch 'master' into future 2021-09-08 16:22:44 -03:00
gnembon 229d0b037b events handling is disabled now when potentially triggered from the scarpet script preventing from recursive callbacks. 2021-09-06 02:37:08 -03:00