Jump to content

[1.8.9] Missing Custom Particle Texture, Fully Working System Otherwise


Parizval

Recommended Posts

I have been following TheGreyGhost's tutorial on how to create a custom particle effect and am stumped. See here for his tutorial: http://github.com/TheGreyGhost/MinecraftByExample/tree/master/src/main/java/minecraftbyexample/mbe50_entityfx

 

I have the system almost fully working expect for the texture actually rendering. I have checked to make sure the file is in the right place, spelling, calling all the necessary functions, all that. But still I have a missing texture. The texture I am using has a transparent background, the particle I want to show is 8x8 px and the PNG is 128x128 px. I am posting here to hope that someone has an idea of what I am missing. I am working on a large mod right now and the code is very connected together, so let me know what code you would like to see for this issue.

 

Thanks for reading!

Link to comment
Share on other sites

Well, is there anything to see in the logs?

 

And for the code part, I would like to see the particleClass itself, and the part where you spawn in the particles. Besides, if you init the ResourceLocation of the particletexture outside the particleClass, please show us that part as well.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

There are no errors in my console or even warnings about missing textures. Here is a gist to the 3 java classes I believe are relevant to the issue. Please let me know if you would like to look at any other classes.

 

https://gist.github.com/ajman1101/d02d2bdc755622273af115e44e028237

 

coralNercoBlock.java is the block I am trying to create a custom particle effect for. Line 123 is where work related to the particle effect is done.

 

TestFX.java is where I set the texture for my custom particle effect (or at least where I am trying to!) , move the particle, and update it. I have commented out the renderParticle function, as when trying to debug this issue, I read in TheGreyGhost's comment on his example that it is not necessary to override the function. To which I agree as nothing has changed with my mod since commenting that function out.

 

TextureStitcher.java is where I believe I am adding my custom particle onto Minecraft's particle spritesheet.

 

The only other line missing is inside my preInit function in my main class, shown below:

 

MinecraftForge.EVENT_BUS.register(new TextureStitcher())

 

 

Many thanks for the reply and any and all feedback are greatly appreciated!

Link to comment
Share on other sites

First of all, dont copy paste stuff if you dont know how it works! Its better to figure out every single step on your own.

 

Second,  you redoing a part of the velocity calculations in the constructor, with the intention to change the velocity each tick.... I hope you know that a constructor is only called once per instance?

 

Furthermore, In your StichtEvent you register a 'CopperCrucible' texture, while in your FXClass you are searching for a 'particles' texture. Any idea what is going wrong here ;)

 

But appart from that, everything seems normal meaning that if the above isnt the problem, you got to debug everything till you find the problem.

Ps. You could try to spawn in the particle without any velocity to check if it isnt flying out of view the second it spawns.

 

Hope this helps you on the right track.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

Sorry if my last post sounded like I did not know the code I wrote, I am just sorely confused with the issue I am having and second guessing my work.

 

I realize that I am doing some velocity calculations in my constructor, I also have a randomDisplayTick function in my block I am adding particles to (Lines 123-151 of coralNercoBlock.java). I have been unsure for a while about the amount of ticks between initialization of a particle and adding logic to it in randomDisplayTick. This is something I plan to investigate further on my own, but I first was hoping to solve this issue. So that is my reasoning for having the velocity code also in the constructor.

 

The joys of trying to solve a problem while writing a forum post!

 

You are supremely correct that my resources do not match, on my local copy they are both the "testing:entity/particles" and I am still not getting my chosen texture, just Minecraft's broken one (the black and purple checkerboard).

 

Thinking about it more yesterday, are there any certain requirements on the size of my particles texture? Can it not be transparent? Or is this not a issue?

Link to comment
Share on other sites

Just a small tip, if you want to adjust the particle's velocity after initialization, just move the calculation part from the constructor to the 'onUpdate()' function.

 

On to the texture bug, if it is black and purple, you deffenitly need to see some kind of error in the logs, otherwise that default texture wouldnt appear. Furthermore you can mess up as much as you want on the texture size etc. Opengl will render it nontheless. The only thing that might happen is that it might not be rendered as you would like it to be.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

I attached to the gist a 4th file that holds all the output from my console. During the session, I launch the game, create a new creative world, open the inventory to grab a coral Nerco Block, and place it.

 

Here the gist: http://gist.github.com/ajman1101/d02d2bdc755622273af115e44e028237

 

I only have an error at startup of a Minecraft world, which I attribute to loading in the whole world, the engine getting behind throwing some errors, then catching up with itself.

 

Do you see anything out of the ordinary N247S?

 

Thanks for your help so far as well!

Link to comment
Share on other sites

Unfortunatly I dont see anything wierd/mistakes so far. Just to make sure, your particle is rendered but only with the default black and purple texture? Either that is your texture :P, or there is something going wrong with the ResourceLocations, although Im sure it would give some kind of error.

 

So I am sorry, but I think that Ii cannot help you further with this. Try some extensive debugging, and see where strange thingd are happening.

Projects:

Discontinued:

- N2ConfigAPI

- Meachanical Crafting Table

 

Latest:

- CollectionUtils

 

Coöperations:

- InGameConfigManager

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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