This commit is contained in:
modmuss50 2023-02-01 16:35:59 +00:00
parent 29d0689b28
commit 12a6ba2c15
15 changed files with 61 additions and 111 deletions

View file

@ -73,7 +73,7 @@ import java.util.zip.ZipFile
task generateAccessWidener() {
doLast {
File inputJar = loom.namedMinecraftProvider.parentMinecraftProvider.commonJar.toFile()
File inputJar = loom.namedMinecraftProvider.parentMinecraftProvider.commonJar.path.toFile()
String accessWidener = "accessWidener\tv2\tnamed\n"
accessWidener += "\n"
accessWidener += "# DO NOT EDIT BY HAND! This file is generated automatically.\n"

View file

@ -25,7 +25,7 @@ import java.util.stream.Stream;
import org.jetbrains.annotations.Nullable;
import net.minecraft.block.Block;
import net.minecraft.data.server.tag.AbstractTagProvider;
import net.minecraft.data.server.tag.TagProvider;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.entity.EntityType;
import net.minecraft.fluid.Fluid;
@ -70,7 +70,7 @@ import net.fabricmc.fabric.impl.datagen.ForcedTagEntry;
* @see EntityTypeTagProvider
* @see GameEventTagProvider
*/
public abstract class FabricTagProvider<T> extends AbstractTagProvider<T> {
public abstract class FabricTagProvider<T> extends TagProvider<T> {
/**
* Constructs a new {@link FabricTagProvider} with the default computed path.
*
@ -239,7 +239,7 @@ public abstract class FabricTagProvider<T> extends AbstractTagProvider<T> {
* An extension to {@link ProvidedTagBuilder} that provides additional functionality.
*/
public final class FabricTagBuilder extends ProvidedTagBuilder<T> {
private final AbstractTagProvider.ProvidedTagBuilder<T> parent;
private final TagProvider.ProvidedTagBuilder<T> parent;
private FabricTagBuilder(ProvidedTagBuilder<T> parent) {
super(parent.builder);

View file

@ -29,14 +29,14 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.minecraft.data.DataWriter;
import net.minecraft.data.server.tag.AbstractTagProvider;
import net.minecraft.data.server.tag.TagProvider;
import net.minecraft.registry.tag.TagBuilder;
import net.minecraft.util.Identifier;
import net.fabricmc.fabric.impl.datagen.FabricTagBuilder;
@Mixin(AbstractTagProvider.class)
public class AbstractTagProviderMixin {
@Mixin(TagProvider.class)
public class TagProviderMixin {
@Inject(method = "method_27046", at = @At(value = "INVOKE", target = "Lnet/minecraft/data/DataOutput$PathResolver;resolveJson(Lnet/minecraft/util/Identifier;)Ljava/nio/file/Path;"), locals = LocalCapture.CAPTURE_FAILHARD)
public void addReplaced(Predicate<?> p, DataWriter dataWriter, Map.Entry<?, ?> entry, CallbackInfoReturnable<CompletableFuture<?>> ci, Identifier id, TagBuilder builder, List list, List list2, JsonElement jsonElement) {
if (builder instanceof FabricTagBuilder fabricTagBuilder) {

View file

@ -9,11 +9,11 @@ mutable field net/minecraft/data/DataGenerator output Lnet/minecraft/data/DataOu
accessible field net/minecraft/data/server/recipe/RecipeProvider recipesPathResolver Lnet/minecraft/data/DataOutput$PathResolver;
accessible field net/minecraft/data/server/recipe/RecipeProvider advancementsPathResolver Lnet/minecraft/data/DataOutput$PathResolver;
accessible field net/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder builder Lnet/minecraft/registry/tag/TagBuilder;
extendable method net/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder add (Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder;
extendable method net/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder add ([Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder;
accessible field net/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder builder Lnet/minecraft/registry/tag/TagBuilder;
extendable method net/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder add (Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder;
extendable method net/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder add ([Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder;
accessible field net/minecraft/data/server/tag/AbstractTagProvider tagBuilders Ljava/util/Map;
accessible field net/minecraft/data/server/tag/TagProvider tagBuilders Ljava/util/Map;
accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator lootTables Ljava/util/Map;
@ -43,7 +43,7 @@ transitive-accessible field net/minecraft/data/client/ItemModelGenerator
transitive-accessible method net/minecraft/data/client/TextureKey of (Ljava/lang/String;)Lnet/minecraft/data/client/TextureKey;
transitive-accessible method net/minecraft/data/client/TextureKey of (Ljava/lang/String;Lnet/minecraft/data/client/TextureKey;)Lnet/minecraft/data/client/TextureKey;
transitive-extendable method net/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder add ([Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder;
transitive-extendable method net/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder add ([Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder;
transitive-accessible method net/minecraft/data/client/TexturedModel makeFactory (Ljava/util/function/Function;Lnet/minecraft/data/client/Model;)Lnet/minecraft/data/client/TexturedModel$Factory;
@ -60,9 +60,9 @@ transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider off
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerSmelting (Ljava/util/function/Consumer;Ljava/util/List;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;FILjava/lang/String;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerBlasting (Ljava/util/function/Consumer;Ljava/util/List;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;FILjava/lang/String;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerMultipleOptions (Ljava/util/function/Consumer;Lnet/minecraft/recipe/RecipeSerializer;Ljava/util/List;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;FILjava/lang/String;Ljava/lang/String;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider method_48531 (Ljava/util/function/Consumer;Lnet/minecraft/item/Item;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerLegacyNetheriteUpgradeRecipe (Ljava/util/function/Consumer;Lnet/minecraft/item/Item;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerNetheriteUpgradeRecipe (Ljava/util/function/Consumer;Lnet/minecraft/item/Item;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider method_48530 (Ljava/util/function/Consumer;Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerSmithingTrimRecipe (Ljava/util/function/Consumer;Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offer2x2CompactingRecipe (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerCompactingRecipe (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerCompactingRecipe (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
@ -111,8 +111,8 @@ transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider off
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerReversibleCompactingRecipesWithCompactingRecipeGroup (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;Ljava/lang/String;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerReversibleCompactingRecipesWithReverseRecipeGroup (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;Ljava/lang/String;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerReversibleCompactingRecipes (Ljava/util/function/Consumer;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider method_48532 (Ljava/util/function/Consumer;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/registry/tag/TagKey;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider method_48533 (Ljava/util/function/Consumer;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerSmithingTemplateCopyingRecipe (Ljava/util/function/Consumer;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/registry/tag/TagKey;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerSmithingTemplateCopyingRecipe (Ljava/util/function/Consumer;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider generateCookingRecipes (Ljava/util/function/Consumer;Ljava/lang/String;Lnet/minecraft/recipe/RecipeSerializer;I)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerFoodCookingRecipe (Ljava/util/function/Consumer;Ljava/lang/String;Lnet/minecraft/recipe/RecipeSerializer;ILnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;F)V
transitive-accessible method net/minecraft/data/server/recipe/RecipeProvider offerWaxingRecipes (Ljava/util/function/Consumer;)V
@ -291,11 +291,11 @@ transitive-accessible method net/minecraft/data/client/ItemModelGenerator regist
transitive-accessible method net/minecraft/data/client/ItemModelGenerator register (Lnet/minecraft/item/Item;Lnet/minecraft/item/Item;Lnet/minecraft/data/client/Model;)V
transitive-accessible method net/minecraft/data/client/ItemModelGenerator registerCompass (Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/data/client/ItemModelGenerator registerClock (Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48517 (Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)V
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48518 (Lnet/minecraft/util/Identifier;Ljava/lang/String;)Lnet/minecraft/util/Identifier;
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48520 (Lnet/minecraft/item/ArmorItem;)Ljava/util/List;
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48519 (Lnet/minecraft/util/Identifier;Ljava/util/Map;Ljava/util/List;)Lcom/google/gson/JsonObject;
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48523 (Lnet/minecraft/item/ArmorItem;)V
transitive-accessible method net/minecraft/data/client/ItemModelGenerator uploadArmor (Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)V
transitive-accessible method net/minecraft/data/client/ItemModelGenerator method_48742 (Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)V
transitive-accessible method net/minecraft/data/client/ItemModelGenerator suffixTrim (Lnet/minecraft/util/Identifier;Ljava/lang/String;)Lnet/minecraft/util/Identifier;
transitive-accessible method net/minecraft/data/client/ItemModelGenerator createArmorJson (Lnet/minecraft/util/Identifier;Ljava/util/Map;Lnet/minecraft/item/ArmorMaterial;)Lcom/google/gson/JsonObject;
transitive-accessible method net/minecraft/data/client/ItemModelGenerator registerArmor (Lnet/minecraft/item/ArmorItem;)V
transitive-extendable method net/minecraft/data/MetadataProvider getName ()Ljava/lang/String;
transitive-extendable method net/minecraft/data/SnbtProvider getName ()Ljava/lang/String;
transitive-extendable method net/minecraft/data/client/ModelProvider getName ()Ljava/lang/String;
@ -308,4 +308,4 @@ transitive-extendable method net/minecraft/data/server/BiomeParametersProvider g
transitive-extendable method net/minecraft/data/server/advancement/AdvancementProvider getName ()Ljava/lang/String;
transitive-extendable method net/minecraft/data/server/loottable/LootTableProvider getName ()Ljava/lang/String;
transitive-extendable method net/minecraft/data/server/recipe/RecipeProvider getName ()Ljava/lang/String;
transitive-extendable method net/minecraft/data/server/tag/AbstractTagProvider getName ()Ljava/lang/String;
transitive-extendable method net/minecraft/data/server/tag/TagProvider getName ()Ljava/lang/String;

View file

@ -4,7 +4,7 @@
"compatibilityLevel": "JAVA_16",
"mixins": [
"loot.BlockLootTableGeneratorMixin",
"AbstractTagProviderMixin",
"TagProviderMixin",
"ModelProviderMixin",
"TagBuilderMixin"
],

View file

@ -4,11 +4,11 @@ mutable field net/minecraft/data/DataGenerator output Lnet/minecraft/data/DataOu
accessible field net/minecraft/data/server/recipe/RecipeProvider recipesPathResolver Lnet/minecraft/data/DataOutput$PathResolver;
accessible field net/minecraft/data/server/recipe/RecipeProvider advancementsPathResolver Lnet/minecraft/data/DataOutput$PathResolver;
accessible field net/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder builder Lnet/minecraft/registry/tag/TagBuilder;
extendable method net/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder add (Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder;
extendable method net/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder add ([Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder;
accessible field net/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder builder Lnet/minecraft/registry/tag/TagBuilder;
extendable method net/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder add (Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder;
extendable method net/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder add ([Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder;
accessible field net/minecraft/data/server/tag/AbstractTagProvider tagBuilders Ljava/util/Map;
accessible field net/minecraft/data/server/tag/TagProvider tagBuilders Ljava/util/Map;
accessible field net/minecraft/data/server/loottable/BlockLootTableGenerator lootTables Ljava/util/Map;
@ -38,7 +38,7 @@ transitive-accessible field net/minecraft/data/client/ItemModelGenerator
transitive-accessible method net/minecraft/data/client/TextureKey of (Ljava/lang/String;)Lnet/minecraft/data/client/TextureKey;
transitive-accessible method net/minecraft/data/client/TextureKey of (Ljava/lang/String;Lnet/minecraft/data/client/TextureKey;)Lnet/minecraft/data/client/TextureKey;
transitive-extendable method net/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder add ([Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/AbstractTagProvider$ProvidedTagBuilder;
transitive-extendable method net/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder add ([Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/data/server/tag/TagProvider$ProvidedTagBuilder;
transitive-accessible method net/minecraft/data/client/TexturedModel makeFactory (Ljava/util/function/Function;Lnet/minecraft/data/client/Model;)Lnet/minecraft/data/client/TexturedModel$Factory;

View file

@ -23,6 +23,6 @@ import net.fabricmc.fabric.api.entity.event.v1.FabricElytraItem;
public class DiamondElytraItem extends ArmorItem implements FabricElytraItem {
public DiamondElytraItem() {
super(ArmorMaterials.DIAMOND, class_8051.CHESTPLATE, new Settings().maxCount(1));
super(ArmorMaterials.DIAMOND, Type.CHESTPLATE, new Settings().maxCount(1));
}
}

View file

@ -35,18 +35,18 @@ import net.minecraft.item.ArmorMaterials;
@Mixin(ArmorItem.class)
public class ArmorItemMixin {
@Shadow private static @Final EnumMap<ArmorItem.class_8051, UUID> MODIFIERS;
@Shadow private static @Final EnumMap<ArmorItem.Type, UUID> MODIFIERS;
@Shadow protected @Final float knockbackResistance;
/* Vanilla only adds a knockback resistance modifier to ArmorItems made of ArmorMaterials.NETHERITE. This mixin
* 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;"))
private ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> fabric_knockbackResistance(ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> builder, ArmorMaterial material, ArmorItem.class_8051 slot) {
private ImmutableMultimap.Builder<EntityAttribute, EntityAttributeModifier> fabric_knockbackResistance(ImmutableMultimap.Builder<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(
MODIFIERS.get(slot), "Armor knockback resistance",
MODIFIERS.get(type), "Armor knockback resistance",
knockbackResistance, EntityAttributeModifier.Operation.ADDITION));
}

View file

@ -32,12 +32,12 @@ import net.fabricmc.api.ModInitializer;
public class ArmorKnockbackResistanceTest implements ModInitializer {
private static final ArmorMaterial WOOD_ARMOR = new ArmorMaterial() {
@Override
public int method_48402(ArmorItem.class_8051 arg) {
public int getDurability(ArmorItem.Type arg) {
return 50;
}
@Override
public int method_48403(ArmorItem.class_8051 arg) {
public int getProtection(ArmorItem.Type arg) {
return 5;
}
@ -70,16 +70,11 @@ public class ArmorKnockbackResistanceTest implements ModInitializer {
public float getKnockbackResistance() {
return 0.5F;
}
@Override
public boolean method_48404() {
return false;
}
};
@Override
public void onInitialize() {
Registry.register(Registries.ITEM, new Identifier("fabric-item-api-v1-testmod",
"wooden_boots"), new ArmorItem(WOOD_ARMOR, ArmorItem.class_8051.BOOTS, new Item.Settings()));
"wooden_boots"), new ArmorItem(WOOD_ARMOR, ArmorItem.Type.BOOTS, new Item.Settings()));
}
}

View file

@ -35,7 +35,7 @@ import net.fabricmc.api.ModInitializer;
public class TooltipComponentTestInit implements ModInitializer {
public static Item CUSTOM_TOOLTIP_ITEM = new CustomTooltipItem();
public static Item CUSTOM_ARMOR_ITEM = new ArmorItem(TestArmorMaterial.INSTANCE, ArmorItem.class_8051.CHESTPLATE, new Item.Settings());
public static Item CUSTOM_ARMOR_ITEM = new ArmorItem(TestArmorMaterial.INSTANCE, ArmorItem.Type.CHESTPLATE, new Item.Settings());
@Override
public void onInitialize() {
@ -64,12 +64,12 @@ public class TooltipComponentTestInit implements ModInitializer {
}
@Override
public int method_48402(ArmorItem.class_8051 arg) {
public int getDurability(ArmorItem.Type type) {
return 0;
}
@Override
public int method_48403(ArmorItem.class_8051 arg) {
public int getProtection(ArmorItem.Type type) {
return 0;
}
@ -102,10 +102,5 @@ public class TooltipComponentTestInit implements ModInitializer {
public float getKnockbackResistance() {
return 0;
}
@Override
public boolean method_48404() {
return false;
}
}
}

View file

@ -21,10 +21,8 @@ import java.io.File;
import com.mojang.datafixers.util.Pair;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.ModifyArg;
import org.spongepowered.asm.mixin.injection.ModifyVariable;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
@ -40,9 +38,6 @@ import net.fabricmc.fabric.impl.resource.loader.ModResourcePackUtil;
@Mixin(CreateWorldScreen.class)
public abstract class CreateWorldScreenMixin extends Screen {
@Unique
private static DataConfiguration defaultDataConfiguration;
@Shadow
private ResourcePackManager packManager;
@ -60,12 +55,7 @@ public abstract class CreateWorldScreenMixin extends Screen {
@Redirect(method = "create(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;)V", at = @At(value = "FIELD", target = "Lnet/minecraft/resource/DataConfiguration;SAFE_MODE:Lnet/minecraft/resource/DataConfiguration;", ordinal = 0))
private static DataConfiguration replaceDefaultSettings() {
return (defaultDataConfiguration = ModResourcePackUtil.createDefaultDataConfiguration());
}
@ModifyArg(method = "create(Lnet/minecraft/client/MinecraftClient;Lnet/minecraft/client/gui/screen/Screen;)V", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/world/CreateWorldScreen;<init>(Lnet/minecraft/client/gui/screen/Screen;Lnet/minecraft/resource/DataConfiguration;Lnet/minecraft/client/gui/screen/world/MoreOptionsDialog;)V"), index = 1)
private static DataConfiguration useReplacedDefaultSettings(DataConfiguration dataPackSettings) {
return defaultDataConfiguration;
return ModResourcePackUtil.createDefaultDataConfiguration();
}
@Inject(method = "getScannedPack",

View file

@ -1,29 +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.mixin.resource.loader.client;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
import net.minecraft.client.gui.screen.world.MoreOptionsDialog;
import net.minecraft.client.world.GeneratorOptionsHolder;
@Mixin(MoreOptionsDialog.class)
public interface MoreOptionsDialogAccessor {
@Invoker
void callSetGeneratorOptionsHolder(GeneratorOptionsHolder generatorOptionsHolder);
}

View file

@ -7,8 +7,7 @@
"CreateWorldScreenMixin",
"FontManagerMixin",
"GameOptionsMixin",
"KeyedResourceReloadListenerClientMixin",
"MoreOptionsDialogAccessor"
"KeyedResourceReloadListenerClientMixin"
],
"injectors": {
"defaultRequire": 1

View file

@ -32,7 +32,7 @@ task generateAccessWidener {
lines.add("")
lines.addAll(file("template.accesswidener").text.lines().toList())
Path commonJar = loom.namedMinecraftProvider.parentMinecraftProvider.commonJar
Path commonJar = loom.namedMinecraftProvider.parentMinecraftProvider.commonJar.path
try (def fs = FileSystems.newFileSystem(URI.create("jar:${commonJar.toUri()}"), [create: false])) {
generateBlockConstructors(lines, fs)
@ -41,7 +41,7 @@ task generateAccessWidener {
lines.add("")
}
Path clientJar = loom.namedMinecraftProvider.parentMinecraftProvider.clientOnlyJar
Path clientJar = loom.namedMinecraftProvider.parentMinecraftProvider.clientOnlyJar.path
try (def fs = FileSystems.newFileSystem(URI.create("jar:${clientJar.toUri()}"), [create: false])) {
generateRenderPhaseFields(lines, fs)

View file

@ -2,9 +2,9 @@ org.gradle.jvmargs=-Xmx2560M
org.gradle.parallel=true
fabric.loom.multiProjectOptimisation=true
version=0.73.2
minecraft_version=23w04a
yarn_version=+build.1
version=0.73.3
minecraft_version=23w05a
yarn_version=+build.2
loader_version=0.14.13
installer_version=0.11.1
@ -20,44 +20,44 @@ fabric-command-api-v1-version=1.2.24
fabric-command-api-v2-version=2.2.3
fabric-commands-v0-version=0.2.41
fabric-containers-v0-version=0.1.49
fabric-content-registries-v0-version=3.5.3
fabric-content-registries-v0-version=3.5.4
fabric-crash-report-info-v1-version=0.2.14
fabric-data-generation-api-v1-version=11.2.2
fabric-data-generation-api-v1-version=11.2.3
fabric-dimensions-v1-version=2.1.43
fabric-entity-events-v1-version=1.5.9
fabric-entity-events-v1-version=1.5.10
fabric-events-interaction-v0-version=0.4.42
fabric-events-lifecycle-v0-version=0.2.46
fabric-events-lifecycle-v0-version=0.2.47
fabric-game-rule-api-v1-version=1.0.32
fabric-gametest-api-v1-version=1.1.19
fabric-item-api-v1-version=2.1.12
fabric-item-group-api-v1-version=2.1.14
fabric-gametest-api-v1-version=1.1.20
fabric-item-api-v1-version=2.1.13
fabric-item-group-api-v1-version=2.1.15
fabric-key-binding-api-v1-version=1.0.31
fabric-keybindings-v0-version=0.2.29
fabric-lifecycle-events-v1-version=2.2.12
fabric-loot-api-v2-version=1.1.22
fabric-loot-tables-v1-version=1.1.26
fabric-loot-api-v2-version=1.1.23
fabric-loot-tables-v1-version=1.1.27
fabric-message-api-v1-version=5.0.16
fabric-mining-level-api-v1-version=2.1.33
fabric-mining-level-api-v1-version=2.1.34
fabric-models-v0-version=0.3.29
fabric-networking-api-v1-version=1.2.19
fabric-networking-v0-version=0.3.36
fabric-object-builder-api-v1-version=5.4.2
fabric-object-builder-api-v1-version=5.4.3
fabric-particles-v1-version=1.0.22
fabric-recipe-api-v1-version=1.0.3
fabric-registry-sync-v0-version=2.0.7
fabric-renderer-api-v1-version=2.2.3
fabric-renderer-indigo-version=0.7.3
fabric-renderer-registries-v1-version=3.2.32
fabric-renderer-registries-v1-version=3.2.33
fabric-rendering-data-attachment-v1-version=0.3.27
fabric-rendering-fluids-v1-version=3.0.20
fabric-rendering-v0-version=1.1.35
fabric-rendering-v1-version=1.12.3
fabric-rendering-v0-version=1.1.36
fabric-rendering-v1-version=1.12.4
fabric-resource-conditions-api-v1-version=2.2.3
fabric-resource-loader-v0-version=0.10.7
fabric-resource-loader-v0-version=0.10.8
fabric-screen-api-v1-version=1.0.43
fabric-screen-handler-api-v1-version=1.3.15
fabric-sound-api-v1-version=1.0.8
fabric-transfer-api-v1-version=2.1.17
fabric-transitive-access-wideners-v1-version=2.3.2
fabric-transitive-access-wideners-v1-version=2.3.3
fabric-convention-tags-v1-version=1.2.4
fabric-client-tags-api-v1-version=1.0.14