Jump to content

Recommended Posts

Posted

I have my effects, and I using DeferredRegister to regist them.
Here's my effects.

 

For FoodEffect, I need to reuse texture from specific items, I override the IForgeEffect#renderInventoryEffect to finish these.

@OnlyIn(Dist.CLIENT)
@Override
public void renderInventoryEffect(EffectInstance effect, DisplayEffectsScreen<?> gui, int x, int y, float z){
	/* Cover original icon */
	Minecraft minecraft = gui.getMinecraft();
	minecraft.getTextureManager().bindTexture(ContainerScreen.INVENTORY_BACKGROUND);
	gui.blit(x + 6, y, 6, 166, 18, 32);

	/* Show custom icon */
	ItemRenderer itemRenderer = minecraft.getItemRenderer();
	itemRenderer.zLevel = z;
	itemRenderer.renderItemAndEffectIntoGUI(new ItemStack(Ingredients.getIngredientByName(this.getIngredientName()))
		, x + 6, y + 7);
}

FoodEffect's code

 

It worked.

2020-03-26_23_15_03.thumb.png.ebedaff95eb767330fdefd3ee2bd3a67.png

 

But there's a problem on console log, it complained that it can't find file under mob_effect folder.

Of course, I put nothing in the mob_effect folder.

[m[1;31m[23:14:54] [Server-Worker-11/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/fermented_endereye_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/fermented_endereye_power.png
[m[1;31m[23:14:54] [Server-Worker-11/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/orange_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/orange_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/porkchop_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/porkchop_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/egg_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/egg_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/papaya_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/papaya_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/spinach_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/spinach_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/beetroot_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/beetroot_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/honey_bottle_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/honey_bottle_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/ghast_tear_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/ghast_tear_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/mint_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/mint_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/sweet_berries_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/sweet_berries_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/nether_wart_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/nether_wart_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/beef_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/beef_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/salt_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/salt_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/dragon_breath_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/dragon_breath_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/cheese_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/cheese_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/sauce_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/sauce_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/flour_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/flour_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/kelp_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/kelp_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/cream_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/cream_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/dough_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/dough_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/red_mushroom_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/red_mushroom_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/rice_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/rice_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/oil_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/oil_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/pumpkin_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/pumpkin_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/chicken_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/chicken_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/chorus_fruit_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/chorus_fruit_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/butter_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/butter_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/ketchup_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/ketchup_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/cabbage_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/cabbage_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/cocoa_beans_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/cocoa_beans_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/kiwi_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/kiwi_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/melon_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/melon_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/tomato_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/tomato_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/chili_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/chili_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/carrot_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/carrot_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/apple_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/apple_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/experience_bottle_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/experience_bottle_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/lemon_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/lemon_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/mutton_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/mutton_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/milk_bucket_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/milk_bucket_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/sugar_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/sugar_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/magma_cream_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/magma_cream_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/brown_mushroom_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/brown_mushroom_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/corn_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/corn_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/water_bucket_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/water_bucket_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/potato_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/potato_power.png
[m[1;31m[23:14:54] [Server-Worker-13/ERROR] [minecraft/AtlasTexture]: Using missing texture, unable to load foodpower:textures/mob_effect/mango_power.png : java.io.FileNotFoundException: foodpower:textures/mob_effect/mango_power.png

 

These error log are annoyed me, and it's not nessery to trying load textures for these effects in my mod.

So is there a way I can tell minecraft no need to load these textures?

Or a way I can set all these effects to a single texture like mob_effect/default.png.

I'm tired about copy a lot png files and rename them, it's make extra work when I add new effects, and I think I may avoid this.

 

I tried using TextureManager#deleteTexture in FMLClientSetupEvent and TextureStitchEvent.Pre, but it didn't work.

 

Posted
12 hours ago, diesieben07 said:

There is no way to prevent it. Look at PotionSpriteUploader. It could be hacked together using reflection and TextureStitchEvent.Pre. I'll leave that as an excercise to the reader ;)

Thanks for replied and advice, I finished the exercise.

 

PS. I spend a lot of time seeking which field I can hack in PotionSpriteUploader and plan to do it in TextureStitchEvent.Pre.

After hours I realize that just hack TextureStitchEvent.Pre and everything will be done ?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.