Skip to content

Commit 291c493

Browse files
committed
Merge branch '1.21' into 26.1
2 parents a543579 + 13a5147 commit 291c493

3 files changed

Lines changed: 21 additions & 0 deletions

File tree

cardinal-components-scoreboard/src/main/java/org/ladysnake/cca/mixin/scoreboard/MixinPackedScoreboardState.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
*/
2323
package org.ladysnake.cca.mixin.scoreboard;
2424

25+
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
2526
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
2627
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
2728
import com.mojang.datafixers.kinds.App;
@@ -37,6 +38,7 @@
3738
import org.spongepowered.asm.mixin.Unique;
3839
import org.spongepowered.asm.mixin.injection.At;
3940

41+
import java.util.Objects;
4042
import java.util.Optional;
4143
import java.util.function.Function;
4244

@@ -69,4 +71,11 @@ private static Codec<ScoreboardSaveData.Packed> wrapCodec(Function<RecordCodecBu
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
}

changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ Updated to 26.1-snapshot-9
66
**Removed**
77
- Components attached to a `LevelData` object (using the `cardinal-components-level` module) can no longer use dynamic registries in serialization (vanilla limitation)
88

9+
------------------------------------------------------
10+
Version 7.3.1
11+
------------------------------------------------------
12+
**Fixes**
13+
- Fixed a serialization issue in `cardinal-components-scoreboard` (thanks *farpo* and *AmyMialee* !)
14+
915
------------------------------------------------------
1016
Version 7.3.0
1117
------------------------------------------------------

src/testmod/java/org/ladysnake/componenttest/content/VitaCommand.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ public static void register(CommandDispatcher<CommandSourceStack> dispatcher) {
5050
return 1;
5151
})
5252
)
53+
.then(Commands.literal("serverwide")
54+
.executes(commandContext -> {
55+
Vita.get(commandContext.getSource().getServer().getScoreboard()).setVitality(IntegerArgumentType.getInteger(commandContext, "amount"));
56+
commandContext.getSource().sendSuccess(() -> Component.literal("success!"), false);
57+
return 1;
58+
}))
5359
)
5460
)
5561
.then(Commands.literal("get")

0 commit comments

Comments
 (0)