Port to 23w51b ()

Breaking changes:

- `FabricBrewingRecipeRegistry.registerPotionRecipe` takes `RegistryEntry<Potion>` instead of `Potion`
- `SculkSensorFrequencyRegistry.regster` takes `RegistryKey<GameEvent>` instead of `GameEvent`
- `FabricLanguageProvider.add` takes `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
- `FabricTagProvider.GameEventTagProvider` was removed replace with `FabricTagProvider<GameEvent>`
- `FabricItem.getAttributeModifiers` returns a Multimap with a key of `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
- `ModifyItemAttributeModifiersCallback.modifyAttributeModifiers` takes Multimap with a key of `RegistryEntry<EntityAttribute>` instead of `EntityAttribute`
This commit is contained in:
modmuss 2023-12-18 18:47:42 +00:00 committed by GitHub
parent 4ced05928d
commit 3434862fbd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
81 changed files with 304 additions and 230 deletions
deprecated
fabric-command-api-v1/src/main/resources
fabric-commands-v0/src/main/resources
fabric-containers-v0/src/main/resources
fabric-events-lifecycle-v0/src/main/resources
fabric-keybindings-v0/src/client/resources
fabric-models-v0/src/client/resources
fabric-renderer-registries-v1/src/client/resources
fabric-rendering-data-attachment-v1/src/main/resources
fabric-rendering-v0/src/client/resources
fabric-api-base/src/main/resources
fabric-api-lookup-api-v1/src
main/resources
testmod/java/net/fabricmc/fabric/test/lookup
fabric-biome-api-v1/src/main/resources
fabric-block-api-v1/src/main/resources
fabric-block-view-api-v2/src/main/resources
fabric-blockrenderlayer-v1/src/client/resources
fabric-client-tags-api-v1/src/client/resources
fabric-command-api-v2/src/main/resources
fabric-content-registries-v0/src
main
testmod/java/net/fabricmc/fabric/test/content/registry
fabric-convention-tags-v1/src
datagen/resources
main/resources
fabric-crash-report-info-v1/src/main/resources
fabric-data-generation-api-v1/src
main
java/net/fabricmc/fabric/api/datagen/v1/provider
resources
testmod/java/net/fabricmc/fabric/test/datagen
fabric-dimensions-v1/src/main/resources
fabric-entity-events-v1/src
main/resources
testmod/java/net/fabricmc/fabric/test/entity/event
fabric-events-interaction-v0/src
main/resources
testmod
java/net/fabricmc/fabric/test/event/interaction
resources
fabric-game-rule-api-v1/src/main/resources
fabric-gametest-api-v1/src/main/resources
fabric-item-api-v1/src
fabric-item-group-api-v1/src/main/resources
fabric-key-binding-api-v1/src/client/resources
fabric-lifecycle-events-v1/src/main/resources
fabric-loot-api-v2/src/main/resources
fabric-message-api-v1/src/main/resources
fabric-mining-level-api-v1/src/main/resources
fabric-model-loading-api-v1/src/client/resources
fabric-networking-api-v1/src/main/resources
fabric-object-builder-api-v1/src
main/resources
testmod/java/net/fabricmc/fabric/test/object/builder
fabric-particles-v1/src/main/resources
fabric-recipe-api-v1/src/main/resources
fabric-registry-sync-v0/src/main/resources
fabric-renderer-api-v1/src
client/resources
testmod/java/net/fabricmc/fabric/test/renderer
fabric-renderer-indigo/src/client/resources
fabric-rendering-fluids-v1/src/main/resources
fabric-rendering-v1/src/client/resources
fabric-resource-conditions-api-v1/src/main/resources
fabric-resource-loader-v0/src
client/java/net/fabricmc/fabric/mixin/resource/loader/client
main/resources
fabric-screen-api-v1/src/client/resources
fabric-screen-handler-api-v1/src
main/resources
testmod/java/net/fabricmc/fabric/test/screenhandler/block
fabric-sound-api-v1/src/client/resources
fabric-transfer-api-v1/src
main/resources
testmod/java/net/fabricmc/fabric/test/transfer/ingame
fabric-transitive-access-wideners-v1
gradle.properties
src/main/resources

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-command-api-v2": "*"
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-command-api-v2": "*"
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-networking-api-v1": "*"
},

View file

@ -24,7 +24,7 @@
]
},
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-item-api-v1": "*",
"fabric-lifecycle-events-v1": "*"

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-key-binding-api-v1": "*"
},
"description": "Keybinding registry API.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-model-loading-api-v1": "*"
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.15-alpha.19.39.a",
"fabric-api-base": "*",
"fabric-rendering-v1": "*"

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-block-view-api-v2": "*"
},
"description": "Thread-safe hooks for block entity data use during terrain rendering.",

View file

@ -21,7 +21,7 @@
]
},
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.15-alpha.19.39.a",
"fabric-api-base": "*",
"fabric-rendering-v1": "*"

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Contains the essentials for Fabric API modules.",
"custom": {

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-lifecycle-events-v1": "*"
},

View file

