Skip to content

Commit

Permalink
23w51b
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Dec 18, 2023
1 parent 4ced059 commit 7d2743f
Show file tree
Hide file tree
Showing 75 changed files with 124 additions and 174 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"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.1",
"fabricloader": ">=0.15.3",
"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.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-networking-api-v1": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
]
},
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-item-api-v1": "*",
"fabric-lifecycle-events-v1": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1",
"fabricloader": ">=0.15.3",
"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.1",
"fabricloader": ">=0.15.3",
"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.1",
"fabricloader": ">=0.15.3",
"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.1",
"fabricloader": ">=0.15.3",
"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.1",
"fabricloader": ">=0.15.3",
"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.1"
"fabricloader": ">=0.15.3"
},
"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.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"fabric-lifecycle-events-v1": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@

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;
Expand All @@ -38,19 +38,18 @@ public InspectorBlock(Settings settings) {
}

@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) {
if (!world.isClient()) {
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
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.1",
"fabricloader": ">=0.15.3",
"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.1"
"fabricloader": ">=0.15.3"
},
"entrypoints": {
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"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.1",
"fabricloader": ">=0.15.3",
"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.1"
"fabricloader": ">=0.15.3"
},
"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.1",
"fabricloader": ">=0.15.3",
"fabric-api-base": "*",
"minecraft": ">1.19-alpha.22.11.a"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
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.
Expand All @@ -45,7 +46,7 @@ public static void registerItemRecipe(PotionItem input, Ingredient ingredient, P
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()));
}

/**
Expand All @@ -55,9 +56,9 @@ public static void registerItemRecipe(PotionItem input, Ingredient ingredient, P
* @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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -48,16 +48,16 @@ private 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);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
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;
Expand All @@ -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() {
Expand Down Expand Up @@ -139,13 +139,12 @@ public void onInitialize() {

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) {
Expand All @@ -169,7 +168,7 @@ public TestEventBlock(Settings settings) {
}

@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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Adds Fabric-related debug info to crash reports.",
"mixins": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
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;
Expand All @@ -68,7 +67,6 @@
* @see ItemTagProvider
* @see FluidTagProvider
* @see EntityTypeTagProvider
* @see GameEventTagProvider
*/
public abstract class FabricTagProvider<T> extends TagProvider<T> {
/**
Expand Down Expand Up @@ -221,20 +219,6 @@ protected RegistryKey<EntityType<?>> reverseLookup(EntityType<?> element) {
}
}

/**
* 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.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"FabricMC"
],
"depends": {
"fabricloader": ">=0.15.1"
"fabricloader": ">=0.15.3"
},
"description": "Allows for automatic data generation.",
"mixins": [
Expand Down
Loading

0 comments on commit 7d2743f

Please sign in to comment.