diff --git a/src/main/java/de/cas_ual_ty/ydm/clientutil/ClientProxy.java b/src/main/java/de/cas_ual_ty/ydm/clientutil/ClientProxy.java index c54ff849..94989703 100644 --- a/src/main/java/de/cas_ual_ty/ydm/clientutil/ClientProxy.java +++ b/src/main/java/de/cas_ual_ty/ydm/clientutil/ClientProxy.java @@ -209,23 +209,32 @@ private void textureStitchPre(TextureStitchEvent.Pre event) private void modelRegistry(ModelRegistryEvent event) { YDM.log("Registering models (size: " + ClientProxy.activeItemImageSize + ") for " + YdmItems.BLANC_CARD.getRegistryName().toString() + " and " + YdmItems.CARD_BACK.getRegistryName().toString()); - ModelLoader.addSpecialModel(new ModelResourceLocation(new ResourceLocation(YdmItems.BLANC_CARD.getRegistryName().toString() + "_" + ClientProxy.activeItemImageSize), "inventory")); - ModelLoader.addSpecialModel(new ModelResourceLocation(new ResourceLocation(YdmItems.CARD_BACK.getRegistryName().toString() + "_" + ClientProxy.activeItemImageSize), "inventory")); + + // 16 is default texture; no need to do anything special in that case + if(ClientProxy.activeItemImageSize != 16) + { + ModelLoader.addSpecialModel(new ModelResourceLocation(new ResourceLocation(YdmItems.BLANC_CARD.getRegistryName().toString() + "_" + ClientProxy.activeItemImageSize), "inventory")); + ModelLoader.addSpecialModel(new ModelResourceLocation(new ResourceLocation(YdmItems.CARD_BACK.getRegistryName().toString() + "_" + ClientProxy.activeItemImageSize), "inventory")); + } } private void modelBake(ModelBakeEvent event) { YDM.log("Baking models (size: " + ClientProxy.activeItemImageSize + ") for " + YdmItems.BLANC_CARD.getRegistryName().toString() + " and " + YdmItems.CARD_BACK.getRegistryName().toString()); - event.getModelRegistry().put(new ModelResourceLocation(YdmItems.BLANC_CARD.getRegistryName(), "inventory"), - event.getModelRegistry().get( - new ModelResourceLocation( - new ResourceLocation(YdmItems.BLANC_CARD.getRegistryName().toString() + "_" + ClientProxy.activeItemImageSize), "inventory"))); - - event.getModelRegistry().put(new ModelResourceLocation(YdmItems.CARD_BACK.getRegistryName(), "inventory"), - event.getModelRegistry().get( - new ModelResourceLocation( - new ResourceLocation(YdmItems.CARD_BACK.getRegistryName().toString() + "_" + ClientProxy.activeItemImageSize), "inventory"))); + // 16 is default texture; no need to do anything special in that case + if(ClientProxy.activeItemImageSize != 16) + { + event.getModelRegistry().put(new ModelResourceLocation(YdmItems.BLANC_CARD.getRegistryName(), "inventory"), + event.getModelRegistry().get( + new ModelResourceLocation( + new ResourceLocation(YdmItems.BLANC_CARD.getRegistryName().toString() + "_" + ClientProxy.activeItemImageSize), "inventory"))); + + event.getModelRegistry().put(new ModelResourceLocation(YdmItems.CARD_BACK.getRegistryName(), "inventory"), + event.getModelRegistry().get( + new ModelResourceLocation( + new ResourceLocation(YdmItems.CARD_BACK.getRegistryName().toString() + "_" + ClientProxy.activeItemImageSize), "inventory"))); + } ModelResourceLocation key = new ModelResourceLocation(YdmItems.CARD.getRegistryName(), "inventory"); event.getModelRegistry().put(key, new CardBakedModel(event.getModelRegistry().get(key)));