public static class ItemSpawnerCore.SpawnerCoreStats extends java.lang.Object implements ISpawnerCoreStats
| Modifier and Type | Method and Description |
|---|---|
boolean |
addAmount(net.minecraft.entity.EntityType<?> type,
int toAdd)
Update the percentage level for the given entity type.
|
java.util.Set<net.minecraft.entity.EntityType<?>> |
getEntities()
Get the entity types stored in this spawner core
|
int |
getPercentage(net.minecraft.entity.EntityType<?> entityType)
Get the percentage of the core that the given entity type occupies
|
int |
getUnusedPercentage()
Get the unoccupied percentage of the core
|
net.minecraft.entity.EntityType<?> |
pickEntity(boolean includeUnused)
Pick a weighted random entity from the core.
|
void |
serialize(net.minecraft.item.ItemStack stack)
Serialize the current stats onto the given ItemStack, which must be a Spawner Core
|
public void serialize(net.minecraft.item.ItemStack stack)
ISpawnerCoreStatsserialize in interface ISpawnerCoreStatsstack - an ItemStackpublic java.util.Set<net.minecraft.entity.EntityType<?>> getEntities()
ISpawnerCoreStatsgetEntities in interface ISpawnerCoreStatspublic int getPercentage(net.minecraft.entity.EntityType<?> entityType)
ISpawnerCoreStatsgetPercentage in interface ISpawnerCoreStatsentityType - an entity typepublic int getUnusedPercentage()
ISpawnerCoreStatsgetUnusedPercentage in interface ISpawnerCoreStatspublic boolean addAmount(net.minecraft.entity.EntityType<?> type,
int toAdd)
ISpawnerCoreStats
The updated level is not automatically serialized to an ItemStack; see ISpawnerCoreStats.serialize(ItemStack) for that.
addAmount in interface ISpawnerCoreStatstype - an entity typetoAdd - the amount to adjust by, may be negativepublic net.minecraft.entity.EntityType<?> pickEntity(boolean includeUnused)
ISpawnerCoreStatspickEntity in interface ISpawnerCoreStatsincludeUnused - if true, the unused percentage will be taken into account, leading to a possible null
return value