Class PermissionEvent

java.lang.Object
com.minecolonies.api.colony.permissions.PermissionEvent

public class PermissionEvent extends Object
Permission event class, used to store events happening in the colony.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PermissionEvent(UUID id, String name, Action action, net.minecraft.core.BlockPos position)
    Constructor for permission events.
    PermissionEvent(net.minecraft.network.RegistryFriendlyByteBuf buf)
    Constructor for permission events.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    The action causing the event.
    @Nullable UUID
    The UUID of the player causing the event.
    The name of the player causing the event.
    net.minecraft.core.BlockPos
    The position at which the event had happened.
    int
     
    void
    serialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
    Serialize the permission event to a ByteBuf.

    Methods inherited from class java.lang.Object

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

    • PermissionEvent

      public PermissionEvent(UUID id, String name, Action action, net.minecraft.core.BlockPos position)
      Constructor for permission events.
      Parameters:
      id - the player UUID.
      name - the player name.
      action - the action happening.
      position - the position of the action.
    • PermissionEvent

      public PermissionEvent(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Constructor for permission events. to load them from a ByteBuf.
      Parameters:
      buf - the ByteBuf.
  • Method Details

    • getId

      @Nullable public @Nullable UUID getId()
      The UUID of the player causing the event.
      Returns:
      the UUID.
    • getName

      public String getName()
      The name of the player causing the event.
      Returns:
      the name String.
    • getAction

      public Action getAction()
      The action causing the event.
      Returns:
      the Action
    • getPosition

      public net.minecraft.core.BlockPos getPosition()
      The position at which the event had happened.
      Returns:
      the BlockPos.
    • serialize

      public void serialize(net.minecraft.network.RegistryFriendlyByteBuf buf)
      Serialize the permission event to a ByteBuf.
      Parameters:
      buf - the buffer.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object