mirror of
https://github.com/FabricMC/fabric.git
synced 2024-11-30 03:26:07 -05:00
Fix crash with custom signs. (#4240)
This commit is contained in:
parent
5f014276c3
commit
6383078589
9 changed files with 56 additions and 5 deletions
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* 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.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import net.minecraft.block.WoodType;
|
||||
import net.minecraft.client.render.TexturedRenderLayers;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
@Mixin(WoodType.class)
|
||||
public abstract class WoodTypeMixin {
|
||||
@Inject(method = "register", at = @At("RETURN"))
|
||||
private static void register(WoodType type, CallbackInfoReturnable<WoodType> cir) {
|
||||
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));
|
||||
}
|
||||
}
|
|
@ -5,7 +5,8 @@
|
|||
"client": [
|
||||
"EntityModelLayersMixin",
|
||||
"HangingSignEditScreenMixin",
|
||||
"TexturedRenderLayersMixin"
|
||||
"TexturedRenderLayersMixin",
|
||||
"WoodTypeMixin"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
|
@ -67,6 +67,8 @@ public class TealSignTest implements ModInitializer {
|
|||
Registry.register(Registries.ITEM, TEAL_HANGING_SIGN_KEY.getValue(), TEAL_HANGING_SIGN_ITEM);
|
||||
|
||||
BlockEntityType.SIGN.addSupportedBlock(TEAL_SIGN);
|
||||
BlockEntityType.SIGN.addSupportedBlock(TEAL_WALL_SIGN);
|
||||
BlockEntityType.HANGING_SIGN.addSupportedBlock(TEAL_HANGING_SIGN);
|
||||
BlockEntityType.HANGING_SIGN.addSupportedBlock(TEAL_WALL_HANGING_SIGN);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "fabric-rendering-v1-testmod:block/teal_hanging_sign"
|
||||
"model": "fabric-object-builder-api-v1-testmod:block/teal_sign"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "fabric-rendering-v1-testmod:block/teal_sign"
|
||||
"model": "fabric-object-builder-api-v1-testmod:block/teal_sign"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "fabric-rendering-v1-testmod:block/teal_hanging_sign"
|
||||
"model": "fabric-object-builder-api-v1-testmod:block/teal_sign"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"variants": {
|
||||
"": {
|
||||
"model": "fabric-rendering-v1-testmod:block/teal_sign"
|
||||
"model": "fabric-object-builder-api-v1-testmod:block/teal_sign"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "fabric-object-builder-api-v1-testmod:item/teal_hanging_sign"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"model": {
|
||||
"type": "minecraft:model",
|
||||
"model": "fabric-object-builder-api-v1-testmod:item/teal_sign"
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue