Skip to content

Commit

Permalink
[+] Config option to toggle weather pets can match their owners visib…
Browse files Browse the repository at this point in the history
…ility status
  • Loading branch information
brainsynder-Dev committed Jun 26, 2023
1 parent c2f14d3 commit a9fe1fc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,11 @@ This option allows for the removal of the placeholder items (The glass panes)
Should pet owners be able to open their pets data menu when right clicking the pet.
Default: {default}""");
public final ConfigEntry<Boolean> MISC_TOGGLES_PET_VANISHING = createOption("misc-toggles.enable-pet-vanishing", true,
"""
Should pets turn invisible when their owner is not visible (either via Spectator or Invisibility potions)
Default: {default}""");


// Pet Toggles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,9 @@ public void tick() {
if (displayName && hideNameShifting)
getEntity().setCustomNameVisible((!shifting));

if (!canIgnoreVanish()) {
// Checks if the pet can actually be toggled to match their owners
// player visibility status
if ((!canIgnoreVanish()) && ConfigOption.INSTANCE.MISC_TOGGLES_PET_VANISHING.getValue()) {
boolean ownerVanish = (VersionTranslator.getEntityHandle(player).isInvisible()
// Added this check for SuperVanish and PremiumVanish since they recommend using this method to check
|| SimplePets.getPetUtilities().isVanished(player)
Expand Down

0 comments on commit a9fe1fc

Please sign in to comment.