mirror of
https://github.com/FabricMC/fabric.git
synced 2025-03-22 21:15:23 -04:00
parent
67421c4c83
commit
50ed0faf3a
17 changed files with 77 additions and 76 deletions
fabric-client-tags-api-v1/src/client/java/net/fabricmc/fabric
fabric-command-api-v2/src/client/java/net/fabricmc/fabric/impl/command/client
fabric-convention-tags-v2/src/main/java/net/fabricmc/fabric/api/tag
fabric-data-attachment-api-v1/src/testmod/java/net/fabricmc/fabric/test/attachment/gametest
fabric-gametest-api-v1/src/testmod/java/net/fabricmc/fabric/test/gametest
fabric-rendering-v1/src/client/java/net/fabricmc/fabric/mixin/client/rendering
fabric-resource-conditions-api-v1/src/main/java/net/fabricmc/fabric/impl/resource/conditions/conditions
fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client
fabric-transfer-api-v1/src
main/java/net/fabricmc/fabric/impl/transfer
testmod/java/net/fabricmc/fabric/test/transfer/gametests
|
@ -99,7 +99,7 @@ public final class ClientTags {
|
|||
Objects.requireNonNull(tagKey);
|
||||
Objects.requireNonNull(registryKey);
|
||||
|
||||
if (tagKey.registry().getValue().equals(registryKey.getRegistry())) {
|
||||
if (tagKey.registryRef().getValue().equals(registryKey.getRegistry())) {
|
||||
// Check local tags
|
||||
Set<Identifier> ids = getOrCreateLocalTag(tagKey);
|
||||
return ids.contains(registryKey.getValue());
|
||||
|
|
|
@ -87,13 +87,13 @@ public class ClientTagsImpl {
|
|||
if (MinecraftClient.getInstance().world != null) {
|
||||
if (MinecraftClient.getInstance().world.getRegistryManager() != null) {
|
||||
Optional<? extends Registry<T>> maybeRegistry = MinecraftClient.getInstance().world
|
||||
.getRegistryManager().getOptional(tagKey.registry());
|
||||
.getRegistryManager().getOptional(tagKey.registryRef());
|
||||
if (maybeRegistry.isPresent()) return maybeRegistry;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (Optional<? extends Registry<T>>) Registries.REGISTRIES.getOptionalValue(tagKey.registry().getValue());
|
||||
return (Optional<? extends Registry<T>>) Registries.REGISTRIES.getOptionalValue(tagKey.registryRef().getValue());
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
|
|
@ -52,7 +52,7 @@ public class ClientTagsLoader {
|
|||
*/
|
||||
public static LoadedTag loadTag(TagKey<?> tagKey) {
|
||||
var tags = new HashSet<TagEntry>();
|
||||
HashSet<Path> tagFiles = getTagFiles(tagKey.registry(), tagKey.id());
|
||||
HashSet<Path> tagFiles = getTagFiles(tagKey.registryRef(), tagKey.id());
|
||||
|
||||
for (Path tagPath : tagFiles) {
|
||||
try (BufferedReader tagReader = Files.newBufferedReader(tagPath)) {
|
||||
|
@ -88,7 +88,7 @@ public class ClientTagsLoader {
|
|||
@Nullable
|
||||
@Override
|
||||
public Collection<Identifier> tag(Identifier id) {
|
||||
TagKey<?> tag = TagKey.of(tagKey.registry(), id);
|
||||
TagKey<?> tag = TagKey.of(tagKey.registryRef(), id);
|
||||
immediateChildTags.add(tag);
|
||||
return ClientTagsImpl.getOrCreatePartiallySyncedTag(tag).completeIds;
|
||||
}
|
||||
|
|
|
@ -40,10 +40,10 @@ import org.jetbrains.annotations.Nullable;
|
|||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import net.minecraft.class_10209;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.text.Texts;
|
||||
import net.minecraft.util.profiler.Profilers;
|
||||
|
||||
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
|
||||
import net.fabricmc.fabric.mixin.command.HelpCommandAccessor;
|
||||
|
@ -77,7 +77,7 @@ public final class ClientCommandInternals {
|
|||
// noinspection ConstantConditions
|
||||
FabricClientCommandSource commandSource = (FabricClientCommandSource) client.getNetworkHandler().getCommandSource();
|
||||
|
||||
class_10209.method_64146().push(command);
|
||||
Profilers.get().push(command);
|
||||
|
||||
try {
|
||||
// TODO: Check for server commands before executing.
|
||||
|
@ -101,7 +101,7 @@ public final class ClientCommandInternals {
|
|||
commandSource.sendError(Text.of(e.getMessage()));
|
||||
return true;
|
||||
} finally {
|
||||
class_10209.method_64146().pop();
|
||||
Profilers.get().pop();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ public interface FabricTagKey {
|
|||
stringBuilder.append("tag.");
|
||||
|
||||
TagKey<?> tagKey = (TagKey<?>) this;
|
||||
Identifier registryIdentifier = tagKey.registry().getValue();
|
||||
Identifier registryIdentifier = tagKey.registryRef().getValue();
|
||||
Identifier tagIdentifier = tagKey.id();
|
||||
|
||||
if (!registryIdentifier.getNamespace().equals(Identifier.DEFAULT_NAMESPACE)) {
|
||||
|
|
|
@ -64,9 +64,9 @@ public final class TagUtil {
|
|||
Objects.requireNonNull(entry);
|
||||
|
||||
if (registryManager != null) {
|
||||
maybeRegistry = registryManager.getOptional(tagKey.registry());
|
||||
maybeRegistry = registryManager.getOptional(tagKey.registryRef());
|
||||
} else {
|
||||
maybeRegistry = Registries.REGISTRIES.getOptionalValue(tagKey.registry().getValue());
|
||||
maybeRegistry = Registries.REGISTRIES.getOptionalValue(tagKey.registryRef().getValue());
|
||||
}
|
||||
|
||||
if (maybeRegistry.isPresent()) {
|
||||
|
|
|
@ -57,7 +57,7 @@ public class AttachmentCopyTests implements FabricGameTest {
|
|||
ServerWorld end = server.getWorld(World.END);
|
||||
// using overworld and end to avoid portal code related to the nether
|
||||
|
||||
Entity entity = EntityType.PIG.create(overworld, SpawnReason.SPAWN_EGG);
|
||||
Entity entity = EntityType.PIG.create(overworld, SpawnReason.SPAWN_ITEM_USE);
|
||||
Objects.requireNonNull(entity, "entity was null");
|
||||
entity.setAttached(DUMMY, () -> 10);
|
||||
entity.setAttached(COPY_ON_DEATH, () -> 10);
|
||||
|
|
|
@ -47,7 +47,7 @@ public class ExampleFabricTestSuite implements FabricGameTest {
|
|||
|
||||
private void afterEach(TestContext context) {
|
||||
context.addInstantFinalTask(() ->
|
||||
context.checkBlock(new BlockPos(0, 2, 0), (block) -> block == Blocks.DIAMOND_BLOCK, "Expect block to be gold")
|
||||
context.checkBlock(new BlockPos(0, 1, 0), (block) -> block == Blocks.DIAMOND_BLOCK, "Expect block to be diamond")
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -58,6 +58,6 @@ public class ExampleFabricTestSuite implements FabricGameTest {
|
|||
|
||||
@GameTest(templateName = EMPTY_STRUCTURE)
|
||||
public void noStructure(TestContext context) {
|
||||
context.setBlockState(0, 2, 0, Blocks.DIAMOND_BLOCK);
|
||||
context.setBlockState(0, 1, 0, Blocks.DIAMOND_BLOCK);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public class ExampleTestSuite {
|
|||
@GameTest
|
||||
public void diamond(TestContext context) {
|
||||
context.addInstantFinalTask(() ->
|
||||
context.checkBlock(new BlockPos(0, 2, 0), (block) -> block == Blocks.DIAMOND_BLOCK, "Expect block to be diamond")
|
||||
context.checkBlock(new BlockPos(0, 1, 0), (block) -> block == Blocks.DIAMOND_BLOCK, "Expect block to be diamond")
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import net.fabricmc.fabric.api.client.rendering.v1.LivingEntityFeatureRenderEven
|
|||
|
||||
@Mixin(CapeFeatureRenderer.class)
|
||||
public class CapeFeatureRendererMixin {
|
||||
@WrapOperation(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/feature/CapeFeatureRenderer;method_64257(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/equipment/EquipmentModel$LayerType;)Z"), method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/state/PlayerEntityRenderState;FF)V")
|
||||
@WrapOperation(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/entity/feature/CapeFeatureRenderer;hasCustomModelForLayer(Lnet/minecraft/item/ItemStack;Lnet/minecraft/item/equipment/EquipmentModel$LayerType;)Z"), method = "render(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;ILnet/minecraft/client/render/entity/state/PlayerEntityRenderState;FF)V")
|
||||
public boolean injectCapeRenderCheck(CapeFeatureRenderer instance, ItemStack itemStack, EquipmentModel.LayerType layerType, Operation<Boolean> original, @Local(argsOnly = true) PlayerEntityRenderState state) {
|
||||
if (!LivingEntityFeatureRenderEvents.ALLOW_CAPE_RENDER.invoker().allowCapeRender(state)) {
|
||||
return false;
|
||||
|
|
|
@ -48,7 +48,7 @@ public record TagsPopulatedResourceCondition(Identifier registry, List<Identifie
|
|||
|
||||
@SafeVarargs
|
||||
public <T> TagsPopulatedResourceCondition(TagKey<T>... tags) {
|
||||
this(tags[0].registry().getValue(), Arrays.stream(tags).map(TagKey::id).toList());
|
||||
this(tags[0].registryRef().getValue(), Arrays.stream(tags).map(TagKey::id).toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -45,7 +45,7 @@ public abstract class CreateWorldScreenMixin extends Screen {
|
|||
super(null);
|
||||
}
|
||||
|
||||
@ModifyVariable(method = "method_64244",
|
||||
@ModifyVariable(method = "show(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;Ljava/util/function/Function;Lnet/minecraft/client/world/GeneratorOptionsFactory;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/class_10241;)V",
|
||||
at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/world/CreateWorldScreen;createServerConfig(Lnet/minecraft/resource/ResourcePackManager;Lnet/minecraft/resource/DataConfiguration;)Lnet/minecraft/server/SaveLoading$ServerConfig;"))
|
||||
private static ResourcePackManager onCreateResManagerInit(ResourcePackManager manager) {
|
||||
// Add mod data packs to the initial res pack manager so they are active even if the user doesn't use custom data packs
|
||||
|
@ -53,7 +53,8 @@ public abstract class CreateWorldScreenMixin extends Screen {
|
|||
return manager;
|
||||
}
|
||||
|
||||
@Redirect(method = "method_64244", at = @At(value = "FIELD", target = "Lnet/minecraft/resource/DataConfiguration;SAFE_MODE:Lnet/minecraft/resource/DataConfiguration;", ordinal = 0))
|
||||
@Redirect(method = "show(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;Ljava/util/function/Function;Lnet/minecraft/client/world/GeneratorOptionsFactory;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/class_10241;)V",
|
||||
at = @At(value = "FIELD", target = "Lnet/minecraft/resource/DataConfiguration;SAFE_MODE:Lnet/minecraft/resource/DataConfiguration;", ordinal = 0))
|
||||
private static DataConfiguration replaceDefaultSettings() {
|
||||
return ModResourcePackUtil.createDefaultDataConfiguration();
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.mojang.serialization.DataResult;
|
|||
import com.mojang.serialization.codecs.RecordCodecBuilder;
|
||||
|
||||
import net.minecraft.component.ComponentChanges;
|
||||
import net.minecraft.component.ComponentMapImpl;
|
||||
import net.minecraft.component.MergedComponentMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.RegistryByteBuf;
|
||||
import net.minecraft.network.codec.PacketCodec;
|
||||
|
@ -60,6 +60,6 @@ public class VariantCodecs {
|
|||
);
|
||||
|
||||
private static DataResult<ItemVariant> validateComponents(ItemVariant variant) {
|
||||
return ItemStack.validateComponents(ComponentMapImpl.create(variant.getItem().getComponents(), variant.getComponents())).map(v -> variant);
|
||||
return ItemStack.validateComponents(MergedComponentMap.create(variant.getItem().getComponents(), variant.getComponents())).map(v -> variant);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ import org.jetbrains.annotations.Nullable;
|
|||
|
||||
import net.minecraft.component.ComponentChanges;
|
||||
import net.minecraft.component.ComponentMap;
|
||||
import net.minecraft.component.ComponentMapImpl;
|
||||
import net.minecraft.component.MergedComponentMap;
|
||||
import net.minecraft.fluid.FlowableFluid;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.fluid.Fluids;
|
||||
|
@ -71,7 +71,7 @@ public class FluidVariantImpl implements FluidVariant {
|
|||
public FluidVariantImpl(Fluid fluid, ComponentChanges components) {
|
||||
this.fluid = fluid;
|
||||
this.components = components;
|
||||
this.componentMap = components == ComponentChanges.EMPTY ? ComponentMap.EMPTY : ComponentMapImpl.create(ComponentMap.EMPTY, components);
|
||||
this.componentMap = components == ComponentChanges.EMPTY ? ComponentMap.EMPTY : MergedComponentMap.create(ComponentMap.EMPTY, components);
|
||||
this.hashCode = Objects.hash(fluid, components);
|
||||
}
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ public class ComposterWrapper extends SnapshotParticipant<Float> {
|
|||
location.setBlockState(newState);
|
||||
|
||||
if (newLevel == 7) {
|
||||
location.world.scheduleBlockTick(location.pos, state.getBlock(), 20);
|
||||
location.world.method_64310(location.pos, state.getBlock(), 20);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -288,7 +288,7 @@ public class VanillaStorageTests {
|
|||
*/
|
||||
@GameTest(templateName = "fabric-transfer-api-v1-testmod:double_chest_comparators", skyAccess = true)
|
||||
public void testDoubleChestComparator(TestContext context) {
|
||||
BlockPos chestPos = new BlockPos(2, 2, 2);
|
||||
BlockPos chestPos = new BlockPos(2, 1, 2);
|
||||
Storage<ItemVariant> storage = ItemStorage.SIDED.find(context.getWorld(), context.getAbsolutePos(chestPos), Direction.UP);
|
||||
context.assertTrue(storage != null, "Storage must not be null");
|
||||
|
||||
|
|
|
@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx2560M
|
|||
org.gradle.parallel=true
|
||||
fabric.loom.multiProjectOptimisation=true
|
||||
|
||||
version=0.104.1
|
||||
minecraft_version=24w37a
|
||||
yarn_version=+build.1
|
||||
version=0.104.2
|
||||
minecraft_version=24w38a
|
||||
yarn_version=+build.2
|
||||
loader_version=0.16.4
|
||||
installer_version=1.0.1
|
||||
|
||||
|
@ -12,51 +12,51 @@ prerelease=true
|
|||
curseforge_minecraft_version=1.21.2-Snapshot
|
||||
|
||||
# Do not manually update, use the bumpversions task:
|
||||
fabric-api-base-version=0.4.45
|
||||
fabric-api-lookup-api-v1-version=1.6.74
|
||||
fabric-biome-api-v1-version=14.0.2
|
||||
fabric-block-api-v1-version=1.0.25
|
||||
fabric-block-view-api-v2-version=1.0.13
|
||||
fabric-blockrenderlayer-v1-version=1.1.55
|
||||
fabric-command-api-v1-version=1.2.53
|
||||
fabric-command-api-v2-version=2.2.32
|
||||
fabric-commands-v0-version=0.2.70
|
||||
fabric-content-registries-v0-version=9.0.5
|
||||
fabric-crash-report-info-v1-version=0.3.0
|
||||
fabric-data-attachment-api-v1-version=1.1.33
|
||||
fabric-data-generation-api-v1-version=21.0.6
|
||||
fabric-dimensions-v1-version=4.0.3
|
||||
fabric-entity-events-v1-version=2.0.1
|
||||
fabric-events-interaction-v0-version=2.0.3
|
||||
fabric-game-rule-api-v1-version=1.0.56
|
||||
fabric-gametest-api-v1-version=2.0.8
|
||||
fabric-item-api-v1-version=11.0.5
|
||||
fabric-item-group-api-v1-version=4.1.9
|
||||
fabric-key-binding-api-v1-version=1.0.50
|
||||
fabric-keybindings-v0-version=0.2.48
|
||||
fabric-lifecycle-events-v1-version=2.3.18
|
||||
fabric-loot-api-v2-version=3.0.18
|
||||
fabric-loot-api-v3-version=1.0.6
|
||||
fabric-message-api-v1-version=6.0.16
|
||||
fabric-model-loading-api-v1-version=3.0.4
|
||||
fabric-networking-api-v1-version=4.2.6
|
||||
fabric-object-builder-api-v1-version=17.0.2
|
||||
fabric-particles-v1-version=4.0.5
|
||||
fabric-recipe-api-v1-version=6.0.3
|
||||
fabric-registry-sync-v0-version=5.1.7
|
||||
fabric-renderer-api-v1-version=3.5.2
|
||||
fabric-renderer-indigo-version=1.8.2
|
||||
fabric-rendering-data-attachment-v1-version=0.3.51
|
||||
fabric-rendering-fluids-v1-version=3.1.9
|
||||
fabric-rendering-v0-version=1.1.76
|
||||
fabric-rendering-v1-version=8.0.0
|
||||
fabric-resource-conditions-api-v1-version=5.0.2
|
||||
fabric-resource-loader-v0-version=3.0.0
|
||||
fabric-screen-api-v1-version=2.0.28
|
||||
fabric-screen-handler-api-v1-version=1.3.91
|
||||
fabric-sound-api-v1-version=1.0.26
|
||||
fabric-transfer-api-v1-version=5.2.1
|
||||
fabric-transitive-access-wideners-v1-version=6.1.4
|
||||
fabric-convention-tags-v1-version=2.0.27
|
||||
fabric-convention-tags-v2-version=2.7.1
|
||||
fabric-client-tags-api-v1-version=1.1.18
|
||||
fabric-api-base-version=0.4.46
|
||||
fabric-api-lookup-api-v1-version=1.6.75
|
||||
fabric-biome-api-v1-version=14.0.3
|
||||
fabric-block-api-v1-version=1.0.26
|
||||
fabric-block-view-api-v2-version=1.0.14
|
||||
fabric-blockrenderlayer-v1-version=2.0.0
|
||||
fabric-command-api-v1-version=1.2.54
|
||||
fabric-command-api-v2-version=2.2.33
|
||||
fabric-commands-v0-version=0.2.71
|
||||
fabric-content-registries-v0-version=9.0.6
|
||||
fabric-crash-report-info-v1-version=0.3.1
|
||||
fabric-data-attachment-api-v1-version=1.1.34
|
||||
fabric-data-generation-api-v1-version=21.0.7
|
||||
fabric-dimensions-v1-version=4.0.4
|
||||
fabric-entity-events-v1-version=2.0.2
|
||||
fabric-events-interaction-v0-version=2.0.4
|
||||
fabric-game-rule-api-v1-version=1.0.57
|
||||
fabric-gametest-api-v1-version=2.0.9
|
||||
fabric-item-api-v1-version=11.0.6
|
||||
fabric-item-group-api-v1-version=4.1.10
|
||||
fabric-key-binding-api-v1-version=1.0.51
|
||||
fabric-keybindings-v0-version=0.2.49
|
||||
fabric-lifecycle-events-v1-version=2.3.19
|
||||
fabric-loot-api-v2-version=3.0.19
|
||||
fabric-loot-api-v3-version=1.0.7
|
||||
fabric-message-api-v1-version=6.0.17
|
||||
fabric-model-loading-api-v1-version=3.0.5
|
||||
fabric-networking-api-v1-version=4.2.7
|
||||
fabric-object-builder-api-v1-version=17.0.3
|
||||
fabric-particles-v1-version=4.0.6
|
||||
fabric-recipe-api-v1-version=6.0.4
|
||||
fabric-registry-sync-v0-version=5.1.8
|
||||
fabric-renderer-api-v1-version=4.0.0
|
||||
fabric-renderer-indigo-version=1.9.0
|
||||
fabric-rendering-data-attachment-v1-version=0.3.52
|
||||
fabric-rendering-fluids-v1-version=3.1.10
|
||||
fabric-rendering-v0-version=1.1.77
|
||||
fabric-rendering-v1-version=8.0.1
|
||||
fabric-resource-conditions-api-v1-version=5.0.3
|
||||
fabric-resource-loader-v0-version=3.0.1
|
||||
fabric-screen-api-v1-version=2.0.29
|
||||
fabric-screen-handler-api-v1-version=1.3.92
|
||||
fabric-sound-api-v1-version=1.0.27
|
||||
fabric-transfer-api-v1-version=5.2.2
|
||||
fabric-transitive-access-wideners-v1-version=6.1.5
|
||||
fabric-convention-tags-v1-version=2.0.28
|
||||
fabric-convention-tags-v2-version=2.7.2
|
||||
fabric-client-tags-api-v1-version=1.1.19
|
||||
|
|
Loading…
Reference in a new issue