mirror of
https://github.com/FabricMC/fabric.git
synced 2025-05-10 05:10:52 -04:00
Update to 24w45a (#4213)
* Update to 24w45a * Fix model provider and build * Remove old mixin file * Bump versions
This commit is contained in:
parent
7feeb733ad
commit
77a65688c8
61 changed files with 455 additions and 691 deletions
fabric-object-builder-api-v1
build.gradle
src/client
java/net/fabricmc/fabric
api/object/builder/v1/client/model
mixin/object/builder/client
resources
|
@ -13,7 +13,3 @@ testDependencies(project, [
|
|||
loom {
|
||||
accessWidenerPath = file("src/main/resources/fabric-object-builder-api-v1.accesswidener")
|
||||
}
|
||||
|
||||
validateMixinNames {
|
||||
exclude "**/ModelPredicateProviderRegistrySpecificAccessor.class"
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -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 -> {
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -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");
|
||||
}
|
||||
}
|
|
@ -5,8 +5,6 @@
|
|||
"client": [
|
||||
"EntityModelLayersMixin",
|
||||
"HangingSignEditScreenMixin",
|
||||
"ModelPredicateProviderRegistryAccessor",
|
||||
"ModelPredicateProviderRegistrySpecificAccessor",
|
||||
"TexturedRenderLayersMixin"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue