Update to 24w45a ()

* Update to 24w45a

* Fix model provider and build

* Remove old mixin file

* Bump versions
This commit is contained in:
modmuss 2024-11-06 21:10:00 +00:00 committed by GitHub
parent 7feeb733ad
commit 77a65688c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
61 changed files with 455 additions and 691 deletions

View file

@ -13,7 +13,3 @@ testDependencies(project, [
loom {
accessWidenerPath = file("src/main/resources/fabric-object-builder-api-v1.accesswidener")
}
validateMixinNames {
exclude "**/ModelPredicateProviderRegistrySpecificAccessor.class"
}

View file

@ -1,58 +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.api.object.builder.v1.client.model;
import net.minecraft.client.item.ClampedModelPredicateProvider;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
import net.fabricmc.fabric.mixin.object.builder.client.ModelPredicateProviderRegistryAccessor;
import net.fabricmc.fabric.mixin.object.builder.client.ModelPredicateProviderRegistrySpecificAccessor;
/**
* Allows registering model predicate providers for item models.
*
* <p>A registered model predicate providers for an item can be retrieved through
* {@link net.minecraft.client.item.ModelPredicateProviderRegistry#get(net.minecraft.item.ItemStack, Identifier)}.</p>
*
* @see net.minecraft.client.item.ModelPredicateProviderRegistry
* @deprecated Replaced by access wideners for {@link net.minecraft.client.item.ModelPredicateProviderRegistry}
* registration methods in Fabric Transitive Access Wideners (v1).
*/
@Deprecated
public final class FabricModelPredicateProviderRegistry {
/**
* Registers a model predicate provider that is applicable for any item.
*
* @param id the identifier of the provider
* @param provider the provider
*/
public static void register(Identifier id, ClampedModelPredicateProvider provider) {
ModelPredicateProviderRegistryAccessor.callRegister(id, provider);
}
/**
* Registers a model predicate provider to a specific item.
*
* @param item the item the provider is associated to
* @param id the identifier of the provider
* @param provider the provider
*/
public static void register(Item item, Identifier id, ClampedModelPredicateProvider provider) {
ModelPredicateProviderRegistrySpecificAccessor.callRegister(item, id, provider);
}
}

View file

@ -46,7 +46,7 @@ public class EntityModelLayersMixin {
}
@Inject(method = "createHangingSign", at = @At("HEAD"), cancellable = true)
private static void createHangingSign(WoodType type, HangingSignBlockEntityRenderer.class_10381 attachmentType, CallbackInfoReturnable<EntityModelLayer> cir) {
private static void createHangingSign(WoodType type, HangingSignBlockEntityRenderer.AttachmentType attachmentType, CallbackInfoReturnable<EntityModelLayer> cir) {
if (type.name().indexOf(Identifier.NAMESPACE_SEPARATOR) != -1) {
Identifier identifier = Identifier.of(type.name());
cir.setReturnValue(new EntityModelLayer(identifier.withPath(path -> {

View file

@ -1,32 +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.object.builder.client;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
import net.minecraft.client.item.ClampedModelPredicateProvider;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.util.Identifier;
@Mixin(ModelPredicateProviderRegistry.class)
public interface ModelPredicateProviderRegistryAccessor {
@Invoker
static ClampedModelPredicateProvider callRegister(Identifier id, ClampedModelPredicateProvider provider) {
throw new AssertionError("mixin dummy");
}
}

View file

@ -1,34 +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.object.builder.client;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Invoker;
import net.minecraft.client.item.ClampedModelPredicateProvider;
import net.minecraft.client.item.ModelPredicateProviderRegistry;
import net.minecraft.item.Item;
import net.minecraft.util.Identifier;
// mixin doesn't care about descriptor, must put two "register" accessors in different places
@Mixin(ModelPredicateProviderRegistry.class)
public interface ModelPredicateProviderRegistrySpecificAccessor {
@Invoker
static void callRegister(Item item, Identifier id, ClampedModelPredicateProvider provider) {
throw new AssertionError("mixin dummy");
}
}

View file

@ -5,8 +5,6 @@
"client": [
"EntityModelLayersMixin",
"HangingSignEditScreenMixin",
"ModelPredicateProviderRegistryAccessor",
"ModelPredicateProviderRegistrySpecificAccessor",
"TexturedRenderLayersMixin"
],
"injectors": {