public class ItemStackRequirement extends AbstractRequirement
net.minecraft.command.impl.GiveCommand
's item stack
formatModifier and Type | Field and Description |
---|---|
protected java.util.List<net.minecraft.item.ItemStack> |
requiredItems |
error, typeId
Constructor and Description |
---|
ItemStackRequirement() |
Modifier and Type | Method and Description |
---|---|
java.util.List<net.minecraft.item.ItemStack> |
getRequiredItems() |
boolean |
hasMetRequirement(net.minecraft.entity.player.ServerPlayerEntity player,
DayCareBox box)
Determines if the player has met the given requirement
|
void |
read(net.minecraft.nbt.CompoundNBT nbt)
Reads the requirement from NBT
|
void |
read(com.google.gson.Gson gson,
com.google.gson.JsonElement json)
Reads the breeding requirement from JSON
|
void |
takeFrom(net.minecraft.entity.player.ServerPlayerEntity player,
DayCareBox box)
The logic for taking the items from the player
|
void |
write(net.minecraft.nbt.CompoundNBT nbt)
Writes the requirement to NBT
|
getError, getTypeId, setError
public void read(com.google.gson.Gson gson, com.google.gson.JsonElement json) throws java.lang.RuntimeException
DayCareRequirement
gson
- The GSON instancejson
- The JSON element to be parsedjava.lang.RuntimeException
public boolean hasMetRequirement(net.minecraft.entity.player.ServerPlayerEntity player, DayCareBox box)
DayCareRequirement
player
- The playerbox
- The box in relation topublic void takeFrom(net.minecraft.entity.player.ServerPlayerEntity player, DayCareBox box)
DayCareRequirement
player
- The playerpublic void write(net.minecraft.nbt.CompoundNBT nbt)
DayCareRequirement
nbt
- The NBT being written topublic void read(net.minecraft.nbt.CompoundNBT nbt)
DayCareRequirement
nbt
- The NBT being read frompublic java.util.List<net.minecraft.item.ItemStack> getRequiredItems()