Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[SOLVED] [1.15.2] Camera yaw issues


Novârch
 Share

Recommended Posts

I've been trying to create a remote controlled entity, it's been going pretty well so far, though I have a single issue. To move the camera I've opted for how AbstractHorseEntity does it, copying the player's yaw and pitch values. This works fine until the yaw value reaches 360, upon which it abruptly snaps to about -90 and then returns to 0. Can anyone tell me what's causing this? The code for the entity can be found here.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

4 hours ago, Novârch said:

Can anyone tell me what's causing this?

Try moving the line

prevRotationYaw = rotationYaw;

below the line

setRotation(rotationYaw, rotationPitch);

 

You could also try overriding getYaw() to simply return rotationYaw, since getYaw() is what is used to determine the viewport yaw.

  • Like 1
Link to comment
Share on other sites

15 minutes ago, vemerion said:

You could also try overriding getYaw() to simply return rotationYaw, since getYaw() is what is used to determine the viewport yaw.

This works, though it makes the rotation a heck of a lot less smooth. Nonetheless, thank you.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

  • Novârch changed the title to [SOLVED] [1.15.2] Camera yaw issues
14 minutes ago, Novârch said:

This works, though it makes the rotation a heck of a lot less smooth. Nonetheless, thank you.

Yes, the unfortunate side-effect of this solution is that it effectively reduces the update rate of the yaw rotation to 20 fps. A more sophisticated method might call super.getYaw() in most cases, and only resort to returning rotationYaw in the case when the rotation goes from 360 -> 0, or similar.

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.

