Jump to content

[1.16.5] Redundant texture list for particle


TheRedMelon

Recommended Posts

I'm trying to make a particle that behaves identically to the PortalParticle, but with the ability to have different colours.  For now I'm just trying clone the PortalParticle as a BasicParticleType.

I've looked over examples, can't see what I'm missing.

 

Error

Spoiler

[20:17:13] [Render thread/FATAL] [ne.mi.co.ForgeMod/]: Preparing crash report with UUID b25ca0a7-7b1b-4565-804d-d6e95f704ac8
[20:17:13] [Render thread/INFO] [STDOUT/]: [net.minecraft.crash.CrashReport:addCategory:196]: Negative index in crash report handler (8/15)
[20:17:14] [Render thread/FATAL] [minecraft/Minecraft]: Reported exception thrown!
net.minecraft.crash.ReportedException: Rendering overlay
        at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:488) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at net.minecraft.client.Minecraft.runTick(Minecraft.java:977) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_322] {}
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_322] {}
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_322] {}
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_322] {}
        at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}
        at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}
        at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {}
        at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108) [forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {}
Caused by: java.lang.IllegalStateException: Redundant texture list for particle melsportals:colored_portal
        at net.minecraft.client.particle.ParticleManager.loadParticleDescription(ParticleManager.java:217) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at net.minecraft.client.particle.ParticleManager.lambda$null$0(ParticleManager.java:169) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_322] {}
        at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_322] {}
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_322] {}
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_322] {}
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_322] {}
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_322] {}
[20:17:14] [Render thread/INFO] [STDOUT/]: [net.minecraft.util.registry.Bootstrap:realStdoutPrintln:123]: ---- Minecraft Crash Report ----
// Hi. I'm Minecraft, and I'm a crashaholic.

Time: 10/04/22 20:17
Description: Rendering overlay

java.lang.IllegalStateException: Redundant texture list for particle melsportals:colored_portal
        at net.minecraft.client.particle.ParticleManager.loadParticleDescription(ParticleManager.java:217) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at net.minecraft.client.particle.ParticleManager.lambda$null$0(ParticleManager.java:169) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1640) ~[?:1.8.0_322] {}
        at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1632) ~[?:1.8.0_322] {}
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289) ~[?:1.8.0_322] {}
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[?:1.8.0_322] {}
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[?:1.8.0_322] {}
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:175) ~[?:1.8.0_322] {}


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Thread: Render thread
Stacktrace:
        at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:484) ~[forge:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
-- Overlay render details --
Details:
        Overlay name: net.minecraft.client.gui.ResourceLoadProgressGui
Stacktrace:
        at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:484) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at net.minecraft.client.Minecraft.runTick(Minecraft.java:977) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
        at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A}
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_322] {}
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_322] {}
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_322] {}
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_322] {}
        at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.1.3.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.1.3.jar:?] {}
        at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.1.3.jar:?] {}
        at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.1.3.jar:?] {}
        at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.1.3.jar:?] {}
        at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:108) [forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp.jar:?] {}


-- System Details --
Details:
        Minecraft Version: 1.16.5
        Minecraft Version ID: 1.16.5
        Operating System: Windows 10 (amd64) version 10.0
        Java Version: 1.8.0_322, Temurin
        Java VM Version: OpenJDK 64-Bit Server VM (mixed mode), Temurin
        Memory: 283590552 bytes (270 MB) / 1726480384 bytes (1646 MB) up to 3801088000 bytes (3625 MB)
        CPUs: 24
        JVM Flags: 2 total; -XX:+IgnoreUnrecognizedVMOptions -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump
        ModLauncher: 8.1.3+8.1.3+main-8.1.x.c94d18ec
        ModLauncher launch target: fmluserdevclient
        ModLauncher naming: mcp
        ModLauncher services:
                /mixin-0.8.4.jar mixin PLUGINSERVICE
                /eventbus-4.0.0.jar eventbus PLUGINSERVICE
                /forge-1.16.5-36.2.33_mapped_official_1.16.5-launcher.jar object_holder_definalize PLUGINSERVICE
                /forge-1.16.5-36.2.33_mapped_official_1.16.5-launcher.jar runtime_enum_extender PLUGINSERVICE
                /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE
                /forge-1.16.5-36.2.33_mapped_official_1.16.5-launcher.jar capability_inject_definalize PLUGINSERVICE
                /forge-1.16.5-36.2.33_mapped_official_1.16.5-launcher.jar runtimedistcleaner PLUGINSERVICE
                /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE
                /forge-1.16.5-36.2.33_mapped_official_1.16.5-launcher.jar fml TRANSFORMATIONSERVICE
        FML: 36.2
        Forge: net.minecraftforge:36.2.33
        FML Language Providers:
                [email protected]
                minecraft@1
        Mod List:
                client-extra.jar                                  |Minecraft                     |minecraft                     |1.16.5              |SIDED_SETU|Manifest: a1:d4:5e:04:4f:d3:d6:e0:7b:37:97:cf:77:b0:de:ad:4a:47:ce:8c:96:49:5f:0a:cf:8c:ae:b2:6d:4b:8a:3f    
                forge-1.16.5-36.2.33_mapped_official_1.16.5-recomp|Forge                         |forge                         |36.2.33             |SIDED_SETU|Manifest: NOSIGNATURE
                main                                              |Mel's Portals                 |melsportals                   |NONE                |SIDED_SETU|Manifest: NOSIGNATURE
        Crash Report UUID: b25ca0a7-7b1b-4565-804d-d6e95f704ac8
        Launched Version: MOD_DEV
        Backend library: LWJGL version 3.2.2 build 10
        Backend API: NVIDIA GeForce RTX 3090/PCIe/SSE2 GL version 4.6.0 NVIDIA 511.79, NVIDIA Corporation
        GL Caps: Using framebuffer using OpenGL 3.0
        Using VBOs: Yes
        Is Modded: Definitely; Client brand changed to 'forge'
        Type: Client (map_client.txt)
        Graphics mode: fancy
        Resource Packs:
        Current Language: English (US)
        CPU: 24x AMD Ryzen 9 3900X 12-Core Processor

 

