Skip to content

Commit 9c21a28

Browse files
authored
fix: disable bundle decorator for joja membership (#8)
1 parent 35647fe commit 9c21a28

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

Informant/Implementation/Decorator/BundleDecorator.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@ public BundleDecorator(IModHelper modHelper)
2828

2929
public bool HasDecoration(Item input)
3030
{
31+
if (Game1.MasterPlayer.mailReceived.Contains("JojaMember")) {
32+
return false;
33+
}
34+
3135
if (_bundles.Any() && input is SObject obj && !obj.bigCraftable.Value) {
3236

3337
int[]? allowedAreas;
3438

35-
if (!Game1.player.mailReceived.Contains("canReadJunimoText")) {
39+
if (!Game1.MasterPlayer.mailReceived.Contains("canReadJunimoText")) {
3640
// if player can't read Junimo text, they can't have bundles yet
3741
allowedAreas = null;
3842
} else {

Informant/Implementation/Decorator/ShippingBinDecorator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public bool HasDecoration(Item input)
3131
return false;
3232
}
3333
var parentSheetIndex = input.ParentSheetIndex.ToString();
34-
var alreadyShipped = Game1.player.basicShipped.ContainsKey(parentSheetIndex) ? Game1.player.basicShipped[parentSheetIndex] : 0;
34+
var alreadyShipped = Game1.MasterPlayer.basicShipped.ContainsKey(parentSheetIndex) ? Game1.MasterPlayer.basicShipped[parentSheetIndex] : 0;
3535

3636
if (!Ship15Items.Contains(input.ParentSheetIndex)) {
3737
// we only need to ship this item once
@@ -58,7 +58,7 @@ public Decoration Decorate(Item input)
5858
return null;
5959
}
6060
var parentSheetIndex = input.ParentSheetIndex.ToString();
61-
var alreadyShipped = Game1.player.basicShipped.ContainsKey(parentSheetIndex) ? Game1.player.basicShipped[parentSheetIndex] : 0;
61+
var alreadyShipped = Game1.MasterPlayer.basicShipped.ContainsKey(parentSheetIndex) ? Game1.MasterPlayer.basicShipped[parentSheetIndex] : 0;
6262
const int needToBeShipped = 15;
6363
if (alreadyShipped >= needToBeShipped) {
6464
// we don't need to ship anything? why even show the decorator?

Informant/Implementation/NewRecipeDisplayable.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ private static void DrawOverlayIfNecessary(ClickableTextureComponent __instance,
7575

7676
// recipe.timesCrafted is not updated it seems
7777
var timesCrafted = recipe.isCookingRecipe
78-
? (Game1.player.recipesCooked.ContainsKey(recipe.getIndexOfMenuView()) ? Game1.player.recipesCooked[recipe.getIndexOfMenuView()] : 0)
79-
: (Game1.player.craftingRecipes.ContainsKey(recipe.name) ? Game1.player.craftingRecipes[recipe.name] : 0);
78+
? (Game1.MasterPlayer.recipesCooked.ContainsKey(recipe.getIndexOfMenuView()) ? Game1.MasterPlayer.recipesCooked[recipe.getIndexOfMenuView()] : 0)
79+
: (Game1.MasterPlayer.craftingRecipes.ContainsKey(recipe.name) ? Game1.MasterPlayer.craftingRecipes[recipe.name] : 0);
8080
if (timesCrafted > 0) {
8181
// we are on the recipe page, have a recipe which was already craftet? nice, it's not new
8282
return;

0 commit comments

Comments
 (0)