Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

Hello

I just saw that Forge has a hook in EffectRenderer.addEffect(EntityFX,Object) but there seams to be no ability to get a own texture into EffectRenderer.addEffect(EntityFX) with Forge. This would be very useful for easily adding custom particles. I don't know if there was this request before, but this part would have to be recoded a little bit. My mod needs to bypass this atm by changing an if-statement in minecraft. But I would like my mod to be fully Forge-compatible, so it would be very nice, if you could add this.

 

P.S. I know, it is possible to do this in another way, but that is very complicated. not as nice as just letting the custom particle implement ITextureProvider

 

Thank you

Tobias

Channeling LexManos here:

If you can do something the hard way, do it the hard way. Don't ask for the easy way.

Done channeling.

But really, that would be nice to have.

So, what would happen if I did push that shiny red button over there? ... Really? ... Can I try it? ... Damn.

  • Author

Thank you for replying so fast.

Yes, I could set up a special Renderer for that, but this is really complicated in comparison to Creating a MyParticleFX.java and just letting this implement ITextureProvider and then using:

 

	EntitySmilieFX var21 = new EntitySmilieFX(mc.theWorld, playz0r.lastTickPosX,playz0r.lastTickPosY,playz0r.lastTickPosZ, 0.1D, 1.0D, 0.1D,5);
	mc.effectRenderer.addEffect((EntityFX)var21,var21);

 

but atm this

 

    public void addEffect(EntityFX effect, Object effectObject)
    {
        if (effectObject == null || !(effect instanceof EntityDiggingFX || effect instanceof EntityBreakingFX))
        {
            addEffect(effect);
            return;
        }
       :
       :

 

prevents this by calling addEffect(EntityFX)

 

    public void addEffect(EntityFX par1EntityFX)
    {
        int var2 = par1EntityFX.getFXLayer();

        if (this.fxLayers[var2].size() >= 4000)
        {
            this.fxLayers[var2].remove(0);
        }

        this.fxLayers[var2].add(par1EntityFX);
    }

 

Here, for some reason, the hashtable for linking a texture-file with the EntityFX is not used.

Using custom particles would be a LOT easier with this small change. I think this would not be too hard to change. I'll change this for my mod, so I can use this the easy way.

 

mfg,

Tobias

 

  • Author

Sorry for double-posting, but found the easiest way for all modders:

    public void addEffect(EntityFX effect, Object effectObject)
    {
        if (effectObject == null || !(effect instanceof EntityDiggingFX || effect instanceof ITextureProvider || effect instanceof EntityBreakingFX))
        {
            addEffect(effect);
            return;
        }

        String texture = "/terrain.png";
        if (effect.getFXLayer() == 0)
        {
            texture = "/particles.png";
        }
        else if (effect.getFXLayer() == 2)
        {
            texture = "/gui/items.png";
        }        
        texture = ForgeHooksClient.getTexture(texture, effectObject);
        
        ArrayList<EntityFX> set = effectList.get(texture);
        if (set == null)
        {
            set = new ArrayList<EntityFX>();
            effectList.put(texture, set);
        }
        set.add(effect);
    }

 

Just a very small change in this if-statement.

Would be really cool, if you could implement this in forge!

 

Thank you

Tobias

Suggest it to Lex, but a better suggestion is to make a pull request and submit it on github.  ;)

 

The changes for 1.2.5 are likely frozen now so it would probably be accepted in 1.3 soon.

  • Author

OK, I created a pull-request on github. Hopefully it will be put into the code for 1.3.

 

Thank you all

Tobias

I REALLY want this cause I want my mod to also have EntityFX's more easily and I dont want to edit base classes.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.