Replaced (along the Accessor) fully by:
global accessible method net/minecraft/advancement/criterion/Criteria register (Lnet/minecraft/advancement/criterion/Criterion;)Lnet/minecraft/advancement/criterion/Criterion;
Mod code changes from:
net.fabricmc.fabric.api.object.builder.v1.advancement.CriterionRegistry.register(...)
to calling Vanillas
net.minecraft.advancement.criterion.Criteria.register(...)
Replaced by an interface that is injected into Vanilla's Block.Settings
:
public interface FabricBlockSettings {
AbstractBlock.Settings breakByHand(boolean breakByHand);
AbstractBlock.Settings breakByTool(Tag<Item> tag, int miningLevel);
default AbstractBlock.Settings breakByTool(Tag<Item> tag) {
return breakByTool(tag, 0);
}
}
- NOTE: It'd be Fabric's choice to be bold and omit a prefix here, or use a
fabric
Prefix for the added Methods (i.e.fabricBreakByHand
).
using the V2 access widener:
global add-interface net/minecraft/block/AbstractBlock$Settings net/fabricmc/fabric/api/object/builder/v2/block/FabricBlockSettings
It is then implemented using the existing mixin net.fabricmc.fabric.mixin.object.builder.AbstractBlockSettingsMixin
:
@Mixin(AbstractBlock.Settings.class)
public abstract class AbstractBlockSettingsMixin implements BlockSettingsInternals, **FabricBlockSettings** {
[...]
@Override
public AbstractBlock.Settings breakByHand(boolean breakByHand) {
getOrCreateExtraData().breakByHand(breakByHand);
return (AbstractBlock.Settings) (Object) this;
}
@Override
public AbstractBlock.Settings breakByTool(Tag<Item> tag, int miningLevel) {
getOrCreateExtraData().addMiningLevel(tag, miningLevel);
return (AbstractBlock.Settings) (Object) this;
}
}
Mods can replace their uses of FabricBlockSettings
with the Vanilla block settings builder, and still call the Fabric specific methods.
Replaced by an interface that is injected into Vanilla's Material.Builder
, and a global access widener:
public interface FabricMaterialBuilder {
Material.Builder pistonBehavior(PistonBehavior behavior);
}
- NOTE: It'd be Fabric's choice to be bold and omit a prefix here, or use a
fabric
Prefix for the added Methods (i.e.fabricPistonBehavior
).
using the V2 access widener:
global add-interface net/minecraft/block/Material$Builder net/fabricmc/fabric/api/object/builder/v2/block/FabricMaterialBuilder
global accessible method net/minecraft/block/Material$Builder lightPassesThrough ()Lnet/minecraft/block/Material$Builder;
Mods can replace their uses of FabricMaterialBuilder
with the Vanilla material builder, and still call the Fabric specific methods.
can be replaced using a V2 access widener:
global accessible class net/minecraft/block/entity/BlockEntityType$BlockEntityFactory
Mods can replace their uses of FabricBlockEntityTypeBuilder
with the Vanilla block entity type builder.