Package com.pixelmonmod.pixelmon.comm
Class SetTrainerData
java.lang.Object
com.pixelmonmod.pixelmon.comm.SetTrainerData
Holder for NPC Trainer data.
-
Field Summary
Modifier and TypeFieldDescriptionThe NPC Trainer's messages.int
The NPC Trainer's ID.The NPC Trainer's messages.The NPC Trainer's name.The rules that the NPC Trainer uses in battle.The NPC Trainer's messages.int
The money won upon the NPC Trainer's defeat.net.minecraft.world.item.ItemStack[]
The items won upon the NPC Trainer's defeat. -
Constructor Summary
ConstructorDescriptionEmpty constructor used for registering the packet.SetTrainerData
(NPCTrainer trainer, String localization) Initializes the NPC Trainer data.SetTrainerData
(String name, String greeting, String win, String lose, int winMoney, net.minecraft.world.item.ItemStack[] winnings) Initializes the NPC Trainer data.SetTrainerData
(String name, String greeting, String win, String lose, int winMoney, net.minecraft.world.item.ItemStack[] winnings, BattleRules rules) Initializes the NPC Trainer data. -
Method Summary
Modifier and TypeMethodDescriptionvoid
decodeInto
(net.minecraft.network.FriendlyByteBuf buffer) Decodes the data from a buffer.void
encodeInto
(net.minecraft.network.FriendlyByteBuf buffer) Encodes the data into a buffer.
-
Field Details
-
name
The NPC Trainer's name. -
greeting
The NPC Trainer's messages. -
win
The NPC Trainer's messages. -
lose
The NPC Trainer's messages. -
winnings
public net.minecraft.world.item.ItemStack[] winningsThe items won upon the NPC Trainer's defeat. -
id
public int idThe NPC Trainer's ID. -
winMoney
public int winMoneyThe money won upon the NPC Trainer's defeat. -
rules
The rules that the NPC Trainer uses in battle.
-
-
Constructor Details
-
SetTrainerData
public SetTrainerData()Empty constructor used for registering the packet. -
SetTrainerData
public SetTrainerData(String name, String greeting, String win, String lose, int winMoney, net.minecraft.world.item.ItemStack[] winnings) Initializes the NPC Trainer data.- Parameters:
name
- The name of the NPC Trainer.greeting
- The greeting said by the NPC Trainer when starting a battle.win
- The message said by the NPC Trainer upon victory.lose
- The message said by the NPC Trainer upon losing.winMoney
- The amount of PokeDollars won when the NPC Trainer is defeated.winnings
- The items won when the NPC Trainer is defeated.
-
SetTrainerData
public SetTrainerData(String name, String greeting, String win, String lose, int winMoney, net.minecraft.world.item.ItemStack[] winnings, BattleRules rules) Initializes the NPC Trainer data.- Parameters:
name
- The name of the NPC Trainer.greeting
- The greeting said by the NPC Trainer when starting a battle.win
- The message said by the NPC Trainer upon victory.lose
- The message said by the NPC Trainer upon losing.winMoney
- The amount of PokeDollars won when the NPC Trainer is defeated.winnings
- The items won when the NPC Trainer is defeated.rules
- The rules that the NPC Trainer uses in battle, or null if they should not be sent in the packet.
-
SetTrainerData
Initializes the NPC Trainer data.- Parameters:
trainer
- The NPC Trainer to get data from.localization
- The localization code for the lang file to translate data from.
-
-
Method Details
-
encodeInto
public void encodeInto(net.minecraft.network.FriendlyByteBuf buffer) Encodes the data into a buffer.- Parameters:
buffer
- The buffer to encode the data into.
-
decodeInto
public void decodeInto(net.minecraft.network.FriendlyByteBuf buffer) Decodes the data from a buffer.- Parameters:
buffer
- The buffer to decode the data from.
-