Grief Prevention

Grief Prevention

1M Downloads

sending msg in chat gives error

aayush2622 opened this issue ยท 6 comments

commented

Observed Behavior

When anyone type in chat it give error in console, but if op player do it nothing happen

Expected Behavior

should give no error

Reproduction steps

1 type anything in chat
2 boom error

Stack trace or error log

31.12 14:24:31 [Server] ERROR Could not pass event AsyncPlayerChatEvent to GriefPrevention vda68020
31.12 14:24:31 [Server] INFO java.lang.UnsupportedOperationException: null
31.12 14:24:31 [Server] INFO at java.util.ImmutableCollections.uoe(ImmutableCollections.java:142) ~[?:?]
31.12 14:24:31 [Server] INFO at java.util.ImmutableCollections$AbstractImmutableCollection.clear(ImmutableCollections.java:149) ~[?:?]
31.12 14:24:31 [Server] INFO at me.ryanhamshire.GriefPrevention.PlayerEventHandler.onPlayerChat(PlayerEventHandler.java:163) ~[GriefPrevention.jar:?]
31.12 14:24:31 [Server] INFO at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:40) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
31.12 14:24:31 [Server] INFO at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:git-Purpur-1882]
31.12 14:24:31 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
31.12 14:24:31 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:680) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
31.12 14:24:31 [Server] INFO at com.github.kaspiandev.antipopup.listeners.URLListener.onMessage(URLListener.java:28) ~[AntiPopup-5.2.jar:?]
31.12 14:24:31 [Server] INFO at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor297.execute(Unknown Source) ~[?:?]
31.12 14:24:31 [Server] INFO at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
31.12 14:24:31 [Server] INFO at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:git-Purpur-1882]
31.12 14:24:31 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
31.12 14:24:31 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:680) ~[purpur-api-1.19.3-R0.1-SNAPSHOT.jar:?]
31.12 14:24:31 [Server] INFO at io.papermc.paper.adventure.ChatProcessor.post(ChatProcessor.java:413) ~[purpur-1.19.3.jar:git-Purpur-1882]
31.12 14:24:31 [Server] INFO at io.papermc.paper.adventure.ChatProcessor.process(ChatProcessor.java:99) ~[purpur-1.19.3.jar:git-Purpur-1882]
31.12 14:24:31 [Server] INFO at net.minecraft.server.network.ServerGamePacketListenerImpl.chat(ServerGamePacketListenerImpl.java:2483) ~[?:?]
31.12 14:24:31 [Server] INFO at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
31.12 14:24:31 [Server] INFO at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
31.12 14:24:31 [Server] INFO at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
31.12 14:24:31 [Server] INFO at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
31.12 14:24:31 [Server] INFO at com.loohp.interactivechat.utils.PlayerUtils.chatAsPlayer(PlayerUtils.java:107) ~[InteractiveChat-4.2.5.2.jar:?]
31.12 14:24:31 [Server] INFO at com.loohp.interactivechat.listeners.RedispatchSignedPacket$1.lambda$onPacketReceiving$2(RedispatchSignedPacket.java:75) ~[InteractiveChat-4.2.5.2.jar:?]
31.12 14:24:31 [Server] INFO at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftTask.run(CraftTask.java:101) ~[purpur-1.19.3.jar:git-Purpur-1882]
31.12 14:24:31 [Server] INFO at org.bukkit.craftbukkit.v1_19_R2.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[purpur-1.19.3.jar:git-Purpur-1882]
31.12 14:24:31 [Server] INFO at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[purpur-1.19.3.jar:?]
31.12 14:24:31 [Server] INFO at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
31.12 14:24:31 [Server] INFO at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
31.12 14:24:31 [Server] INFO at java.lang.Thread.run(Thread.java:833) ~[?:?]

Server version

31.12 14:27:52 [Server] INFO Current: git-Purpur-1882 (MC: 1.19.3)*
31.12 14:27:52 [Server] INFO Previous: git-Purpur-1876 (MC: 1.19.3)

