Commit Graph
26 Commits
Author SHA1 Message Date
altrisi d85c23125f Add explicit deprecation SuppressWarnings for Gradle 2023-04-03 19:40:33 +02:00
altrisi f98c2409be Simplify enum options creation
Slightly optimizes it
2023-03-16 17:36:44 +01:00
altrisi 635fb586c4 Allow rules to declare they only accept a set of options (#1560) 2022-10-12 16:13:59 +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 06af9ce8b1 Migrate the Carpet codebase to Mojang Mappings 2022-01-24 20:33:16 +01:00
altrisi 7fb5e47da5 Use newer Java features in places where it makes sense and more (#1009) 2021-08-03 07:32:40 -03:00
gnembon 7421e56670 customized failed rules behaviour 2021-07-10 18:03:40 -03:00
altrisi 69e9e9b0bb Remove the number_classes set in favour of ClassUtils (#860) 2021-05-15 18:53:50 -03: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
gnembon 741edf1465 three things:
- logger is carpet, fixes #522
 - fixed fancy commands to functions - so could be used later with lambdas and functions that use different argument names
 - moved a few builtin apps to commands via /carpet
2020-11-03 04:45:08 -04:00
altrisi b9eee6e58b Allow rules to manage Scarpet apps (Scarpet Rules) (#519)
by altrisi
2020-11-02 21:52:21 -04:00
Ghoulboy 3dc5f713ab added "ops" setting to each rule (#390)
* added "ops" setting to each rule

* removing changes

* implementing gnembon's fix

* removing unnecessary stuffs

* removing unnecessary changes v2

* removing unnecessary changes v3

* Separating bool from command
2020-08-03 01:32:26 -03:00
gnembon f6fb8e5899 ++ got eaten 2020-05-31 01:06:41 -03:00
gnembon 74c62e5a13 simplified translations keys 2020-05-15 20:00:27 -03:00
gnembon 1e39f6caa8 updates to translations 2020-05-15 17:26:36 -03:00
gnembon fe63334509 enabled some client side command interpretation. 2020-03-30 17:14:16 -03:00
gnembon b4a50b8c3f mulitple counters in hud - not really needed but why not. 2020-02-02 00:03:38 -04:00
gnembon b52b5c335f ops options for commands 2019-12-01 01:04:58 -04:00
Joe df2ea4d2cc Add TNT rules 2019-10-23 04:53:34 +01:00
gnembon 95d556a978 rule management and extensibility 2019-07-04 01:54:13 -03:00
gnembon 3964145907 Settings refactor - adding source to observers 2019-06-28 22:20:43 -03:00
gnembon e8fbf3aadc add observers 2019-06-12 01:29:24 -03:00
gnembon 9bbaaccb3e freekin egyptian braces 2019-06-12 01:03:34 -03:00
gnembon 734dc95dab settings ported to the annotation based system 2019-06-11 23:01:09 -03:00
gnembon f05c661fbf categories not an enum, so its easier to extend. Validators can modify value. 2019-06-11 12:27:26 -03:00
gnembon 92f40c36b8 settings system 2019-06-11 02:08:50 -03:00