Stope 2.6.0 for Fabric (1.20-1.20.1)
Curse Maven Snippet
What's new
New API for server-side tweaks: the gear a dying mob drops, natural spawns, dropped items that despawn, and small values saved on entities; and events for a player joining a server and the client joining a world. A settings screen can now edit a mod's settings file directly, one row per setting. Nothing changes in game until a mod uses it. Mods built for 2.0 through 2.5 run on 2.6.0 unchanged, unless they pass null where the Javadoc already forbade it.
API
- Added
MobEquipmentDropsCallbackand itsDrops(experimental, server): before a dying mob's hand and armor items drop,Drops.forceDropmakes any slot drop at full chance, with or without vanilla's random wear;Dropsalso gives the death'ssource,killer,recentlyHit, and each slot's vanilladropChance. - Added
NaturalSpawnCallback(experimental, server): cancel a mob's natural spawn; spawners, spawn eggs, commands, breeding, and structures are never asked. - Added
ItemExpiredCallback(experimental, server): act on a dropped item when it reaches its despawn age, and take items from its stack before the rest despawns. - Added
EntityData(experimental, server): keep an int under your own key on an entity, saved and loaded with it on every loader. - Added
PlayerJoinedCallback(experimental, server): fired once a player has joined and can be sent packets. - Added
ClientJoinCallback(experimental, client): fired once the client has joined a world and can send packets; the counterpart ofClientDisconnectCallback. - Added
SettingsScreen.builder(parent, prefix, file)and its key rowstoggle(ConfigKey),toggle(String, ConfigKey),intField(ConfigKey), anddecimalField(ConfigKey)(experimental, client): a settings screen that edits aConfigFile's values and saves them on Done, one row per key. - Changed
ConfigFile.of: it no longer looks up the config folder when called;path,load, andsavedo on first use, so astatic finalfield can hold the file in a class unit tests load. - Changed
MobGroups.define: it is all or nothing. A call that throws leaves the owner's earlier definitions and their groups as they were, and a nullownerthrowsNullPointerException. - Changed
Reactions.register,SettingsScreen.Builder.onSave,SettingsScreen.builder(prefix),BoatWood.item, andBoatWood.texture: a null argument throwsNullPointerExceptionat the call, as their Javadoc said, instead of failing later or returning null. - Changed
ReactionParams.getEntityMatcher: marked@Nullable; it returns null for an absent key, as before. - Changed
ConfigScreens.Factory.create:parentis marked@Nullable. Mod Menu and Forge's Mods screen never pass null, but a mod opening the screen another way may. - Changed the Javadoc of
CommandRegistrationCallbackandBiomeFeatures.addto name the threads their listeners andenabledrun on, on each loader. - Changed the Javadoc of
ReactionBinding.withoutandReactionContextto namecountamong what the next step keeps and what chose the members, and ofRegistryLookupsto nameServerStartedCallbackandDataPacksReloadedCallbackas whereblockTagreads current tags; aDataReloadershandler reads the previous ones.