Skip to content

Commit

Permalink
Merge branch 'FabricMC:1.21.1' into pack-load-order
Browse files Browse the repository at this point in the history
  • Loading branch information
Apollounknowndev authored Aug 23, 2024
2 parents 1c2cd59 + 343cdcb commit 1ad5d52
Show file tree
Hide file tree
Showing 186 changed files with 3,545 additions and 678 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ jobs:
image: mcr.microsoft.com/openjdk/jdk:${{ matrix.java }}
options: --user root
steps:
- run: apt update && apt install git -y && git --version
- uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
id 'jacoco'
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 "org.ajoberstar.grgit" version "5.2.2"
id "me.modmuss50.remotesign" version "0.4.0" apply false
id "me.modmuss50.mod-publish-plugin" version "0.4.5"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,30 +191,30 @@ boolean isVerbose() {
createMapEntry(RegistryKeys.ITEM, "sticks", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.WOODEN_RODS),
createMapEntry(RegistryKeys.ITEM, "wooden_rods", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.WOODEN_RODS),
createMapEntry(RegistryKeys.ITEM, "food", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.FOODS),
createMapEntry(RegistryKeys.ITEM, "fruit", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.FRUITS_FOODS),
createMapEntry(RegistryKeys.ITEM, "fruits", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.FRUITS_FOODS),
createMapEntry(RegistryKeys.ITEM, "vegetable", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.VEGETABLES_FOODS),
createMapEntry(RegistryKeys.ITEM, "vegetables", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.VEGETABLES_FOODS),
createMapEntry(RegistryKeys.ITEM, "berry", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BERRIES_FOODS),
createMapEntry(RegistryKeys.ITEM, "berries", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BERRIES_FOODS),
createMapEntry(RegistryKeys.ITEM, "bread", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BREADS_FOODS),
createMapEntry(RegistryKeys.ITEM, "breads", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BREADS_FOODS),
createMapEntry(RegistryKeys.ITEM, "cookie", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKIES_FOODS),
createMapEntry(RegistryKeys.ITEM, "cookies", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKIES_FOODS),
createMapEntry(RegistryKeys.ITEM, "raw_meat", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RAW_MEATS_FOODS),
createMapEntry(RegistryKeys.ITEM, "raw_meats", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RAW_MEATS_FOODS),
createMapEntry(RegistryKeys.ITEM, "raw_fish", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RAW_FISHES_FOODS),
createMapEntry(RegistryKeys.ITEM, "raw_fishes", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RAW_FISHES_FOODS),
createMapEntry(RegistryKeys.ITEM, "cooked_meat", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKED_MEATS_FOODS),
createMapEntry(RegistryKeys.ITEM, "cooked_meats", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKED_MEATS_FOODS),
createMapEntry(RegistryKeys.ITEM, "cooked_fish", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKED_FISHES_FOODS),
createMapEntry(RegistryKeys.ITEM, "cooked_fishes", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKED_FISHES_FOODS),
createMapEntry(RegistryKeys.ITEM, "soup", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUPS_FOODS),
createMapEntry(RegistryKeys.ITEM, "soups", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUPS_FOODS),
createMapEntry(RegistryKeys.ITEM, "stew", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUPS_FOODS),
createMapEntry(RegistryKeys.ITEM, "stews", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUPS_FOODS),
createMapEntry(RegistryKeys.ITEM, "candy", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CANDIES_FOODS),
createMapEntry(RegistryKeys.ITEM, "candies", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CANDIES_FOODS),
createMapEntry(RegistryKeys.ITEM, "fruit", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.FRUIT_FOODS),
createMapEntry(RegistryKeys.ITEM, "fruits", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.FRUIT_FOODS),
createMapEntry(RegistryKeys.ITEM, "vegetable", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.VEGETABLE_FOODS),
createMapEntry(RegistryKeys.ITEM, "vegetables", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.VEGETABLE_FOODS),
createMapEntry(RegistryKeys.ITEM, "berry", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BERRY_FOODS),
createMapEntry(RegistryKeys.ITEM, "berries", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BERRY_FOODS),
createMapEntry(RegistryKeys.ITEM, "bread", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BREAD_FOODS),
createMapEntry(RegistryKeys.ITEM, "breads", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.BREAD_FOODS),
createMapEntry(RegistryKeys.ITEM, "cookie", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKIE_FOODS),
createMapEntry(RegistryKeys.ITEM, "cookies", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKIE_FOODS),
createMapEntry(RegistryKeys.ITEM, "raw_meat", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RAW_MEAT_FOODS),
createMapEntry(RegistryKeys.ITEM, "raw_meats", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RAW_MEAT_FOODS),
createMapEntry(RegistryKeys.ITEM, "raw_fish", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RAW_FISH_FOODS),
createMapEntry(RegistryKeys.ITEM, "raw_fishes", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.RAW_FISH_FOODS),
createMapEntry(RegistryKeys.ITEM, "cooked_meat", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKED_MEAT_FOODS),
createMapEntry(RegistryKeys.ITEM, "cooked_meats", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKED_MEAT_FOODS),
createMapEntry(RegistryKeys.ITEM, "cooked_fish", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKED_FISH_FOODS),
createMapEntry(RegistryKeys.ITEM, "cooked_fishes", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.COOKED_FISH_FOODS),
createMapEntry(RegistryKeys.ITEM, "soup", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUP_FOODS),
createMapEntry(RegistryKeys.ITEM, "soups", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUP_FOODS),
createMapEntry(RegistryKeys.ITEM, "stew", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUP_FOODS),
createMapEntry(RegistryKeys.ITEM, "stews", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.SOUP_FOODS),
createMapEntry(RegistryKeys.ITEM, "candy", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CANDY_FOODS),
createMapEntry(RegistryKeys.ITEM, "candies", net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.CANDY_FOODS),
createMapEntry(TagKey.of(RegistryKeys.ITEM, Identifier.of("minecraft", "music_discs")), net.fabricmc.fabric.api.tag.convention.v2.ConventionalItemTags.MUSIC_DISCS)
);

Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions deprecated/fabric-loot-api-v2/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version = getSubprojectVersion(project)

