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
FieldsModifier and TypeFieldDescriptionnet.minecraft.network.chat.MutableComponentThe custom TitlebooleanWhether there is a custom titleThe items dropped by the opponent.the item drop type, for display -
Constructor Summary
ConstructorsConstructorDescriptionEmpty 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 TypeMethodDescriptionvoiddecode(net.minecraft.network.FriendlyByteBuf buffer) Decodes the information from the buffer to the packet instancevoidencode(net.minecraft.network.FriendlyByteBuf buffer) Encodes the buffer with the packet informationprotected voidhandlePacket(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:PixelmonPacketDecodes the information from the buffer to the packet instance- Specified by:
decodein interfacePixelmonPacket- Overrides:
decodein classAbstractPixelmonPacket- Parameters:
buffer- The buffer being decoded
-
encode
public void encode(net.minecraft.network.FriendlyByteBuf buffer) Description copied from interface:PixelmonPacketEncodes the buffer with the packet information- Specified by:
encodein interfacePixelmonPacket- Overrides:
encodein classAbstractPixelmonPacket- Parameters:
buffer- The buffer being encoded
-
handlePacket
protected void handlePacket(net.minecraftforge.event.network.CustomPayloadEvent.Context context) - Specified by:
handlePacketin classAbstractPixelmonPacket
-