Skip to content

Commit

Permalink
Update to 20w48a
Browse files Browse the repository at this point in the history
  • Loading branch information
Pyrofab committed Nov 26, 2020
1 parent b380795 commit fc3e505
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,35 +44,33 @@
public abstract class MixinScoreboardState {
@Final
@Shadow
private Scoreboard field_27936;
private Scoreboard scoreboard;

@Inject(method = "toTag", at = @At("RETURN"))
private void saveComponents(CompoundTag tag, CallbackInfoReturnable<CompoundTag> cir) {
((ComponentProvider) this.field_27936).getComponentContainer().toTag(tag);
((ComponentProvider) this.scoreboard).getComponentContainer().toTag(tag);
}

@Inject(method = "method_32481", at = @At("RETURN"))
@Inject(method = "fromTag", at = @At("RETURN"))
private void loadComponents(CompoundTag tag, CallbackInfoReturnable<ScoreboardState> ci) {
if (this.field_27936 != null) { // weird deferred loading thing
((ComponentProvider) this.field_27936).getComponentContainer().fromTag(tag);
}
((ComponentProvider) this.scoreboard).getComponentContainer().fromTag(tag);
}

@Inject(
method = "deserializeTeams",
method = "teamsFromTag",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/scoreboard/ScoreboardState;deserializeTeamPlayers(Lnet/minecraft/scoreboard/Team;Lnet/minecraft/nbt/ListTag;)V",
target = "Lnet/minecraft/scoreboard/ScoreboardState;teamPlayersFromTag(Lnet/minecraft/scoreboard/Team;Lnet/minecraft/nbt/ListTag;)V",
shift = At.Shift.AFTER
),
locals = LocalCapture.CAPTURE_FAILEXCEPTION
)
private void loadTeamComponents(ListTag listTag, CallbackInfo ci, int i, CompoundTag teamData, String name, Team team) {
private void loadTeamComponents(ListTag teamsData, CallbackInfo ci, int i, CompoundTag teamData, String name, Team team) {
((ComponentProvider) team).getComponentContainer().fromTag(teamData);
}

@Inject(
method = "serializeTeams",
method = "teamsToTag",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/scoreboard/Team;getPlayerList()Ljava/util/Collection;"
Expand All @@ -81,7 +79,7 @@ private void loadTeamComponents(ListTag listTag, CallbackInfo ci, int i, Compoun
)
private void saveTeamComponents(
CallbackInfoReturnable<ListTag> cir,
ListTag listTag,
ListTag teamsData,
Collection<Team> teams,
Iterator<Team> it,
Team team,
Expand Down
2 changes: 1 addition & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Version 3.0.0
------------------------------------------------------
**The breaking changes are here !**

- Updated to 20w45a
- Updated to 20w48a

Additions
- Ticking components now work on any `BlockEntity`, not just those that already tick in vanilla
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
org.gradle.jvmargs = -Xmx3G

#see https://modmuss50.me/fabric.html
minecraft_version=20w46a
yarn_mappings=11
loader_version=0.10.6+build.214
minecraft_version=20w48a
yarn_mappings=1
loader_version=0.10.8

#Fabric api
fabric_api_version=0.25.7+1.17
fabric_api_version=0.26.4+1.17

#Publishing
mod_version = 3.0.0-nightly.20w46a
mod_version = 3.0.0-nightly.20w48a
curseforge_id = 318449
curseforge_versions = 1.16-Snapshot
curseforge_versions = 1.17
changelog_url = https://github.com/OnyxStudios/Cardinal-Components-API/blob/master/changelog.md
release_type = alpha
#api_package = nerdhub.cardinal.components.api
Expand Down

0 comments on commit fc3e505

Please sign in to comment.