Jump to content

Recommended Posts

Posted (edited)

So, I made my own Mod, and i Tried to Run it with the 1.8FML Versison (I used the MDK for 1.8, i tried download the 1.8 forge but it gave me 1.8.9 instead so i was need to use to the 1.8FML Forge Versison)

 

And when i try Run it on my MC it keeps getting the Error "java.lang.NoClassSeffounder" Error,

 

My Code is Completly fine and All.

 

What's Wrong?

Do i need To Add a specific code to my Mod?

 

By the way, i did exchanged it to a Jar file. so it wont be that problem.

 

Please Answer.

 

Thanks.

 

Edited by Modder123
Error Changed, diffrent Error got solved.
Posted
  On 7/5/2017 at 6:17 AM, Modder123 said:

So, I made my own Mod, and i Tried to Run it with the 1.8FML Versison (I used the MDK for 1.8, i tried download the 1.8 forge but it gave me 1.8.9 instead so i was need to use to the 1.8FML Forge Versison)

 

And when i try Run it on my MC it keeps getting the Error "java.lang.NoClassSeffounder" Error,

 

My Code is Completly fine and All.

 

What's Wrong?

Do i need To Add a specific code to my Mod?

 

By the way, i did exchanged it to a Jar file. so it wont be that problem.

 

Please Answer.

 

Thanks.

 

Expand  

When i'm looking at the Minecraft Log it saying it Missing "signature files" How i Get "Signature files?"

Posted

Post the FML log (logs/fml-client-latest.log in the game directory) using Gist or Pastebin.

 

How exactly did you build you mod?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 7/5/2017 at 6:23 AM, Choonster said:

Post the FML log (logs/fml-client-latest.log in the game directory) using Gist or Pastebin.

 

How exactly did you build you mod?

Expand  

I built it using Eclipse and here is the Error log:

09:20:43 FML Client thread error Fatal errors were detected during the transition from PREINITIALIZATION to INITIALIZATION. Loading cannot continue
09:20:43 FML Client thread error mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{8.0.127.1103} [Forge Mod Loader] (fml-1.8-8.0.127.1103.jar) Unloaded->Constructed->Pre-initialized HM{1.0} [Hypixel Chat Manager Mod] (HM-1.0.jar) Unloaded->Constructed->Errored
09:20:43 FML Client thread error The following problems were captured during this phase
09:20:43 FML Client thread error Caught exception from HM java.lang.NoClassDefFoundError: net/minecraftforge/common/MinecraftForge at com.XxDanielMCYTxX.hypixelchat1.HypixelChat1.preInit(HypixelChat1.java:17) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:527) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:245) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:414) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:326) at net.minecraft.client.main.Main.main(SourceFile:120) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: net.minecraftforge.common.MinecraftForge at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 38 more
09:20:43 STDOUT Client thread info [net.minecraft.init.Bootstrap:func_179870_a:492]: ---- Minecraft Crash Report ---- // I'm sorry, Dave. Time: 7/5/17 9:20 AM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraftforge/common/MinecraftForge at net.minecraftforge.fml.common.LoadController.transition(LoadController.java:163) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:529) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:245) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:414) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:326) at net.minecraft.client.main.Main.main(SourceFile:120) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.NoClassDefFoundError: net/minecraftforge/common/MinecraftForge at com.XxDanielMCYTxX.hypixelchat1.HypixelChat1.preInit(HypixelChat1.java:17) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:537) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:212) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:190) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:119) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:527) ... 10 more Caused by: java.lang.ClassNotFoundException: net.minecraftforge.common.MinecraftForge at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:101) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 38 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.8 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_25, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 110142736 bytes (105 MB) / 280391680 bytes (267 MB) up to 1060372480 bytes (1011 MB) JVM Flags: 6 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx1G -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:-UseAdaptiveSizePolicy -Xmn128M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.10 FML v8.0.127.1103 3 mods loaded, 3 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized FML{8.0.127.1103} [Forge Mod Loader] (fml-1.8-8.0.127.1103.jar) Unloaded->Constructed->Pre-initialized HM{1.0} [Hypixel Chat Manager Mod] (HM-1.0.jar) Unloaded->Constructed->Errored Loaded coremods (and transformers): GL info: ' Vendor: 'Intel' Version: '3.1.0 - Build 9.17.10.3040' Renderer: 'Intel(R) HD Graphics 3000
Posted