@ -18,11 +18,11 @@ package net.fabricmc.fabric.test.lookup;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.class_9062;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
@ -38,8 +38,7 @@ public class InspectorBlock extends Block {
}
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
ItemStack stack = player.getStackInHand(hand);
public class_9062 method_55765(ItemStack stack, BlockState blockState, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult blockHitResult) {
Inspectable inspectable = FabricItemApiLookupTest.INSPECTABLE.find(stack, null);
if (inspectable != null) {
@ -47,10 +46,10 @@ public class InspectorBlock extends Block {
player.sendMessage(inspectable.inspect(), true);
}
return ActionResult.success(world.isClient());
return class_9062.method_55644(world.isClient());
}
return ActionResult.PASS;
return class_9062.PASS_TO_DEFAULT_BLOCK_INTERACTION;
}
@Override

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.16.2"
},
"description": "Hooks for adding biomes to the default world generator.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"entrypoints": {
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Hooks for block views",
"mixins": [

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.15-alpha.19.38.b",
"fabric-api-base": "*"
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Adds the ability to load tags from the local mods.",
"custom": {

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"minecraft": ">1.19-alpha.22.11.a"
},

View file

@ -23,6 +23,7 @@ import net.minecraft.item.PotionItem;
import net.minecraft.potion.Potion;
import net.minecraft.recipe.BrewingRecipeRegistry;
import net.minecraft.recipe.Ingredient;
import net.minecraft.registry.entry.RegistryEntry;
/**
* Counterpart of {@link BrewingRecipeRegistry} with methods that allow adding recipes which use Ingredients instead of Items.
@ -45,7 +46,7 @@ public final class FabricBrewingRecipeRegistry {
Objects.requireNonNull(ingredient, "Ingredient cannot be null!");
Objects.requireNonNull(output, "Output cannot be null!");
BrewingRecipeRegistry.ITEM_RECIPES.add(new BrewingRecipeRegistry.Recipe<>(input, ingredient, output));
BrewingRecipeRegistry.ITEM_RECIPES.add(new BrewingRecipeRegistry.Recipe<>(input.getRegistryEntry(), ingredient, output.getRegistryEntry()));
}
/**
@ -55,9 +56,9 @@ public final class FabricBrewingRecipeRegistry {
* @param input input potion (e.g. awkward)
* @param ingredient the required ingredient (e.g. glistering melon)
* @param output output potion (e.g. instant health)
* @see BrewingRecipeRegistry#registerPotionRecipe(Potion, Item, Potion)
* @see BrewingRecipeRegistry#registerPotionRecipe(RegistryEntry, Item, RegistryEntry)
*/
public static void registerPotionRecipe(Potion input, Ingredient ingredient, Potion output) {
public static void registerPotionRecipe(RegistryEntry<Potion> input, Ingredient ingredient, RegistryEntry<Potion> output) {
Objects.requireNonNull(input, "Input cannot be null!");
Objects.requireNonNull(ingredient, "Ingredient cannot be null!");
Objects.requireNonNull(output, "Output cannot be null");

View file

@ -16,11 +16,11 @@
package net.fabricmc.fabric.api.registry;
import it.unimi.dsi.fastutil.objects.Object2IntOpenHashMap;
import it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.minecraft.registry.Registries;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.tag.GameEventTags;
import net.minecraft.world.event.GameEvent;
import net.minecraft.world.event.Vibrations;
@ -48,16 +48,16 @@ public final class SculkSensorFrequencyRegistry {
* @param frequency The frequency to register.
* @throws IllegalArgumentException if the given frequency is not within the allowed range.
*/
public static void register(GameEvent event, int frequency) {
public static void register(RegistryKey<GameEvent> event, int frequency) {
if (frequency <= 0 || frequency >= 16) {
throw new IllegalArgumentException("Attempted to register Sculk Sensor frequency for event "+ Registries.GAME_EVENT.getId(event) +" with frequency "+frequency+". Sculk Sensor frequencies must be between 1 and 15 inclusive.");
throw new IllegalArgumentException("Attempted to register Sculk Sensor frequency for event "+ event.getValue() +" with frequency "+frequency+". Sculk Sensor frequencies must be between 1 and 15 inclusive.");
}
final Object2IntOpenHashMap<GameEvent> map = (Object2IntOpenHashMap<GameEvent>) Vibrations.FREQUENCIES;
final Reference2IntOpenHashMap<RegistryKey<GameEvent>> map = (Reference2IntOpenHashMap<RegistryKey<GameEvent>>) Vibrations.FREQUENCIES;
int replaced = map.put(event, frequency);
if (replaced != 0) {
LOGGER.debug("Replaced old frequency mapping for {} - was {}, now {}", Registries.GAME_EVENT.getId(event), replaced, frequency);
LOGGER.debug("Replaced old frequency mapping for {} - was {}, now {}", event.getValue(), replaced, frequency);
}
}
}

View file

@ -3,6 +3,6 @@ accessWidener v1 named
accessible method net/minecraft/block/entity/AbstractFurnaceBlockEntity addFuel (Ljava/util/Map;Lnet/minecraft/registry/tag/TagKey;I)V
accessible method net/minecraft/block/entity/AbstractFurnaceBlockEntity addFuel (Ljava/util/Map;Lnet/minecraft/item/ItemConvertible;I)V
accessible class net/minecraft/recipe/BrewingRecipeRegistry$Recipe
accessible method net/minecraft/recipe/BrewingRecipeRegistry$Recipe <init> (Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/recipe/Ingredient;Lnet/minecraft/registry/entry/RegistryEntry;)V
accessible field net/minecraft/recipe/BrewingRecipeRegistry POTION_RECIPES Ljava/util/List;
accessible field net/minecraft/recipe/BrewingRecipeRegistry ITEM_RECIPES Ljava/util/List;

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-lifecycle-events-v1": "*",
"fabric-resource-loader-v0": "*"

View file

@ -34,11 +34,11 @@ import net.minecraft.potion.Potions;
import net.minecraft.recipe.Ingredient;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
@ -64,7 +64,7 @@ public final class ContentRegistryTest implements ModInitializer {
public static final Logger LOGGER = LoggerFactory.getLogger(ContentRegistryTest.class);
public static final Identifier TEST_EVENT_ID = new Identifier("fabric-content-registries-v0-testmod", "test_event");
public static final GameEvent TEST_EVENT = new GameEvent(GameEvent.DEFAULT_RANGE);
public static final RegistryEntry.Reference<GameEvent> TEST_EVENT = Registry.registerReference(Registries.GAME_EVENT, TEST_EVENT_ID, new GameEvent(GameEvent.DEFAULT_RANGE));
@Override
public void onInitialize() {
@ -139,13 +139,12 @@ public final class ContentRegistryTest implements ModInitializer {
VillagerInteractionRegistries.registerGiftLootTable(VillagerProfession.NITWIT, new Identifier("fake_loot_table"));
Registry.register(Registries.GAME_EVENT, TEST_EVENT_ID, TEST_EVENT);
Registry.register(Registries.BLOCK, TEST_EVENT_ID, new TestEventBlock(AbstractBlock.Settings.copy(Blocks.STONE)));
SculkSensorFrequencyRegistry.register(TEST_EVENT, 2);
SculkSensorFrequencyRegistry.register(TEST_EVENT.registryKey(), 2);
// assert that SculkSensorFrequencyRegistry throws when registering a frequency outside the allowed range
try {
SculkSensorFrequencyRegistry.register(GameEvent.SHRIEK, 18);
SculkSensorFrequencyRegistry.register(GameEvent.SHRIEK.registryKey(), 18);
throw new AssertionError("SculkSensorFrequencyRegistry didn't throw when frequency was outside allowed range!");
} catch (IllegalArgumentException e) {
@ -169,7 +168,7 @@ public final class ContentRegistryTest implements ModInitializer {
}
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
public ActionResult method_55766(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
// Emit the test event
world.emitGameEvent(player, TEST_EVENT, pos);
return ActionResult.SUCCESS;

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.18.2"
},
"description": "Contains common tags used by mods for vanilla things.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.18.2"
},
"description": "Contains common tags used by mods for vanilla things.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Adds Fabric-related debug info to crash reports.",
"mixins": [

View file

@ -41,6 +41,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemGroup;
import net.minecraft.registry.Registries;
import net.minecraft.registry.RegistryKey;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.stat.StatType;
import net.minecraft.text.TextContent;
import net.minecraft.text.TranslatableTextContent;
@ -188,8 +189,8 @@ public abstract class FabricLanguageProvider implements DataProvider {
* @param entityAttribute The {@link EntityAttribute} to get the translation key from.
* @param value The value of the entry.
*/
default void add(EntityAttribute entityAttribute, String value) {
add(entityAttribute.getTranslationKey(), value);
default void add(RegistryEntry<EntityAttribute> entityAttribute, String value) {
add(entityAttribute.value().getTranslationKey(), value);
}
/**

View file

@ -46,7 +46,6 @@ import net.minecraft.registry.tag.TagBuilder;
import net.minecraft.registry.tag.TagEntry;
import net.minecraft.registry.tag.TagKey;
import net.minecraft.util.Identifier;
import net.minecraft.world.event.GameEvent;
import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator;
import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput;
@ -68,7 +67,6 @@ import net.fabricmc.fabric.impl.datagen.ForcedTagEntry;
* @see ItemTagProvider
* @see FluidTagProvider
* @see EntityTypeTagProvider
* @see GameEventTagProvider
*/
public abstract class FabricTagProvider<T> extends TagProvider<T> {
/**
@ -221,20 +219,6 @@ public abstract class FabricTagProvider<T> extends TagProvider<T> {
}
}
/**
* Extend this class to create {@link GameEvent} tags in the "/game_events" tag directory.
*/
public abstract static class GameEventTagProvider extends FabricTagProvider<GameEvent> {
public GameEventTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> completableFuture) {
super(output, RegistryKeys.GAME_EVENT, completableFuture);
}
@Override
protected RegistryKey<GameEvent> reverseLookup(GameEvent element) {
return element.getRegistryEntry().registryKey();
}
}
/**
* An extension to {@link ProvidedTagBuilder} that provides additional functionality.
*/

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Allows for automatic data generation.",
"mixins": [

View file

@ -34,9 +34,6 @@ import java.util.concurrent.CompletableFuture;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.minecraft.advancement.Advancement;
import net.minecraft.advancement.AdvancementEntry;
import net.minecraft.advancement.AdvancementFrame;
@ -69,6 +66,7 @@ import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.biome.BiomeKeys;
import net.minecraft.world.event.GameEvent;
import net.fabricmc.api.EnvType;
import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint;
@ -89,7 +87,6 @@ import net.fabricmc.fabric.api.resource.conditions.v1.DefaultResourceConditions;
import net.fabricmc.loader.api.FabricLoader;
public class DataGeneratorTestEntrypoint implements DataGeneratorEntrypoint {
private static final Logger LOGGER = LoggerFactory.getLogger(DataGeneratorTestEntrypoint.class);
private static final ConditionJsonProvider NEVER_LOADED = DefaultResourceConditions.allModsLoaded("a");
private static final ConditionJsonProvider ALWAYS_LOADED = DefaultResourceConditions.not(NEVER_LOADED);
@ -114,6 +111,7 @@ public class DataGeneratorTestEntrypoint implements DataGeneratorEntrypoint {
TestBlockTagProvider blockTagProvider = pack.addProvider(TestBlockTagProvider::new);
pack.addProvider((output, registries) -> new TestItemTagProvider(output, registries, blockTagProvider));
pack.addProvider(TestBiomeTagProvider::new);
pack.addProvider(TestGameEventTagProvider::new);
// TODO replace with a client only entrypoint with FMJ 2
if (FabricLoader.getInstance().getEnvironmentType() == EnvType.CLIENT) {
@ -330,6 +328,18 @@ public class DataGeneratorTestEntrypoint implements DataGeneratorEntrypoint {
}
}
private static class TestGameEventTagProvider extends FabricTagProvider<GameEvent> {
private TestGameEventTagProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture) {
super(output, RegistryKeys.GAME_EVENT, registriesFuture);
}
@Override
protected void configure(RegistryWrapper.WrapperLookup registries) {
getOrCreateTagBuilder(TagKey.of(RegistryKeys.GAME_EVENT, new Identifier(MOD_ID, "game_event_tag_test")))
.add(GameEvent.SHRIEK.registryKey());
}
}
private static class TestAdvancementProvider extends FabricAdvancementProvider {
private TestAdvancementProvider(FabricDataOutput output) {
super(output);

View file

@ -15,7 +15,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.16-rc.3",
"fabric-api-base": "*"
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Events to hook into entities.",
"mixins": [

View file

@ -25,7 +25,6 @@ import net.minecraft.state.property.BooleanProperty;
import net.minecraft.state.property.Properties;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.shape.VoxelShape;
@ -47,7 +46,7 @@ public class TestBedBlock extends Block {
}
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
public ActionResult method_55766(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
if (state.get(OCCUPIED)) {
player.sendMessage(Text.translatable("block.minecraft.bed.occupied"), true);
return ActionResult.CONSUME;

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"minecraft": ">=1.15-alpha.19.37.a"
},

View file

@ -0,0 +1,61 @@
/*
* 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.test.event.interaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.minecraft.block.Blocks;
import net.minecraft.item.Items;
import net.minecraft.util.ActionResult;
import net.minecraft.util.math.BlockPos;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.player.UseBlockCallback;
public class UseBlockTests implements ModInitializer {
private static final Logger LOGGER = LoggerFactory.getLogger(UseBlockTests.class);
@Override
public void onInitialize() {
UseBlockCallback.EVENT.register((player, world, hand, hitResult) -> {
LOGGER.info("UseBlockCallback: before chest/water hook (client-side = %s)".formatted(world.isClient));
return ActionResult.PASS;
});
// If a chest is used and the player holds a water bucket, delete it!
UseBlockCallback.EVENT.register((player, world, hand, hitResult) -> {
BlockPos pos = hitResult.getBlockPos();
if (!player.isSpectator() && world.canPlayerModifyAt(player, pos)) {
if (world.getBlockState(pos).isOf(Blocks.CHEST)) {
if (player.getStackInHand(hand).isOf(Items.WATER_BUCKET)) {
world.setBlockState(pos, Blocks.AIR.getDefaultState());
return ActionResult.success(world.isClient);
}
}
}
return ActionResult.PASS;
});
UseBlockCallback.EVENT.register((player, world, hand, hitResult) -> {
LOGGER.info("UseBlockCallback: after chest/water hook (client-side = %s)".formatted(world.isClient));
return ActionResult.PASS;
});
}
}

View file

@ -0,0 +1,60 @@
/*
* 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.test.event.interaction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import net.minecraft.entity.projectile.FireballEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.util.TypedActionResult;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.player.UseItemCallback;
public class UseItemTests implements ModInitializer {
private static final Logger LOGGER = LoggerFactory.getLogger(UseItemTests.class);
@Override
public void onInitialize() {
UseItemCallback.EVENT.register((player, world, hand) -> {
LOGGER.info("UseItemCallback: before hook (client-side = %s)".formatted(world.isClient));
return TypedActionResult.pass(ItemStack.EMPTY);
});
// If a player is holding a blaze rod and right-clicks spawn a fireball!
UseItemCallback.EVENT.register((player, world, hand) -> {
if (!player.isSpectator()) {
if (player.getStackInHand(hand).isOf(Items.BLAZE_ROD)) {
if (!world.isClient()) {
player.getWorld().spawnEntity(new FireballEntity(player.getWorld(), player, 0, 0, 0, 0));
}
return TypedActionResult.success(player.getStackInHand(hand), world.isClient());
}
}
return TypedActionResult.pass(ItemStack.EMPTY);
});
UseItemCallback.EVENT.register((player, world, hand) -> {
LOGGER.info("UseItemCallback: after hook (client-side = %s)".formatted(world.isClient));
return TypedActionResult.pass(ItemStack.EMPTY);
});
}
}

View file

@ -12,7 +12,9 @@
"main": [
"net.fabricmc.fabric.test.event.interaction.AttackBlockTests",
"net.fabricmc.fabric.test.event.interaction.PlayerBreakBlockTests",
"net.fabricmc.fabric.test.event.interaction.UseEntityTests"
"net.fabricmc.fabric.test.event.interaction.UseBlockTests",
"net.fabricmc.fabric.test.event.interaction.UseEntityTests",
"net.fabricmc.fabric.test.event.interaction.UseItemTests"
],
"fabric-gametest": [
"net.fabricmc.fabric.test.event.interaction.FakePlayerTests"

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Allows registration of custom game rules.",
"mixins": [

View file

@ -21,7 +21,7 @@
]
},
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-resource-loader-v0": "*"
},
"description": "Allows registration of custom game tests.",

View file

@ -25,6 +25,7 @@ import net.minecraft.entity.attribute.EntityAttributeModifier;
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;
/**
@ -75,7 +76,7 @@ public interface FabricItem {
* @param slot the equipment slot this stack is in
* @return the attribute modifiers
*/
default Multimap<EntityAttribute, EntityAttributeModifier> getAttributeModifiers(ItemStack stack, EquipmentSlot slot) {
default Multimap<RegistryEntry<EntityAttribute>, EntityAttributeModifier> getAttributeModifiers(ItemStack stack, EquipmentSlot slot) {
return ((Item) this).getAttributeModifiers(slot);
}

View file

@ -22,6 +22,7 @@ import net.minecraft.entity.EquipmentSlot;
import net.minecraft.entity.attribute.EntityAttribute;
import net.minecraft.entity.attribute.EntityAttributeModifier;
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;
@ -46,7 +47,7 @@ import net.fabricmc.fabric.api.event.EventFactory;
*/
@FunctionalInterface
public interface ModifyItemAttributeModifiersCallback {
void modifyAttributeModifiers(ItemStack stack, EquipmentSlot slot, Multimap<EntityAttribute, EntityAttributeModifier> attributeModifiers);
void modifyAttributeModifiers(ItemStack stack, EquipmentSlot slot, Multimap<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifiers);
Event<ModifyItemAttributeModifiersCallback> EVENT = EventFactory.createArrayBacked(
ModifyItemAttributeModifiersCallback.class,

View file

@ -32,6 +32,7 @@ import net.minecraft.entity.attribute.EntityAttributes;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.ArmorMaterial;
import net.minecraft.item.ArmorMaterials;
import net.minecraft.registry.entry.RegistryEntry;
@Mixin(ArmorItem.class)
public class ArmorItemMixin {
@ -42,7 +43,7 @@ public class ArmorItemMixin {
* adds a knockback resistance modifier to any ArmorItem if knockbackResistance is > 0.0F.
*/
@ModifyVariable(method = "<init>", at = @At(value = "INVOKE", target = "Lcom/google/common/collect/ImmutableMultimap$Builder;build()Lcom/google/common/collect/ImmutableMultimap;", remap = false))
private ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> fabric_knockbackResistance(ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> builder, ArmorMaterial material, ArmorItem.Type type) {
private ImmutableMultimap.Builder<RegistryEntry<EntityAttribute>, EntityAttributeModifier> fabric_knockbackResistance(ImmutableMultimap.Builder<RegistryEntry<EntityAttribute>, EntityAttributeModifier> builder, ArmorMaterial material, ArmorItem.Type type) {
// Vanilla handles netherite
if (material != ArmorMaterials.NETHERITE && knockbackResistance > 0.0F) {
builder.put(EntityAttributes.GENERIC_KNOCKBACK_RESISTANCE, new EntityAttributeModifier(

View file

@ -36,6 +36,7 @@ import net.minecraft.entity.attribute.EntityAttribute;
import net.minecraft.entity.attribute.EntityAttributeModifier;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.entry.RegistryEntry;
import net.fabricmc.fabric.api.item.v1.CustomDamageHandler;
import net.fabricmc.fabric.api.item.v1.FabricItemStack;
@ -82,10 +83,10 @@ public abstract class ItemStackMixin implements FabricItemStack {
target = "Lnet/minecraft/item/Item;getAttributeModifiers(Lnet/minecraft/entity/EquipmentSlot;)Lcom/google/common/collect/Multimap;"
)
)
public Multimap<EntityAttribute, EntityAttributeModifier> hookGetAttributeModifiers(Item item, EquipmentSlot slot) {
public Multimap<RegistryEntry<EntityAttribute>, EntityAttributeModifier> hookGetAttributeModifiers(Item item, EquipmentSlot slot) {
ItemStack stack = (ItemStack) (Object) this;
//we need to ensure it is modifiable for the callback, use linked map to preserve ordering
Multimap<EntityAttribute, EntityAttributeModifier> attributeModifiers = LinkedHashMultimap.create(item.getAttributeModifiers(stack, slot));
Multimap<RegistryEntry<EntityAttribute>, EntityAttributeModifier> attributeModifiers = LinkedHashMultimap.create(item.getAttributeModifiers(stack, slot));
ModifyItemAttributeModifiersCallback.EVENT.invoker().modifyAttributeModifiers(stack, slot, attributeModifiers);
return attributeModifiers;
}

View file

@ -23,7 +23,7 @@
}
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"description": "Hooks for items",

View file

@ -22,6 +22,7 @@ import net.minecraft.item.PickaxeItem;
import net.minecraft.item.ToolMaterials;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.potion.Potions;
import net.minecraft.recipe.Ingredient;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.text.Text;
@ -30,8 +31,8 @@ import net.minecraft.util.Identifier;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.item.v1.CustomDamageHandler;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.registry.FabricBrewingRecipeRegistry;
import net.fabricmc.fabric.api.registry.FuelRegistry;
import net.fabricmc.fabric.test.item.mixin.BrewingRecipeRegistryAccessor;
public class CustomDamageTest implements ModInitializer {
public static final Item WEIRD_PICK = new WeirdPick();
@ -40,7 +41,7 @@ public class CustomDamageTest implements ModInitializer {
public void onInitialize() {
Registry.register(Registries.ITEM, new Identifier("fabric-item-api-v1-testmod", "weird_pickaxe"), WEIRD_PICK);
FuelRegistry.INSTANCE.add(WEIRD_PICK, 200);
BrewingRecipeRegistryAccessor.callRegisterPotionRecipe(Potions.WATER, WEIRD_PICK, Potions.AWKWARD);
FabricBrewingRecipeRegistry.registerPotionRecipe(Potions.WATER, Ingredient.ofItems(WEIRD_PICK), Potions.AWKWARD);
}
public static final CustomDamageHandler WEIRD_DAMAGE_HANDLER = (stack, amount, entity, breakCallback) -> {

View file

@ -29,6 +29,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.entry.RegistryEntry;
import net.minecraft.util.Hand;
import net.minecraft.world.World;
@ -67,7 +68,7 @@ public class UpdatingItem extends Item {
}
@Override
public Multimap<EntityAttribute, EntityAttributeModifier> getAttributeModifiers(ItemStack stack, EquipmentSlot slot) {
public Multimap<RegistryEntry<EntityAttribute>, EntityAttributeModifier> getAttributeModifiers(ItemStack stack, EquipmentSlot slot) {
// Give + 5 attack damage for 15 seconds every 30 seconds.
if (slot == EquipmentSlot.MAINHAND && isEnabled(stack)) {
return ImmutableMultimap.of(EntityAttributes.GENERIC_ATTACK_DAMAGE, PLUS_FIVE);

View file

@ -1,32 +0,0 @@
/*
* 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.test.item.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
import net.minecraft.item.Item;
import net.minecraft.potion.Potion;
import net.minecraft.recipe.BrewingRecipeRegistry;
@Mixin(BrewingRecipeRegistry.class)
public interface BrewingRecipeRegistryAccessor {
@Invoker
static void callRegisterPotionRecipe(Potion input, Item item, Potion output) {
throw new UnsupportedOperationException();
}
}

View file

@ -1,11 +0,0 @@
{
"required": true,
"package": "net.fabricmc.fabric.test.item.mixin",
"compatibilityLevel": "JAVA_17",
"mixins": [
"BrewingRecipeRegistryAccessor"
],
"injectors": {
"defaultRequire": 1
}
}

View file

@ -24,8 +24,5 @@
"net.fabricmc.fabric.test.item.gametest.FurnaceGameTest",
"net.fabricmc.fabric.test.item.gametest.RecipeGameTest"
]
},
"mixins": [
"fabric-item-api-tests-v1.mixins.json"
]
}
}

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-resource-loader-v0": "*"
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Key Binding registry API.",
"mixins": [

View file

@ -31,7 +31,7 @@
}
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"description": "Events for the game's lifecycle.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-resource-loader-v0": "*"
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"description": "Adds message-related hooks.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-lifecycle-events-v1": "*",
"fabric-resource-loader-v0": "*"

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"breaks": {

View file

@ -25,7 +25,7 @@
},
"accessWidener": "fabric-networking-api-v1.accesswidener",
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"description": "Low-level, vanilla protocol oriented networking hooks.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"description": "Builders for objects vanilla has locked down.",

View file

@ -31,7 +31,6 @@ import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.Identifier;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
@ -82,7 +81,7 @@ public class BlockEntityTypeBuilderTest implements ModInitializer {
}
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
public ActionResult method_55766(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
if (!world.isClient()) {
BlockEntity blockEntity = world.getBlockEntity(pos);

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Hooks for registering custom particles.",
"mixins": [

View file

@ -20,7 +20,7 @@
],
"accessWidener": "fabric-recipe-api-v1.accesswidener",
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-networking-api-v1": "*"
},
"entrypoints": {

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-networking-api-v1": "*"
},

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.15-alpha.19.39.a",
"fabric-api-base": "*"
},

View file

@ -23,9 +23,9 @@ import net.minecraft.block.BlockEntityProvider;
import net.minecraft.block.BlockState;
import net.minecraft.block.Blocks;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.class_9062;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
@ -43,9 +43,8 @@ public class FrameBlock extends Block implements BlockEntityProvider, FabricBloc
}
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
public class_9062 method_55765(ItemStack stack, BlockState blockState, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult blockHitResult) {
if (world.getBlockEntity(pos) instanceof FrameBlockEntity frame) {
ItemStack stack = player.getStackInHand(hand);
Block handBlock = Block.getBlockFromItem(stack.getItem());
@Nullable
@ -59,20 +58,20 @@ public class FrameBlock extends Block implements BlockEntityProvider, FabricBloc
frame.setBlock(null);
}
return ActionResult.success(world.isClient());
return class_9062.method_55644(world.isClient());
}
return ActionResult.PASS;
return class_9062.SKIP_DEFAULT_BLOCK_INTERACTION;
}
// getBlockFromItem will return air if we do not have a block item in hand
if (handBlock == Blocks.AIR) {
return ActionResult.FAIL;
return class_9062.FAIL;
}
// Do not allow blocks that may have a block entity
if (handBlock instanceof BlockEntityProvider) {
return ActionResult.FAIL;
return class_9062.FAIL;
}
stack.decrement(1);
@ -85,10 +84,10 @@ public class FrameBlock extends Block implements BlockEntityProvider, FabricBloc
frame.setBlock(handBlock);
}
return ActionResult.success(world.isClient());
return class_9062.method_55644(world.isClient());
}
return ActionResult.FAIL;
return class_9062.FAIL;
}
@Nullable

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.15-alpha.19.39.a",
"fabric-api-base": "*",
"fabric-renderer-api-v1": "*"

View file

@ -15,7 +15,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"description": "Hooks for registering fluid renders.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"description": "Hooks and registries for rendering-related things.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Allows conditionally loading resources.",
"mixins": [

View file

@ -38,8 +38,8 @@ import net.minecraft.nbt.NbtCompound;
import net.minecraft.nbt.NbtElement;
import net.minecraft.nbt.NbtIo;
import net.minecraft.nbt.NbtList;
import net.minecraft.nbt.NbtSizeTracker;
import net.minecraft.nbt.NbtString;
import net.minecraft.nbt.NbtTagSizeTracker;
import net.minecraft.resource.ResourcePack;
import net.minecraft.resource.ResourcePackProfile;
@ -80,7 +80,7 @@ public class GameOptionsMixin {
if (Files.exists(trackerFile)) {
try {
NbtCompound data = NbtIo.readCompressed(trackerFile, NbtTagSizeTracker.ofUnlimitedBytes());
NbtCompound data = NbtIo.readCompressed(trackerFile, NbtSizeTracker.ofUnlimitedBytes());
NbtList values = data.getList("values", NbtElement.STRING_TYPE);
for (int i = 0; i < values.size(); i++) {

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Asset and data resource loading.",
"mixins": [

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*"
},
"description": "Adds screen related hooks.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-networking-api-v1": "*"
},

View file

@ -27,7 +27,6 @@ import net.minecraft.inventory.Inventory;
import net.minecraft.screen.NamedScreenHandlerFactory;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.ItemScatterer;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
@ -44,7 +43,7 @@ public class BoxBlock extends BlockWithEntity {
}
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
public ActionResult method_55766(BlockState state, World world, BlockPos pos, PlayerEntity player, BlockHitResult hit) {
if (!world.isClient) {
NamedScreenHandlerFactory screenHandlerFactory = state.createScreenHandlerFactory(world, pos);

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"minecraft": ">=1.19.2"
},
"description": "Hooks for modifying Minecraft's sound system.",

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-lookup-api-v1": "*",
"fabric-rendering-fluids-v1": "*"
},

View file

@ -25,9 +25,10 @@ import net.minecraft.block.ShapeContext;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityTicker;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.class_9062;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.text.Text;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
@ -64,7 +65,7 @@ public class FluidChuteBlock extends Block implements BlockEntityProvider {
}
@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult hit) {
public class_9062 method_55765(ItemStack stack, BlockState blockState, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockHitResult blockHitResult) {
if (world.getBlockEntity(pos) instanceof FluidChuteBlockEntity chute) {
if (!FluidStorageUtil.interactWithFluidStorage(chute.storage, player, hand)) {
if (!world.isClient()) {
@ -76,10 +77,10 @@ public class FluidChuteBlock extends Block implements BlockEntityProvider {
);
}
return ActionResult.CONSUME;
return class_9062.CONSUME;
}
}
return ActionResult.success(world.isClient());
return class_9062.method_55644(world.isClient());
}
}

View file

@ -49,7 +49,7 @@ transitive-accessible method net/minecraft/item/ItemPlacementContext <init> (Lne
# Registering custom brewing recipes
transitive-accessible method net/minecraft/recipe/BrewingRecipeRegistry registerItemRecipe (Lnet/minecraft/item/Item;Lnet/minecraft/item/Item;Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/recipe/BrewingRecipeRegistry registerPotionType (Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/recipe/BrewingRecipeRegistry registerPotionRecipe (Lnet/minecraft/potion/Potion;Lnet/minecraft/item/Item;Lnet/minecraft/potion/Potion;)V
transitive-accessible method net/minecraft/recipe/BrewingRecipeRegistry registerPotionRecipe (Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/item/Item;Lnet/minecraft/registry/entry/RegistryEntry;)V
# Registering custom scoreboard criteria
transitive-accessible method net/minecraft/scoreboard/ScoreboardCriterion create (Ljava/lang/String;ZLnet/minecraft/scoreboard/ScoreboardCriterion$RenderType;)Lnet/minecraft/scoreboard/ScoreboardCriterion;

View file

@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Contains transitive access wideners that provide access to otherwise inaccessible Minecraft code.",
"accessWidener": "fabric-transitive-access-wideners-v1.accesswidener",

View file

@ -44,7 +44,7 @@ transitive-accessible method net/minecraft/item/ItemPlacementContext <init> (Lne
# Registering custom brewing recipes
transitive-accessible method net/minecraft/recipe/BrewingRecipeRegistry registerItemRecipe (Lnet/minecraft/item/Item;Lnet/minecraft/item/Item;Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/recipe/BrewingRecipeRegistry registerPotionType (Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/recipe/BrewingRecipeRegistry registerPotionRecipe (Lnet/minecraft/potion/Potion;Lnet/minecraft/item/Item;Lnet/minecraft/potion/Potion;)V
transitive-accessible method net/minecraft/recipe/BrewingRecipeRegistry registerPotionRecipe (Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/item/Item;Lnet/minecraft/registry/entry/RegistryEntry;)V
# Registering custom scoreboard criteria
transitive-accessible method net/minecraft/scoreboard/ScoreboardCriterion create (Ljava/lang/String;ZLnet/minecraft/scoreboard/ScoreboardCriterion$RenderType;)Lnet/minecraft/scoreboard/ScoreboardCriterion;

View file

@ -2,63 +2,63 @@ org.gradle.jvmargs=-Xmx2560M
org.gradle.parallel=true
fabric.loom.multiProjectOptimisation=true
version=0.91.3
minecraft_version=1.20.4
version=0.91.4
minecraft_version=23w51b
yarn_version=+build.1
loader_version=0.15.1
loader_version=0.15.3
installer_version=0.11.1
prerelease=false
curseforge_minecraft_version=1.20.4
prerelease=true
curseforge_minecraft_version=1.20.3-Snapshot
# Do not manually update, use the bumpversions task:
fabric-api-base-version=0.4.35
fabric-api-lookup-api-v1-version=1.6.45
fabric-biome-api-v1-version=13.0.15
fabric-block-api-v1-version=1.0.14
fabric-block-view-api-v2-version=1.0.3
fabric-blockrenderlayer-v1-version=1.1.45
fabric-command-api-v1-version=1.2.40
fabric-command-api-v2-version=2.2.19
fabric-commands-v0-version=0.2.57
fabric-containers-v0-version=0.1.81
fabric-content-registries-v0-version=5.0.9
fabric-crash-report-info-v1-version=0.2.22
fabric-data-generation-api-v1-version=13.1.17
fabric-dimensions-v1-version=2.1.60
fabric-entity-events-v1-version=1.5.28
fabric-events-interaction-v0-version=0.6.14
fabric-events-lifecycle-v0-version=0.2.71
fabric-game-rule-api-v1-version=1.0.45
fabric-gametest-api-v1-version=1.2.19
fabric-item-api-v1-version=2.1.34
fabric-item-group-api-v1-version=4.0.20
fabric-key-binding-api-v1-version=1.0.40
fabric-keybindings-v0-version=0.2.38
fabric-lifecycle-events-v1-version=2.2.29
fabric-loot-api-v2-version=2.1.4
fabric-message-api-v1-version=6.0.4
fabric-mining-level-api-v1-version=2.1.59
fabric-model-loading-api-v1-version=1.0.7
fabric-models-v0-version=0.4.6
fabric-networking-api-v1-version=3.1.2
fabric-object-builder-api-v1-version=13.0.7
fabric-particles-v1-version=1.1.6
fabric-recipe-api-v1-version=2.0.15
fabric-registry-sync-v0-version=4.0.13
fabric-renderer-api-v1-version=3.2.3
fabric-renderer-indigo-version=1.5.3
fabric-renderer-registries-v1-version=3.2.50
fabric-rendering-data-attachment-v1-version=0.3.41
fabric-rendering-fluids-v1-version=3.0.32
fabric-rendering-v0-version=1.1.53
fabric-rendering-v1-version=3.0.12
fabric-resource-conditions-api-v1-version=2.3.13
fabric-resource-loader-v0-version=0.11.15
fabric-screen-api-v1-version=2.0.16
fabric-screen-handler-api-v1-version=1.3.50
fabric-sound-api-v1-version=1.0.16
fabric-transfer-api-v1-version=4.0.6
fabric-transitive-access-wideners-v1-version=5.0.13
fabric-convention-tags-v1-version=1.5.9
fabric-client-tags-api-v1-version=1.1.6
fabric-api-base-version=0.4.36
fabric-api-lookup-api-v1-version=1.6.46
fabric-biome-api-v1-version=13.0.16
fabric-block-api-v1-version=1.0.15
fabric-block-view-api-v2-version=1.0.4
fabric-blockrenderlayer-v1-version=1.1.46
fabric-command-api-v1-version=1.2.41
fabric-command-api-v2-version=2.2.20
fabric-commands-v0-version=0.2.58
fabric-containers-v0-version=0.1.82
fabric-content-registries-v0-version=6.0.0
fabric-crash-report-info-v1-version=0.2.23
fabric-data-generation-api-v1-version=14.0.0
fabric-dimensions-v1-version=2.1.61
fabric-entity-events-v1-version=1.5.29
fabric-events-interaction-v0-version=0.6.15
fabric-events-lifecycle-v0-version=0.2.72
fabric-game-rule-api-v1-version=1.0.46
fabric-gametest-api-v1-version=1.2.20
fabric-item-api-v1-version=3.0.0
fabric-item-group-api-v1-version=4.0.21
fabric-key-binding-api-v1-version=1.0.41
fabric-keybindings-v0-version=0.2.39
fabric-lifecycle-events-v1-version=2.2.30
fabric-loot-api-v2-version=2.1.5
fabric-message-api-v1-version=6.0.5
fabric-mining-level-api-v1-version=2.1.60
fabric-model-loading-api-v1-version=1.0.8
fabric-models-v0-version=0.4.7
fabric-networking-api-v1-version=3.1.3
fabric-object-builder-api-v1-version=13.0.8
fabric-particles-v1-version=1.1.7
fabric-recipe-api-v1-version=2.0.16
fabric-registry-sync-v0-version=4.0.14
fabric-renderer-api-v1-version=3.2.4
fabric-renderer-indigo-version=1.5.4
fabric-renderer-registries-v1-version=3.2.51
fabric-rendering-data-attachment-v1-version=0.3.42
fabric-rendering-fluids-v1-version=3.0.33
fabric-rendering-v0-version=1.1.54
fabric-rendering-v1-version=3.0.13
fabric-resource-conditions-api-v1-version=2.3.14
fabric-resource-loader-v0-version=0.11.16
fabric-screen-api-v1-version=2.0.17
fabric-screen-handler-api-v1-version=1.3.51
fabric-sound-api-v1-version=1.0.17
fabric-transfer-api-v1-version=4.0.7
fabric-transitive-access-wideners-v1-version=6.0.0
fabric-convention-tags-v1-version=1.5.10
fabric-client-tags-api-v1-version=1.1.7

View file

@ -19,9 +19,9 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"java": ">=17",
"minecraft": ">=1.20.3- <1.20.5-"
"minecraft": ">=1.20.5- <1.20.6-"
},
"description": "Core API module providing key hooks and intercompatibility features."
}