Skip to content

Commit

Permalink
Merge tag 2.2.2+1.21 into 1.20.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Estecka committed Jul 4, 2024
2 parents 6012467 + 9ea6a38 commit 4679480
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Initial release
- Reimplemented Trade-Rebalance support in a backward-compatible way
### 2.1.1
- Fixed a crash that would occur upon restock if Depleted Reroll is disabled.
### 2.1.2 (Branched of v2.2)
- Custom serialization is no longer callable from the render thread.
## 2.2
### 2.2.0
- Updated for MC 1.20.5
Expand All @@ -36,3 +38,6 @@ Initial release
- Added custom logic for upgrading caches from before 1.20.5
### 2.2.1
- Updated for MC 1.21
### 2.2.2
- Custom serialization is no longer callable from the render thread.
This boost performances when using Fresh Animations
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ loader_version=0.15.10
fabric_version=0.97.6+1.20.5

# Mod Properties
mod_version=2.2.1
mod_version=2.2.2
maven_group=tk.estecka.shiftingwares
archives_base_name=shifting-wares
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,18 @@ private boolean RestockDepletedOnly(TradeOffer offer, Operation<Boolean> hasBeen

@Inject ( method="writeCustomDataToNbt", at=@At("TAIL"))
void WriteCachedMapsToNbt(NbtCompound nbt, CallbackInfo info){
this.tradeCache.FillCacheFromTrades(villager.getOffers());
this.tradeCache.WriteMapCacheToNbt(nbt);
if (!villager.getWorld().isClient()){
this.tradeCache.FillCacheFromTrades(villager.getOffers());
this.tradeCache.WriteMapCacheToNbt(nbt);
}
}

@Inject ( method="readCustomDataFromNbt", at=@At("TAIL"))
void ReadCachedMapsFromNbt(NbtCompound nbt, CallbackInfo info){
this.tradeCache.ReadMapCacheFromNbt(nbt);
this.tradeCache.FillCacheFromTrades(villager.getOffers());
if (!villager.getWorld().isClient()){
this.tradeCache.ReadMapCacheFromNbt(nbt);
this.tradeCache.FillCacheFromTrades(villager.getOffers());
}
}

}

0 comments on commit 4679480

Please sign in to comment.