GriefPrevention version

31.12 14:28:26 [Server] INFO GriefPrevention version da68020

Configuration

# Default values are perfect for most servers.  If you want to customize and have a question, look for the answer here first: http://dev.bukkit.org/bukkit-plugins/grief-prevention/pages/setup-and-configuration/

GriefPrevention:
  SeaLevelOverrides:
    world_aqua: -1
    world_aqua_nether: -1
    world_aqua_the_end: -1
    spawn: -1
  Claims:
    Mode:
      world_aqua_nether: Disabled
      spawn: Survival
      world_aqua_the_end: Disabled
      world_aqua: Survival
    PreventGlobalMonsterEggs: true
    PreventTheft: true
    ProtectCreatures: true
    PreventButtonsSwitches: true
    LockWoodenDoors: false
    LockTrapDoors: false
    LockFenceGates: true
    EnderPearlsRequireAccessTrust: true
    RaidTriggersRequireBuildTrust: true
    ProtectHorses: true
    ProtectDonkeys: true
    ProtectLlamas: true
    InitialBlocks: 100
    Claim Blocks Accrued Per Hour:
      Default: 100
    Max Accrued Claim Blocks:
      Default: 80000
    Accrued Idle Threshold: 0
    AccruedIdlePercent: 0
    AbandonReturnRatio: 1.0
    AutomaticNewPlayerClaimsRadius: 4
    AutomaticNewPlayerClaimsRadiusMinimum: 0
    ExtendIntoGroundDistance: 5
    MinimumWidth: 5
    MinimumArea: 100
    MaximumDepth: -2147483648
    InvestigationTool: STICK
    ModificationTool: GOLDEN_SHOVEL
    Expiration:
      ChestClaimDays: 7
      UnusedClaimDays: 14
      AllClaims:
        DaysInactive: 60
        ExceptWhenOwnerHasTotalClaimBlocks: 10000
        ExceptWhenOwnerHasBonusClaimBlocks: 5000
      AutomaticNatureRestoration:
        SurvivalWorlds: false
    AllowTrappedInAdminClaims: false
    MaximumNumberOfClaimsPerPlayer: 0
    CreationRequiresWorldGuardBuildPermission: true
    VillagerTradingRequiresPermission: true
    CommandsRequiringAccessTrust: /sethome
    DeliverManuals: true
    ManualDeliveryDelaySeconds: 30
    RavagersBreakBlocks: true
    FireSpreadsInClaims: false
    FireDamagesInClaims: false
    LecternReadingRequiresAccessTrust: true
  Spam:
    Enabled: true
    LoginCooldownSeconds: 60
    LoginLogoutNotificationsPerMinute: 5
    ChatSlashCommands: /me;/global;/local
    WhisperSlashCommands: /tell;/pm;/r;/whisper;/msg
    WarningMessage: Please reduce your noise level.  Spammers will be banned.
    BanOffenders: true
    BanMessage: Banned for spam.
    AllowedIpAddresses: 1.2.3.4; 5.6.7.8
    DeathMessageCooldownSeconds: 120
    Logout Message Delay In Seconds: 0
  PvP:
    RulesEnabledInWorld:
      world_aqua: true
      world_aqua_nether: true
      world_aqua_the_end: true
      spawn: true
    ProtectFreshSpawns: true
    PunishLogout: true
    CombatTimeoutSeconds: 15
    AllowCombatItemDrop: false
    BlockedSlashCommands: /home;/vanish;/spawn;/tpa
    ProtectPlayersInLandClaims:
      PlayerOwnedClaims: true
      AdministrativeClaims: true
      AdministrativeSubdivisions: true
    AllowLavaDumpingNearOtherPlayers:
      PvPWorlds: true
      NonPvPWorlds: false
    AllowFlintAndSteelNearOtherPlayers:
      PvPWorlds: true
      NonPvPWorlds: false
    ProtectPetsOutsideLandClaims: false
  Economy:
    ClaimBlocksMaxBonus: 0
    ClaimBlocksPurchaseCost: 0.0
    ClaimBlocksSellValue: 0.0
  ProtectItemsDroppedOnDeath:
    PvPWorlds: false
    NonPvPWorlds: true
  BlockLandClaimExplosions: true
  BlockSurfaceCreeperExplosions: true
  BlockSurfaceOtherExplosions: true
  LimitSkyTrees: true
  LimitTreeGrowth: false
  PistonMovement: CLAIMS_ONLY
  PistonExplosionSound: true
  FireSpreads: false
  FireDestroys: false
  AdminsGetWhispers: true
  AdminsGetSignNotifications: true
  VisualizationAntiCheatCompatMode: false
  SmartBan: true
  Mute New Players Using Banned Words: true
  MaxPlayersPerIpAddress: 3
  SilenceBans: true
  Siege:
    Worlds: []
    BreakableBlocks:
    - GRASS_BLOCK
    - DIRT
    - COBBLESTONE
    - OAK_PLANKS
    - SPRUCE_PLANKS
    - BIRCH_PLANKS
    - JUNGLE_PLANKS
    - ACACIA_PLANKS
    - DARK_OAK_PLANKS
    - SAND
    - GRAVEL
    - GLASS
    - GRASS
    - FERN
    - DEAD_BUSH
    - WHITE_WOOL
    - ORANGE_WOOL
    - MAGENTA_WOOL
    - LIGHT_BLUE_WOOL
    - YELLOW_WOOL
    - LIME_WOOL
    - PINK_WOOL
    - GRAY_WOOL
    - LIGHT_GRAY_WOOL
    - CYAN_WOOL
    - PURPLE_WOOL
    - BLUE_WOOL
    - BROWN_WOOL
    - GREEN_WOOL
    - RED_WOOL
    - BLACK_WOOL
    - SNOW
    - GLASS_PANE
    DoorsOpenDelayInSeconds: 300
    CooldownEndInMinutes: 60
  EndermenMoveBlocks: false
  SilverfishBreakBlocks: false
  CreaturesTrampleCrops: false
  RabbitsEatCrops: true
  HardModeZombiesBreakDoors: false
  Database:
    URL: ''
    UserName: ''
    Password: ''
  UseBanCommand: false
  BanCommandPattern: ban %name% %reason%
  Advanced:
    fixNegativeClaimblockAmounts: true
    ClaimExpirationCheckRate: 60
    OfflinePlayer_cache_days: 90
  Abridged Logs:
    Days To Keep: 7
    Included Entry Types:
      Social Activity: true
      Suspicious Activity: true
      Administrative Activity: false
      Debug: false
      Muted Chat Messages: false
  ConfigVersion: 1

