From 7dcfcf9c76d8df6b1dacc7495f3644491bf0bb33 Mon Sep 17 00:00:00 2001 From: haykam821 <24855774+haykam821@users.noreply.github.com> Date: Thu, 26 Sep 2024 04:06:22 -0400 Subject: [PATCH] Update to Minecraft snapshot 24w39a (#4121) --- .../content/registry/ContentRegistryTest.java | 4 ++-- .../generators/EntityTypeTagGenerator.java | 13 +++++++++++-- .../resources/data/c/tags/entity_type/boats.json | 15 +++++++++++++-- .../mixin/entity/event/LivingEntityMixin.java | 6 +++--- .../fabricmc/fabric/api/entity/FakePlayer.java | 2 +- .../client/CreativeInventoryScreenMixin.java | 8 ++++---- .../test/client/rendering/fluid/CustomFluid.java | 4 ++-- .../client/rendering/fluid/NoOverlayFluid.java | 4 ++-- .../test/client/rendering/fluid/OverlayFluid.java | 4 ++-- .../client/rendering/fluid/UnregisteredFluid.java | 4 ++-- .../conditions/DefaultResourceConditionsTest.java | 4 ++-- .../recipe/features_enabled.json | 2 +- .../loader/client/CreateWorldScreenMixin.java | 4 ++-- .../impl/transfer/item/ComposterWrapper.java | 2 +- gradle.properties | 4 ++-- 15 files changed, 50 insertions(+), 30 deletions(-) diff --git a/fabric-content-registries-v0/src/testmod/java/net/fabricmc/fabric/test/content/registry/ContentRegistryTest.java b/fabric-content-registries-v0/src/testmod/java/net/fabricmc/fabric/test/content/registry/ContentRegistryTest.java index b2429f595d..e05f47b0b3 100644 --- a/fabric-content-registries-v0/src/testmod/java/net/fabricmc/fabric/test/content/registry/ContentRegistryTest.java +++ b/fabric-content-registries-v0/src/testmod/java/net/fabricmc/fabric/test/content/registry/ContentRegistryTest.java @@ -97,7 +97,7 @@ public void onInitialize() { // - assign a loot table to the nitwit villager type // - right-clicking a 'test_event' block will emit a 'test_event' game event, which will have a sculk sensor frequency of 2 // - instant health potions can be brewed from awkward potions with any item in the 'minecraft:small_flowers' tag - // - if Bundle experiment is enabled, luck potions can be brewed from awkward potions with a bundle + // - if Redstone Experiments experiment is enabled, luck potions can be brewed from awkward potions with a bundle // - dirty potions can be brewed by adding any item in the 'minecraft:dirt' tag to any standard potion CompostingChanceRegistry.INSTANCE.add(Items.OBSIDIAN, 0.5F); @@ -180,7 +180,7 @@ public void onInitialize() { builder.registerItemRecipe(Items.POTION, Ingredient.fromTag(Registries.ITEM.getOrThrow(ItemTags.DIRT)), dirtyPotion); builder.registerPotionRecipe(Potions.AWKWARD, Ingredient.fromTag(Registries.ITEM.getOrThrow(ItemTags.SMALL_FLOWERS)), Potions.HEALING); - if (builder.getEnabledFeatures().contains(FeatureFlags.BUNDLE)) { + if (builder.getEnabledFeatures().contains(FeatureFlags.REDSTONE_EXPERIMENTS)) { builder.registerPotionRecipe(Potions.AWKWARD, Ingredient.ofItems(Items.BUNDLE), Potions.LUCK); } }); diff --git a/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EntityTypeTagGenerator.java b/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EntityTypeTagGenerator.java index d14805a28b..d025f0e7e0 100644 --- a/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EntityTypeTagGenerator.java +++ b/fabric-convention-tags-v2/src/datagen/java/net/fabricmc/fabric/impl/tag/convention/datagen/generators/EntityTypeTagGenerator.java @@ -20,6 +20,7 @@ import net.minecraft.entity.EntityType; import net.minecraft.registry.RegistryWrapper; +import net.minecraft.registry.tag.EntityTypeTags; import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput; import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider; @@ -44,8 +45,16 @@ protected void configure(RegistryWrapper.WrapperLookup registries) { .add(EntityType.HOPPER_MINECART) .add(EntityType.SPAWNER_MINECART); getOrCreateTagBuilder(ConventionalEntityTypeTags.BOATS) - .add(EntityType.BOAT) - .add(EntityType.CHEST_BOAT); + .addOptionalTag(EntityTypeTags.BOAT) + .add(EntityType.OAK_CHEST_BOAT) + .add(EntityType.SPRUCE_CHEST_BOAT) + .add(EntityType.BIRCH_CHEST_BOAT) + .add(EntityType.JUNGLE_CHEST_BOAT) + .add(EntityType.ACACIA_CHEST_BOAT) + .add(EntityType.CHERRY_CHEST_BOAT) + .add(EntityType.DARK_OAK_CHEST_BOAT) + .add(EntityType.MANGROVE_CHEST_BOAT) + .add(EntityType.BAMBOO_CHEST_RAFT); getOrCreateTagBuilder(ConventionalEntityTypeTags.CAPTURING_NOT_SUPPORTED); getOrCreateTagBuilder(ConventionalEntityTypeTags.TELEPORTING_NOT_SUPPORTED); } diff --git a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/entity_type/boats.json b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/entity_type/boats.json index 5d453e0a99..ec9bdf7bb8 100644 --- a/fabric-convention-tags-v2/src/generated/resources/data/c/tags/entity_type/boats.json +++ b/fabric-convention-tags-v2/src/generated/resources/data/c/tags/entity_type/boats.json @@ -1,6 +1,17 @@ { "values": [ - "minecraft:boat", - "minecraft:chest_boat" + { + "id": "#minecraft:boat", + "required": false + }, + "minecraft:oak_chest_boat", + "minecraft:spruce_chest_boat", + "minecraft:birch_chest_boat", + "minecraft:jungle_chest_boat", + "minecraft:acacia_chest_boat", + "minecraft:cherry_chest_boat", + "minecraft:dark_oak_chest_boat", + "minecraft:mangrove_chest_boat", + "minecraft:bamboo_chest_raft" ] } \ No newline at end of file diff --git a/fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/LivingEntityMixin.java b/fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/LivingEntityMixin.java index 6b88b4a0e5..73383a8c62 100644 --- a/fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/LivingEntityMixin.java +++ b/fabric-entity-events-v1/src/main/java/net/fabricmc/fabric/mixin/entity/event/LivingEntityMixin.java @@ -73,19 +73,19 @@ private void notifyDeath(DamageSource source, CallbackInfo ci) { } @Redirect(method = "damage", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/LivingEntity;isDead()Z", ordinal = 1)) - boolean beforeEntityKilled(LivingEntity livingEntity, DamageSource source, float amount) { + boolean beforeEntityKilled(LivingEntity livingEntity, ServerWorld world, DamageSource source, float amount) { return isDead() && ServerLivingEntityEvents.ALLOW_DEATH.invoker().allowDeath(livingEntity, source, amount); } @Inject(method = "damage", at = @At(value = "INVOKE", target = "net/minecraft/entity/LivingEntity.isSleeping()Z"), cancellable = true) - private void beforeDamage(DamageSource source, float amount, CallbackInfoReturnable cir) { + private void beforeDamage(ServerWorld world, DamageSource source, float amount, CallbackInfoReturnable cir) { if (!ServerLivingEntityEvents.ALLOW_DAMAGE.invoker().allowDamage((LivingEntity) (Object) this, source, amount)) { cir.setReturnValue(false); } } @Inject(method = "damage", at = @At("TAIL"), locals = LocalCapture.CAPTURE_FAILHARD) - private void afterDamage(DamageSource source, float amount, CallbackInfoReturnable cir, float dealt, boolean blocked) { + private void afterDamage(ServerWorld world, DamageSource source, float amount, CallbackInfoReturnable cir, float dealt, boolean blocked) { if (!isDead()) { ServerLivingEntityEvents.AFTER_DAMAGE.invoker().afterDamage((LivingEntity) (Object) this, source, dealt, amount, blocked); } diff --git a/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/entity/FakePlayer.java b/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/entity/FakePlayer.java index d28ce219ce..6bb3695ab0 100644 --- a/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/entity/FakePlayer.java +++ b/fabric-events-interaction-v0/src/main/java/net/fabricmc/fabric/api/entity/FakePlayer.java @@ -120,7 +120,7 @@ public void increaseStat(Stat stat, int amount) { } public void resetStat(Stat stat) { } @Override - public boolean isInvulnerableTo(DamageSource damageSource) { + public boolean isInvulnerableTo(ServerWorld world, DamageSource damageSource) { return true; } diff --git a/fabric-item-group-api-v1/src/client/java/net/fabricmc/fabric/mixin/itemgroup/client/CreativeInventoryScreenMixin.java b/fabric-item-group-api-v1/src/client/java/net/fabricmc/fabric/mixin/itemgroup/client/CreativeInventoryScreenMixin.java index 535587ee06..48680c4b63 100644 --- a/fabric-item-group-api-v1/src/client/java/net/fabricmc/fabric/mixin/itemgroup/client/CreativeInventoryScreenMixin.java +++ b/fabric-item-group-api-v1/src/client/java/net/fabricmc/fabric/mixin/itemgroup/client/CreativeInventoryScreenMixin.java @@ -29,12 +29,12 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import net.minecraft.client.gui.DrawContext; -import net.minecraft.client.gui.screen.ingame.AbstractInventoryScreen; import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen; +import net.minecraft.client.gui.screen.ingame.CreativeInventoryScreen.CreativeScreenHandler; +import net.minecraft.client.gui.screen.ingame.HandledScreen; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemGroups; -import net.minecraft.screen.ScreenHandler; import net.minecraft.text.Text; import net.fabricmc.fabric.api.client.itemgroup.v1.FabricCreativeInventoryScreen; @@ -42,8 +42,8 @@ import net.fabricmc.fabric.impl.itemgroup.FabricItemGroupImpl; @Mixin(CreativeInventoryScreen.class) -public abstract class CreativeInventoryScreenMixin extends AbstractInventoryScreen implements FabricCreativeInventoryScreen { - public CreativeInventoryScreenMixin(T screenHandler, PlayerInventory playerInventory, Text text) { +public abstract class CreativeInventoryScreenMixin extends HandledScreen implements FabricCreativeInventoryScreen { + public CreativeInventoryScreenMixin(CreativeScreenHandler screenHandler, PlayerInventory playerInventory, Text text) { super(screenHandler, playerInventory, text); } diff --git a/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/CustomFluid.java b/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/CustomFluid.java index b57b81bbc1..e8ff72ffbf 100644 --- a/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/CustomFluid.java +++ b/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/CustomFluid.java @@ -27,13 +27,13 @@ import net.minecraft.fluid.FluidState; import net.minecraft.item.Item; import net.minecraft.item.Items; +import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; -import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; @@ -57,7 +57,7 @@ public Item getBucketItem() { } @Override - protected boolean isInfinite(World world) { + protected boolean isInfinite(ServerWorld world) { return true; } diff --git a/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/NoOverlayFluid.java b/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/NoOverlayFluid.java index f85ece53c3..a50f1847a9 100644 --- a/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/NoOverlayFluid.java +++ b/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/NoOverlayFluid.java @@ -27,13 +27,13 @@ import net.minecraft.fluid.FluidState; import net.minecraft.item.Item; import net.minecraft.item.Items; +import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; -import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; @@ -57,7 +57,7 @@ public Item getBucketItem() { } @Override - protected boolean isInfinite(World world) { + protected boolean isInfinite(ServerWorld world) { return true; } diff --git a/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/OverlayFluid.java b/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/OverlayFluid.java index dcbde66ebb..10db35945a 100644 --- a/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/OverlayFluid.java +++ b/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/OverlayFluid.java @@ -27,13 +27,13 @@ import net.minecraft.fluid.FluidState; import net.minecraft.item.Item; import net.minecraft.item.Items; +import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; -import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; @@ -57,7 +57,7 @@ public Item getBucketItem() { } @Override - protected boolean isInfinite(World world) { + protected boolean isInfinite(ServerWorld world) { return true; } diff --git a/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/UnregisteredFluid.java b/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/UnregisteredFluid.java index fe76c6d9f3..746c903a66 100644 --- a/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/UnregisteredFluid.java +++ b/fabric-rendering-fluids-v1/src/testmod/java/net/fabricmc/fabric/test/client/rendering/fluid/UnregisteredFluid.java @@ -27,13 +27,13 @@ import net.minecraft.fluid.FluidState; import net.minecraft.item.Item; import net.minecraft.item.Items; +import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundEvent; import net.minecraft.sound.SoundEvents; import net.minecraft.state.StateManager; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.world.BlockView; -import net.minecraft.world.World; import net.minecraft.world.WorldAccess; import net.minecraft.world.WorldView; @@ -57,7 +57,7 @@ public Item getBucketItem() { } @Override - protected boolean isInfinite(World world) { + protected boolean isInfinite(ServerWorld world) { return true; } diff --git a/fabric-resource-conditions-api-v1/src/testmod/java/net/fabricmc/fabric/test/resource/conditions/DefaultResourceConditionsTest.java b/fabric-resource-conditions-api-v1/src/testmod/java/net/fabricmc/fabric/test/resource/conditions/DefaultResourceConditionsTest.java index 611bb1f5a6..f0e4dec15b 100644 --- a/fabric-resource-conditions-api-v1/src/testmod/java/net/fabricmc/fabric/test/resource/conditions/DefaultResourceConditionsTest.java +++ b/fabric-resource-conditions-api-v1/src/testmod/java/net/fabricmc/fabric/test/resource/conditions/DefaultResourceConditionsTest.java @@ -124,14 +124,14 @@ public void anyModsLoaded(TestContext context) { public void featuresEnabled(TestContext context) { ResourceCondition vanilla = ResourceConditions.featuresEnabled(FeatureFlags.VANILLA); // Reminder: GameTest enables all features by default - ResourceCondition vanillaAndBundle = ResourceConditions.featuresEnabled(FeatureFlags.VANILLA, FeatureFlags.BUNDLE); + ResourceCondition vanillaAndRedstoneExperiments = ResourceConditions.featuresEnabled(FeatureFlags.VANILLA, FeatureFlags.REDSTONE_EXPERIMENTS); Identifier unknownId = Identifier.of(TESTMOD_ID, "unknown_feature_to_test_condition"); ResourceCondition unknown = ResourceConditions.featuresEnabled(unknownId); // Passing an array to avoid type ambiguity ResourceCondition empty = ResourceConditions.featuresEnabled(new FeatureFlag[]{}); expectCondition(context, "vanilla only", vanilla, true); - expectCondition(context, "vanilla and bundle", vanillaAndBundle, true); + expectCondition(context, "vanilla and redstone experiments", vanillaAndRedstoneExperiments, true); expectCondition(context, "unknown feature ID", unknown, false); expectCondition(context, "no feature", empty, true); diff --git a/fabric-resource-conditions-api-v1/src/testmod/resources/data/fabric-resource-conditions-api-v1-testmod/recipe/features_enabled.json b/fabric-resource-conditions-api-v1/src/testmod/resources/data/fabric-resource-conditions-api-v1-testmod/recipe/features_enabled.json index 011e60d3e8..e0980494f8 100644 --- a/fabric-resource-conditions-api-v1/src/testmod/resources/data/fabric-resource-conditions-api-v1-testmod/recipe/features_enabled.json +++ b/fabric-resource-conditions-api-v1/src/testmod/resources/data/fabric-resource-conditions-api-v1-testmod/recipe/features_enabled.json @@ -11,7 +11,7 @@ "condition": "fabric:features_enabled", "features": [ "minecraft:vanilla", - "minecraft:bundle" + "minecraft:redstone_experiments" ] } ] diff --git a/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client/CreateWorldScreenMixin.java b/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client/CreateWorldScreenMixin.java index 464a3365dd..585072e3d2 100644 --- a/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client/CreateWorldScreenMixin.java +++ b/fabric-resource-loader-v0/src/client/java/net/fabricmc/fabric/mixin/resource/loader/client/CreateWorldScreenMixin.java @@ -45,7 +45,7 @@ private CreateWorldScreenMixin() { super(null); } - @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", + @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/client/gui/screen/world/CreateWorldCallback;)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,7 @@ private static ResourcePackManager onCreateResManagerInit(ResourcePackManager ma return manager; } - @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", + @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/client/gui/screen/world/CreateWorldCallback;)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(); diff --git a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/ComposterWrapper.java b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/ComposterWrapper.java index 06eeb5e5a4..bc0eba6937 100644 --- a/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/ComposterWrapper.java +++ b/fabric-transfer-api-v1/src/main/java/net/fabricmc/fabric/impl/transfer/item/ComposterWrapper.java @@ -122,7 +122,7 @@ protected void onFinalCommit() { location.setBlockState(newState); if (newLevel == 7) { - location.world.method_64310(location.pos, state.getBlock(), 20); + location.world.scheduleBlockTick(location.pos, state.getBlock(), 20); } } diff --git a/gradle.properties b/gradle.properties index f5dabd8ff1..b067830ee7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,8 @@ org.gradle.parallel=true fabric.loom.multiProjectOptimisation=true version=0.105.0 -minecraft_version=24w38a -yarn_version=+build.2 +minecraft_version=24w39a +yarn_version=+build.4 loader_version=0.16.4 installer_version=1.0.1