Jump to content

Recommended Posts

Posted

Hi, I'm new to capabilities, I followed a few tutorials on how to create your own, and after creating the interfaces, capability classes, storage, providers and registering them and attatching them to entities, I'm getting an exception crash saying I'm registering capabilities multiple times, I dont see where. :/

 

  Quote

[29jul2020 09:55:22.252] [modloading-worker-1/ERROR] [net.minecraftforge.fml.javafmlmod.FMLModContainer/LOADING]: Caught exception during event FMLCommonSetupEvent dispatch for modid customgunsmod
java.lang.IllegalArgumentException: Cannot register a capability implementation multiple times : com.xanderindalzone.customgunsmod.capabilities.entity.IGunAim
    at net.minecraftforge.common.capabilities.CapabilityManager.register(CapabilityManager.java:72) ~[forge-1.15.2-31.2.0_mapped_snapshot_20200514-1.15.1-recomp.jar:?]
    at com.xanderindalzone.customgunsmod.init.InitCapabilities.registerCapabilities(InitCapabilities.java:19) ~[main/:?]
    at com.xanderindalzone.customgunsmod.CustomGunsMod.setup(CustomGunsMod.java:111) ~[main/:?]
    at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:212) ~[eventbus-2.2.0-service.jar:?]
    at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:204) ~[eventbus-2.2.0-service.jar:?]
    at net.minecraftforge.eventbus.EventBus.post(EventBus.java:258) ~[eventbus-2.2.0-service.jar:?]
    at net.minecraftforge.fml.javafmlmod.FMLModContainer.fireEvent(FMLModContainer.java:106) ~[?:31.2]
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_251]
    at java.util.function.Consumer.lambda$andThen$0(Unknown Source) ~[?:1.8.0_251]
    at net.minecraftforge.fml.ModContainer.transitionState(ModContainer.java:112) ~[?:?]
    at net.minecraftforge.fml.ModList.lambda$null$10(ModList.java:135) ~[?:?]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(Unknown Source) ~[?:1.8.0_251]
    at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(Unknown Source) ~[?:1.8.0_251]
    at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[?:1.8.0_251]
    at java.util.stream.ForEachOps$ForEachTask.compute(Unknown Source) ~[?:1.8.0_251]
    at java.util.concurrent.CountedCompleter.exec(Unknown Source) ~[?:1.8.0_251]
    at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) ~[?:1.8.0_251]
    at java.util.concurrent.ForkJoinTask.doInvoke(Unknown Source) ~[?:1.8.0_251]
    at java.util.concurrent.ForkJoinTask.invoke(Unknown Source) ~[?:1.8.0_251]
    at java.util.stream.ForEachOps$ForEachOp.evaluateParallel(Unknown Source) ~[?:1.8.0_251]
    at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(Unknown Source) ~[?:1.8.0_251]
    at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[?:1.8.0_251]
    at java.util.stream.ReferencePipeline.forEach(Unknown Source) ~[?:1.8.0_251]
    at java.util.stream.ReferencePipeline$Head.forEach(Unknown Source) ~[?:1.8.0_251]
    at net.minecraftforge.fml.ModList.lambda$dispatchParallelEvent$11(ModList.java:135) ~[?:?]
    at java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(Unknown Source) [?:1.8.0_251]
    at java.util.concurrent.ForkJoinTask.doExec(Unknown Source) [?:1.8.0_251]
    at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(Unknown Source) [?:1.8.0_251]
    at java.util.concurrent.ForkJoinPool.runWorker(Unknown Source) [?:1.8.0_251]
    at java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source) [?:1.8.0_251]

Expand  

 

 

Main Mod class

  Quote
Expand  

 

Capability package with providers

  Quote
Expand  

 

Event that attatches capabilities to the player

  Quote
Expand  

 

 

I know I'm doing 1 capability per variable, I've seen that you can have multiple variables in 1 capability, I just wanted to make them as simpler as posible for start.

Posted

You do understand that this line:

https://github.com/xanderindalzone/customgunsmod/blob/master/src/main/java/com/xanderindalzone/customgunsmod/CustomGunsMod.java#L93

