mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-14 11:15:06 -05:00
parent
97fc76fd23
commit
0af3f5a702
91 changed files with 262 additions and 245 deletions
|
@ -4,7 +4,7 @@ plugins {
|
|||
id "idea"
|
||||
id "maven-publish"
|
||||
id 'jacoco'
|
||||
id "fabric-loom" version "1.6.5" apply false
|
||||
id "fabric-loom" version "1.6.11" apply false
|
||||
id "com.diffplug.spotless" version "6.20.0"
|
||||
id "org.ajoberstar.grgit" version "3.1.0"
|
||||
id "me.modmuss50.remotesign" version "0.4.0" apply false
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-command-api-v2": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-command-api-v2": "*"
|
||||
},
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
]
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.18.2"
|
||||
},
|
||||
"description": "Contains common tags used by mods for vanilla things.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-key-binding-api-v1": "*"
|
||||
},
|
||||
"description": "Keybinding registry API.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-model-loading-api-v1": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.15-alpha.19.39.a",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-rendering-v1": "*"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-block-view-api-v2": "*"
|
||||
},
|
||||
"description": "Thread-safe hooks for block entity data use during terrain rendering.",
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
]
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.15-alpha.19.39.a",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-rendering-v1": "*"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Contains the essentials for Fabric API modules.",
|
||||
"custom": {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-lifecycle-events-v1": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.16.2"
|
||||
},
|
||||
"description": "Hooks for adding biomes to the default world generator.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"entrypoints": {
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Hooks for block views",
|
||||
"mixins": [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.15-alpha.19.38.b",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Adds the ability to load tags from the local mods.",
|
||||
"custom": {
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"minecraft": ">1.19-alpha.22.11.a"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-lifecycle-events-v1": "*",
|
||||
"fabric-resource-loader-v0": "*"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.18.2"
|
||||
},
|
||||
"description": "Contains common tags used by mods for vanilla things.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.20.5-beta.1",
|
||||
"fabric-lifecycle-events-v1": "*"
|
||||
},
|
||||
|
|
|
@ -37,7 +37,7 @@ public class TagUtilTest implements ModInitializer {
|
|||
@Override
|
||||
public void onInitialize() {
|
||||
ServerLifecycleEvents.SERVER_STARTED.register(server -> {
|
||||
if (!TagUtil.isIn(ConventionalEnchantmentTags.INCREASE_BLOCK_DROPS, Enchantments.FORTUNE)) {
|
||||
if (!TagUtil.isIn(server.getRegistryManager(), ConventionalEnchantmentTags.INCREASE_BLOCK_DROPS, server.getRegistryManager().get(RegistryKeys.ENCHANTMENT).get(Enchantments.FORTUNE))) {
|
||||
throw new AssertionError("Failed to find fortune in c:increase_block_drops!");
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Adds Fabric-related debug info to crash reports.",
|
||||
"mixins": [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-entity-events-v1": "*",
|
||||
"fabric-object-builder-api-v1": "*"
|
||||
},
|
||||
|
|
|
@ -52,7 +52,7 @@ public abstract class FabricBlockLootTableProvider extends BlockLootTableGenerat
|
|||
private final CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup;
|
||||
|
||||
protected FabricBlockLootTableProvider(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registryLookup) {
|
||||
super(Collections.emptySet(), FeatureFlags.FEATURE_MANAGER.getFeatureSet());
|
||||
super(Collections.emptySet(), FeatureFlags.FEATURE_MANAGER.getFeatureSet(), registryLookup.join());
|
||||
this.output = dataOutput;
|
||||
this.registryLookup = registryLookup;
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public abstract class FabricBlockLootTableProvider extends BlockLootTableGenerat
|
|||
}
|
||||
|
||||
@Override
|
||||
public void accept(RegistryWrapper.WrapperLookup registryLookup, BiConsumer<RegistryKey<LootTable>, LootTable.Builder> biConsumer) {
|
||||
public void accept(BiConsumer<RegistryKey<LootTable>, LootTable.Builder> biConsumer) {
|
||||
generate();
|
||||
|
||||
for (Map.Entry<RegistryKey<LootTable>, LootTable.Builder> entry : lootTables.entrySet()) {
|
||||
|
|
|
@ -47,6 +47,7 @@ import net.minecraft.stat.StatType;
|
|||
import net.minecraft.text.TextContent;
|
||||
import net.minecraft.text.TranslatableTextContent;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
|
||||
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
|
||||
|
@ -184,8 +185,8 @@ public abstract class FabricLanguageProvider implements DataProvider {
|
|||
* @param enchantment The {@link Enchantment} to get the translation key from.
|
||||
* @param value The value of the entry.
|
||||
*/
|
||||
default void add(Enchantment enchantment, String value) {
|
||||
add(enchantment.getTranslationKey(), value);
|
||||
default void addEnchantment(RegistryKey<Enchantment> enchantment, String value) {
|
||||
add(Util.createTranslationKey("enchantment", enchantment.getValue()), value);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -114,6 +114,7 @@ public abstract class FabricRecipeProvider extends RecipeProvider {
|
|||
|
||||
@Override
|
||||
public Advancement.Builder getAdvancementBuilder() {
|
||||
//noinspection removal
|
||||
return Advancement.Builder.createUntelemetered().parent(CraftingRecipeJsonBuilder.ROOT);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -212,12 +212,6 @@ public abstract class FabricTagProvider<T> extends TagProvider<T> {
|
|||
public EnchantmentTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) {
|
||||
super(output, RegistryKeys.ENCHANTMENT, completableFuture);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RegistryKey<Enchantment> reverseLookup(Enchantment element) {
|
||||
return Registries.ENCHANTMENT.getKey(element)
|
||||
.orElseThrow(() -> new IllegalArgumentException("Enchantment " + element + " is not registered"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -25,13 +25,14 @@ import net.minecraft.resource.featuretoggle.FeatureFlags;
|
|||
|
||||
import net.fabricmc.fabric.api.resource.conditions.v1.ResourceCondition;
|
||||
import net.fabricmc.fabric.impl.datagen.FabricDataGenHelper;
|
||||
import net.fabricmc.fabric.mixin.datagen.loot.BlockLootTableGeneratorAccessor;
|
||||
|
||||
public class ConditionBlockLootTableGenerator extends BlockLootTableGenerator {
|
||||
private final BlockLootTableGenerator parent;
|
||||
private final ResourceCondition[] conditions;
|
||||
|
||||
public ConditionBlockLootTableGenerator(BlockLootTableGenerator parent, ResourceCondition[] conditions) {
|
||||
super(Collections.emptySet(), FeatureFlags.FEATURE_MANAGER.getFeatureSet());
|
||||
super(Collections.emptySet(), FeatureFlags.FEATURE_MANAGER.getFeatureSet(), ((BlockLootTableGeneratorAccessor) parent).getRegistryLookup());
|
||||
|
||||
this.parent = parent;
|
||||
this.conditions = conditions;
|
||||
|
|
|
@ -58,7 +58,7 @@ public final class FabricLootTableProviderImpl {
|
|||
HashMap<Identifier, ResourceCondition[]> conditionMap = new HashMap<>();
|
||||
|
||||
return registryLookup.thenCompose(lookup -> {
|
||||
provider.accept(lookup, (registryKey, builder) -> {
|
||||
provider.accept((registryKey, builder) -> {
|
||||
ResourceCondition[] conditions = FabricDataGenHelper.consumeConditions(builder);
|
||||
conditionMap.put(registryKey.getValue(), conditions);
|
||||
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package net.fabricmc.fabric.mixin.datagen.loot;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.gen.Accessor;
|
||||
|
||||
import net.minecraft.data.server.loottable.BlockLootTableGenerator;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
|
||||
@Mixin(BlockLootTableGenerator.class)
|
||||
public interface BlockLootTableGeneratorAccessor {
|
||||
@Accessor()
|
||||
RegistryWrapper.WrapperLookup getRegistryLookup();
|
||||
}
|
|
@ -54,13 +54,7 @@ transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$B
|
|||
transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$LogTexturePool
|
||||
transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$BuiltinModelPool
|
||||
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SILK_TOUCH Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITHOUT_SILK_TOUCH Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SILK_TOUCH_OR_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITHOUT_SILK_TOUCH_NOR_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator SAPLING_DROP_CHANCE [F
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator LEAVES_STICK_DROP_CHANCE [F
|
||||
|
||||
### Generated access wideners below
|
||||
|
||||
|
@ -259,6 +253,10 @@ transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator
|
|||
transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator registerRoots (Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;)V
|
||||
transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator addJigsawOrientationToVariant (Lnet/minecraft/block/enums/Orientation;Lnet/minecraft/data/client/BlockStateVariant;)Lnet/minecraft/data/client/BlockStateVariant;
|
||||
transitive-accessible method net/minecraft/data/client/BlockStateModelGenerator registerCandle (Lnet/minecraft/block/Block;Lnet/minecraft/block/Block;)V
|
||||
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithoutSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithShearsOrSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator createWithoutShearsOrSilkTouchCondition ()Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator applyExplosionDecay (Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/loot/function/LootFunctionConsumingBuilder;)Lnet/minecraft/loot/function/LootFunctionConsumingBuilder;
|
||||
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator addSurvivesExplosionCondition (Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/loot/condition/LootConditionConsumingBuilder;)Lnet/minecraft/loot/condition/LootConditionConsumingBuilder;
|
||||
transitive-accessible method net/minecraft/data/server/loottable/BlockLootTableGenerator drops (Lnet/minecraft/block/Block;Lnet/minecraft/loot/condition/LootCondition$Builder;Lnet/minecraft/loot/entry/LootPoolEntry$Builder;)Lnet/minecraft/loot/LootTable$Builder;
|
||||
|
|
|
@ -3,11 +3,12 @@
|
|||
"package": "net.fabricmc.fabric.mixin.datagen",
|
||||
"compatibilityLevel": "JAVA_17",
|
||||
"mixins": [
|
||||
"loot.BlockLootTableGeneratorMixin",
|
||||
"DataProviderMixin",
|
||||
"TagProviderMixin",
|
||||
"ModelProviderMixin",
|
||||
"TagBuilderMixin"
|
||||
"TagBuilderMixin",
|
||||
"TagProviderMixin",
|
||||
"loot.BlockLootTableGeneratorAccessor",
|
||||
"loot.BlockLootTableGeneratorMixin"
|
||||
],
|
||||
"server": [
|
||||
"server.MainMixin"
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Allows for automatic data generation.",
|
||||
"mixins": [
|
||||
|
|
|
@ -58,7 +58,6 @@ import net.minecraft.loot.LootTable;
|
|||
import net.minecraft.loot.LootTables;
|
||||
import net.minecraft.loot.condition.BlockStatePropertyLootCondition;
|
||||
import net.minecraft.loot.condition.LootCondition;
|
||||
import net.minecraft.loot.condition.LootConditionTypes;
|
||||
import net.minecraft.loot.context.LootContextTypes;
|
||||
import net.minecraft.loot.entry.ItemEntry;
|
||||
import net.minecraft.loot.provider.number.ConstantLootNumberProvider;
|
||||
|
@ -403,7 +402,7 @@ public class DataGeneratorTestEntrypoint implements DataGeneratorEntrypoint {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void accept(RegistryWrapper.WrapperLookup registryLookup, BiConsumer<RegistryKey<LootTable>, LootTable.Builder> consumer) {
|
||||
public void accept(BiConsumer<RegistryKey<LootTable>, LootTable.Builder> consumer) {
|
||||
withConditions(consumer, ALWAYS_LOADED).accept(
|
||||
LootTables.PIGLIN_BARTERING_GAMEPLAY,
|
||||
LootTable.builder().pool(
|
||||
|
@ -435,7 +434,7 @@ public class DataGeneratorTestEntrypoint implements DataGeneratorEntrypoint {
|
|||
|
||||
private static class TestPredicateProvider extends FabricCodecDataProvider<LootCondition> {
|
||||
private TestPredicateProvider(FabricDataOutput dataOutput, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
|
||||
super(dataOutput, registriesFuture, DataOutput.OutputType.DATA_PACK, "predicates", LootConditionTypes.CODEC);
|
||||
super(dataOutput, registriesFuture, DataOutput.OutputType.DATA_PACK, "predicates", LootCondition.CODEC);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -49,12 +49,6 @@ transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$B
|
|||
transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$LogTexturePool
|
||||
transitive-accessible class net/minecraft/data/client/BlockStateModelGenerator$BuiltinModelPool
|
||||
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SILK_TOUCH Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITHOUT_SILK_TOUCH Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITH_SILK_TOUCH_OR_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator WITHOUT_SILK_TOUCH_NOR_SHEARS Lnet/minecraft/loot/condition/LootCondition$Builder;
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator SAPLING_DROP_CHANCE [F
|
||||
transitive-accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator LEAVES_STICK_DROP_CHANCE [F
|
||||
|
||||
### Generated access wideners below
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.16-rc.3",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Events to hook into entities.",
|
||||
"mixins": [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"minecraft": ">=1.15-alpha.19.37.a"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Allows registration of custom game rules.",
|
||||
"mixins": [
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
]
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-resource-loader-v0": "*"
|
||||
},
|
||||
"description": "Allows registration of custom game tests.",
|
||||
|
|
|
@ -18,6 +18,7 @@ package net.fabricmc.fabric.api.item.v1;
|
|||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
|
||||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.fabricmc.fabric.api.event.EventFactory;
|
||||
|
@ -44,7 +45,7 @@ public final class EnchantmentEvents {
|
|||
* <p>Note that allowing an enchantment using this event does not guarantee the item will receive that enchantment,
|
||||
* only that it isn't forbidden from doing so.</p>
|
||||
*
|
||||
* @see AllowEnchanting#allowEnchanting(Enchantment, ItemStack, EnchantingContext)
|
||||
* @see AllowEnchanting#allowEnchanting(RegistryEntry, ItemStack, EnchantingContext)
|
||||
* @see Enchantment#isAcceptableItem(ItemStack)
|
||||
* @see FabricItem#canBeEnchantedWith(ItemStack, Enchantment, EnchantingContext)
|
||||
*/
|
||||
|
@ -76,7 +77,7 @@ public final class EnchantmentEvents {
|
|||
* @see EnchantingContext
|
||||
*/
|
||||
TriState allowEnchanting(
|
||||
Enchantment enchantment,
|
||||
RegistryEntry<Enchantment> enchantment,
|
||||
ItemStack target,
|
||||
EnchantingContext enchantingContext
|
||||
);
|
||||
|
|
|
@ -21,6 +21,7 @@ import net.minecraft.enchantment.Enchantment;
|
|||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.util.Hand;
|
||||
|
||||
import net.fabricmc.fabric.impl.item.FabricItemInternals;
|
||||
|
@ -124,8 +125,8 @@ public interface FabricItem {
|
|||
* @param context the context in which the enchantment is being checked
|
||||
* @return whether the enchantment is allowed to apply to the stack
|
||||
*/
|
||||
default boolean canBeEnchantedWith(ItemStack stack, Enchantment enchantment, EnchantingContext context) {
|
||||
return enchantment.isAcceptableItem(stack);
|
||||
default boolean canBeEnchantedWith(ItemStack stack, RegistryEntry<Enchantment> enchantment, EnchantingContext context) {
|
||||
return enchantment.value().isAcceptableItem(stack);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -19,6 +19,7 @@ package net.fabricmc.fabric.api.item.v1;
|
|||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
|
||||
import net.fabricmc.fabric.api.util.TriState;
|
||||
|
||||
|
@ -49,9 +50,9 @@ public interface FabricItemStack {
|
|||
* @param enchantment the enchantment to check
|
||||
* @param context the context in which the enchantment is being checked
|
||||
* @return whether the enchantment is allowed to apply to the stack
|
||||
* @see FabricItem#canBeEnchantedWith(ItemStack, Enchantment, EnchantingContext)
|
||||
* @see FabricItem#canBeEnchantedWith(ItemStack, RegistryEntry, EnchantingContext)
|
||||
*/
|
||||
default boolean canBeEnchantedWith(Enchantment enchantment, EnchantingContext context) {
|
||||
default boolean canBeEnchantedWith(RegistryEntry<Enchantment> enchantment, EnchantingContext context) {
|
||||
TriState result = EnchantmentEvents.ALLOW_ENCHANTING.invoker().allowEnchanting(
|
||||
enchantment,
|
||||
(ItemStack) this,
|
||||
|
|
|
@ -37,7 +37,7 @@ public abstract class AbstractFurnaceBlockEntityMixin {
|
|||
private static final ThreadLocal<ItemStack> REMAINDER_STACK = new ThreadLocal<>();
|
||||
|
||||
@Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;getItem()Lnet/minecraft/item/Item;"), locals = LocalCapture.CAPTURE_FAILHARD, allow = 1)
|
||||
private static void getStackRemainder(World world, BlockPos pos, BlockState state, AbstractFurnaceBlockEntity blockEntity, CallbackInfo ci, boolean bl, boolean bl2, ItemStack itemStack, boolean bl3, boolean bl4, RecipeEntry<?> recipe, int i) {
|
||||
private static void getStackRemainder(World world, BlockPos pos, BlockState state, AbstractFurnaceBlockEntity blockEntity, CallbackInfo ci, boolean bl, boolean bl2, ItemStack itemStack, ItemStack itemStack2, boolean bl3, boolean bl4, RecipeEntry recipeEntry, int i) {
|
||||
REMAINDER_STACK.set(itemStack.getRecipeRemainder());
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.item;
|
||||
|
||||
import com.llamalad7.mixinextras.sugar.Local;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
|
@ -24,6 +25,7 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.screen.AnvilScreenHandler;
|
||||
import net.minecraft.screen.ForgingScreenHandler;
|
||||
import net.minecraft.screen.ScreenHandlerContext;
|
||||
|
@ -44,7 +46,7 @@ abstract class AnvilScreenHandlerMixin extends ForgingScreenHandler {
|
|||
target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z"
|
||||
)
|
||||
)
|
||||
private boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack) {
|
||||
return stack.canBeEnchantedWith(instance, EnchantingContext.ANVIL);
|
||||
private boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack, @Local RegistryEntry<Enchantment> registryEntry) {
|
||||
return stack.canBeEnchantedWith(registryEntry, EnchantingContext.ANVIL);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,13 +16,18 @@
|
|||
|
||||
package net.fabricmc.fabric.mixin.item;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.server.command.EnchantCommand;
|
||||
import net.minecraft.server.command.ServerCommandSource;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.EnchantingContext;
|
||||
|
||||
|
@ -32,7 +37,7 @@ abstract class EnchantCommandMixin {
|
|||
method = "execute",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z")
|
||||
)
|
||||
private static boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack) {
|
||||
return stack.canBeEnchantedWith(instance, EnchantingContext.ENCHANT_COMMAND);
|
||||
private static boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack, ServerCommandSource source, Collection<? extends Entity> targets, RegistryEntry<Enchantment> enchantment) {
|
||||
return stack.canBeEnchantedWith(enchantment, EnchantingContext.ENCHANT_COMMAND);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,16 +23,17 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.loot.function.EnchantRandomlyLootFunction;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.EnchantingContext;
|
||||
|
||||
@Mixin(EnchantRandomlyLootFunction.class)
|
||||
abstract class EnchantRandomlyLootFunctionMixin {
|
||||
@Redirect(
|
||||
method = "method_53327",
|
||||
method = "method_60291",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z")
|
||||
)
|
||||
private static boolean callAllowEnchantingEvent(Enchantment instance, ItemStack stack) {
|
||||
return stack.canBeEnchantedWith(instance, EnchantingContext.LOOT_RANDOM_ENCHANTMENT);
|
||||
private static boolean callAllowEnchantingEvent(Enchantment enchantment, ItemStack stack, boolean bl, ItemStack itemStack, RegistryEntry<Enchantment> registryEntry) {
|
||||
return stack.canBeEnchantedWith(registryEntry, EnchantingContext.LOOT_RANDOM_ENCHANTMENT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,16 +23,17 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.EnchantingContext;
|
||||
|
||||
@Mixin(EnchantmentHelper.class)
|
||||
abstract class EnchantmentHelperMixin {
|
||||
@Redirect(
|
||||
method = "getPossibleEntries",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isAcceptableItem(Lnet/minecraft/item/ItemStack;)Z")
|
||||
method = "method_60143",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/enchantment/Enchantment;isPrimaryItem(Lnet/minecraft/item/ItemStack;)Z")
|
||||
)
|
||||
private static boolean useCustomEnchantingChecks(Enchantment instance, ItemStack stack) {
|
||||
return stack.canBeEnchantedWith(instance, EnchantingContext.RANDOM_ENCHANTMENT);
|
||||
private static boolean useCustomEnchantingChecks(Enchantment instance, ItemStack stack, ItemStack itemStack, boolean bl, RegistryEntry<Enchantment> registryEntry) {
|
||||
return stack.canBeEnchantedWith(registryEntry, EnchantingContext.RANDOM_ENCHANTMENT);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import net.minecraft.entity.EquipmentSlot;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.util.math.random.Random;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
|
||||
import net.fabricmc.fabric.api.item.v1.CustomDamageHandler;
|
||||
import net.fabricmc.fabric.api.item.v1.FabricItemStack;
|
||||
|
@ -38,8 +38,8 @@ import net.fabricmc.fabric.impl.item.ItemExtensions;
|
|||
public abstract class ItemStackMixin implements FabricItemStack {
|
||||
@Shadow public abstract Item getItem();
|
||||
|
||||
@WrapOperation(method = "damage(ILnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;damage(ILnet/minecraft/util/math/random/Random;Lnet/minecraft/server/network/ServerPlayerEntity;Ljava/lang/Runnable;)V"))
|
||||
private void hookDamage(ItemStack instance, int amount, Random random, ServerPlayerEntity serverPlayerEntity, Runnable runnable, Operation<Void> original, @Local(argsOnly = true) EquipmentSlot slot) {
|
||||
@WrapOperation(method = "damage(ILnet/minecraft/entity/LivingEntity;Lnet/minecraft/entity/EquipmentSlot;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemStack;damage(ILnet/minecraft/server/world/ServerWorld;Lnet/minecraft/server/network/ServerPlayerEntity;Ljava/lang/Runnable;)V"))
|
||||
private void hookDamage(ItemStack instance, int amount, ServerWorld serverWorld, ServerPlayerEntity serverPlayerEntity, Runnable runnable, Operation<Void> original, @Local(argsOnly = true) EquipmentSlot slot) {
|
||||
CustomDamageHandler handler = ((ItemExtensions) getItem()).fabric_getCustomDamageHandler();
|
||||
|
||||
if (handler != null) {
|
||||
|
@ -54,6 +54,6 @@ public abstract class ItemStackMixin implements FabricItemStack {
|
|||
if (mut.booleanValue()) return;
|
||||
}
|
||||
|
||||
original.call(instance, amount, random, serverPlayerEntity, runnable);
|
||||
original.call(instance, amount, serverWorld, serverPlayerEntity, runnable);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,20 +23,20 @@ import org.spongepowered.asm.mixin.injection.Redirect;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
|
||||
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.input.RecipeInput;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
|
||||
import net.fabricmc.fabric.impl.item.RecipeRemainderHandler;
|
||||
|
||||
@Mixin(Recipe.class)
|
||||
public interface RecipeMixin<C extends Inventory> {
|
||||
@Inject(method = "getRemainder", at = @At(value = "INVOKE", target = "Lnet/minecraft/inventory/Inventory;getStack(I)Lnet/minecraft/item/ItemStack;"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
default void captureStack(C inventory, CallbackInfoReturnable<DefaultedList<ItemStack>> cir, DefaultedList<ItemStack> defaultedList, int i) {
|
||||
RecipeRemainderHandler.REMAINDER_STACK.set(inventory.getStack(i).getRecipeRemainder());
|
||||
public interface RecipeMixin<T extends RecipeInput> {
|
||||
@Inject(method = "getRemainder", at = @At(value = "INVOKE", target = "Lnet/minecraft/recipe/input/RecipeInput;getStackInSlot(I)Lnet/minecraft/item/ItemStack;"), locals = LocalCapture.CAPTURE_FAILHARD)
|
||||
default void captureStack(T inventory, CallbackInfoReturnable<DefaultedList<ItemStack>> cir, DefaultedList<ItemStack> defaultedList, int i) {
|
||||
RecipeRemainderHandler.REMAINDER_STACK.set(inventory.getStackInSlot(i).getRecipeRemainder());
|
||||
}
|
||||
|
||||
@Redirect(method = "getRemainder", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/Item;hasRecipeRemainder()Z"))
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
}
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"description": "Hooks for items",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package net.fabricmc.fabric.test.item;
|
||||
|
||||
import net.minecraft.component.DataComponentType;
|
||||
import net.minecraft.component.ComponentType;
|
||||
import net.minecraft.enchantment.Enchantment;
|
||||
import net.minecraft.enchantment.EnchantmentHelper;
|
||||
import net.minecraft.enchantment.Enchantments;
|
||||
|
@ -29,6 +29,7 @@ import net.minecraft.network.codec.PacketCodecs;
|
|||
import net.minecraft.potion.Potions;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
import net.minecraft.registry.entry.RegistryEntry;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.dynamic.Codecs;
|
||||
|
@ -42,8 +43,8 @@ import net.fabricmc.fabric.api.registry.FuelRegistry;
|
|||
import net.fabricmc.fabric.api.util.TriState;
|
||||
|
||||
public class CustomDamageTest implements ModInitializer {
|
||||
public static final DataComponentType<Integer> WEIRD = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("fabric-item-api-v1-testmod", "weird"),
|
||||
DataComponentType.<Integer>builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build());
|
||||
public static final ComponentType<Integer> WEIRD = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("fabric-item-api-v1-testmod", "weird"),
|
||||
ComponentType.<Integer>builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build());
|
||||
public static final CustomDamageHandler WEIRD_DAMAGE_HANDLER = (stack, amount, entity, slot, breakCallback) -> {
|
||||
// If sneaking, apply all damage to vanilla. Otherwise, increment a tag on the stack by one and don't apply any damage
|
||||
if (entity.isSneaking()) {
|
||||
|
@ -62,9 +63,17 @@ public class CustomDamageTest implements ModInitializer {
|
|||
FuelRegistry.INSTANCE.add(WEIRD_PICK, 200);
|
||||
FabricBrewingRecipeRegistryBuilder.BUILD.register(builder -> builder.registerPotionRecipe(Potions.WATER, WEIRD_PICK, Potions.AWKWARD));
|
||||
EnchantmentEvents.ALLOW_ENCHANTING.register(((enchantment, target, enchantingContext) -> {
|
||||
if (target.isOf(Items.DIAMOND_PICKAXE)
|
||||
&& enchantment == Enchantments.SHARPNESS
|
||||
&& EnchantmentHelper.hasSilkTouch(target)) {
|
||||
// TODO 1.21 this is clearly wrong
|
||||
boolean hasSilkTouch = false;
|
||||
|
||||
for (RegistryEntry<Enchantment> entry : EnchantmentHelper.getEnchantments(target).getEnchantments()) {
|
||||
if (entry.getKey().orElse(null) == Enchantments.SILK_TOUCH) {
|
||||
hasSilkTouch = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.isOf(Items.DIAMOND_PICKAXE) && enchantment == Enchantments.SHARPNESS && hasSilkTouch) {
|
||||
return TriState.TRUE;
|
||||
}
|
||||
|
||||
|
@ -96,7 +105,7 @@ public class CustomDamageTest implements ModInitializer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeEnchantedWith(ItemStack stack, Enchantment enchantment, EnchantingContext context) {
|
||||
public boolean canBeEnchantedWith(ItemStack stack, RegistryEntry<Enchantment> enchantment, EnchantingContext context) {
|
||||
return context == EnchantingContext.ANVIL && enchantment == Enchantments.FIRE_ASPECT
|
||||
|| enchantment != Enchantments.FORTUNE && super.canBeEnchantedWith(stack, enchantment, context);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
package net.fabricmc.fabric.test.item;
|
||||
|
||||
import net.minecraft.component.DataComponentType;
|
||||
import net.minecraft.component.ComponentType;
|
||||
import net.minecraft.network.codec.PacketCodecs;
|
||||
import net.minecraft.registry.Registries;
|
||||
import net.minecraft.registry.Registry;
|
||||
|
@ -26,8 +26,8 @@ import net.minecraft.util.dynamic.Codecs;
|
|||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class ItemUpdateAnimationTest implements ModInitializer {
|
||||
public static final DataComponentType<Integer> TICKS = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("fabric-item-api-v1-testmod", "ticks"),
|
||||
DataComponentType.<Integer>builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build());
|
||||
public static final ComponentType<Integer> TICKS = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier("fabric-item-api-v1-testmod", "ticks"),
|
||||
ComponentType.<Integer>builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build());
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
|
|
|
@ -16,12 +16,14 @@
|
|||
|
||||
package net.fabricmc.fabric.test.item.gametest;
|
||||
|
||||
import net.minecraft.inventory.SimpleInventory;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.recipe.Recipe;
|
||||
import net.minecraft.recipe.RecipeSerializer;
|
||||
import net.minecraft.recipe.RecipeType;
|
||||
import net.minecraft.recipe.input.CraftingRecipeInput;
|
||||
import net.minecraft.registry.RegistryWrapper;
|
||||
import net.minecraft.test.GameTest;
|
||||
import net.minecraft.test.GameTestException;
|
||||
|
@ -35,11 +37,11 @@ import net.fabricmc.fabric.test.item.CustomDamageTest;
|
|||
public class RecipeGameTest implements FabricGameTest {
|
||||
@GameTest(templateName = EMPTY_STRUCTURE)
|
||||
public void vanillaRemainderTest(TestContext context) {
|
||||
Recipe<SimpleInventory> testRecipe = createTestingRecipeInstance();
|
||||
Recipe<CraftingRecipeInput> testRecipe = createTestingRecipeInstance();
|
||||
|
||||
SimpleInventory inventory = new SimpleInventory(
|
||||
CraftingRecipeInput inventory = CraftingRecipeInput.create(1, 2, List.of(
|
||||
new ItemStack(Items.WATER_BUCKET),
|
||||
new ItemStack(Items.DIAMOND));
|
||||
new ItemStack(Items.DIAMOND)));
|
||||
|
||||
DefaultedList<ItemStack> remainderList = testRecipe.getRemainder(inventory);
|
||||
|
||||
|
@ -52,13 +54,13 @@ public class RecipeGameTest implements FabricGameTest {
|
|||
|
||||
@GameTest(templateName = EMPTY_STRUCTURE)
|
||||
public void fabricRemainderTest(TestContext context) {
|
||||
Recipe<SimpleInventory> testRecipe = createTestingRecipeInstance();
|
||||
Recipe<CraftingRecipeInput> testRecipe = createTestingRecipeInstance();
|
||||
|
||||
SimpleInventory inventory = new SimpleInventory(
|
||||
CraftingRecipeInput inventory = CraftingRecipeInput.create(1, 4, List.of(
|
||||
new ItemStack(CustomDamageTest.WEIRD_PICK),
|
||||
withDamage(new ItemStack(CustomDamageTest.WEIRD_PICK), 10),
|
||||
withDamage(new ItemStack(CustomDamageTest.WEIRD_PICK), 31),
|
||||
new ItemStack(Items.DIAMOND));
|
||||
new ItemStack(Items.DIAMOND)));
|
||||
|
||||
DefaultedList<ItemStack> remainderList = testRecipe.getRemainder(inventory);
|
||||
|
||||
|
@ -71,15 +73,15 @@ public class RecipeGameTest implements FabricGameTest {
|
|||
context.complete();
|
||||
}
|
||||
|
||||
private Recipe<SimpleInventory> createTestingRecipeInstance() {
|
||||
private Recipe<CraftingRecipeInput> createTestingRecipeInstance() {
|
||||
return new Recipe<>() {
|
||||
@Override
|
||||
public boolean matches(SimpleInventory inventory, World world) {
|
||||
public boolean matches(CraftingRecipeInput recipeInput, World world) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack craft(SimpleInventory inventory, RegistryWrapper.WrapperLookup wrapperLookup) {
|
||||
public ItemStack craft(CraftingRecipeInput recipeInput, RegistryWrapper.WrapperLookup wrapperLookup) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ abstract class ItemGroupMixin implements FabricItemGroup {
|
|||
private int fabric_page = -1;
|
||||
|
||||
@SuppressWarnings("ConstantConditions")
|
||||
@Inject(method = "updateEntries", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/ItemGroup;reloadSearchProvider()V"))
|
||||
@Inject(method = "updateEntries", at = @At("TAIL"))
|
||||
public void getStacks(ItemGroup.DisplayContext context, CallbackInfo ci) {
|
||||
final ItemGroup self = (ItemGroup) (Object) this;
|
||||
final RegistryKey<ItemGroup> registryKey = Registries.ITEM_GROUP.getKey(self).orElseThrow(() -> new IllegalStateException("Unregistered item group : " + self));
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-resource-loader-v0": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Key Binding registry API.",
|
||||
"mixins": [
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
}
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"description": "Events for the game's lifecycle.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-resource-loader-v0": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"description": "Adds message-related hooks.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"breaks": {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
},
|
||||
"accessWidener": "fabric-networking-api-v1.accesswidener",
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"description": "Low-level, vanilla protocol oriented networking hooks.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"description": "Builders for objects vanilla has locked down.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Hooks for registering custom particles.",
|
||||
"mixins": [
|
||||
|
|
|
@ -28,7 +28,7 @@ import com.mojang.serialization.codecs.RecordCodecBuilder;
|
|||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import net.minecraft.component.ComponentChanges;
|
||||
import net.minecraft.component.DataComponentType;
|
||||
import net.minecraft.component.ComponentType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.RegistryByteBuf;
|
||||
import net.minecraft.network.codec.PacketCodec;
|
||||
|
@ -58,8 +58,8 @@ public class ComponentsIngredient implements CustomIngredient {
|
|||
if (!base.test(stack)) return false;
|
||||
|
||||
// None strict matching
|
||||
for (Map.Entry<DataComponentType<?>, Optional<?>> entry : components.entrySet()) {
|
||||
final DataComponentType<?> type = entry.getKey();
|
||||
for (Map.Entry<ComponentType<?>, Optional<?>> entry : components.entrySet()) {
|
||||
final ComponentType<?> type = entry.getKey();
|
||||
final Optional<?> value = entry.getValue();
|
||||
|
||||
if (value.isPresent()) {
|
||||
|
|
|
@ -28,11 +28,11 @@ import org.spongepowered.asm.mixin.injection.Inject;
|
|||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import net.minecraft.inventory.RecipeInputInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.recipe.Ingredient;
|
||||
import net.minecraft.recipe.ShapelessRecipe;
|
||||
import net.minecraft.recipe.book.CraftingRecipeCategory;
|
||||
import net.minecraft.recipe.input.CraftingRecipeInput;
|
||||
import net.minecraft.util.collection.DefaultedList;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -56,13 +56,13 @@ public class ShapelessRecipeMixin {
|
|||
}
|
||||
}
|
||||
|
||||
@Inject(at = @At("HEAD"), method = "matches", cancellable = true)
|
||||
public void customIngredientMatch(RecipeInputInventory craftingInventory, World world, CallbackInfoReturnable<Boolean> cir) {
|
||||
@Inject(at = @At("HEAD"), method = "matches(Lnet/minecraft/recipe/input/CraftingRecipeInput;Lnet/minecraft/world/World;)Z", cancellable = true)
|
||||
public void customIngredientMatch(CraftingRecipeInput recipeInput, World world, CallbackInfoReturnable<Boolean> cir) {
|
||||
if (fabric_requiresTesting) {
|
||||
List<ItemStack> nonEmptyStacks = new ArrayList<>(craftingInventory.size());
|
||||
List<ItemStack> nonEmptyStacks = new ArrayList<>(recipeInput.getStackCount());
|
||||
|
||||
for (int i = 0; i < craftingInventory.size(); ++i) {
|
||||
ItemStack stack = craftingInventory.getStack(i);
|
||||
for (int i = 0; i < recipeInput.getStackCount(); ++i) {
|
||||
ItemStack stack = recipeInput.getStackInSlot(i);
|
||||
|
||||
if (!stack.isEmpty()) {
|
||||
nonEmptyStacks.add(stack);
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
],
|
||||
"accessWidener": "fabric-recipe-api-v1.accesswidener",
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-networking-api-v1": "*"
|
||||
},
|
||||
"entrypoints": {
|
||||
|
|
|
@ -16,12 +16,14 @@
|
|||
|
||||
package net.fabricmc.fabric.test.recipe.ingredient;
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.recipe.ShapelessRecipe;
|
||||
import net.minecraft.screen.ScreenHandler;
|
||||
import net.minecraft.recipe.input.CraftingRecipeInput;
|
||||
import net.minecraft.test.GameTest;
|
||||
import net.minecraft.test.GameTestException;
|
||||
import net.minecraft.test.TestContext;
|
||||
|
@ -42,30 +44,16 @@ public class ShapelessRecipeMatchTests {
|
|||
ItemStack damagedPickaxe = new ItemStack(Items.DIAMOND_PICKAXE);
|
||||
damagedPickaxe.setDamage(100);
|
||||
|
||||
CraftingInventory craftingInv = new CraftingInventory(new ScreenHandler(null, 0) {
|
||||
@Override
|
||||
public ItemStack quickMove(PlayerEntity player, int slot) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
List<ItemStack> damagedPickaxes = Collections.nCopies(9, damagedPickaxe);
|
||||
|
||||
@Override
|
||||
public boolean canUse(PlayerEntity player) {
|
||||
return false;
|
||||
}
|
||||
}, 3, 3);
|
||||
|
||||
// Test that damaged only doesn't work
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
craftingInv.setStack(i, damagedPickaxe);
|
||||
}
|
||||
|
||||
if (recipe.matches(craftingInv, context.getWorld())) {
|
||||
if (recipe.matches(CraftingRecipeInput.create(3, 3, damagedPickaxes), context.getWorld())) {
|
||||
throw new GameTestException("Recipe should not match with only damaged pickaxes");
|
||||
}
|
||||
|
||||
craftingInv.setStack(1, undamagedPickaxe);
|
||||
List<ItemStack> oneUndamagedPickaxe = new LinkedList<>(damagedPickaxes);
|
||||
oneUndamagedPickaxe.set(0, undamagedPickaxe);
|
||||
|
||||
if (!recipe.matches(craftingInv, context.getWorld())) {
|
||||
if (!recipe.matches(CraftingRecipeInput.create(3, 3, oneUndamagedPickaxe), context.getWorld())) {
|
||||
throw new GameTestException("Recipe should match with at least one undamaged pickaxe");
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public final class DynamicRegistriesImpl {
|
|||
throw new IllegalArgumentException("Dynamic registry " + key + " has already been registered!");
|
||||
}
|
||||
|
||||
var entry = new RegistryLoader.Entry<>(key, codec);
|
||||
var entry = new RegistryLoader.Entry<>(key, codec, false);
|
||||
DYNAMIC_REGISTRIES.add(entry);
|
||||
FABRIC_DYNAMIC_REGISTRY_KEYS.add(key);
|
||||
return entry;
|
||||
|
@ -74,7 +74,7 @@ public final class DynamicRegistriesImpl {
|
|||
RegistryLoader.SYNCED_REGISTRIES = new ArrayList<>(RegistryLoader.SYNCED_REGISTRIES);
|
||||
}
|
||||
|
||||
RegistryLoader.SYNCED_REGISTRIES.add(new RegistryLoader.Entry<>(key, networkCodec));
|
||||
RegistryLoader.SYNCED_REGISTRIES.add(new RegistryLoader.Entry<>(key, networkCodec, false));
|
||||
|
||||
if (!(SerializableRegistries.SYNCED_REGISTRIES instanceof HashSet<RegistryKey<? extends Registry<?>>>)) {
|
||||
SerializableRegistries.SYNCED_REGISTRIES = new HashSet<>(SerializableRegistries.SYNCED_REGISTRIES);
|
||||
|
|
|
@ -53,10 +53,6 @@ public class FabricRegistryInit implements ModInitializer {
|
|||
RegistryAttributeHolder.get(Registries.BLOCK)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
||||
// Synced in EnchantmentScreenHandler
|
||||
RegistryAttributeHolder.get(Registries.ENCHANTMENT)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
||||
// Synced in EntitySpawnS2CPacket and RegistryTagManager
|
||||
RegistryAttributeHolder.get(Registries.ENTITY_TYPE)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
@ -101,10 +97,6 @@ public class FabricRegistryInit implements ModInitializer {
|
|||
RegistryAttributeHolder.get(Registries.BLOCK_ENTITY_TYPE)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
||||
// Synced in PaintingSpawnS2CPacket
|
||||
RegistryAttributeHolder.get(Registries.PAINTING_VARIANT)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
||||
// Synced via PacketCodecs.registry
|
||||
RegistryAttributeHolder.get(Registries.CUSTOM_STAT)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
@ -137,10 +129,6 @@ public class FabricRegistryInit implements ModInitializer {
|
|||
RegistryAttributeHolder.get(Registries.FROG_VARIANT)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
||||
// Uses a data tracker (and thus, raw IDs) to sync painting entities to the client
|
||||
RegistryAttributeHolder.get(Registries.PAINTING_VARIANT)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
||||
// Uses the raw ID when syncing the command tree to the client
|
||||
RegistryAttributeHolder.get(Registries.COMMAND_ARGUMENT_TYPE)
|
||||
.addAttribute(RegistryAttribute.SYNCED);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-networking-api-v1": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.15-alpha.19.39.a",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.15-alpha.19.39.a",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-renderer-api-v1": "*"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"description": "Hooks for registering fluid renders.",
|
||||
|
|
|
@ -29,7 +29,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
|||
|
||||
@Mixin(InGameHud.class)
|
||||
public class InGameHudMixin {
|
||||
@Inject(method = "render", at = @At(value = "TAIL"), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/PlayerListHud;render(Lnet/minecraft/client/gui/DrawContext;ILnet/minecraft/scoreboard/Scoreboard;Lnet/minecraft/scoreboard/ScoreboardObjective;)V")))
|
||||
@Inject(method = "render", at = @At(value = "TAIL"), slice = @Slice(from = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/LayeredDrawer;render(Lnet/minecraft/client/gui/DrawContext;F)V")))
|
||||
public void render(DrawContext drawContext, float tickDelta, CallbackInfo callbackInfo) {
|
||||
HudRenderCallback.EVENT.invoker().onHudRender(drawContext, tickDelta);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"description": "Hooks and registries for rendering-related things.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Allows conditionally loading resources.",
|
||||
"entrypoints": {
|
||||
|
|
|
@ -58,7 +58,7 @@ public class SimpleResourceReloadMixin {
|
|||
return sorted;
|
||||
}
|
||||
|
||||
@Redirect(method = "start", at = @At(value = "NEW", target = "Lnet/minecraft/resource/ProfiledResourceReload;<init>"))
|
||||
@Redirect(method = "start", at = @At(value = "NEW", target = "(Lnet/minecraft/resource/ResourceManager;Ljava/util/List;Ljava/util/concurrent/Executor;Ljava/util/concurrent/Executor;Ljava/util/concurrent/CompletableFuture;)Lnet/minecraft/resource/ProfiledResourceReload;"))
|
||||
private static ProfiledResourceReload sortProfiled(ResourceManager manager, List<ResourceReloader> reloaders, Executor prepareExecutor, Executor applyExecutor, CompletableFuture<Unit> initialStage) {
|
||||
List<ResourceReloader> sorted = ResourceManagerHelperImpl.sort(fabric_resourceType.get(), reloaders);
|
||||
fabric_resourceType.set(null);
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Asset and data resource loading.",
|
||||
"mixins": [
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*"
|
||||
},
|
||||
"description": "Adds screen related hooks.",
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-base": "*",
|
||||
"fabric-networking-api-v1": "*"
|
||||
},
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"minecraft": ">=1.19.2"
|
||||
},
|
||||
"description": "Hooks for modifying Minecraft's sound system.",
|
||||
|
|
|
@ -20,5 +20,5 @@ package net.fabricmc.fabric.api.transfer.v1.storage.base;
|
|||
* An immutable object storing both a resource and an amount, provided for convenience.
|
||||
* @param <T> The type of the stored resource.
|
||||
*/
|
||||
public record ResourceAmount<T> (T resource, long amount) {
|
||||
public record ResourceAmount<T>(T resource, long amount) {
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import net.minecraft.block.entity.BrewingStandBlockEntity;
|
|||
import net.minecraft.block.entity.ChestBlockEntity;
|
||||
import net.minecraft.block.entity.ShulkerBoxBlockEntity;
|
||||
import net.minecraft.block.enums.ChestType;
|
||||
import net.minecraft.component.DataComponentType;
|
||||
import net.minecraft.component.ComponentType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
@ -159,7 +159,7 @@ class InventorySlotWrapper extends SingleStackStorage {
|
|||
// Components have changed, we need to copy the stack.
|
||||
if (!Objects.equals(original.getComponentChanges(), currentStack.getComponentChanges())) {
|
||||
// Remove all the existing components and copy the new ones on top.
|
||||
for (DataComponentType<?> type : original.getComponents().getTypes()) {
|
||||
for (ComponentType<?> type : original.getComponents().getTypes()) {
|
||||
original.set(type, null);
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"fabric-api-lookup-api-v1": "*",
|
||||
"fabric-rendering-fluids-v1": "*"
|
||||
},
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.junit.jupiter.api.BeforeAll;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.minecraft.component.ComponentChanges;
|
||||
import net.minecraft.component.DataComponentType;
|
||||
import net.minecraft.component.ComponentType;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.network.RegistryByteBuf;
|
||||
|
@ -44,7 +44,7 @@ import net.fabricmc.fabric.test.transfer.ingame.TransferTestInitializer;
|
|||
class FluidTests extends AbstractTransferApiTest {
|
||||
private static FluidVariant TAGGED_WATER, TAGGED_WATER_2, WATER, LAVA;
|
||||
private static int finalCommitCount = 0;
|
||||
public static DataComponentType<Integer> TEST;
|
||||
public static ComponentType<Integer> TEST;
|
||||
private static SingleSlotStorage<FluidVariant> createWaterStorage() {
|
||||
return new SingleVariantStorage<>() {
|
||||
@Override
|
||||
|
@ -81,7 +81,7 @@ class FluidTests extends AbstractTransferApiTest {
|
|||
WATER = FluidVariant.of(Fluids.WATER);
|
||||
LAVA = FluidVariant.of(Fluids.LAVA);
|
||||
TEST = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier(TransferTestInitializer.MOD_ID, "test"),
|
||||
DataComponentType.<Integer>builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build());
|
||||
ComponentType.<Integer>builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.junit.jupiter.api.BeforeAll;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.minecraft.component.ComponentChanges;
|
||||
import net.minecraft.component.DataComponentType;
|
||||
import net.minecraft.component.ComponentType;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
import net.minecraft.inventory.SidedInventory;
|
||||
|
@ -57,13 +57,13 @@ import net.fabricmc.fabric.test.transfer.ingame.TransferTestInitializer;
|
|||
* Tests for the item transfer APIs.
|
||||
*/
|
||||
class ItemTests extends AbstractTransferApiTest {
|
||||
public static DataComponentType<Integer> ENERGY;
|
||||
public static ComponentType<Integer> ENERGY;
|
||||
|
||||
@BeforeAll
|
||||
static void beforeAll() {
|
||||
bootstrap();
|
||||
ENERGY = Registry.register(Registries.DATA_COMPONENT_TYPE, new Identifier(TransferTestInitializer.MOD_ID, "energy"),
|
||||
DataComponentType.<Integer>builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build());
|
||||
ComponentType.<Integer>builder().codec(Codecs.NONNEGATIVE_INT).packetCodec(PacketCodecs.VAR_INT).build());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.junit.jupiter.api.BeforeAll;
|
|||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import net.minecraft.component.ComponentChanges;
|
||||
import net.minecraft.component.DataComponentType;
|
||||
import net.minecraft.component.ComponentType;
|
||||
import net.minecraft.component.DataComponentTypes;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.inventory.Inventory;
|
||||
|
@ -57,7 +57,7 @@ import net.fabricmc.fabric.test.transfer.ingame.TransferTestInitializer;
|
|||
|
||||
public class SingleVariantItemStorageTests extends AbstractTransferApiTest {
|
||||
private static FluidVariant LAVA;
|
||||
public static DataComponentType<FluidData> FLUID;
|
||||
public static ComponentType<FluidData> FLUID;
|
||||
|
||||
@BeforeAll
|
||||
static void beforeAll() {
|
||||
|
@ -66,7 +66,7 @@ public class SingleVariantItemStorageTests extends AbstractTransferApiTest {
|
|||
LAVA = FluidVariant.of(Fluids.LAVA);
|
||||
FLUID = Registry.register(
|
||||
Registries.DATA_COMPONENT_TYPE, new Identifier(TransferTestInitializer.MOD_ID, "fluid"),
|
||||
DataComponentType.<FluidData>builder().codec(FluidData.CODEC).packetCodec(FluidData.PACKET_CODEC).build());
|
||||
ComponentType.<FluidData>builder().codec(FluidData.CODEC).packetCodec(FluidData.PACKET_CODEC).build());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6"
|
||||
"fabricloader": ">=0.15.11"
|
||||
},
|
||||
"description": "Contains transitive access wideners that provide access to otherwise inaccessible Minecraft code.",
|
||||
"accessWidener": "fabric-transitive-access-wideners-v1.accesswidener",
|
||||
|
|
|
@ -2,62 +2,62 @@ org.gradle.jvmargs=-Xmx2560M
|
|||
org.gradle.parallel=true
|
||||
fabric.loom.multiProjectOptimisation=true
|
||||
|
||||
version=0.97.8
|
||||
minecraft_version=1.20.6-rc1
|
||||
yarn_version=+build.1
|
||||
loader_version=0.15.6
|
||||
version=0.97.9
|
||||
minecraft_version=24w18a
|
||||
yarn_version=+build.2
|
||||
loader_version=0.15.11
|
||||
installer_version=1.0.1
|
||||
|
||||
prerelease=true
|
||||
curseforge_minecraft_version=1.20.5-Snapshot
|
||||
curseforge_minecraft_version=1.21-Snapshot
|
||||
|
||||
# Do not manually update, use the bumpversions task:
|
||||
fabric-api-base-version=0.4.40
|
||||
fabric-api-lookup-api-v1-version=1.6.59
|
||||
fabric-biome-api-v1-version=13.0.25
|
||||
fabric-block-api-v1-version=1.0.20
|
||||
fabric-block-view-api-v2-version=1.0.8
|
||||
fabric-blockrenderlayer-v1-version=1.1.50
|
||||
fabric-command-api-v1-version=1.2.45
|
||||
fabric-command-api-v2-version=2.2.24
|
||||
fabric-commands-v0-version=0.2.62
|
||||
fabric-content-registries-v0-version=8.0.4
|
||||
fabric-crash-report-info-v1-version=0.2.27
|
||||
fabric-data-attachment-api-v1-version=1.1.15
|
||||
fabric-data-generation-api-v1-version=19.0.6
|
||||
fabric-dimensions-v1-version=2.1.68
|
||||
fabric-entity-events-v1-version=1.6.8
|
||||
fabric-events-interaction-v0-version=0.7.6
|
||||
fabric-game-rule-api-v1-version=1.0.50
|
||||
fabric-gametest-api-v1-version=1.3.16
|
||||
fabric-item-api-v1-version=8.1.1
|
||||
fabric-item-group-api-v1-version=4.0.38
|
||||
fabric-key-binding-api-v1-version=1.0.45
|
||||
fabric-keybindings-v0-version=0.2.43
|
||||
fabric-lifecycle-events-v1-version=2.3.4
|
||||
fabric-loot-api-v2-version=3.0.4
|
||||
fabric-message-api-v1-version=6.0.10
|
||||
fabric-model-loading-api-v1-version=1.0.12
|
||||
fabric-models-v0-version=0.4.11
|
||||
fabric-networking-api-v1-version=4.0.8
|
||||
fabric-object-builder-api-v1-version=15.1.3
|
||||
fabric-particles-v1-version=4.0.0
|
||||
fabric-recipe-api-v1-version=5.0.3
|
||||
fabric-registry-sync-v0-version=5.0.15
|
||||
fabric-renderer-api-v1-version=3.2.12
|
||||
fabric-renderer-indigo-version=1.5.12
|
||||
fabric-renderer-registries-v1-version=3.2.61
|
||||
fabric-rendering-data-attachment-v1-version=0.3.46
|
||||
fabric-rendering-fluids-v1-version=3.1.3
|
||||
fabric-rendering-v0-version=1.1.64
|
||||
fabric-rendering-v1-version=4.2.4
|
||||
fabric-resource-conditions-api-v1-version=4.0.1
|
||||
fabric-resource-loader-v0-version=1.0.5
|
||||
fabric-screen-api-v1-version=2.0.21
|
||||
fabric-screen-handler-api-v1-version=1.3.72
|
||||
fabric-sound-api-v1-version=1.0.21
|
||||
fabric-transfer-api-v1-version=5.1.6
|
||||
fabric-transitive-access-wideners-v1-version=6.0.10
|
||||
fabric-convention-tags-v1-version=2.0.3
|
||||
fabric-convention-tags-v2-version=2.0.0
|
||||
fabric-client-tags-api-v1-version=1.1.12
|
||||
fabric-api-base-version=0.4.41
|
||||
fabric-api-lookup-api-v1-version=1.6.60
|
||||
fabric-biome-api-v1-version=13.0.26
|
||||
fabric-block-api-v1-version=1.0.21
|
||||
fabric-block-view-api-v2-version=1.0.9
|
||||
fabric-blockrenderlayer-v1-version=1.1.51
|
||||
fabric-command-api-v1-version=1.2.46
|
||||
fabric-command-api-v2-version=2.2.25
|
||||
fabric-commands-v0-version=0.2.63
|
||||
fabric-content-registries-v0-version=8.0.5
|
||||
fabric-crash-report-info-v1-version=0.2.28
|
||||
fabric-data-attachment-api-v1-version=1.1.16
|
||||
fabric-data-generation-api-v1-version=20.0.0
|
||||
fabric-dimensions-v1-version=2.1.69
|
||||
fabric-entity-events-v1-version=1.6.9
|
||||
fabric-events-interaction-v0-version=0.7.7
|
||||
fabric-game-rule-api-v1-version=1.0.51
|
||||
fabric-gametest-api-v1-version=1.3.17
|
||||
fabric-item-api-v1-version=9.0.0
|
||||
fabric-item-group-api-v1-version=4.0.39
|
||||
fabric-key-binding-api-v1-version=1.0.46
|
||||
fabric-keybindings-v0-version=0.2.44
|
||||
fabric-lifecycle-events-v1-version=2.3.5
|
||||
fabric-loot-api-v2-version=3.0.5
|
||||
fabric-message-api-v1-version=6.0.11
|
||||
fabric-model-loading-api-v1-version=1.0.13
|
||||
fabric-models-v0-version=0.4.12
|
||||
fabric-networking-api-v1-version=4.0.9
|
||||
fabric-object-builder-api-v1-version=15.1.4
|
||||
fabric-particles-v1-version=4.0.1
|
||||
fabric-recipe-api-v1-version=5.0.4
|
||||
fabric-registry-sync-v0-version=5.0.16
|
||||
fabric-renderer-api-v1-version=3.2.13
|
||||
fabric-renderer-indigo-version=1.5.13
|
||||
fabric-renderer-registries-v1-version=3.2.62
|
||||
fabric-rendering-data-attachment-v1-version=0.3.47
|
||||
fabric-rendering-fluids-v1-version=3.1.4
|
||||
fabric-rendering-v0-version=1.1.65
|
||||
fabric-rendering-v1-version=4.2.5
|
||||
fabric-resource-conditions-api-v1-version=4.0.2
|
||||
fabric-resource-loader-v0-version=1.0.6
|
||||
fabric-screen-api-v1-version=2.0.22
|
||||
fabric-screen-handler-api-v1-version=1.3.73
|
||||
fabric-sound-api-v1-version=1.0.22
|
||||
fabric-transfer-api-v1-version=5.1.7
|
||||
fabric-transitive-access-wideners-v1-version=6.0.11
|
||||
fabric-convention-tags-v1-version=2.0.4
|
||||
fabric-convention-tags-v2-version=2.0.1
|
||||
fabric-client-tags-api-v1-version=1.1.13
|
||||
|
|
|
@ -19,9 +19,9 @@
|
|||
"FabricMC"
|
||||
],
|
||||
"depends": {
|
||||
"fabricloader": ">=0.15.6",
|
||||
"fabricloader": ">=0.15.11",
|
||||
"java": ">=21",
|
||||
"minecraft": ">=1.20.5- <1.20.7-"
|
||||
"minecraft": ">=1.21- <1.21.1-"
|
||||
},
|
||||
"description": "Core API module providing key hooks and intercompatibility features."
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue