Commit Graph
49 Commits
Author SHA1 Message Date
gnembon 4c8e477f4b 1.19.4-pre1 2023-02-22 20:22:02 +01:00
gnembon 75d94b0570 cleanup of scarpet dependencies 2023-02-08 21:13:14 +01: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 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
gnembon e5af397e22 22w15a 2022-04-13 21:10:24 +02:00
gnembon 302a7b4817 fixes for 22w11a 2022-03-17 20:21:55 +01:00
altrisi 06af9ce8b1 Migrate the Carpet codebase to Mojang Mappings 2022-01-24 20:33:16 +01:00
50d9e51d3f Fake players can be spawned in survival mode while flying (#1264)
* Fixes #1263

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

Co-authored-by: James103 <37945304+James103@users.noreply.github.com>

Co-authored-by: gnembon <41132274+gnembon@users.noreply.github.com>
Co-authored-by: James103 <37945304+James103@users.noreply.github.com>
2022-01-09 00:07:45 +01:00
Yuuta Liang 14be166935 allow specifying game modes when spawning fake players (#1117)
This enables administrators to flexibly spawn players in game modes other than their current modes, and also allows administrators to spawn non-creative players from the console or rcon.

Usage: /player spawn bot in <gamemode>

Usage: /player spawn bot at ~ ~ ~ face 0 0 in minecraft:overworld in <gamemode>

Permissions required: OP Level 2 and above.

Note on flying: For spectator players, flying is always enabled. For other game modes, whether they are flying depends on the command caller. Therefore, it is possible to spawn a flying survival player when you are currently flying.
2021-09-30 00:01:56 -03:00
gnembon 702789cab5 1.17.1-rc-1 2021-07-02 00:28:49 -03:00
gnembon 9a4e15da48 mappings 2021-06-29 17:28:58 -03:00
gnembon aa38fe4e85 update 2021-06-23 03:46:47 -03:00
gnembon 60d4887302 Merge branch 'master' into 1.17
# Conflicts:
#	src/main/java/carpet/patches/EntityPlayerMPFake.java
2021-06-23 03:38:40 -03:00
gnembon a77fc5c2f5 fake players will inherit caller flying status. Fixes #938 2021-06-23 03:38:12 -03:00
gnembon e2dfbc5bdd Merge branch 'master' into 1.17 2021-05-27 01:56:13 -03:00
gnembon f2e759130a make sure player names do not cause players to get disconnected 2021-05-25 20:10:47 -03:00
gnembon b96a1b1216 Merge branch 'master' into 1.17 2021-05-25 17:25:55 -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 9fb43b6095 mappings 2021-03-02 08:52:32 -04:00
gnembon 34bfe32e39 Merge branch 'master' into 1.17 2021-03-02 08:48:46 -04:00
gnembon 84797bef0e restrict player placement to buildable area. 2021-02-25 21:59:36 -04:00
gnembon b2bde4b836 Merge branch 'master' into 1.17 2020-12-04 00:39:18 -04:00
gnembon 4b0fd8296c player selects hotbar slot, fixes #557 2020-12-03 22:40:16 -04:00
gnembon 091a4deadc Merge branch 'master' into 1.17
# Conflicts:
#	src/main/java/carpet/script/value/ValueConversions.java
2020-11-22 21:59:57 -04:00
gnembon 190d17d1fe fixes NPE when summoning a player with a banned account. 2020-11-22 21:47:32 -04:00
gnembon be3cb35f75 Merge branch 'master' into 1.17 2020-11-11 02:08:05 -04:00
gnembon a40b8ff0cc fixed player use timings 2020-11-09 20:39:45 -04:00
gnembon 2cdea92da7 20w45a 2020-11-06 00:06:53 -04:00
gnembon 8a2ddcbf2a 1.4.12 2020-10-01 14:14:01 -03:00
gnembon 3167fe06f3 cleanup unused code and mixins 2020-08-18 01:54:24 -03:00
gnembon e67ec14285 mappings 2020-07-20 21:06:03 -03:00
gnembon bba9f4e88d Merge branch 'master' into 1.16 2020-07-08 00:48:56 -03:00
Hunter Kvalevog 1f1c5de303 Add "/player look at" subcommand 2020-07-04 06:02:24 -05:00
gnembon 441676a1e5 1.16-pre3 2020-06-10 14:55:11 -03:00
gnembon c61429099a mappings 2020-06-04 15:59:46 -03:00
gnembon 3b588e8488 20w22a 2020-05-29 12:15:51 -03:00
gnembon cf817c2e39 mappings 2020-05-21 14:23:04 -03:00
gnembon bec5259216 20w21a ohboi 2020-05-21 02:59:17 -03:00
gnembon dfd88b7142 20w20a 2020-05-13 16:58:12 -03:00
gnembon 19a01bee1b cannot shadow other players if you are not OP. Fixes #208 2020-04-12 20:47:39 -03:00
gnembon 182eac89c9 too long player names, fixes #195 2020-03-31 20:53:10 -03:00
gnembon 161b5d491d added options for drop command 2020-02-09 01:56:30 -04:00
gnembon e44cf0d79b action pack improvements 2020-01-10 21:48:55 -04:00
gnembon 55065a38a6 moved CarpetSettings up from settings manager, should be easier to find later. 2019-12-10 23:08:40 -04:00
gnembon b52b5c335f ops options for commands 2019-12-01 01:04:58 -04:00
gnembon 50d1d74579 player actions 2019-07-17 03:58:16 -03:00
gnembon cd4ae14448 1.14.4pre1 2019-07-03 16:38:12 -03:00
gnembon 734dc95dab settings ported to the annotation based system 2019-06-11 23:01:09 -03:00
gnembon f985678517 moved rest of the stuff. mixins needed still 2019-05-12 17:50:00 -03:00