Plugin list

31.12 14:29:13 [Server] INFO Plugins (83): AdvancedPortals, AltDetector, AntiPopup, ArmorStandEditor, AuctionHouse, AuthMe, BetterRTP, BuycraftX, ChatEmojis, ChatGames*, Citizens, CMILib, ColoredSigns, CommandDefender, CompatNoCheatPlus, ConsoleSpamFix, CoreProtect, DataHeadFix, DeluxeTags, DiscordSRV, dynmap, Essentials, EssentialsChat, EssentialsSpawn, ExcellentCrates, ExecutableItems, FarmProtect*, FastAsyncWorldEdit (WorldEdit), FastLogin, floodgate, GeoLocation*, Geyser-Spigot, GPFlags, GriefPrevention, GSit, HeadDB, HeadsPlus, HoloAddon, HolographicDisplays, ImageFrame, Infiniteannouncements, InfiniteVouchers, InteractiveChat, InteractiveChatDiscordSrvAddon, InventoryRollbackPlus, ItemEdit, ItemTag, JoinAndLeaveDisabler*, LuckPerms, mcMMO, Multiverse-Core, NexEngine, NoCheatPlus, NoCollisions, OfflineManager, PlaceholderAPI, PlayerParticles, PlayerVaults*, PlayerWarps, PlugManX (PlugMan), ProtocolLib, PyroFishing, PyroLib, PyroMining, QuickShop, SCore, Shopkeepers, SilkSpawners_v2, SimpleScore, SkinsRestorer, spark, SuperbVote, TAB, UltimateAntiBot*, UTitleAuth, Vault, VeinMiner, ViaBackwards, ViaVersion, Votifier, WorldBorder*, WorldGuard, WorldGuardExtraFlags

