Skip to content

Commit

Permalink
fix banner loading spam
Browse files Browse the repository at this point in the history
  • Loading branch information
Raycoms committed Aug 20, 2024
1 parent 035a5f8 commit 223e9ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,9 @@ public final class NbtTagConstants
public static final String TAG_FLAG_PATTERNS = "colonyflag";

/**
* Tag used by vanilla to store banner patterns
* Tag we use to store the patterns.
*/
public static final String TAG_BANNER_PATTERNS = "Patterns";
public static final String TAG_BANNER_PATTERNS = "cbpatterns";

/**
* Tag used by vanilla to store a single pattern in banner pattern-color pairs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@

import static com.minecolonies.api.research.util.ResearchConstants.*;
import static com.minecolonies.api.util.constant.GuardConstants.*;
import static com.minecolonies.api.util.constant.NbtTagConstants.TAG_BANNER_PATTERNS;
import static com.minecolonies.api.util.constant.StatisticsConstants.MOBS_KILLED;
import static com.minecolonies.api.util.constant.StatisticsConstants.MOB_KILLED;
import static com.minecolonies.core.colony.buildings.modules.BuildingModules.STATS_MODULE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ public void loadAdditional(CompoundTag compound, @NotNull final HolderLookup.Pro
{
super.loadAdditional(compound, provider);

this.patterns = Utils.deserializeCodecMess(BannerPatternLayers.CODEC, provider, compound.get(TAG_BANNER_PATTERNS));
if (compound.contains(TAG_BANNER_PATTERNS))
{
this.patterns = Utils.deserializeCodecMess(BannerPatternLayers.CODEC, provider, compound.get(TAG_BANNER_PATTERNS));
}

this.colonyId = compound.getInt(TAG_COLONY_ID);

if(this.colonyId == -1 && this.hasLevel())
Expand Down

0 comments on commit 223e9ca

Please sign in to comment.