Guest
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.

 Share



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • Hello Everyone! I just started learning how to code forge mods and this is my first post. I have been coding spigot plugins for 2 years so I'm not totally clueless. I just want to know how to get all the items from a Inventory/GUI. I have no clue how. I tried something like this. but it got me nowhere @SubscribeEvent public void onOpenInventory(GuiOpenEvent e) { e.getGui().itemsplsssss }  
    • I think that is the problem. I changed to using ResourceKeys instead and haven't seen the log since. 
    • That's how, thanks a lot! (≧ ▽ ≦)
    • Sorry if this is something that is solved but i cant find anything. So when I am getting hurt or about to die the game crashes.   ---- Minecraft Crash Report ---- WARNING: coremods are present:   Plugin (NotEnoughIDs-1.5.4.4.jar)   llibrary (llibrary-core-1.0.11-1.12.2.jar)   EnderCorePlugin (EnderCore-1.12.2-0.5.76-core.jar)   LucraftCoreCoreMod (LucraftCore-1.12.2-2.4.16.jar)   ForgelinPlugin (Forgelin-1.8.4.jar)   MicdoodlePlugin (MicdoodleCore-1.12.2-4.0.2.280.jar)   JustEnoughIDs Extension Plugin (JustEnoughIDs-1.0.3-55.jar)   OpenModsCorePlugin (OpenModsLib-1.12.2-0.12.2.jar)   pymtech (PymTech-1.12.2-1.0.2.jar)   SteveKunGLibPlugin (SteveKunG's-Lib-1.12.2-1.1.10.jar)   ObfuscatePlugin (obfuscate-0.4.2-1.12.2.jar)   iceandfire (iceandfire-1.9.1-1.12.2.jar) Contact their authors BEFORE contacting forge // Uh... Did I do that? Time: 9/18/21 6:11 PM Description: Ticking entity java.lang.NoClassDefFoundError: c4/conarm/lib/capabilities/ArmorAbilityHandler     at landmaster.plustic.traits.DeathSaveTrait.timing(DeathSaveTrait.java:70)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1306_DeathSaveTrait_timing_LivingHurtEvent.invoke(.dynamic)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)     at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)     at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:604)     at net.minecraft.entity.player.EntityPlayer.func_70665_d(EntityPlayer.java:1120)     at net.minecraft.entity.EntityLivingBase.func_70097_a(EntityLivingBase.java:918)     at net.minecraft.entity.player.EntityPlayer.func_70097_a(EntityPlayer.java:1038)     at net.minecraft.entity.player.EntityPlayerMP.func_70097_a(EntityPlayerMP.java:645)     at micdoodle8.mods.galacticraft.core.entities.player.GCEntityPlayerMP.func_70097_a(GCEntityPlayerMP.java:68)     at com.github.alexthe666.iceandfire.entity.EntityMyrmexSoldier.func_70636_d(EntityMyrmexSoldier.java:54)     at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2179)     at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:295)     at com.github.alexthe666.iceandfire.entity.EntityMyrmexBase.func_70071_h_(EntityMyrmexBase.java:240)     at net.minecraft.world.World.func_72866_a(World.java:1996)     at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:832)     at net.minecraft.world.World.func_72870_g(World.java:1958)     at net.minecraft.world.World.func_72939_s(World.java:1762)     at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613)     at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767)     at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)     at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)     at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: c4.conarm.lib.capabilities.ArmorAbilityHandler     at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:191)     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)     ... 24 more Caused by: java.lang.NullPointerException A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Server thread Stacktrace:     at landmaster.plustic.traits.DeathSaveTrait.timing(DeathSaveTrait.java:70)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler_1306_DeathSaveTrait_timing_LivingHurtEvent.invoke(.dynamic)     at net.minecraftforge.fml.common.eventhandler.ASMEventHandler.invoke(ASMEventHandler.java:90)     at net.minecraftforge.fml.common.eventhandler.EventBus.post(EventBus.java:182)     at net.minecraftforge.common.ForgeHooks.onLivingHurt(ForgeHooks.java:604)     at net.minecraft.entity.player.EntityPlayer.func_70665_d(EntityPlayer.java:1120)     at net.minecraft.entity.EntityLivingBase.func_70097_a(EntityLivingBase.java:918)     at net.minecraft.entity.player.EntityPlayer.func_70097_a(EntityPlayer.java:1038)     at net.minecraft.entity.player.EntityPlayerMP.func_70097_a(EntityPlayerMP.java:645)     at micdoodle8.mods.galacticraft.core.entities.player.GCEntityPlayerMP.func_70097_a(GCEntityPlayerMP.java:68)     at com.github.alexthe666.iceandfire.entity.EntityMyrmexSoldier.func_70636_d(EntityMyrmexSoldier.java:54)     at net.minecraft.entity.EntityLivingBase.func_70071_h_(EntityLivingBase.java:2179)     at net.minecraft.entity.EntityLiving.func_70071_h_(EntityLiving.java:295)     at com.github.alexthe666.iceandfire.entity.EntityMyrmexBase.func_70071_h_(EntityMyrmexBase.java:240)     at net.minecraft.world.World.func_72866_a(World.java:1996)     at net.minecraft.world.WorldServer.func_72866_a(WorldServer.java:832)     at net.minecraft.world.World.func_72870_g(World.java:1958) -- Entity being ticked -- Details:     Entity Type: iceandfire:myrmex_soldier (com.github.alexthe666.iceandfire.entity.EntityMyrmexSoldier)     Entity ID: 15     Entity Name: Myrmex Soldier     Entity's Exact location: -183.34, 61.00, -11.63     Entity's Block location: World: (-184,61,-12), Chunk: (at 8,3,4 in -12,-1; contains blocks -192,0,-16 to -177,255,-1), Region: (-1,-1; contains chunks -32,-32 to -1,-1, blocks -512,0,-512 to -1,255,-1)     Entity's Momentum: -0.04, -0.08, -0.14     Entity's Passengers: []     Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace:     at net.minecraft.world.World.func_72939_s(World.java:1762)     at net.minecraft.world.WorldServer.func_72939_s(WorldServer.java:613) -- Affected level -- Details:     Level name: New World     All players: 1 total; [GCEntityPlayerMP['Altutium'/390, l='New World', x=-183.77, y=61.00, z=-12.57]]     Chunk stats: ServerChunkCache: 769 Drop: 0     Level seed: 2105410062015924141     Level generator: ID 00 - default, ver 1. Features enabled: true     Level generator options:      Level spawn location: World: (8,64,8), Chunk: (at 8,4,8 in 0,0; contains blocks 0,0,0 to 15,255,15), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)     Level time: 10758 game time, 10758 day time     Level dimension: 0     Level storage version: 0x04ABD - Anvil     Level weather: Rain time: 5018 (now: false), thunder time: 119120 (now: false)     Level game mode: Game mode: survival (ID 0). Hardcore: false. Cheats: false Stacktrace:     at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:767)     at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:668)     at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:185)     at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:526)     at java.lang.Thread.run(Thread.java:745) -- System Details -- Details:     Minecraft Version: 1.12.2     Operating System: Windows 10 (amd64) version 10.0     Java Version: 1.8.0_51, Oracle Corporation     Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation     Memory: 2523489512 bytes (2406 MB) / 5603590144 bytes (5344 MB) up to 6442450944 bytes (6144 MB)     JVM Flags: 8 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xmx6G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     IntCache: cache: 0, tcache: 0, allocated: 12, tallocated: 94     FML: MCP 9.42 Powered by Forge 14.23.5.2855 95 mods loaded, 95 mods active     States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.