Class FlagMessage

java.lang.Object
de.z0rdak.yawp.core.flag.FlagMessage

public class FlagMessage extends Object
  • Field Details

  • Constructor Details

    • FlagMessage

      public FlagMessage(String msg)
    • FlagMessage

      public FlagMessage(String msg, boolean muted)
    • FlagMessage

      public FlagMessage(String msg, boolean muted, boolean isDefault)
  • Method Details

    • defaultSubstitutes

      public static Map<String,String> defaultSubstitutes(RegionFlag flag, IProtectedRegion region, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.entity.player.Player player)
      Returns a map with default substitutes for the given flag and region.
      Parameters:
      flag - the flag to get the substitutes for
      region - the region to get the substitutes for
      pos - the position to get the substitutes for
      player - the player to get the substitutes for
      Returns:
      a map with default substitutes for the given flag and region
    • defaultSubstitutesFor

      public static Map<String,String> defaultSubstitutesFor(FlagCheckResult result)
      Returns a map with default substitutes for the given flag check result.
      The substitutes are built from the flag, responsible region, position and player in the result.
      The substitutes are then returned as a map.
      Parameters:
      result - the flag check result to get the default substitutes for
      Returns:
      a map with default substitutes for the given flag check result
    • buildFrom

      public static net.minecraft.network.chat.MutableComponent buildFrom(FlagCheckResult result, Map<String,String> substitutes)
      Builds a flag message from the given flag check result and substitutes.
      The flag message is built from the flag message template of the flag in the result.
      The matches in the flag message template are replaced with the substitutes.
      The flag message is then returned as a MutableComponent.
      Parameters:
      result - the flag check result to build the message for
      substitutes - the substitutes to replace the matches in the flag message template with
      Returns:
      the flag message for the given flag check result and substitutes
    • isMuted

      public boolean isMuted()
    • mute

      public void mute(boolean mute)
    • reset

      public void reset()
    • isDefault

      public boolean isDefault()
    • msg

      public String msg()
    • setMsg

      public void setMsg(String msg)
    • toString

      public String toString()
      Overrides:
      toString in class Object