Skip to content

Commit

Permalink
25w04a
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Jan 22, 2025
1 parent 450ef60 commit eae0ba9
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ transitive-accessible method net/minecraft/data/recipe/RecipeGenerator offerSmel
transitive-accessible method net/minecraft/data/recipe/RecipeGenerator offerBlasting (Ljava/util/List;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;FILjava/lang/String;)V
transitive-accessible method net/minecraft/data/recipe/RecipeGenerator offerMultipleOptions (Lnet/minecraft/recipe/RecipeSerializer;Lnet/minecraft/recipe/AbstractCookingRecipe$RecipeFactory;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/recipe/RecipeGenerator offerNetheriteUpgradeRecipe (Lnet/minecraft/item/Item;Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/data/recipe/RecipeGenerator offerSmithingTrimRecipe (Lnet/minecraft/item/Item;Lnet/minecraft/registry/RegistryKey;)V
transitive-accessible method net/minecraft/data/recipe/RecipeGenerator offerSmithingTrimRecipe (Lnet/minecraft/item/Item;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/registry/RegistryKey;)V
transitive-accessible method net/minecraft/data/recipe/RecipeGenerator offer2x2CompactingRecipe (Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
transitive-accessible method net/minecraft/data/recipe/RecipeGenerator offerCompactingRecipe (Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;Ljava/lang/String;)V
transitive-accessible method net/minecraft/data/recipe/RecipeGenerator offerCompactingRecipe (Lnet/minecraft/recipe/book/RecipeCategory;Lnet/minecraft/item/ItemConvertible;Lnet/minecraft/item/ItemConvertible;)V
Expand Down Expand Up @@ -347,7 +347,7 @@ transitive-accessible method net/minecraft/client/data/ItemModelGenerator regist
transitive-accessible method net/minecraft/client/data/ItemModelGenerator uploadTwoLayers (Lnet/minecraft/item/Item;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)Lnet/minecraft/util/Identifier;
transitive-accessible method net/minecraft/client/data/ItemModelGenerator uploadArmor (Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)Lnet/minecraft/util/Identifier;
transitive-accessible method net/minecraft/client/data/ItemModelGenerator uploadArmor (Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;Lnet/minecraft/util/Identifier;)V
transitive-accessible method net/minecraft/client/data/ItemModelGenerator registerArmor (Lnet/minecraft/item/Item;Lnet/minecraft/registry/RegistryKey;Ljava/lang/String;Z)V
transitive-accessible method net/minecraft/client/data/ItemModelGenerator registerArmor (Lnet/minecraft/item/Item;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/util/Identifier;Z)V
transitive-accessible method net/minecraft/client/data/ItemModelGenerator registerBundle (Lnet/minecraft/item/Item;)V
transitive-accessible method net/minecraft/client/data/ItemModelGenerator uploadOpenBundleModel (Lnet/minecraft/item/Item;Lnet/minecraft/client/data/Model;Ljava/lang/String;)Lnet/minecraft/util/Identifier;
transitive-accessible method net/minecraft/client/data/ItemModelGenerator registerBow (Lnet/minecraft/item/Item;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import net.minecraft.class_10721;
import net.minecraft.client.render.TexturedRenderLayers;
import net.minecraft.client.util.SpriteIdentifier;
import net.minecraft.util.Identifier;

import net.fabricmc.fabric.impl.object.builder.client.SignTypeTextureHelper;
Expand All @@ -34,13 +36,13 @@ private static void onReturnClinit(CallbackInfo ci) {
SignTypeTextureHelper.shouldAddTextures = true;
}

@Redirect(method = "createSignTextureId", at = @At(value = "INVOKE", target = "net/minecraft/util/Identifier.ofVanilla(Ljava/lang/String;)Lnet/minecraft/util/Identifier;"))
private static Identifier redirectSignVanillaId(String name) {
return Identifier.of(name);
@Redirect(method = "createSignTextureId", at = @At(value = "INVOKE", target = "Lnet/minecraft/class_10721;method_67274(Ljava/lang/String;)Lnet/minecraft/client/util/SpriteIdentifier;"))
private static SpriteIdentifier redirectSignVanillaId(class_10721 instance, String name) {
return instance.method_67273(Identifier.of(name));
}

@Redirect(method = "createHangingSignTextureId", at = @At(value = "INVOKE", target = "net/minecraft/util/Identifier.ofVanilla(Ljava/lang/String;)Lnet/minecraft/util/Identifier;"))
private static Identifier redirectHangingVanillaId(String name) {
return Identifier.of(name);
@Redirect(method = "createHangingSignTextureId", at = @At(value = "INVOKE", target = "Lnet/minecraft/class_10721;method_67274(Ljava/lang/String;)Lnet/minecraft/client/util/SpriteIdentifier;"))
private static SpriteIdentifier redirectHangingVanillaId(class_10721 instance, String name) {
return instance.method_67273(Identifier.of(name));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ abstract class WoodTypeMixin {
private static void onReturnRegister(WoodType type, CallbackInfoReturnable<WoodType> cir) {
if (SignTypeTextureHelper.shouldAddTextures) {
final Identifier identifier = Identifier.of(type.name());
TexturedRenderLayers.SIGN_TYPE_TEXTURES.put(type, TexturedRenderLayers.createSignTextureId(identifier));
TexturedRenderLayers.HANGING_SIGN_TYPE_TEXTURES.put(type, TexturedRenderLayers.createHangingSignTextureId(identifier));
TexturedRenderLayers.SIGN_TYPE_TEXTURES.put(type, TexturedRenderLayers.field_56363.method_67273(identifier));
TexturedRenderLayers.HANGING_SIGN_TYPE_TEXTURES.put(type, TexturedRenderLayers.field_56364.method_67273(identifier));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,6 @@ public void onInitialize() {
// Serialised by string, doesnt seem to be synced
RegistryAttributeHolder.get(Registries.STRUCTURE_POOL_ELEMENT);

// Uses a data tracker (and thus, raw IDs) to sync cat entities to the client
RegistryAttributeHolder.get(Registries.CAT_VARIANT)
.addAttribute(RegistryAttribute.SYNCED);

// Uses a data tracker (and thus, raw IDs) to sync frog entities to the client
RegistryAttributeHolder.get(Registries.FROG_VARIANT)
.addAttribute(RegistryAttribute.SYNCED);

// Uses the raw ID when syncing the command tree to the client
RegistryAttributeHolder.get(Registries.COMMAND_ARGUMENT_TYPE)
.addAttribute(RegistryAttribute.SYNCED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,27 @@

package net.fabricmc.fabric.api.client.rendering.v1;

import net.minecraft.client.texture.atlas.AtlasSourceType;
import com.mojang.serialization.MapCodec;

import net.minecraft.client.texture.atlas.AtlasSource;
import net.minecraft.util.Identifier;

import net.fabricmc.fabric.impl.client.rendering.AtlasSourceTypeRegistryImpl;
import net.fabricmc.fabric.impl.client.rendering.AtlasSourceRegistryImpl;

/**
* A registry for custom {@link AtlasSourceType}s. Registered types will be automatically available for use in atlas definition JSON files.
* A registry for custom {@link AtlasSource}s. Registered types will be automatically available for use in atlas definition JSON files.
*/
public final class AtlasSourceTypeRegistry {
private AtlasSourceTypeRegistry() {
public final class AtlasSourceRegistry {
private AtlasSourceRegistry() {
}

/**
* Registers a new {@link AtlasSourceType}.
* Registers a new {@link AtlasSource} by providing a codec for it.
*
* @param id the identifier of the atlas source type
* @param type the atlas source type to register
* @param codec the codec for the atlas source type
*/
public static void register(Identifier id, AtlasSourceType type) {
AtlasSourceTypeRegistryImpl.register(id, type);
public static void register(Identifier id, MapCodec<? extends AtlasSource> codec) {
AtlasSourceRegistryImpl.register(id, codec);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,20 @@

import java.util.Objects;

import net.minecraft.client.texture.atlas.AtlasSourceType;
import com.mojang.serialization.MapCodec;

import net.minecraft.client.texture.atlas.AtlasSource;
import net.minecraft.util.Identifier;

import net.fabricmc.fabric.mixin.client.rendering.AtlasSourceManagerAccessor;

public final class AtlasSourceTypeRegistryImpl {
private AtlasSourceTypeRegistryImpl() {
public final class AtlasSourceRegistryImpl {
private AtlasSourceRegistryImpl() {
}

public static void register(Identifier id, AtlasSourceType type) {
public static void register(Identifier id, MapCodec<? extends AtlasSource> codec) {
Objects.requireNonNull(id, "id must not be null!");
Objects.requireNonNull(type, "type must not be null!");

AtlasSourceType oldType = AtlasSourceManagerAccessor.getSourceTypeById().putIfAbsent(id, type);

if (oldType != null) {
throw new IllegalStateException("Duplicate registration " + id);
}
Objects.requireNonNull(codec, "codec must not be null!");
AtlasSourceManagerAccessor.getAtlasSourceCodecs().put(id, codec);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,19 @@

package net.fabricmc.fabric.mixin.client.rendering;

import com.google.common.collect.BiMap;
import com.mojang.serialization.MapCodec;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

import net.minecraft.client.texture.atlas.AtlasSource;
import net.minecraft.client.texture.atlas.AtlasSourceManager;
import net.minecraft.client.texture.atlas.AtlasSourceType;
import net.minecraft.util.Identifier;
import net.minecraft.util.dynamic.Codecs;

@Mixin(AtlasSourceManager.class)
public interface AtlasSourceManagerAccessor {
@Accessor("SOURCE_TYPE_BY_ID")
static BiMap<Identifier, AtlasSourceType> getSourceTypeById() {
@Accessor("field_56377")
static Codecs.IdMapper<Identifier, MapCodec<? extends AtlasSource>> getAtlasSourceCodecs() {
throw new AssertionError();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,19 @@
import net.minecraft.client.texture.SpriteDimensions;
import net.minecraft.client.texture.SpriteOpener;
import net.minecraft.client.texture.atlas.AtlasSource;
import net.minecraft.client.texture.atlas.AtlasSourceType;
import net.minecraft.resource.Resource;
import net.minecraft.resource.ResourceManager;
import net.minecraft.resource.metadata.ResourceMetadata;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.client.rendering.v1.AtlasSourceTypeRegistry;
import net.fabricmc.fabric.api.client.rendering.v1.AtlasSourceRegistry;

public class CustomAtlasSourcesTest implements ClientModInitializer {
@Override
public void onInitializeClient() {
AtlasSourceTypeRegistry.register(Identifier.of("fabric-rendering-v1-testmod", "double"), DoubleAtlasSource.TYPE);
AtlasSourceRegistry.register(Identifier.of("fabric-rendering-v1-testmod", "double"), DoubleAtlasSource.CODEC);
}

private static class DoubleAtlasSource implements AtlasSource {
Expand All @@ -53,7 +52,6 @@ private static class DoubleAtlasSource implements AtlasSource {
Identifier.CODEC.fieldOf("resource").forGetter(source -> source.resource),
Identifier.CODEC.fieldOf("sprite").forGetter(source -> source.sprite)
).apply(instance, DoubleAtlasSource::new));
public static final AtlasSourceType TYPE = new AtlasSourceType(CODEC);

private final Identifier resource;
private final Identifier sprite;
Expand All @@ -76,8 +74,8 @@ public void load(ResourceManager resourceManager, SpriteRegions regions) {
}

@Override
public AtlasSourceType getType() {
return TYPE;
public MapCodec<? extends AtlasSource> method_67288() {
return CODEC;
}

private static class DoubleSpriteRegion implements AtlasSource.SpriteRegion {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"wild_texture": "fabric-resource-loader-v0-testmod:entity/wolf/green",
"angry_texture": "fabric-resource-loader-v0-testmod:entity/wolf/green",
"tame_texture": "fabric-resource-loader-v0-testmod:entity/wolf/green",
"biomes": "minecraft:forest"
"assets": {
"angry": "fabric-resource-loader-v0-testmod:entity/wolf/green",
"tame": "fabric-resource-loader-v0-testmod:entity/wolf/green",
"wild": "fabric-resource-loader-v0-testmod:entity/wolf/green"
},
"spawn_conditions": [
{
"condition": {
"type": "minecraft:biome",
"biomes": "minecraft:forest"
},
"priority": 1
}
]
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
{
"wild_texture": "fabric-resource-loader-v0-testmod:entity/wolf/pink",
"angry_texture": "fabric-resource-loader-v0-testmod:entity/wolf/pink",
"tame_texture": "fabric-resource-loader-v0-testmod:entity/wolf/pink",
"biomes": "minecraft:forest"
"assets": {
"angry": "fabric-resource-loader-v0-testmod:entity/wolf/pink",
"tame": "fabric-resource-loader-v0-testmod:entity/wolf/pink",
"wild": "fabric-resource-loader-v0-testmod:entity/wolf/pink"
},
"spawn_conditions": [
{
"condition": {
"type": "minecraft:biome",
"biomes": "minecraft:forest"
},
"priority": 1
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

import net.minecraft.class_10712;
import net.minecraft.component.ComponentChanges;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.fluid.Fluid;
Expand All @@ -47,16 +48,16 @@ public void testFlowing() {
@Test
public void testWithComponentChanges() {
FluidVariant variant = FluidVariant.of(Fluids.WATER, ComponentChanges.builder()
.add(DataComponentTypes.HIDE_TOOLTIP, Unit.INSTANCE)
.add(DataComponentTypes.TOOLTIP_DISPLAY, class_10712.field_56318)
.build());

FluidVariant newVariant = variant.withComponentChanges(ComponentChanges.builder()
.remove(DataComponentTypes.HIDE_TOOLTIP)
.remove(DataComponentTypes.TOOLTIP_DISPLAY)
.add(DataComponentTypes.GLIDER, Unit.INSTANCE)
.build());

Assertions.assertFalse(
newVariant.getComponentMap().contains(DataComponentTypes.HIDE_TOOLTIP),
newVariant.getComponentMap().contains(DataComponentTypes.TOOLTIP_DISPLAY),
"New variant's HIDE_TOOLTIP component was removed, but is still present"
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ transitive-accessible method net/minecraft/entity/ai/brain/Activity <init> (Ljav
# Living entity methods
transitive-accessible method net/minecraft/entity/LivingEntity damageArmor (Lnet/minecraft/entity/damage/DamageSource;F)V
transitive-accessible method net/minecraft/entity/LivingEntity damageHelmet (Lnet/minecraft/entity/damage/DamageSource;F)V
transitive-accessible method net/minecraft/entity/LivingEntity damageShield (F)V

# Entity constructors
transitive-accessible method net/minecraft/entity/projectile/ProjectileEntity <init> (Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ transitive-accessible method net/minecraft/entity/ai/brain/Activity <init> (Ljav
# Living entity methods
transitive-accessible method net/minecraft/entity/LivingEntity damageArmor (Lnet/minecraft/entity/damage/DamageSource;F)V
transitive-accessible method net/minecraft/entity/LivingEntity damageHelmet (Lnet/minecraft/entity/damage/DamageSource;F)V
transitive-accessible method net/minecraft/entity/LivingEntity damageShield (F)V

# Entity constructors
transitive-accessible method net/minecraft/entity/projectile/ProjectileEntity <init> (Lnet/minecraft/entity/EntityType;Lnet/minecraft/world/World;)V
Expand Down
38 changes: 19 additions & 19 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
org.gradle.jvmargs=-Xmx2560M
org.gradle.parallel=true

version=0.115.0
minecraft_version=25w03a
yarn_version=+build.3
version=0.115.1
minecraft_version=25w04a
yarn_version=+build.1
loader_version=0.16.10
installer_version=1.0.1

Expand All @@ -21,42 +21,42 @@ fabric-client-gametest-api-v1-version=3.2.0
fabric-command-api-v1-version=1.2.65
fabric-command-api-v2-version=2.2.44
fabric-commands-v0-version=0.2.82
fabric-content-registries-v0-version=10.0.1
fabric-content-registries-v0-version=10.0.2
fabric-crash-report-info-v1-version=0.3.7
fabric-data-attachment-api-v1-version=1.5.2
fabric-data-generation-api-v1-version=22.2.9
fabric-data-attachment-api-v1-version=1.5.3
fabric-data-generation-api-v1-version=22.2.10
fabric-dimensions-v1-version=4.0.11
fabric-entity-events-v1-version=2.0.15
fabric-events-interaction-v0-version=4.0.6
fabric-game-rule-api-v1-version=1.0.65
fabric-gametest-api-v1-version=3.0.0
fabric-item-api-v1-version=11.1.18
fabric-item-group-api-v1-version=4.1.27
fabric-gametest-api-v1-version=3.0.1
fabric-item-api-v1-version=11.1.19
fabric-item-group-api-v1-version=4.1.28
fabric-key-binding-api-v1-version=1.0.58
fabric-keybindings-v0-version=0.2.56
fabric-lifecycle-events-v1-version=2.5.7
fabric-loot-api-v2-version=3.0.37
fabric-loot-api-v3-version=1.0.25
fabric-loot-api-v2-version=3.0.38
fabric-loot-api-v3-version=1.0.26
fabric-message-api-v1-version=6.0.28
fabric-model-loading-api-v1-version=4.2.4
fabric-networking-api-v1-version=4.3.13
fabric-object-builder-api-v1-version=19.0.1
fabric-object-builder-api-v1-version=19.0.2
fabric-particles-v1-version=4.0.17
fabric-recipe-api-v1-version=8.0.11
fabric-registry-sync-v0-version=6.1.8
fabric-registry-sync-v0-version=6.1.9
fabric-renderer-api-v1-version=5.0.6
fabric-renderer-indigo-version=2.0.6
fabric-rendering-data-attachment-v1-version=0.3.58
fabric-rendering-fluids-v1-version=3.1.22
fabric-rendering-v1-version=10.1.5
fabric-rendering-v1-version=11.0.0
fabric-resource-conditions-api-v1-version=5.0.16
fabric-resource-loader-v0-version=3.0.14
fabric-resource-loader-v0-version=3.0.15
fabric-screen-api-v1-version=2.0.41
fabric-screen-handler-api-v1-version=1.3.115
fabric-screen-handler-api-v1-version=1.3.116
fabric-sound-api-v1-version=1.0.33
fabric-tag-api-v1-version=1.0.6
fabric-transfer-api-v1-version=5.4.12
fabric-transitive-access-wideners-v1-version=6.3.4
fabric-tag-api-v1-version=1.0.7
fabric-transfer-api-v1-version=5.4.13
fabric-transitive-access-wideners-v1-version=6.3.5
fabric-convention-tags-v1-version=2.1.16
fabric-convention-tags-v2-version=2.12.0
fabric-client-tags-api-v1-version=1.1.32

0 comments on commit eae0ba9

Please sign in to comment.