In future, please post the entire FML log. The snippets you posted appear to be from a different log.

 

  Quote
java.lang.NoClassDefFoundError: net/minecraftforge/common/MinecraftForge
...
FML: MCP v9.10 FML v8.0.127.1103 3 mods loaded, 3 mods active
    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized
    FML{8.0.127.1103} [Forge Mod Loader] (fml-1.8-8.0.127.1103.jar) Unloaded->Constructed->Pre-initialized
    HM{1.0} [Hypixel Chat Manager Mod] (HM-1.0.jar) Unloaded->Constructed->Errored
Expand  

 

You appear to be running FML without Forge, but your mod uses at least one class from Forge (and using FML by itself isn't supported). Forge includes FML, so use Forge.

 

You should be able to download a 1.8 version of Forge from the main Files site.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted (edited)
  On 7/5/2017 at 7:04 AM, Choonster said:

In future, please post the entire FML log. The snippets you posted appear to be from a different log.

 

 

You appear to be running FML without Forge, but your mod uses at least one class from Forge (and using FML by itself isn't supported). Forge includes FML, so use Forge.

 

You should be able to download a 1.8 version of Forge from the main Files site.

Expand  

I Tried that, but when it opening the minecraft it opens 1.8.9 And not 1.8 as the download (main site) said.

but I'll try again.

Edited by Modder123
Posted
  On 7/5/2017 at 7:04 AM, Choonster said:

In future, please post the entire FML log. The snippets you posted appear to be from a different log.

 

 

You appear to be running FML without Forge, but your mod uses at least one class from Forge (and using FML by itself isn't supported). Forge includes FML, so use Forge.

 

You should be able to download a 1.8 version of Forge from the main Files site.

Expand  

And the For the full log:https://pastebin.com/yJW8GGqM

Posted
  On 7/5/2017 at 7:30 AM, Modder123 said:

I Tried that, but when it opening the minecraft it opens 1.8.9 And not 1.8 as the download (main site) said.

but I'll try again.

Expand  

The game loaded up But the Mod didn't work (it said a Signature Error)

 

is there Fix for that?

Posted
  On 7/5/2017 at 7:31 AM, Modder123 said:

And the For the full log:https://pastebin.com/yJW8GGqM

Expand  

 

That's the crash report, not the FML log. As I said previously, the FML log is the logs/fml-client-latest.log file in the game directory.

 

  On 7/5/2017 at 7:30 AM, Modder123 said:

I'll Tried that, but when it opening the minecraft it opens 1.8.9 And not 1.8 as the download (main site) said.

Expand  

 

Did you select the correct Forge version in the launcher profile?

 

MGMiefA.png

 

 

  On 7/5/2017 at 7:35 AM, Modder123 said:

The game loaded up But the Mod didn't work (it said a Signature Error)

Expand  

 

Post the full FML log (the actual FML log, not a different log or a crash report) from a session where this happens.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 7/5/2017 at 7:48 AM, Choonster said:

 

That's the crash report, not the FML log. As I said previously, the FML log is the logs/fml-client-latest.log file in the game directory.

 

 

Did you select the correct Forge version in the launcher profile?

 

MGMiefA.png

 

 

 

Post the full FML log (the actual FML log, not a different log or a crash report) from a session where this happens.

Expand  

FML Log:https://pastebin.com/94dipRZ5

Posted
  On 7/5/2017 at 7:51 AM, Modder123 said:
Expand  

 

That's not the full log. It doesn't appear to be the FML log, either.

 

The missing signature data error is bad if you're running Minecraft outside of the development environment, but it doesn't crash the game.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 7/5/2017 at 8:17 AM, Modder123 said:

here is the FULL log from the logs floder:

https://pastebin.com/KsTBhsyi

Expand  

 

That's closer, but it's still not the FML log. The FML log should have several DEBUG and TRACE messages, the log you linked doesn't.

 

There's no error in that log. What issue are you currently experiencing?

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 7/5/2017 at 8:43 AM, Choonster said:

 

That's closer, but it's still not the FML log. The FML log should have several DEBUG and TRACE messages, the log you linked doesn't.

 

There's no error in that log. What issue are you currently experiencing?

Expand  

OK, firstable, why you Respond like 30 minutes after i reply, And I seriously Don't understand how that's not the Log i Litearlly went to my Logs floder in .minecraft And Took it from there... Secondly, my Code is all Good but the Mod wont work.

 

Aka Signature problem.

 

Thats the problem.

Posted
  On 7/5/2017 at 8:53 AM, Modder123 said:

OK, firstable, why you Respond like 30 minutes after i reply

Expand  

Because I'm doing other things and this thread is becoming frustrating.

 

  On 7/5/2017 at 8:53 AM, Modder123 said:

And I seriously Don't understand how that's not the Log i Litearlly went to my Logs floder in .minecraft And Took it from there..

Expand  

Are you absolutely sure that you posted fml-client-latest.log? Like I said, it doesn't appear to be the correct log.

 

  On 7/5/2017 at 8:53 AM, Modder123 said:

Secondly, my Code is all Good but the Mod wont work.

 

Aka Signature problem.

Expand  

"The mod doesn't work" doesn't really tell me anything. How does it not work?

 

What's the "signature problem"? If you mean the "FML appears to be missing any signature data. This is not a good thing" message, I explained that this is bad but it doesn't crash the game or stop anything from working.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted (edited)
  On 7/5/2017 at 9:33 AM, Choonster said:

Because I'm doing other things and this thread is becoming frustrating.

 

Are you absolutely sure that you posted fml-client-latest.log? Like I said, it doesn't appear to be the correct log.

 

"The mod doesn't work" doesn't really tell me anything. How does it not work?

 

What's the "signature problem"? If you mean the "FML appears to be missing any signature data. This is not a good thing" message, I explained that this is bad but it doesn't crash the game or stop anything from working.

Expand  

For some reason, in the Logs floder in .minecraft I cannot find anything like You mentioded.

 

I see there files with Dates like: 2017-07-05 And not fml-client-lastest.log or something like that.

 

And by what i mean That mod doesn't work:

 

Ok, basically i made a Mod thats if you click a Specific Button (Basically i added a Keybind to my mod) it will execute a Command to the Server.

The thing is, it wont Send it, maybe it does send but i dont see the message, Anyways, Just incase I may coded wrong the 

Send Command to the Server code, here is the Codes:

 

KeyBinds:https://pastebin.com/hprVPhAd

 

KeybindInputHandler(the class which executes the Code for the keybind.):https://pastebin.com/Kp2QY1g1

Quick Note - About the Command inside this ^ code i typed there a command that the Server added to himself, basically, a Custom Command of the server i use the Mod to. (the server is not mine) 

 

NOTE: Those are not ALL of the mod Class codes.

 

I Hope you can tell me whats wrong with my code or with the mod.

 

Thanks.

Modder123.

Edited by Modder123
Posted

EntityPlayerSP#sendChatMessage is the correct method to send a chat message from the client (which may be a command). ClientCommandHandler#executeCommand can only execute client-side commands, not server-side commands.

 

KeyBindings should be checked in ClientTickEvent (make sure you check TickEvent#phase to avoid checking the KeyBindings in both phases of the event) rather than KeyInputEvent.

 

Have you registered an instance of KeyInputHandler with the appropriate event bus? Is the onKeyInput method being called? Set a breakpoint in the method and run Minecraft in debug mode if you're not sure.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Posted
  On 7/5/2017 at 12:13 PM, Choonster said:

Have you registered an instance of KeyInputHandler with the appropriate event bus? Is the onKeyInput method being called? Set a breakpoint in the method and run Minecraft in debug mode if you're no

Expand  

Yeah I did.

 

  On 7/5/2017 at 12:13 PM, Choonster said:

EntityPlayerSP#sendChatMessage is the correct method to send a chat message from the client (which may be a command).

Expand  

Wait, Can you give me an Example of where to put the Command In? it would help me.

 

  On 7/5/2017 at 12:13 PM, Choonster said:

KeyBindings should be checked in ClientTickEvent (make sure you check TickEvent#phase to avoid checking the KeyBindings in both phases of the event) rather than KeyInputEvent

Expand  

Where exactly to Put those methods?

 

 

I'm not the best In those Stuff... You can just ignore that message if you want... i'm really not the best in Java Coding...

 

Uh.. can you maybe Make a pastebin Explaining where goes each thing? it would help me a bit...

 

Thanks.

Modder123

Posted (edited)
  On 7/5/2017 at 12:37 PM, Modder123 said:

Yeah I did.

Expand  

So you've set a breakpoint inside the if statement in onKeyInput and it was hit? Did you try stepping through the code to see what happened?

 

  On 7/5/2017 at 12:37 PM, Modder123 said:

Wait, Can you give me an Example of where to put the Command In? it would help me.

Expand  

The way you're sending the command chat message with EntityPlayerSP#sendChatMessage should work.

 

  On 7/5/2017 at 12:37 PM, Modder123 said:

Where exactly to Put those methods?

Expand  

ClientTickEvent is an event just like KeyInputEvent, you subscribe to it in the same way. It's even fired on the same event bus (the FML bus).

 

Forge's documentation has an introduction to events here.

 

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Guest
This topic is now closed to further replies.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • dynamictrees and dtneapolitan are the last mentioned mod - remove these
    • https://mclo.gs/9y5ciD2 anyone ever had this issue?  Internal exception illegal argument exception: unable to fit 3194354 into 3
    • Hi! I'm trying to add my custom models/textures renderer like this: public class PonyPlayerWrapperRenderer extends EntityRenderer<Player> { // wrapper class under my LivingEntityRenderer class implementation private final PonyPlayerRenderer innerRenderer; private final PonyPlayerRenderer innerSlimRenderer; public PonyPlayerWrapperRenderer(final EntityRendererProvider.Context context) { super(context); System.out.println("creating new PonyPlayerWrapperRenderer"); this.innerRenderer = new PonyPlayerRenderer(context, false); this.innerSlimRenderer = new PonyPlayerRenderer(context, true); } @Override public void render(final Player entity, final float yaw, final float partialTicks, final PoseStack poseStack, final MultiBufferSource bufferSource, final int packedLight) { System.out.println("PonyPlayerWrapperRenderer render: " + entity.toString()); if (entity instanceof AbstractClientPlayer clientPlayer) { if (clientPlayer.getModelName().contains("slim")) { innerSlimRenderer.render(clientPlayer, yaw, partialTicks, poseStack, bufferSource, packedLight); } else { innerRenderer.render(clientPlayer, yaw, partialTicks, poseStack, bufferSource, packedLight); } } } @Override public ResourceLocation getTextureLocation(final Player player) { System.out.println("PonyPlayerWrapperRenderer getTextureLocation"); if (player instanceof AbstractClientPlayer clientPlayer) { return clientPlayer.getSkinTextureLocation(); } System.out.println("player instanceof AbstractClientPlayer is false"); return getDefaultSkin(player.getUUID()); } } public class PonyPlayerRenderer extends LivingEntityRenderer<AbstractClientPlayer, PlayerModel<AbstractClientPlayer>> { private final PlayerModel<AbstractClientPlayer> earthModel; private final PlayerModel<AbstractClientPlayer> pegasusModel; private final PlayerModel<AbstractClientPlayer> unicornModel; public PonyPlayerRenderer(final EntityRendererProvider.Context context, final boolean slim) { super( context, slim ? new PonyModelSlim(context.bakeLayer(PonyModelSlim.LAYER_LOCATION)) : new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)), 0.5f ); System.out.println("creating new PonyPlayerRenderer"); this.earthModel = slim ? new PonyModelSlim(context.bakeLayer(PonyModelSlim.LAYER_LOCATION)) : new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)); this.pegasusModel = new PegasusModel(context.bakeLayer(PegasusModel.LAYER_LOCATION)); this.unicornModel = new UnicornModel(context.bakeLayer(UnicornModel.LAYER_LOCATION)); } @Override public void render(final AbstractClientPlayer player, final float entityYaw, final float partialTicks, final PoseStack poseStack, final MultiBufferSource buffer, final int packedLight) { final PonyRace race = player.getCapability(PONY_DATA) .map(data -> ofNullable(data.getRace()).orElse(PonyRace.EARTH)) .orElse(PonyRace.EARTH); this.model = switch (race) { case PEGASUS -> pegasusModel; case UNICORN -> unicornModel; case EARTH -> earthModel; }; super.render(player, entityYaw, partialTicks, poseStack, buffer, packedLight); } @Override public ResourceLocation getTextureLocation(final AbstractClientPlayer player) { final PonyRace race = player.getCapability(PONY_DATA) .map(data -> ofNullable(data.getRace()).orElse(PonyRace.EARTH)) .orElse(PonyRace.EARTH); return switch (race) { case EARTH -> fromNamespaceAndPath(MODID, "textures/entity/earth_pony.png"); case PEGASUS -> fromNamespaceAndPath(MODID, "textures/entity/pegasus.png"); case UNICORN -> fromNamespaceAndPath(MODID, "textures/entity/unicorn.png"); }; } } @Mod.EventBusSubscriber(modid = MODID, bus = MOD, value = CLIENT) public class ClientRenderers { // mod bus render registration config @SubscribeEvent public static void onRegisterLayerDefinitions(final EntityRenderersEvent.RegisterLayerDefinitions event) { event.registerLayerDefinition(PonyModel.LAYER_LOCATION, PonyModel::createBodyLayer); event.registerLayerDefinition(PonyModelSlim.LAYER_LOCATION, PonyModelSlim::createBodyLayer); event.registerLayerDefinition(PegasusModel.LAYER_LOCATION, PegasusModel::createBodyLayer); event.registerLayerDefinition(UnicornModel.LAYER_LOCATION, UnicornModel::createBodyLayer); event.registerLayerDefinition(InnerPonyArmorModel.LAYER_LOCATION, InnerPonyArmorModel::createBodyLayer); event.registerLayerDefinition(OuterPonyArmorModel.LAYER_LOCATION, OuterPonyArmorModel::createBodyLayer); } @SubscribeEvent public static void onRegisterRenderers(final EntityRenderersEvent.RegisterRenderers event) { event.registerEntityRenderer(EntityType.PLAYER, PonyPlayerWrapperRenderer::new); System.out.println("onRegisterRenderers end"); } } Method onRegisterRenderers() is called and I can see it being logged. But when I enter the world, my PonyWrapperRenderer render() method doesn't ever seem to be called. I also tried to put my renderer to EntityRenderDispatcher's playerRenderers via reflection: @Mod.EventBusSubscriber(modid = MODID, bus = MOD, value = CLIENT) public class ClientRenderers { @SubscribeEvent public static void onRegisterLayerDefinitions(final EntityRenderersEvent.RegisterLayerDefinitions event) { event.registerLayerDefinition(PonyModel.LAYER_LOCATION, PonyModel::createBodyLayer); event.registerLayerDefinition(PonyModelSlim.LAYER_LOCATION, PonyModelSlim::createBodyLayer); event.registerLayerDefinition(PegasusModel.LAYER_LOCATION, PegasusModel::createBodyLayer); event.registerLayerDefinition(UnicornModel.LAYER_LOCATION, UnicornModel::createBodyLayer); event.registerLayerDefinition(InnerPonyArmorModel.LAYER_LOCATION, InnerPonyArmorModel::createBodyLayer); event.registerLayerDefinition(OuterPonyArmorModel.LAYER_LOCATION, OuterPonyArmorModel::createBodyLayer); } @SubscribeEvent public static void onClientSetup(final FMLClientSetupEvent event) { event.enqueueWork(() -> { try { final EntityRenderDispatcher dispatcher = Minecraft.getInstance().getEntityRenderDispatcher(); final Field renderersField = getEntityRenderDispatcherField("playerRenderers"); final Field itemInHandRenderer = getEntityRenderDispatcherField("itemInHandRenderer"); @SuppressWarnings("unchecked") final Map<String, EntityRenderer<? extends Player>> playerRenderers = (Map<String, EntityRenderer<? extends Player>>)renderersField.get(dispatcher); final PonyPlayerWrapperRenderer renderer = new PonyPlayerWrapperRenderer( new EntityRendererProvider.Context( dispatcher, Minecraft.getInstance().getItemRenderer(), Minecraft.getInstance().getBlockRenderer(), (ItemInHandRenderer)itemInHandRenderer.get(dispatcher), Minecraft.getInstance().getResourceManager(), Minecraft.getInstance().getEntityModels(), Minecraft.getInstance().font ) ); playerRenderers.put("default", renderer); playerRenderers.put("slim", renderer); System.out.println("Player renderers replaced"); } catch (final Exception e) { throw new RuntimeException("Failed to replace player renderers", e); } }); } private static Field getEntityRenderDispatcherField(final String fieldName) throws NoSuchFieldException { final Field field = EntityRenderDispatcher.class.getDeclaredField(fieldName); field.setAccessible(true); return field; } } But I receive the error before Minecraft Client appears (RuntimeException: Failed to replace player renderers - from ClientRenderers onClientSetup() method - and its cause below): java.lang.IllegalArgumentException: No model for layer anotherlittlepony:earth_pony#main at net.minecraft.client.model.geom.EntityModelSet.bakeLayer(EntityModelSet.java:18) ~[forge-1.20.1-47.4.0_mapped_official_1.20.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.entity.EntityRendererProvider$Context.bakeLayer(EntityRendererProvider.java:69) ~[forge-1.20.1-47.4.0_mapped_official_1.20.1-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at com.thuggeelya.anotherlittlepony.client.renderer.pony.PonyPlayerRenderer.<init>(PonyPlayerRenderer.java:32) ~[main/:?] {re:classloading} at com.thuggeelya.anotherlittlepony.client.renderer.pony.PonyPlayerWrapperRenderer.<init>(PonyPlayerWrapperRenderer.java:24) ~[main/:?] {re:classloading} at com.thuggeelya.anotherlittlepony.client.renderer.ClientRenderers.lambda$onClientSetup$0(ClientRenderers.java:79) ~[main/:?] {re:classloading} ... 33 more Problem appears when EntityRendererProvider context tries to bakeLayer with my model layer location: new PonyModel(context.bakeLayer(PonyModel.LAYER_LOCATION)); // PonyPlayerRenderer.java:32 public class PonyModel extends PlayerModel<AbstractClientPlayer> { // the model class itself public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation( ResourceLocation.fromNamespaceAndPath(MODID, "earth_pony"), "main" ); public PonyModel(final ModelPart root) { super(root, false); } public static LayerDefinition createBodyLayer() { // some CubeListBuilder stuff for model appearance } } Textures PNGs are placed at: resources/assets/[my mod id]/textures/entity. My forge version is 1.20.1. Would appreciate any help.
    • Well, a bit more information about what you're trying to do would be helpful. e.g. why you're trying to use "INVOKE_ASSIGN" instead of "INVOKE". "INVOKE_ASSIGN" calls your code after the "target" is called and its value is stored, if applicable. "INVOKE" calls your code before the target is called. "target" expects a fully qualified name, as per the SpongePowered docs, if that name is going to be remapped (which it will be if your injecting into Minecraft itself and not another mod). For more information on fully qualified names versus canonical names, see the Java specifications. Here's an example of a working "@At" from my own code that targets the "getClosestsVulnerablePlayerToEntity" call inside a mob's logic: @At(value = "INVOKE_ASSIGN", target = "net.minecraft.world.World.getClosestVulnerablePlayerToEntity(Lnet/minecraft/entity/Entity;D)Lnet/minecraft/entity/player/EntityPlayer;") Hope this helps!
    • Ran it one more time just to check, and there's no errors this time on the log??? Log : https://mclo.gs/LnuaAiu I tried allocating more memory to the modpack, around 8000MB and it's still the same; stopping at "LOAD_REGISTRIES". Are some of the mods clashing, maybe? I have no clue what to do LOL
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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