java.lang.Object
com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
com.pixelmonmod.pixelmon.comm.packetHandlers.itemDrops.ItemDropPacket
All Implemented Interfaces:
PixelmonPacket

public class ItemDropPacket extends AbstractPixelmonPacket
Contains information about opponent drops.
  • Field Details

    • items

      public DroppedItem[] items
      The items dropped by the opponent.
    • hasCustomTitle

      public boolean hasCustomTitle
      Whether there is a custom title
    • mode

      public ItemDropMode mode
      the item drop type, for display
    • customTitle

      public net.minecraft.network.chat.MutableComponent customTitle
      The custom Title
  • Constructor Details

    • ItemDropPacket

      public ItemDropPacket()
      Empty constructor for packet registration.
    • ItemDropPacket

      public ItemDropPacket(ItemDropMode mode, List<DroppedItem> givenDrops)
      Initializes the drop information holder.
      Parameters:
      mode - The source of the dropped items.
      givenDrops - The items dropped by the opponent.
    • ItemDropPacket

      public ItemDropPacket(ItemDropMode mode, net.minecraft.network.chat.MutableComponent customTitle, List<DroppedItem> drops)
      Initializes the drop information holder.
      Parameters:
      mode - The source of the dropped items.
      customTitle - Custom text to label the drop GUI with.
      drops - The items dropped by the opponent.
    • ItemDropPacket

      public ItemDropPacket(net.minecraft.network.chat.MutableComponent customTitle, ArrayList<DroppedItem> drops)
      Initializes the drop information holder.
      Parameters:
      customTitle - Custom text to label the drop GUI with.
      drops - The items dropped by the opponent.
  • Method Details

    • decode

      public void decode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PixelmonPacket
      Decodes the information from the buffer to the packet instance
      Specified by:
      decode in interface PixelmonPacket
      Overrides:
      decode in class AbstractPixelmonPacket
      Parameters:
      buffer - The buffer being decoded
    • encode

      public void encode(net.minecraft.network.FriendlyByteBuf buffer)
      Description copied from interface: PixelmonPacket
      Encodes the buffer with the packet information
      Specified by:
      encode in interface PixelmonPacket
      Overrides:
      encode in class AbstractPixelmonPacket
      Parameters:
      buffer - The buffer being encoded
    • handlePacket

      protected void handlePacket(net.minecraftforge.event.network.CustomPayloadEvent.Context context)
      Specified by:
      handlePacket in class AbstractPixelmonPacket