illusivesoulworks / constructsarmory

A Tinkers' Construct add-on for those looking to enter the world of armor
https://www.curseforge.com/minecraft/mc-mods/constructs-armory
Other
54 stars 36 forks source link

Knockback events are not wrapped as CraftTweaker event type for ContentTweaker support #222

Closed nihiltres closed 4 years ago

nihiltres commented 4 years ago

In c4.conarm.integrations.contenttweaker.traits.CoTArmorTrait, in the onKnockback method, the event is provided to the ContentTweaker function as a raw event (net.minecraftforge.event.entity.living.LivingKnockBackEvent). This means that the handler isn't usable in practice.

To be usable by ContentTweaker, the event should be wrapped as a CraftTweaker event (the crafttweaker.api.event.LivingKnockBackEvent interface), probably by replacing evt in the method body with something like new MCLivingKnockBackEvent(evt).

The support in CraftTweaker for wrapping this event is brand-new, so don't fret that this wasn't handled properly before. :)

Fatetaker-voidwalker commented 4 years ago

This error is back in [1.2.5.8] - 2020.05.03

TheIllusiveC4 commented 4 years ago

@Fatetaker-voidwalker When was the last version in which it was working? I didn't change anything about this fix since the first iteration, and the event is still wrapped by the CraftTweaker event type as it should be.

dwentz89 commented 4 years ago

I just ran into an error that I think is related to this issue:

---- Minecraft Crash Report ---- // On the bright side, I bought you a teddy bear!

Time: 8/14/20 6:36 PM Description: There was a severe problem during mod loading that has caused the game to fail

net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from CraftTweaker2 (crafttweaker) Caused by: java.lang.NoClassDefFoundError: crafttweaker/api/event/LivingKnockBackEvent at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.getDeclaredMethods(Class.java:1975) at crafttweaker.CraftTweakerAPI.registerClass(CraftTweakerAPI.java:252) at crafttweaker.mc1120.CraftTweaker.lambda$onPreInitialization$0(CraftTweaker.java:110) at crafttweaker.mc1120.CraftTweaker$$Lambda$111/1420214445.accept(Unknown Source) at java.lang.Iterable.forEach(Iterable.java:75) at crafttweaker.mc1120.CraftTweaker.onPreInitialization(CraftTweaker.java:102) 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:497) at net.minecraftforge.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:637) 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:497) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:219) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:197) 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:497) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:136) at net.minecraftforge.fml.common.Loader.preinitializeMods(Loader.java:629) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:252) at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:467) at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:378) at net.minecraft.client.main.Main.main(SourceFile:123) 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:497) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) Caused by: java.lang.ClassNotFoundException: crafttweaker.api.event.LivingKnockBackEvent 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) ... 49 more

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

-- System Details -- Details: Minecraft Version: 1.12.2 Operating System: Windows 8.1 (amd64) version 6.3 Java Version: 1.8.0_51, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 2860385680 bytes (2727 MB) / 3221225472 bytes (3072 MB) up to 3221225472 bytes (3072 MB) JVM Flags: 9 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xms3072M -Xmx3072M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.42 Powered by Forge 14.23.5.2847 10 mods loaded, 10 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored

State ID Version Source Signature
LCH minecraft 1.12.2 minecraft.jar None
LCH mcp 9.42 minecraft.jar None
LCH FML 8.0.99.99 forge-1.12.2-14.23.5.2847.jar None
LCH forge 14.23.5.2847 forge-1.12.2-14.23.5.2847.jar None
LCE crafttweaker 4.1.19 CraftTweaker2-1.12-4.1.19.jar None
LC mantle 1.12-1.3.3.55 Mantle-1.12-1.3.3.55.jar None
LC tconstruct 1.12.2-2.13.0.183 TConstruct-1.12.2-2.13.0.183.jar None
LC conarm 1.2.5.9 conarm-1.12.2-1.2.5.9.jar 2484ef4d131fdc0dca0647aa21b7b944ddb935a1
LC ctgui 1.0.0 CraftTweaker2-1.12-4.1.19.jar None
LC crafttweakerjei 2.0.3 CraftTweaker2-1.12-4.1.19.jar None

Loaded coremods (and transformers): GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.5.13399 Compatibility Profile Context 15.200.1062.1004' Renderer: 'AMD Radeon HD 6670' Pulsar/tconstruct loaded Pulses:

  • TinkerCommons (Enabled/Forced)
  • TinkerWorld (Enabled/Not Forced)
  • TinkerTools (Enabled/Not Forced)
  • TinkerHarvestTools (Enabled/Forced)
  • TinkerMeleeWeapons (Enabled/Forced)
  • TinkerRangedWeapons (Enabled/Forced)
  • TinkerModifiers (Enabled/Forced)
  • TinkerSmeltery (Enabled/Not Forced)
  • TinkerGadgets (Enabled/Not Forced)
  • TinkerOredict (Enabled/Forced)
  • TinkerIntegration (Enabled/Forced)
  • TinkerFluids (Enabled/Forced)
  • TinkerMaterials (Enabled/Forced)
  • TinkerModelRegister (Enabled/Forced)
TheIllusiveC4 commented 4 years ago

@dwentz89 Update your CraftTweaker to the latest version.

dwentz89 commented 4 years ago

@TheIllusiveC4 Thanks, that fixed it. I had no idea that was so out of date.