moduleDependencies(project, [
'fabric-api-base',
'fabric-resource-loader-v0',
'fabric-loot-api-v3'
])
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
/*
* 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.api.loot.v2;

import java.util.Collection;

import org.jetbrains.annotations.ApiStatus;

import net.minecraft.loot.LootPool;
import net.minecraft.loot.condition.LootCondition;
import net.minecraft.loot.entry.LootPoolEntry;
import net.minecraft.loot.function.LootFunction;

/**
* Convenience extensions to {@link LootPool.Builder}
* for adding pre-built objects or collections.
*
* <p>This interface is automatically injected to {@link LootPool.Builder}.
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder} instead.
*/
@ApiStatus.NonExtendable
@Deprecated
public interface FabricLootPoolBuilder {
/**
* Adds an entry to this builder.
*
* @param entry the added loot entry
* @return this builder
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder#with(LootPoolEntry)} instead.
*/
@Deprecated
default LootPool.Builder with(LootPoolEntry entry) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Adds entries to this builder.
*
* @param entries the added loot entries
* @return this builder
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder#with(LootPoolEntry)} instead.
*/
@Deprecated
default LootPool.Builder with(Collection<? extends LootPoolEntry> entries) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Adds a condition to this builder.
*
* @param condition the added condition
* @return this builder
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder#conditionally(LootCondition)} instead.
*/
@Deprecated
default LootPool.Builder conditionally(LootCondition condition) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Adds conditions to this builder.
*
* @param conditions the added conditions
* @return this builder
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder#conditionally(LootCondition)} instead.
*/
@Deprecated
default LootPool.Builder conditionally(Collection<? extends LootCondition> conditions) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Applies a function to this builder.
*
* @param function the applied loot function
* @return this builder
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder#apply(LootFunction)} instead.
*/
@Deprecated
default LootPool.Builder apply(LootFunction function) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Applies loot functions to this builder.
*
* @param functions the applied loot functions
* @return this builder
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder#apply(LootFunction)} instead.
*/
@Deprecated
default LootPool.Builder apply(Collection<? extends LootFunction> functions) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Creates a builder copy of a loot pool.
*
* @param pool the loot pool
* @return the copied builder
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder#copyOf(LootPool)} instead.
*/
@Deprecated
static LootPool.Builder copyOf(LootPool pool) {
return net.fabricmc.fabric.api.loot.v3.FabricLootPoolBuilder.copyOf(pool);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* 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.api.loot.v2;

import java.util.Collection;
import java.util.function.Consumer;

import org.jetbrains.annotations.ApiStatus;

import net.minecraft.loot.LootPool;
import net.minecraft.loot.LootTable;
import net.minecraft.loot.function.LootFunction;

/**
* Convenience extensions to {@link LootTable.Builder}
* for adding pre-built objects or collections and modifying loot pools.
*
* <p>This interface is automatically injected to {@link LootTable.Builder}.
*
* @deprecated use {@link net.fabricmc.fabric.api.loot.v3.FabricLootTableBuilder} instead.
*/
@ApiStatus.NonExtendable
@Deprecated
public interface FabricLootTableBuilder {
/**
* Adds a loot pool to this builder.
*
* @param pool the added pool
* @return this builder
* @deprecated use {@link net.fabricmc.fabric.api.loot.v3.FabricLootTableBuilder#pool(LootPool)} instead.
*/
@Deprecated
default LootTable.Builder pool(LootPool pool) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Applies a loot function to this builder.
*
* @param function the applied function
* @return this builder
* @deprecated use {@link net.fabricmc.fabric.api.loot.v3.FabricLootTableBuilder#apply(LootFunction)} instead.
*/
@Deprecated
default LootTable.Builder apply(LootFunction function) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Adds loot pools to this builder.
*
* @param pools the added pools
* @return this builder
* @deprecated use {@link net.fabricmc.fabric.api.loot.v3.FabricLootTableBuilder#pools(Collection)} instead.
*/
@Deprecated
default LootTable.Builder pools(Collection<? extends LootPool> pools) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Applies loot functions to this builder.
*
* @param functions the applied functions
* @return this builder
* @deprecated use {@link net.fabricmc.fabric.api.loot.v3.FabricLootTableBuilder#apply(Collection)} instead.
*/
@Deprecated
default LootTable.Builder apply(Collection<? extends LootFunction> functions) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Modifies all loot pools already present in this builder.
*
* <p>This method can be used instead of simply adding a new pool
* when you want the loot table to only drop items from one of the loot pool entries
* instead of both.
*
* <p>Calling this method turns all pools into builders and rebuilds them back into loot pools afterwards,
* so it is more efficient to do all transformations with one {@code modifyPools} call.
*
* @param modifier the modifying function
* @return this builder
* @deprecated use {@link net.fabricmc.fabric.api.loot.v3.FabricLootTableBuilder#modifyPools(Consumer)} instead.
*/
@Deprecated
default LootTable.Builder modifyPools(Consumer<? super LootPool.Builder> modifier) {
throw new UnsupportedOperationException("Implemented via mixin");
}

/**
* Creates a builder copy of a loot table.
*
* @param table the loot table
* @return the copied builder
* @deprecated use {@link net.fabricmc.fabric.api.loot.v3.FabricLootTableBuilder#copyOf(LootTable)} instead.
*/
@Deprecated
static LootTable.Builder copyOf(LootTable table) {
return net.fabricmc.fabric.api.loot.v3.FabricLootTableBuilder.copyOf(table);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,21 @@

/**
* Events for manipulating loot tables.
*
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.LootTableEvents} instead.
*/
@Deprecated
public final class LootTableEvents {
private LootTableEvents() {
}

/**
* This event can be used to replace loot tables.
* If a loot table is replaced, the iteration will stop for that loot table.
*
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.LootTableEvents#REPLACE} instead.
*/
@Deprecated
public static final Event<Replace> REPLACE = EventFactory.createArrayBacked(Replace.class, listeners -> (key, original, source) -> {
for (Replace listener : listeners) {
@Nullable LootTable replaced = listener.replaceLootTable(key, original, source);
Expand Down Expand Up @@ -82,7 +88,10 @@ private LootTableEvents() {
* });
* }
* </pre>
*
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.LootTableEvents#MODIFY} instead.
*/
@Deprecated
public static final Event<Modify> MODIFY = EventFactory.createArrayBacked(Modify.class, listeners -> (key, tableBuilder, source) -> {
for (Modify listener : listeners) {
listener.modifyLootTable(key, tableBuilder, source);
Expand All @@ -91,13 +100,17 @@ private LootTableEvents() {

/**
* This event can be used for post-processing after all loot tables have been loaded and modified by Fabric.
*
* @deprecated Please use {@link net.fabricmc.fabric.api.loot.v3.LootTableEvents#ALL_LOADED} instead.
*/
@Deprecated
public static final Event<Loaded> ALL_LOADED = EventFactory.createArrayBacked(Loaded.class, listeners -> (resourceManager, lootManager) -> {
for (Loaded listener : listeners) {
listener.onLootTablesLoaded(resourceManager, lootManager);
}
});

@Deprecated
public interface Replace {
/**
* Replaces loot tables.
Expand All @@ -111,6 +124,7 @@ public interface Replace {
LootTable replaceLootTable(RegistryKey<LootTable> key, LootTable original, LootTableSource source);
}

@Deprecated
public interface Modify {
/**
* Called when a loot table is loading to modify loot tables.
Expand All @@ -122,6 +136,7 @@ public interface Modify {
void modifyLootTable(RegistryKey<LootTable> key, LootTable.Builder tableBuilder, LootTableSource source);
}

@Deprecated
public interface Loaded {
/**
* Called when all loot tables have been loaded and {@link LootTableEvents#REPLACE} and {@link LootTableEvents#MODIFY} have been invoked.
Expand Down
Loading

0 comments on commit 1ad5d52

Please sign in to comment.