java.lang.Object
me.neznamy.tab.api.TabFeature
me.neznamy.tab.platforms.bukkit.features.PetFix

public class PetFix extends me.neznamy.tab.api.TabFeature
A feature to disable minecraft 1.9+ feature making tamed animals with custom names copy NameTag properties of their owner. This is achieved by listening to entity spawn (<1.15) / entity metadata packets and removing owner field from the DataWatcher list. Since 1.16 this results in client sending entity use packet twice, so we must cancel the 2nd one to prevent double toggle.
  • Field Summary

    Fields inherited from class me.neznamy.tab.api.TabFeature

    disabledServers, disabledWorlds
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs new instance with given parameter
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    onPacketReceive(me.neznamy.tab.api.TabPlayer sender, Object packet)
    Cancels a packet if previous one arrived with no delay to prevent double toggle since 1.16
    void
    onPacketSend(me.neznamy.tab.api.TabPlayer receiver, Object packet)
    Removes pet owner field from DataWatcher

    Methods inherited from class me.neznamy.tab.api.TabFeature

    addDisabledPlayer, addUsedPlaceholders, contains, getFeatureName, getRefreshDisplayName, isDisabled, isDisabledPlayer, load, onCommand, onDisplayObjective, onJoin, onLoginPacket, onObjective, onPlayerInfo, onQuit, onServerChange, onVanishStatusChange, onWorldChange, overridesMethod, refresh, removeDisabledPlayer, unload

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PetFix

      public PetFix()
      Constructs new instance with given parameter
  • Method Details

    • onPacketReceive

      public boolean onPacketReceive(me.neznamy.tab.api.TabPlayer sender, Object packet) throws ReflectiveOperationException
      Cancels a packet if previous one arrived with no delay to prevent double toggle since 1.16
      Overrides:
      onPacketReceive in class me.neznamy.tab.api.TabFeature
      Throws:
      ReflectiveOperationException - if thrown by reflective operation
    • onPacketSend

      public void onPacketSend(me.neznamy.tab.api.TabPlayer receiver, Object packet) throws ReflectiveOperationException
      Removes pet owner field from DataWatcher
      Overrides:
      onPacketSend in class me.neznamy.tab.api.TabFeature
      Throws:
      ReflectiveOperationException - if thrown by reflective operation