public interface GameRegistry
Game
.
Note that the registries may be in flux, especially during game initialization. These will be accurate for the time they are called, however they may change at a later point. Do not assume that the contents of a collection will be all the entries that will exist.
Some of the returned instances my become incorrect if they are later
overwritten. However, this should occur prior to
GameState.POST_INITIALIZATION
.
<T extends CatalogType> Optional<T> getType(Class<T> typeClass, String id)
CatalogType
based on
the string id given.
Some types may not be available for various reasons including but not restricted to: mods adding custom types, plugins providing custom types, game version changes.
T
- The type of catalog typetypeClass
- The class of the type of CatalogType
id
- The string id of the catalog type<T extends CatalogType> Collection<T> getAllOf(Class<T> typeClass)
CatalogType
requested.
The presented CatalogType
s may not exist in default catalogs
due to various reasons including but not restricted to: mods, plugins,
game changes.
T
- The type of CatalogType
typeClass
- The class of CatalogType
<T> Optional<T> createBuilderOfType(Class<T> builderClass)
AttributeBuilder
,
FireworkEffectBuilder
, etc.T
- The type of builderbuilderClass
- The class of the builderBlockStateBuilder createBlockStateBuilder()
BlockStateBuilder
.BlockSnapshotBuilder createBlockSnapshotBuilder()
BlockSnapshotBuilder
.EntitySnapshotBuilder createEntitySnapshotBuilder()
EntitySnapshotBuilder
.ItemStackBuilder createItemBuilder()
TradeOfferBuilder createTradeOfferBuilder()
FireworkEffectBuilder createFireworkEffectBuilder()
FireworkEffectBuilder
.PotionEffectBuilder createPotionEffectBuilder()
ObjectiveBuilder createObjectiveBuilder()
TeamBuilder createTeamBuilder()
ScoreboardBuilder createScoreboardBuilder()
StatisticBuilder createStatisticBuilder()
StatisticBuilder
which may be used to create custom
Statistic
s.StatisticBuilder.EntityStatisticBuilder createEntityStatisticBuilder()
StatisticBuilder.EntityStatisticBuilder
which may be used to create custom EntityStatistic
s.StatisticBuilder.BlockStatisticBuilder createBlockStatisticBuilder()
StatisticBuilder.BlockStatisticBuilder
which may be used to create custom BlockStatistic
s.StatisticBuilder.ItemStatisticBuilder createItemStatisticBuilder()
StatisticBuilder.ItemStatisticBuilder
which may be used to create custom ItemStatistic
s.StatisticBuilder.TeamStatisticBuilder createTeamStatisticBuilder()
StatisticBuilder.TeamStatisticBuilder
which may be used to create custom TeamStatistic
s.AchievementBuilder createAchievementBuilder()
AchievementBuilder
which may be used to create
custom Achievement
s.AttributeModifierBuilder createAttributeModifierBuilder()
AttributeModifierBuilder
.AttributeCalculator getAttributeCalculator()
AttributeCalculator
.AttributeCalculator
AttributeBuilder createAttributeBuilder()
AttributeBuilder
.WorldBuilder createWorldBuilder()
ExplosionBuilder createExplosionBuilder()
ExplosionBuilder
for creating Explosion
s.ValueBuilder createValueBuilder()
ValueBuilder
for creating Value
s.ParticleEffectBuilder createParticleEffectBuilder(ParticleType particle)
ParticleType
.particle
- The particle typeCollection<Career> getCareers(Profession profession)
Career
s for the given profession.profession
- The villager profession to collection careers fromCollection<String> getDefaultGameRules()
Collection
of the default GameRules.Optional<EntityStatistic> getEntityStatistic(StatisticGroup statisticGroup, EntityType entityType)
Statistic
for the given StatisticGroup
and
EntityType
. If the statistic group is not a valid
EntityStatistic
group then Optional.absent()
will be
returned.statisticGroup
- The type of statistic to returnentityType
- The entity type for the statistic to returnOptional<ItemStatistic> getItemStatistic(StatisticGroup statisticGroup, ItemType itemType)
Statistic
for the given StatisticGroup
and
ItemType
. If the statistic group is not a valid
ItemStatistic
group then Optional.absent()
will be
returned.statisticGroup
- The type of statistic to returnitemType
- The item type for the statistic to returnOptional<BlockStatistic> getBlockStatistic(StatisticGroup statisticGroup, BlockType blockType)
Statistic
for the given StatisticGroup
and
BlockType
. If the statistic group is not a valid
BlockStatistic
group then Optional.absent()
will be
returned.statisticGroup
- The type of statistic to returnblockType
- The block type for the statistic to returnOptional<TeamStatistic> getTeamStatistic(StatisticGroup statisticGroup, TextColor teamColor)
Statistic
for the given StatisticGroup
and
team's TextColor
. If the StatisticGroup
is not a valid
TeamStatistic
group then Optional.absent()
will be
returned.statisticGroup
- The type of statistic to returnteamColor
- The team's color for the statistic to returnCollection<Statistic> getStatistics(StatisticGroup statisticGroup)
Statistic
s which belong to the given
StatisticGroup
.statisticGroup
- The statisticType to returnvoid registerStatistic(Statistic stat)
stat
- The custom statisticOptional<Rotation> getRotationFromDegree(int degrees)
Rotation
with the provided degrees.degrees
- The degrees of the rotationRotation
with the given degrees or Optional.absent() if not foundGameProfile createGameProfile(UUID uuid, String name)
GameProfile
using the specified unique identifier and name.uuid
- The unique identifier for the profilename
- The name for the profileFavicon loadFavicon(String raw) throws IOException
Favicon
from the specified encoded string. The format of
the input depends on the implementation.raw
- The encoded faviconIOException
- If the favicon couldn't be loadedFavicon loadFavicon(File file) throws IOException
File
.file
- The favicon fileIOException
- If the favicon couldn't be loadedFileNotFoundException
- If the file doesn't existFavicon loadFavicon(URL url) throws IOException
URL
.url
- The favicon URLIOException
- If the favicon couldn't be loadedFavicon loadFavicon(InputStream in) throws IOException
InputStream
.in
- The favicon input streamIOException
- If the favicon couldn't be loadedFavicon loadFavicon(BufferedImage image) throws IOException
BufferedImage
.image
- The favicon imageIOException
- If the favicon couldn't be loadedGameDictionary getGameDictionary()
RecipeRegistry getRecipeRegistry()
DataManipulatorRegistry getManipulatorRegistry()
DataManipulatorRegistry
for this GameRegistry
.ImmutableDataRegistry getImmutableDataRegistry()
ImmutableDataRegistry
for this GameRegistry
.Optional<ResourcePack> getById(String id)
ResourcePack
that's already been created by its ID.id
- The ID of the packOptional<DisplaySlot> getDisplaySlotForColor(TextColor color)
DisplaySlot
which displays only for teams
with the provided color.color
- The color for the display slotDisplaySlot
with the provided color, or Optional.absent() if not foundvoid registerWorldGeneratorModifier(WorldGeneratorModifier modifier)
WorldGeneratorModifier
, so that the server is able to
use it for modifying the world generator of a new world.modifier
- The modifier to registerPopulatorFactory getPopulatorFactory()
<E extends Extent> Transform.Builder<E> createTransformBuilder()
createTransformBuilder()
.withPosition(position)
.withRotation(rotation)
.build()
ExtentBufferFactory getExtentBufferFactory()
ExtentBufferFactory
for creating buffers
to store extent data.Optional<Translation> getTranslationById(String id)
Translation
with the provided ID.id
- The ID of the translationTranslation
with the given ID or Optional.absent() if not foundBlockDamageSourceBuilder createBlockDamageSourceBuilder()
DamageSourceBuilder createDamageSourceBuilder()
EntityDamageSourceBuilder createEntityDamageSourceBuilder()
FallingBlockDamageSourceBuilder createFallingBlockDamageSourceBuilder()
ProjectileDamageSourceBuilder createProjectileDamageSourceBuilder()
SpawnCauseBuilder createSpawnCauseBuilder()
BlockSpawnCauseBuilder createBlockSpawnCauseBuilder()
EntitySpawnCauseBuilder createEntitySpawnCauseBuilder()
BreedingSpawnCauseBuilder createBreedingSpawnCauseBuilder()
MobSpawnerSpawnCauseBuilder createMobSpawnerSpawnCauseBuilder()
WeatherSpawnCauseBuilder createWeatherSpawnCauseBuilder()