Links
Tags
Creators
Details
0.3.5
Compatibility
Required content
Changes
Right-click behavior, block entity sync, freeform multiblocks.
Everything here comes from one modder hitting the same wall three ways: RetroAPI gave you a place to put your block, and nothing to put in it.
BlockUseCallback, right-click behavior on any block, safely. Beta's CropBlock never overrides onUse, which tempts you into mixing a fresh onUse INTO CropBlock to add right-click harvest. That method then shadows Block.onUse, and every other mod's @Inject into Block.onUse silently stops running for crops. Their mod breaks, from three dependencies away, with no error anywhere. Listeners here compose: they run in order until one returns SUCCESS or FAIL, and the event fires for every block before its own onUse, so it can also replace or veto vanilla behavior.
BlockUseCallback.EVENT.register((player, world, held, x, y, z, face) -> {
if (world.getBlockId(x, y, z) != Block.WHEAT.id) return Result.PASS;
if (!world.isRemote) harvestAndReplant(world, x, y, z);
return Result.SUCCESS;
});
Hooked on the side that actually decides the interaction, the client in singleplayer and the dedicated server in multiplayer, so a listener runs exactly once per click.
RetroSyncedBlockEntity, block entity data on the client without an inventory. b1.7.3's protocol has no generic block entity packet. The only one that carries block entity data is the sign packet, so the one vanilla-shaped way for a modded block entity to reach the client was to masquerade as a container and push its state through the inventory and window packets. Anything that is not an inventory, a tank's fluid level, a machine's progress bar, a barrel's displayed stack, had no answer at all. Implement the interface and RetroAPI carries the NBT over its own channel, automatically on chunk send and on every setBlockDirty; RetroBlockEntities.sync(be) is the explicit push. It rides vanilla's own per-chunk player tracking, so only players who can see the block get the packet.
RetroMultiblock.matchAnywhere(...) and RetroBlockRegion. match assumed the position IS the anchor, the dedicated-controller shape: walk to the core block and click that. matchAnywhere tries the position as every cell in every rotation, so right-clicking any part of the structure works, and Match.anchor() says where the controller landed. RetroBlockRegion is the other half: a pattern is the wrong tool for a structure whose size and shape are the player's choice, so it floods outward from any block through whatever rule you give it, with a visit limit so an unbounded build comes back marked incomplete rather than freezing the tick.
Registrable tool tiers. RetroToolTier was an enum, which made its five tiers the only tiers that could ever exist. It is a registry now, and the built-ins are ordinary entries in it: RetroToolTier.register("bronze", 1, 5.0F). Levels need not be unique, so two tiers can harvest the same blocks and still differ in speed and in which needs_<name>_tool tag they answer to. Being a class rather than an enum, it can no longer be used in a switch or an EnumSet; compare with isAtLeast or read getLevel().
RetroToolTier.Positional, a tool tier that can see the block's position and state. Contextual gets the Block, which is the block TYPE, and every state of a block is the same Block object, so "diamond-tier on lit ore, wood-tier on unlit" was not expressible. Beta's harvest hooks carry no coordinates at all, so RetroAPI records what a player is breaking and hands the position over. Reads are validated against the world, so a stale record from an abandoned break can never answer for the wrong block.
RetroBlockAccess.AUTO_ID, which the item side has had since 0.3.0, plus block() and item() for reaching a vanilla method mid-chain.
Fixed: hoes no longer mine leaves faster. Material inference gave undeclared blocks a sensible default tool, and it was reaching vanilla blocks too. Leaves are the LEAVES material, modern Minecraft files leaves under mineable/hoe, and so merely installing RetroAPI handed every beta hoe a leaf-cutting bonus. Vanilla membership is spelled out block by block in VanillaToolTags, transcribed from beta's own tool code, and that is now the whole truth about vanilla blocks. A library has no business changing how vanilla plays.
Fixed: allocateId() reserves what it hands out. It scanned for a null slot and returned it, so two allocations before either constructor ran picked the same id and the second store silently won, the race RetroItemIds already closed on the item side.
Fixed: a javadoc that caused a bug. RetroModInitializer.initRetro() listed recipes among the things to register there. Every mod's initRetro() runs before any callback fires, but they run in mod load order relative to each other, so a recipe built there that names another mod's item works or fails depending on which mod loaded first. Register those in RecipeRegistrationCallback.EVENT instead, which is what it is for.
Built and validated with and without -Pstationapi on Ornithe (b1.7.3): all four launch smoke suites plus the four-stage conversion pipeline. The StationAPI run earned its keep this time, catching that the new use hook had been added to a mixin class RetroAPI disables under StationAPI, which would have shipped the event dead for every StationAPI user.
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:iFaqJ8QH:jb1nMFq8"
}
// Legacy Loom dependency
dependencies {
modImplementation "maven.modrinth:iFaqJ8QH:jb1nMFq8"
}


