Tags
Creators
Details
0.22.0
Compatibility
Changes
Ornithe Standard Libraries 0.22.0
OSL 0.22.0 supports Minecraft versions between Alpha 1.0.1_01 and Release 1.14.4.
Core 0.11.0
Direction and BlockPos
The Core API now provides its own Direction enum and BlockPos class. These provide the same functionality as the equivalent Vanilla classes in 1.8 and above, but are available for all supported Minecraft versions. They are utilized by the new Block States API in 1.7 and below.
Registries 0.2.0
Registry Keys
Expanded the RegistryKeys class with registry keys for biome, block entity, and entity registries.
Legacy String IDs
Namespaced IDs were introduced in 1.7 for blocks and items, and were slowly adopted for other registries in subsequent updates. Namespaced IDs are all lowercase and use snake_case. Legacy String IDs were not namespaced and were usually PascalCase instead. These legacy IDs cannot be used as namespaced IDs without some form of conversion.
The LegacyStringIds class provides methods to convert between namespaced IDs and the legacy format String IDs.
For legacy ID -> namespaced ID conversion, this means:
- Converting strings from PascalCase to snake_case. Consecutive uppercase letters are assumed to be an abbreviation and stick together:
TNTMinecart->tnt_minecart. - A
.-separated prefix is assumed to be a namespace:example.Cookie->example:cookie. If the ID has no such prefix, theminecraftnamespace is assumed.
For namespaced ID -> legacy ID conversion, this means:
- Converting strings from snake_case to PascalCase:
minecart_tnt->MinecartTnt. - Namespaces are prefixed to the ID, separated by a
.-character:example:cookie->example.Cookie. For IDs with theminecraftnamespace no prefix is attached.
Registry Sync
- Added new built-in ID-mapper:
DynamicInt2ObjectMapMapper, for maps whose contents may change throughout a world session. - When remapping registries, old numerical ID values will be re-used when possible, preventing unnecessary increase of numerical ID values.
- Improved logging of errors during remapping.
Block States 0.1.0
The Block States API implements block states in 1.7.10 and below, and extends functionality in 1.8 and above.
Block States in 1.7.10-
- Many methods in
Blockthat take inintparameters for block data values, directions and coordinates, are deprecated in favor of equivalent methods that take inBlockState,Direction, andBlockPosparameters. - The
WorldView,WorldChunk, andWorldChunkSectionclasses have been extended withBlockStategetters and setters. - A
StatefulBlockimplementation is provided that forwards calls to the deprecated methods to the equivalent methods that use block states. - The chunk format is not modified whatsoever. The block state getters and setters convert block states to/from block IDs and block data values and call the existing block ID and block data value getters and setters.
example usage:
package com.example;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import net.ornithemc.osl.blockstates.api.block.StatefulBlock;
import net.ornithemc.osl.blockstates.api.state.BlockState;
import net.ornithemc.osl.blockstates.api.state.StateDefinition;
import net.ornithemc.osl.blockstates.api.state.property.BooleanProperty;
import net.ornithemc.osl.blockstates.api.state.property.IntegerProperty;
import net.ornithemc.osl.core.api.util.math.BlockPos;
public class CookieBlock extends StatefulBlock {
public static final IntegerProperty BITES_TAKEN = IntegerProperty.of("bites_taken", 0, 7);
public static final BooleanProperty BAKED = BooleanProperty.of("baked");
public CookieBlock() {
super(Material.COOKIE);
}
@Override
public void buildStateDefinition(StateDefinition.Builder<Block, BlockState> builder) {
builder.add(BITES_TAKEN, BAKED);
}
@Override
public BlockState getStateFromMetadata(int metadata) {
int bitesTaken = metadata & 0x7
boolean baked = (metadata & 0x8) != 0;
return this.defaultState()
.set(BITES_TAKEN, bitesTaken)
.set(BAKED, baked);
}
@Override
public int getMetadataFromState(BlockState state) {
int bitesTaken = state.get(BITES_TAKEN);
int baked = state.get(BAKED) ? 0x8 : 0;
return baked | bitesTaken;
}
@Override
public void onAdded(World world, BlockPos pos, BlockState state) {
...
}
@Override
public void onRemoved(World world, BlockPos pos, BlockState state) {
...
}
}
Block States in 1.8+
- In 1.8, many methods are added that forward calls to equivalent methods in
Block(Vanilla did not do this until 1.9) - In 1.12 and below, several methods are added that do exist in 1.13+, like
isAir,ticksRandomly,canBePlaced,onAdded,onRemoved, and more.
Blocks 0.3.0
Moved Block functionality extensions into the Block States API.
Items 0.3.0
Fixes
- Fixes item model cache resetting when leaving a world or server, leading to corrupted GUI item textures when joining another world or server.
Block Entities 0.1.0
Basic APIs for registering block entity types.
package com.example;
import net.ornithemc.osl.blockentities.api.BlockEntityEvents;
import net.ornithemc.osl.entrypoints.api.ModInitializer;
public class ExampleInitializer implements ModInitializer {
@Override
public void init() {
BlockEntityEvents.REGISTER_BLOCK_ENTITY_TYPES.register(ExampleBlockEntityTypes::init);
}
}
package com.example;
import net.minecraft.block.entity.BlockEntityType;
import net.ornithemc.osl.blockentities.api.BlockEntityTypeRegistry;
import net.ornithemc.osl.blockentities.api.BlockEntityTypes;
import net.ornithemc.osl.core.util.NamespacedIdentifiers;
public final class ExampleBlockEntityTypes {
public static final BlockEntityType<CookieBlockEntity> COOKIE = BlockEntityTypeRegistry.register(NamespacedIdentifiers.from("example", "cookie"), BlockEntityTypes.builder(CookieBlockEntity::new, ExampleBlocks.COOKIE));
public static void init() {
}
}
Block Entities Rendering 0.1.0
Basic APIs for registering block entity renderers.
package com.example;
import net.ornithemc.osl.blockentities.api.client.BlockEntityRenderingEvents;
import net.ornithemc.osl.entrypoints.api.client.ClientModInitializer;
public class ExampleInitializer implements ClientModInitializer {
@Override
public void initClient() {
BlockEntityRenderingEvents.REGISTER_BLOCK_ENTITY_RENDERERS.register(registry -> {
registry.register(CookieBlockEntity.class, CookieBlockRenderer::new);
});
}
}
Entities 0.1.0
Basic APIs for registering entity types.
package com.example;
import net.ornithemc.osl.entities.api.EntityEvents;
import net.ornithemc.osl.entrypoints.api.ModInitializer;
public class ExampleInitializer implements ModInitializer {
@Override
public void init() {
EntityEvents.REGISTER_ENTITY_TYPES.register(ExampleEntityTypes::init);
}
}
package com.example;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.living.MobCategory;
import net.ornithemc.osl.entities.api.EntityTypeRegistry;
import net.ornithemc.osl.entities.api.EntityTypes;
import net.ornithemc.osl.core.util.NamespacedIdentifiers;
public final class ExampleEntityTypes {
public static final EntityType<CookieMonsterEntity> COOKIE_MONSTER = EntityTypeRegistry.register(NamespacedIdentifiers.from("example", "cookie_monster"), EntityTypes.builder(CookieMonsterEntity::new, MobCategory.MISC));
public static void init() {
}
}
Entities Rendering 0.1.0
Basic APIs for registering entity renderers.
package com.example;
import net.ornithemc.osl.entities.api.client.EntityRenderingEvents;
import net.ornithemc.osl.entrypoints.api.client.ClientModInitializer;
public class ExampleInitializer implements ClientModInitializer {
@Override
public void initClient() {
EntityRenderingEvents.REGISTER_ENTITY_RENDERERS.register(registry -> {
registry.register(CookieMonsterEntity.class, CookieMonsterRenderer::new);
});
}
}
Biomes 0.1.0
Basic API for registering biomes.
package com.example;
import net.ornithemc.osl.biomes.api.BiomeEvents;
import net.ornithemc.osl.entrypoints.api.ModInitializer;
public class ExampleInitializer implements ModInitializer {
@Override
public void init() {
BiomeEvents.REGISTER_BIOMES.register(ExampleBiomes::init);
}
}
package com.example;
import net.minecraft.world.biome.Biome;
import net.ornithemc.osl.biomes.api.BiomeRegistry;
import net.ornithemc.osl.core.util.NamespacedIdentifiers;
public final class ExampleBiomes {
public static final CookieBiome COOKIE = BiomeRegistry.register(NamespacedIdentifiers.from("example", "cookie"), new CookieBiome(new Biome.Settings().setName("Cookie")));
public static void init() {
}
}
Localization 0.1.2
- Fixes
L10n.getthrowing error if no translation exists.
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle. To learn more about the Modrinth Maven API, click here.
Note: When available, you should use the creator's maven repo instead as it will have transitive dependency information that the Modrinth Maven API does not. You may also end up with duplicate dependencies if you use a mix of Modrinth and non-Modrinth Maven repositories for your dependencies, because the group identifier will be different when served through the Modrinth Maven API.
Maven coordinates:
Version ID:
build.gradle:
repositories {
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
// forRepositories(fg.repository) // Uncomment when using ForgeGradle
filter {
includeGroup "maven.modrinth"
}
}
}
// Standard Gradle dependency
dependencies {
implementation "maven.modrinth:EHGtwpJv:8qR4kY5j"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:EHGtwpJv:8qR4kY5j"
}