And this line:

https://github.com/xanderindalzone/customgunsmod/blob/master/src/main/java/com/xanderindalzone/customgunsmod/CustomGunsMod.java#L89

 

Do basically the same thing, right? Lines 89 and 91 each register one method specified, line 93 registers "all annotated methods" which happens to be...one method (line 137).

 

Then you have this line:

https://github.com/xanderindalzone/customgunsmod/blob/master/src/main/java/com/xanderindalzone/customgunsmod/CustomGunsMod.java#L80

Which literally does the same thing as line 89, registering the same method a second time.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

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

    • Yes that’s the full log, I managed to get it working last night, the anvil fix mod is what was causing it to crash
    • Hey guys, i'm currently developping a mod with forge 1.12.2 2860 and i'm using optifine and gradle 4.9. The thing is i'm trying to figure out how to show the player's body in first person. So far everything's going well since i've try to use a shader. The player's body started to blink dark when using a shader. I've try a lot of shader like chocapic, zeus etc etc but still the same issue. So my question is : How should i apply the current shader to the body ? At the same time i'm also drawing a HUD so maybe it could be the problem?   Here is the issue :    And here is the code where i'm trying to display the body :    private static void renderFirstPersonBody(EntityPlayerSP player, float partialTicks) { Minecraft mc = Minecraft.getMinecraft(); GlStateManager.pushMatrix(); GlStateManager.pushAttrib(); try { // Préparation OpenGL GlStateManager.enableDepth(); GlStateManager.depthMask(true); GlStateManager.enableAlpha(); GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // Éclairage correct pour shaders GlStateManager.enableLighting(); RenderHelper.enableStandardItemLighting(); GlStateManager.enableRescaleNormal(); // Active la lightmap pour les shaders mc.entityRenderer.enableLightmap(); // Position de rendu interpolée double px = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; double py = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; double pz = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; GlStateManager.translate( px - mc.getRenderManager().viewerPosX, py - mc.getRenderManager().viewerPosY, pz - mc.getRenderManager().viewerPosZ ); // Rendu du joueur sans la tête Render<?> render = mc.getRenderManager().getEntityRenderObject(player); if (render instanceof RenderPlayer) { RenderPlayer renderPlayer = (RenderPlayer) render; boolean oldHeadHidden = renderPlayer.getMainModel().bipedHead.isHidden; boolean oldHeadwearHidden = renderPlayer.getMainModel().bipedHeadwear.isHidden; renderPlayer.getMainModel().bipedHead.isHidden = true; renderPlayer.getMainModel().bipedHeadwear.isHidden = true; setArmorHeadVisibility(renderPlayer, false); renderPlayer.doRender(player, 0, 0, 0, player.rotationYaw, partialTicks); renderPlayer.getMainModel().bipedHead.isHidden = oldHeadHidden; renderPlayer.getMainModel().bipedHeadwear.isHidden = oldHeadwearHidden; setArmorHeadVisibility(renderPlayer, !oldHeadwearHidden); } // Nettoyage post rendu mc.entityRenderer.disableLightmap(); GlStateManager.disableRescaleNormal(); } catch (Exception e) { // silent fail } finally { GlStateManager.popAttrib(); GlStateManager.popMatrix(); } }   Ty for your help. 
    • Item successfully registered, but there was a problem with the texture of the item, it did not insert and has just the wrong texture.     
    • Keep on using the original Launcher Run Vanilla 1.12.2 once and close the game Download Optifine and run optifine as installer (click on the optifine jar) Start the launcher and make sure the Optifine profile is selected - then test it again  
    • Hi everyone, I’m hoping to revisit an old version of Minecraft — specifically around Beta 1.7.3 — for nostalgia’s sake. I’ve heard you can do this through the official Minecraft Launcher, but I’m unsure how to do it safely without affecting my current installation or save files. Are there any compatibility issues I should watch out for when switching between versions? Would really appreciate any tips or advice from anyone who’s done this before! – Adam
  • Topics

×
×
  • Create New...

Important Information

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