Class ItemDropPacket
java.lang.Object
com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
com.pixelmonmod.pixelmon.comm.packetHandlers.itemDrops.ItemDropPacket
- All Implemented Interfaces:
PixelmonPacket
Contains information about opponent drops.
-
Field Summary
Modifier and TypeFieldDescriptionnet.minecraft.network.chat.MutableComponent
The custom Titleboolean
Whether there is a custom titleThe items dropped by the opponent.the item drop type, for display -
Constructor Summary
ConstructorDescriptionEmpty constructor for packet registration.ItemDropPacket
(ItemDropMode mode, List<DroppedItem> givenDrops) Initializes the drop information holder.ItemDropPacket
(ItemDropMode mode, net.minecraft.network.chat.MutableComponent customTitle, List<DroppedItem> drops) Initializes the drop information holder.ItemDropPacket
(net.minecraft.network.chat.MutableComponent customTitle, ArrayList<DroppedItem> drops) Initializes the drop information holder. -
Method Summary
Modifier and TypeMethodDescriptionvoid
decode
(net.minecraft.network.FriendlyByteBuf buffer) Decodes the information from the buffer to the packet instancevoid
encode
(net.minecraft.network.FriendlyByteBuf buffer) Encodes the buffer with the packet informationprotected void
handlePacket
(net.minecraftforge.event.network.CustomPayloadEvent.Context context) Methods inherited from class com.pixelmonmod.pixelmon.comm.data.AbstractPixelmonPacket
handle, reply
-
Field Details
-
items
The items dropped by the opponent. -
hasCustomTitle
public boolean hasCustomTitleWhether there is a custom title -
mode
the item drop type, for display -
customTitle
public net.minecraft.network.chat.MutableComponent customTitleThe custom Title
-
-
Constructor Details
-
ItemDropPacket
public ItemDropPacket()Empty constructor for packet registration. -
ItemDropPacket
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 interfacePixelmonPacket
- Overrides:
decode
in classAbstractPixelmonPacket
- 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 interfacePixelmonPacket
- Overrides:
encode
in classAbstractPixelmonPacket
- Parameters:
buffer
- The buffer being encoded
-
handlePacket
protected void handlePacket(net.minecraftforge.event.network.CustomPayloadEvent.Context context) - Specified by:
handlePacket
in classAbstractPixelmonPacket
-