Running without GriefPrevention

  • I attempted running the server without GriefPrevention installed.
  • The problem does not occur when GriefPrevention is removed from the server.

Running with only GriefPrevention

  • I attempted running only GriefPrevention on the server.
  • The issue still occurs when GriefPrevention is the only plugin running.

Running on a fresh, clean server installation

  • I attempted testing for the issue on a new server.
  • The issue still occurs on a new server.

Using unmodified client

  • I attempted testing for the issue with the vanilla client.
  • The issue still occurs when using the vanilla client.

We appreciate you taking the time to fill out a bug report!

  • I searched for similar issues before submitting this bug report.
commented

Looks like the plugin InteractiveChat is firing an AsyncPlayerChatEvent with an immutable recipient list. While GP should be accounting for this possibility (per the docs, "The set returned is not guaranteed to be mutable"), that does entirely break GP's soft mute/spam reduction functionality. You should probably contact them instead so they can better support other chat modification plugins.

As a bandaid, either remove InteractiveChat or disable GP's anti-spam, clear bannedwords.txt, and ensure no players are softmuted.

commented

Hello, I am the author of InteractiveChat. InteractiveChat is this situation is just invoking the chat method of the nms PlayerConnection class. While this is not API, technically this is just executing Paper patched nms code. (The chat event fired is inside the nms method)

The reason IC directly invokes this underlying method instead of the API method player.chat is due to requiring async execution.

As the underlying nms code of player.chatis the same as what IC is doing here, I believe this error could happen if another plugin invokes this API method.

commented

Gotcha, okay.

@aayush2622, I see you have Essentials installed. Would you please try /sudo <regular player> c:Some text to see if this is a generic Player#chat incompatibility? Either way it sounds like InteractiveChat is not compatible with GP's anti-spam features, so you should disable them.

commented

I think I found this issue after a closer look. tl;dr, it's not GP or IC's problem.
Inside the stacktrace above, there is:

31.12 14:24:31 [Server] INFO at com.github.kaspiandev.antipopup.listeners.URLListener.onMessage(URLListener.java:28) ~[AntiPopup-5.2.jar:?]

I've decompiled AntiPopup-5.2.jar and this is what is inside.

public class URLListener implements Listener {
    @EventHandler(priority = EventPriority.MONITOR)
    public void onMessage(final AsyncPlayerChatEvent event) {
        if (event.isCancelled()) {
            return;
        }
        if (event.getRecipients().isEmpty()) {
            return;
        }
        event.setCancelled(true);
        final Player sender = event.getPlayer();
        final String message = String.format(event.getFormat(), sender.getName(), event.getMessage());
        Bukkit.getConsoleSender().sendMessage(message);
        for (final Player player : event.getRecipients()) {
            player.sendMessage(sender.getUniqueId(), message);
        }
        Bukkit.getServer().getPluginManager().callEvent((Event)new AsyncPlayerChatEvent(true, sender, event.getMessage(), (Set)Set.of()));
    }
}

That is the reason why the recipient set is unmodifiable.

BTW, @aayush2622, IC already has options to effectively disable chat reporting and the popup message.

Settings:
  ForceUnsignedChatPackets: true # This effectively makes chat un-reportable
  HideServerUnsignedStatus: true # This hides the popup message
commented

Having the same issue here as of 1.19.4, using AntiPopup as well yet i've never had this issue before..
Does switching it with IC fix the problem? Does IC also support bedrock players (in terms of ability to chat etc)

commented