public class ItemStackRequirement extends AbstractRequirement
net.minecraft.command.impl.GiveCommand's item stack
format| Modifier 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, setErrorpublic void read(com.google.gson.Gson gson,
com.google.gson.JsonElement json)
throws java.lang.RuntimeException
DayCareRequirementgson - The GSON instancejson - The JSON element to be parsedjava.lang.RuntimeExceptionpublic boolean hasMetRequirement(net.minecraft.entity.player.ServerPlayerEntity player,
DayCareBox box)
DayCareRequirementplayer - The playerbox - The box in relation topublic void takeFrom(net.minecraft.entity.player.ServerPlayerEntity player,
DayCareBox box)
DayCareRequirementplayer - The playerpublic void write(net.minecraft.nbt.CompoundNBT nbt)
DayCareRequirementnbt - The NBT being written topublic void read(net.minecraft.nbt.CompoundNBT nbt)
DayCareRequirementnbt - The NBT being read frompublic java.util.List<net.minecraft.item.ItemStack> getRequiredItems()