Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new MobEffect constructor that allows specifying a particle factory #1578

Merged

Conversation

ChampionAsh5357
Copy link
Contributor

Closes #1558

Currently, the mob effect can specify a ParticleOptions to handle what particles should be displayed. However, as the particle options may contain modded entries that may not exist at the time of the mob effect initialization, the options need to be deferred somewhat. This is normally done with a supplier, but since there is already a factory that the option is delegated to, I opted to simply expose it as a parameter.

@ChampionAsh5357 ChampionAsh5357 added the 1.21.1 Targeted at Minecraft 1.21.1 label Oct 2, 2024
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Oct 2, 2024

  • Publish PR to GitHub Packages

Last commit published: 89da086f084e8c2be43d5f9a43fd1d947e5d830f.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #1578' // https://github.com/neoforged/NeoForge/pull/1578
        url 'https://prmaven.neoforged.net/NeoForge/pr1578'
        content {
            includeModule('net.neoforged', 'neoforge')
            includeModule('net.neoforged', 'testframework')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr1578.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1578
cd NeoForge-pr1578
curl -L https://prmaven.neoforged.net/NeoForge/pr1578/net/neoforged/neoforge/21.3.2-beta-pr-1578-fix-mobeffect-particleoptions/mdk-pr1578.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@Shadows-of-Fire
Copy link
Contributor

Yeah I think this is the best solution. Unfortunately, ParticleOptions is a bit of a mess, since MobEffect is dependent on it, but it is natively dependent on both Item and Block. In the vanilla order, MobEffect is before both Item and Block, so trying to shuffle the registry order around for correctness would be incredibly annoying.

@Shadows-of-Fire Shadows-of-Fire changed the title Add MobEffect Constructor For Particle Factory Add new MobEffect constructor that allows specifying a particle factory Oct 8, 2024
@XFactHD XFactHD merged commit d19ca06 into neoforged:1.21.x Oct 23, 2024
6 checks passed
@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.3.1-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.1 Targeted at Minecraft 1.21.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Initialize ParticleType registry before MobEffects
3 participants