ColoredParticle.java

Spoiler
@OnlyIn(Dist.CLIENT)
public class ColoredPortal extends PortalParticle {
    protected ColoredPortal(ClientWorld worldIn, double x, double y, double z,
            double xSpeed, double ySpeed, double zSpeed) {
        super(worldIn, x, y, z, xSpeed, ySpeed, zSpeed);
    }

    @OnlyIn(Dist.CLIENT)
    public static class Factory implements IParticleFactory<BasicParticleType> {
        private final IAnimatedSprite sprite;

        public Factory(IAnimatedSprite spriteIn) {
            this.sprite = spriteIn;
        }

        public Particle createParticle(BasicParticleType p_199234_1_, ClientWorld world, double x,
                double y, double z, double xSpeed, double ySpeed, double zSpeed) {
            ColoredPortal particle = new ColoredPortal(world, x, y, z,
                    xSpeed, ySpeed, zSpeed);
            particle.pickSprite(this.sprite);
            return particle;
        }
    }
}

 

DeferredRegister

Spoiler
public class ModParticles {
    public static final DeferredRegister<ParticleType<?>> PARTICLES = DeferredRegister.create(
            ForgeRegistries.PARTICLE_TYPES, ModGlobals.MOD_ID);

    public static final RegistryObject<BasicParticleType> COLORED_PORTAL = PARTICLES.register("colored_portal",
            () -> new BasicParticleType(true));
}

 

Register Event

Spoiler
@EventBusSubscriber(bus = EventBusSubscriber.Bus.MOD, value = Dist.CLIENT)
public class ClientRegistryHandler {
    public static void onParticlesRegistry(ParticleFactoryRegisterEvent e) {
        Minecraft.getInstance().particleEngine.register(ModParticles.COLORED_PORTAL.get(), ColoredPortal.Factory::new);
    }
}

 

colored_particles.json

Spoiler
{
  "textures": [
    "minecraft:generic_0",
    "minecraft:generic_1",
    "minecraft:generic_2",
    "minecraft:generic_3",
    "minecraft:generic_4",
    "minecraft:generic_5",
    "minecraft:generic_6",
    "minecraft:generic_7"
  ]
}

 

Thanks

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.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • A friend found this code, but I don't know where. It seems to be very outdated, maybe from 1.12? and so uses TextureManager$loadTexture and TextureManager$deleteTexture which both don't seem to exist anymore. It also uses Minecraft.getMinecraft().mcDataDir.getCanonicalPath() which I replaced with the resource location of my texture .getPath()? Not sure if thats entirely correct. String textureName = "entitytest.png"; File textureFile = null; try { textureFile = new File(Minecraft.getMinecraft().mcDataDir.getCanonicalPath(), textureName); } catch (Exception ex) { } if (textureFile != null && textureFile.exists()) { ResourceLocation MODEL_TEXTURE = Resources.OTHER_TESTMODEL_CUSTOM; TextureManager texturemanager = Minecraft.getMinecraft().getTextureManager(); texturemanager.deleteTexture(MODEL_TEXTURE); Object object = new ThreadDownloadImageData(textureFile, null, MODEL_TEXTURE, new ImageBufferDownload()); texturemanager.loadTexture(MODEL_TEXTURE, (ITextureObject)object); return true; } else { return false; }   Then I've been trying to go through the source code of the reload resource packs from minecraft, to see if I can "cache" some data and simply reload some textures and swap them out, but I can't seem to figure out where exactly its "loading" the texture files and such. Minecraft$reloadResourcePacks(bool) seems to be mainly controlling the loading screen, and using this.resourcePackRepository.reload(); which is PackRepository$reload(), but that function seems to be using this absolute confusion of a line List<String> list = this.selected.stream().map(Pack::getId).collect(ImmutableList.toImmutableList()); and then this.discoverAvailable() and this.rebuildSelected. The rebuild selected seemed promising, but it seems to just be going through each pack and doing this to them? pack.getDefaultPosition().insert(list, pack, Functions.identity(), false); e.g. putting them into a list of packs and returning that into this.selected? Where do the textures actually get baked/loaded/whatever? Any info on how Minecraft reloads resource packs or how the texture manager works would be appreciated!
    • This might be a long shot , but do you remember how you fixed that?
    • Yeah, I'll start with the ones I added last night.  Wasn't crashing until today and wasn't crashing at all yesterday (+past few days since removing Cupboard), so deductive reasoning says it's likeliest to be one of the new ones.  A few horse armor mods and a corn-based add-on to Farmer's Delight, the latter which I hope to keep - I could do without the horse armor mods if necessary.  Let me try a few things and we'll see. 
    • Add crash-reports with sites like https://mclo.gs/ Add this mod: https://www.curseforge.com/minecraft/mc-mods/packet-fixer/files/5416165
  • Topics

×
×
  • Create New...

Important Information

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