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

Alright so in a mod I'm working on, we have custom particle effects that behave similarly to the vanilla ones. With the way they work now, I need a ParticleType<?> and an IParticleFactory<ParticleType<?>>. I'm able to get the ParticleType<?> to register using the Register<ParticleType<?>> event just like everything else, however I can't get the ParticleFactoryRegisterEvent to fire. Am I using the wrong event bus, or is something missing on a Forge end? I've tried doing this without registering anything, and just firing the event with some console output, but that isn't working either. I've also tried subscribing to Bus.FORGE instead of Bus.MOD. Here's the class I'm using, a snippet of the vanilla class, and the crash report I get on load.
 

Registration class

Spoiler

@ObjectHolder(BlueSkies.MODID)
@EventBusSubscriber(modid = BlueSkies.MODID, bus = Bus.MOD)
public class SkiesParticleTypes
{
	private static ParticleManager manager;
	
	public static final BasicParticleType BLUE_FLAME = new BasicParticleType(false);
	public static final BasicParticleType BLACK_FLAME = new BasicParticleType(false);

	@SubscribeEvent
	public static void initParticleTypes(Register<ParticleType<?>> event)
	{
		System.out.println("PARTICLE TYPES SILVER_DAVID");

		SkiesRegistry.register(event.getRegistry(), "blue_flame", BLUE_FLAME);
		SkiesRegistry.register(event.getRegistry(), "black_flame", BLACK_FLAME);
	}
	
	@SubscribeEvent
	public static void initFactories(net.minecraftforge.client.event.ParticleFactoryRegisterEvent event)
	{
		System.out.println("PARTICLE FACTORIES SILVER_DAVID");
		manager = Minecraft.getInstance().particles;
		
		manager.registerFactory(BLUE_FLAME, BlueFlameParticle.Factory::new);
		manager.registerFactory(BLACK_FLAME, BlackFlameParticle.Factory::new);
	}
}

 

 

Part of the vanilla class where the ParticleFactoryRegisterEvent is called.

Spoiler

// Class: net.minecraft.client.particle.ParticleManager

@OnlyIn(Dist.CLIENT)
public class ParticleManager implements IFutureReloadListener 
{
	// Method at line 78
	private void registerFactories() 
	{
		this.registerFactory(ParticleTypes.AMBIENT_ENTITY_EFFECT, SpellParticle.AmbientMobFactory::new);
		// Removed other registries for shorter text.
		net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(new net.minecraftforge.client.event.ParticleFactoryRegisterEvent());
	}
}

 

 

Crash report

Spoiler

[12:55:51] [Client thread/FATAL] [minecraft/Minecraft]: Reported exception thrown!
net.minecraft.crash.ReportedException: Rendering overlay
    at net.minecraft.client.renderer.GameRenderer.updateCameraAndRender(GameRenderer.java:563) ~[forge-1.14.4-28.0.101_mapped_snapshot_20190908-1.14.3-recomp.jar:?] {pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:921) ~[forge-1.14.4-28.0.101_mapped_snapshot_20190908-1.14.3-recomp.jar:?] {pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.Minecraft.run(Minecraft.java:384) ~[forge-1.14.4-28.0.101_mapped_snapshot_20190908-1.14.3-recomp.jar:?] {pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.main.Main.main(Main.java:128) ~[forge-1.14.4-28.0.101_mapped_snapshot_20190908-1.14.3-recomp.jar:?] {pl:runtimedistcleaner:A}
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171] {}
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171] {}
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_171] {}
    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_171] {}
    at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:55) ~[forge-1.14.4-28.0.101_mapped_snapshot_20190908-1.14.3-recomp.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-3.2.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:50) [modlauncher-3.2.0.jar:?] {}
    at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:68) [modlauncher-3.2.0.jar:?] {}
    at cpw.mods.modlauncher.Launcher.run(Launcher.java:80) [modlauncher-3.2.0.jar:?] {}
    at cpw.mods.modlauncher.Launcher.main(Launcher.java:65) [modlauncher-3.2.0.jar:?] {}
    at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:101) [forge-1.14.4-28.0.101_mapped_snapshot_20190908-1.14.3-recomp.jar:?] {}
Caused by: java.lang.IllegalStateException: Redundant texture list for particle blue_skies:blue_flame
    at net.minecraft.client.particle.ParticleManager.loadTextureLists(ParticleManager.java:202) ~[?:?] {pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at net.minecraft.client.particle.ParticleManager.lambda$null$0(ParticleManager.java:154) ~[?:?] {pl:accesstransformer:B,pl:runtimedistcleaner:A}
    at java.util.concurrent.CompletableFuture$AsyncRun.run(Unknown Source) ~[?:1.8.0_171] {}
    at java.util.concurrent.CompletableFuture$AsyncRun.exec(Unknown Source) ~[?:1.8.0_171] {}
    at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_171] {}
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) ~[?:1.8.0_171] {}
    at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) ~[?:1.8.0_171] {}
    at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) ~[?:1.8.0_171] {}
[12:55:51] [Client thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:printToSYSOUT:106]: ---- Minecraft Crash Report ----

 

Edited by Silver_David

  • 1 year later...
  • Guest locked this topic
Guest
This topic is now closed to further replies.

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.