Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
Я немного переделал, работает так же.А откуда этот кусок кода? У мя там немного по-другому
Разные варики пробовал, всегда руинит код, ифы мне повырезал половину, ваще хз что творится)А мест для вставки больше одного? ordinal чему равен?
@Override
public void onLivingUpdate() {
ClientProxyCore.playerClientHandler.onLivingUpdatePre(this);
try {
if (this.world.provider instanceof IZeroGDimension) {
//Какой-то код который мне не нужно чтоб выполнялся
} else {
//Мне необходимо чтоб выполнялся именно этот код всегда
super.onLivingUpdate();
}
} catch (RuntimeException e) {}
}
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:debug:20]: [DEBUG] Injecting hooks into class micdoodle8.mods.galacticraft.core.entities.player.GCEntityClientPlayerMP
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:30]: [SEVERE] A problem has occurred during transformation of class micdoodle8.mods.galacticraft.core.entities.player.GCEntityClientPlayerMP.
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:30]: [SEVERE] Attached hooks:
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:30]: [SEVERE] AsmHook: micdoodle8.mods.galacticraft.core.entities.player.GCEntityClientPlayerMP#onLivingUpdate() -> ru.kreatifchk.improvements.Hooks#onLivingUpdate(Lmicdoodle8/mods/galacticraft/core/entities/player/GCEntityClientPlayerMP;)V, ReturnCondition=ALWAYS, ReturnValue=VOID, InjectorFactory: author.hooklib.asm.HookInjectorFactory$ByAnchor, CreateMethod = false
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:30]: [SEVERE] Stack trace:
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: java.lang.NullPointerException
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at author.hooklib.asm.HookClassTransformer.transform(HookClassTransformer.java:51)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at author.hooklib.minecraft.MinecraftClassTransformer.transform(MinecraftClassTransformer.java:66)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:279)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:176)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at net.minecraft.block.BlockFire.func_149843_e(BlockFire.java:99)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at net.minecraft.init.Bootstrap.func_151354_b(Bootstrap.java:499)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at net.minecraft.client.Minecraft.<init>(Minecraft.java:365)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at net.minecraft.client.main.Main.main(SourceFile:123)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at java.lang.reflect.Method.invoke(Method.java:497)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:severe:36]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
[19:27:31] [Client thread/INFO]: [author.hooklib.asm.HookLogger$SystemOutLogger:warning:25]: [WARNING] Can not find target method of hook AsmHook: micdoodle8.mods.galacticraft.core.entities.player.GCEntityClientPlayerMP#onLivingUpdate() -> ru.kreatifchk.improvements.Hooks#onLivingUpdate(Lmicdoodle8/mods/galacticraft/core/entities/player/GCEntityClientPlayerMP;)V, ReturnCondition=ALWAYS, ReturnValue=VOID, InjectorFactory: author.hooklib.asm.HookInjectorFactory$ByAnchor, CreateMethod = false
[19:27:31] [Client thread/ERROR]: Unable to launch
java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_51]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_51]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_51]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:1.8.0_51]
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?]
at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?]
Caused by: java.lang.NoClassDefFoundError: micdoodle8/mods/galacticraft/core/entities/player/GCEntityClientPlayerMP
at net.minecraft.block.BlockFire.func_149843_e(BlockFire.java:99) ~[aqq.class:?]
at net.minecraft.init.Bootstrap.func_151354_b(Bootstrap.java:499) ~[ni.class:?]
at net.minecraft.client.Minecraft.<init>(Minecraft.java:365) ~[bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) ~[Main.class:?]
... 6 more
Caused by: java.lang.ClassNotFoundException: micdoodle8.mods.galacticraft.core.entities.player.GCEntityClientPlayerMP
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191) ~[launchwrapper-1.12.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_51]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_51]
at net.minecraft.block.BlockFire.func_149843_e(BlockFire.java:99) ~[aqq.class:?]
at net.minecraft.init.Bootstrap.func_151354_b(Bootstrap.java:499) ~[ni.class:?]
at net.minecraft.client.Minecraft.<init>(Minecraft.java:365) ~[bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) ~[Main.class:?]
... 6 more
Caused by: java.lang.NullPointerException
at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:182) ~[launchwrapper-1.12.jar:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_51]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_51]
at net.minecraft.block.BlockFire.func_149843_e(BlockFire.java:99) ~[aqq.class:?]
at net.minecraft.init.Bootstrap.func_151354_b(Bootstrap.java:499) ~[ni.class:?]
at net.minecraft.client.Minecraft.<init>(Minecraft.java:365) ~[bib.class:?]
at net.minecraft.client.main.Main.main(SourceFile:123) ~[Main.class:?]
@Hook(at = @At(point = InjectionPoint.HEAD), returnCondition = ReturnCondition.ALWAYS)
public static void onLivingUpdate(GCEntityClientPlayerMP gc) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchFieldException, SecurityException, NoSuchMethodException {
boolean gravPlayer = !ServerPacketHandler.gravPlayer;
//С сервера приходит пакет, когда EntityPlayer оказывается в определенной зоне
if (gravPlayer) {
ClientProxyCore.playerClientHandler.onLivingUpdatePre(gc);
}
LivingHook.onLivingUpdate(gc);
//В данном классе скопированы методы onLivingUpdate из EntityPlayerSP, EntityPlayer и EntityLivingBase
if (gravPlayer) {
ClientProxyCore.playerClientHandler.onLivingUpdatePost(gc);
}
ServerPacketHandler.gravPlayer = false;
}
dependencies = "required-after:micdoodlecore;required-after:galacticraftcore")
У мя на этой строчкеat author.hooklib.asm.HookClassTransformer.transform(HookClassTransformer.java:51)
boolean java7 = majorVersion > 50; И там npe неоткуда взяться, пхд, у тя старая версия. Скинь че у тя на той строчкеint majorVersion = ((bytecode[6] & 0xFF) << 8) | (bytecode[7] & 0xFF);
int majorVersion = ((bytecode[6] & 0xFF) << 8) | (bytecode[7] & 0xFF);