File tree Expand file tree Collapse file tree
cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/mixin/scoreboard
src/testmod/java/org/ladysnake/componenttest/content Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 */
2323package org .ladysnake .cca .mixin .scoreboard ;
2424
25+ import com .llamalad7 .mixinextras .injector .wrapmethod .WrapMethod ;
2526import com .llamalad7 .mixinextras .injector .wrapoperation .Operation ;
2627import com .llamalad7 .mixinextras .injector .wrapoperation .WrapOperation ;
2728import com .mojang .datafixers .kinds .App ;
3738import org .spongepowered .asm .mixin .Unique ;
3839import org .spongepowered .asm .mixin .injection .At ;
3940
41+ import java .util .Objects ;
4042import java .util .Optional ;
4143import java .util .function .Function ;
4244
@@ -69,4 +71,11 @@ private static Codec<ScoreboardState.Packed> wrapCodec(Function<RecordCodecBuild
6971 return packed ;
7072 }));
7173 }
74+
75+ @ WrapMethod (method = "equals" )
76+ private boolean patchEquals (Object object , Operation <Boolean > original ) {
77+ return original .call (object )
78+ && object instanceof CcaPackedState otherState
79+ && Objects .equals (cca$getSerializedComponents (), otherState .cca$getSerializedComponents ());
80+ }
7281}
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ elmendorf_version=0.16.0
1515immersive_portals_version =v6.0.3-mc1.21.1
1616
1717# Publishing
18- mod_version = 7.3.0
18+ mod_version = 7.3.1
1919curseforge_id = 318449
2020modrinth_id = K01OU20C
2121curseforge_versions = 1.21.11
Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ public static void register(CommandDispatcher<ServerCommandSource> dispatcher) {
5050 return 1 ;
5151 })
5252 )
53+ .then (CommandManager .literal ("serverwide" )
54+ .executes (commandContext -> {
55+ Vita .get (commandContext .getSource ().getServer ().getScoreboard ()).setVitality (IntegerArgumentType .getInteger (commandContext , "amount" ));
56+ commandContext .getSource ().sendFeedback (() -> Text .of ("success!" ), false );
57+ return 1 ;
58+ }))
5359 )
5460 )
5561 .then (CommandManager .literal ("get" )
You can’t perform that action at this time.
0 commit comments