Skip to content

Commit

Permalink
24w18a (#3757)
Browse files Browse the repository at this point in the history
Co-authored-by: Drex <[email protected]>
  • Loading branch information
modmuss50 and DrexHD authored May 4, 2024
1 parent 97fc76f commit 0af3f5a
Show file tree
Hide file tree
Showing 91 changed files with 262 additions and 245 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"fabric-api-base": "*",
"fabric-command-api-v2": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"fabric-api-base": "*",
"fabric-command-api-v2": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"fabric-key-binding-api-v1": "*"
},
"description": "Keybinding registry API.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"fabric-api-base": "*",
"fabric-model-loading-api-v1": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
Expand Down
2 changes: 1 addition & 1 deletion fabric-api-base/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6"
"fabricloader": ">=0.15.11"
},
"description": "Contains the essentials for Fabric API modules.",
"custom": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"fabric-api-base": "*",
"fabric-lifecycle-events-v1": "*"
},
Expand Down
2 changes: 1 addition & 1 deletion fabric-biome-api-v1/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion fabric-block-api-v1/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6"
"fabricloader": ">=0.15.11"
},
"entrypoints": {
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6"
"fabricloader": ">=0.15.11"
},
"description": "Hooks for block views",
"mixins": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"minecraft": ">=1.15-alpha.19.38.b",
"fabric-api-base": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion fabric-command-api-v2/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"fabric-api-base": "*",
"minecraft": ">1.19-alpha.22.11.a"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"minecraft": ">=1.20.5-beta.1",
"fabric-lifecycle-events-v1": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6"
"fabricloader": ">=0.15.11"
},
"description": "Adds Fabric-related debug info to crash reports.",
"mixins": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6",
"fabricloader": ">=0.15.11",
"fabric-entity-events-v1": "*",
"fabric-object-builder-api-v1": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -73,7 +73,7 @@ public void excludeFromStrictValidation(Block block) {
}

@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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
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;
Expand Down Expand Up @@ -184,8 +185,8 @@ default void add(EntityType<?> entityType, String value) {
* @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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public void accept(Identifier recipeId, Recipe<?> recipe, @Nullable AdvancementE

@Override
public Advancement.Builder getAdvancementBuilder() {
//noinspection removal
return Advancement.Builder.createUntelemetered().parent(CraftingRecipeJsonBuilder.ROOT);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ public abstract static class EnchantmentTagProvider extends FabricTagProvider<En
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"));
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@

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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static CompletableFuture<?> run(
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);

Expand Down
Original file line number Diff line number Diff line change
@@ -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();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.6"
"fabricloader": ">=0.15.11"
},
"description": "Allows for automatic data generation.",
"mixins": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
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;
Expand Down Expand Up @@ -403,7 +402,7 @@ private TestBarterLootTableProvider(FabricDataOutput output, CompletableFuture<R
}

@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(
Expand Down Expand Up @@ -435,7 +434,7 @@ public String getName() {

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
Expand Down
Loading

0 comments on commit 0af3f5a

Please sign in to comment.