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

[SOLVED] TESR - rotations


Cadiboo
 Share

Recommended Posts

Does anyone know how I would rotate an object to look at a point (xyz entity location) in my TESR? I've gotten my 3 axis rotating perfectly when I only do one of them, but when I try to do all 3 of them, it doesn't work at all. (I'm using GlStateManager.rotate(angle, x, y, z) rather that Quaternions because I just cannot understand them). I'm relatively new to rendering, and haven't rendered anything more complex than ItemBlocks & Models in my TESRs before. Any help would be greatly appreciated.

Link to the file in my GitHub: https://github.com/Cadiboo/WIPTech/blob/master/src/main/java/cadiboo/wiptech/client/render/tileentity/TESRWire.java

Same code but with most comments removed

	@Override
	public void render(TileEntityWire tileEntity, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
		
      	if (tileEntity.electrocutionTime > 0) {
      		
			double dX; //entity xy&z - set later
			double dY;
			double dZ;
			final int NumberOfBranches = 1; //for rendering the electricity
			final int NumberOfPossibleSubBranches = 2;
		
			List<Entity> entities = tileEntity.getAllEntitiesWithinRangeAt(tileEntity.getPos().getX(), tileEntity.getPos().getY(), tileEntity.getPos().getZ(), 113);
			for (int i = 0; i < entities.size(); i++) {
              
            	GlStateManager.pushMatrix();
				GlStateManager.translate(x + 0.5, y + 0.5, z + 0.5);
              
              	dX = entities.get(i).posX - tileEntity.getPos().getX() - 0.5;
				dY = entities.get(i).posY - tileEntity.getPos().getY() - 0.5;
				dZ = entities.get(i).posZ - tileEntity.getPos().getZ() - 0.5;
              
              
              	//Y rotation
              	double aa = dX;
				double bb = dZ;
				double cc = Math.sqrt(aa * aa + bb * bb);

				double angle = 180F / Math.PI * Math.acos((bb * bb - (-cc * cc) - aa * aa) / (2 * bb * cc));
              
             	GlStateManager.rotate(90F + (float) angle * (aa < 0 ? -1 : 1), 0, 1, 0);
              
              	//X rotation
              	aa = dY;
				bb = dX;
				cc = Math.sqrt(aa * aa + bb * bb);

				angle = 180F / Math.PI * Math.acos((bb * bb - (-cc * cc) - aa * aa) / (2 * bb * cc));

				//GlStateManager.rotate(70F + (float) angle * (aa < 0 ? -1 : 1), 0, 0, 1);
              
              	//Z rotation
              
              	aa = dY;
				bb = dZ;
				cc = Math.sqrt(aa * aa + bb * bb);

				angle = 180F / Math.PI * Math.acos((bb * bb - (-cc * cc) - aa * aa) / (2 * bb * cc));

				GlStateManager.rotate(270F + (float) angle * (aa < 0 ? 1 : -1), 1, 0, 0);
              
              	//... render electricity
              
              GlStateManager.popMatrix();
              
            }
		}
      //... render wires
    }

 

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

I think your problem here is that rotations are fundamentally a 4-axis object and you're trying to piecemeal it with three. Yes, Euler Angles are a Thing, but they suffer from gimbal lock.

 

This is the closest thing I can find that has the right math:

https://stackoverflow.com/questions/14720264/create-a-rotation-matrix-from-a-position-and-a-look-at-position

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.

Link to comment
Share on other sites

17 hours ago, Draco18s said:

I think your problem here is that rotations are fundamentally a 4-axis object and you're trying to piecemeal it with three. Yes, Euler Angles are a Thing, but they suffer from gimbal lock.

 

This is the closest thing I can find that has the right math:

https://stackoverflow.com/questions/14720264/create-a-rotation-matrix-from-a-position-and-a-look-at-position

What is the 4th axis??? (time aha?)

Its not gimbal lock so much as that when I rotate on 1 axis the other 2 axis rotate with it. This is as everything should be, but for my code I NEED them not to rotate (or better maths). I also don't understand Matrixes (Matricies??) or Quaternions at all and I don't really understand vectors very well either. I've set myself to fail pretty badly

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

4 hours ago, Cadiboo said:

What is the 4th axis???

Feel free to read up: https://en.wikipedia.org/wiki/Quaternion

4 hours ago, Cadiboo said:

when I rotate on 1 axis the other 2 axis rotate with it.

This is expected for one of two reasons:

1) GL deals with rotation as a quaternion and when you make an adjustment in Euler, the end result is not neccessarily the same Euler (to avoid gimbal lock)

2) Rotation around a rotated axis changes all of the Euler values from a non-rotated reference frame.

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.

Link to comment
Share on other sites

9 hours ago, Draco18s said:

Feel free to read up: https://en.wikipedia.org/wiki/Quaternion

This is expected for one of two reasons:

1) GL deals with rotation as a quaternion and when you make an adjustment in Euler, the end result is not neccessarily the same Euler (to avoid gimbal lock)

2) Rotation around a rotated axis changes all of the Euler values from a non-rotated reference frame.

Thanks! The maths for quaternions is over my head for the moment (I’m trying to fix this). You specified that because I was using Euler angles the axis were also rotated, do you know (off the top of your head) if there is a way use quaternions to avoid this?

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

*I* don't understand quaternions. I just know what they're good for.

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.

Link to comment
Share on other sites

2 minutes ago, Draco18s said:

*I* don't understand quaternions. I just know what they're good for.

All good thanks for the help!

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

After ≈ 6 days of solid work I have made it work, I hope this helps someone.

you find your y rotation through Math.atan2(originX - pointX, originZ - pointZ);

and your up down (z/x) rotation through Math.atan2(originY - pointY, Math.sqrt(originX * originX + originZ * originZ) - Math.sqrt(pointX * pointX + pointZ * pointZ);

 

then you convert both from radians to degrees.

then you rotate around your y axis by your y rotation

GlStateManager.rotate((float) yAngle + 90, 0, 1, 0);

 

then you rotate around your x or z angle (I chose z because a) your normal rotation order is Y, Z, X and b) I was already using x for rotating my object 180 degrees from straight down to straight up)

GlStateManager.rotate(90 - (float) _Angle, 0, 0, 1);

 

I really hope this helps someone.

Here is the full java code that I used

 

Entity Position code (removes render shake)

Spoiler

double flyingMultiplier = 1.825;

double yFlying = 1.02;

double yAdd = 0.0784000015258789;

 

if (entities.get(i) instanceof EntityPlayer) {

if (((EntityPlayer) entities.get(i)).capabilities.isFlying) {

flyingMultiplier = 1.1;

yFlying = 1.67;

yAdd = 0;

}

}

 

double yGround = entities.get(i).motionY + yAdd == 0 && entities.get(i).prevPosY > entities.get(i).posY ? entities.get(i).posY - entities.get(i).prevPosY : 0;

double xFall = 1;

if (flyingMultiplier == 1.825) {

if (entities.get(i).motionX != 0) {

if (entities.get(i).motionY + yAdd != 0) {

xFall = 0.6;

} else if (yGround != 0) {

xFall = 0.6;

}

} else {

xFall = 0.6;

}

}

 

double zFall = 1;

if (flyingMultiplier == 1.825) {

if (entities.get(i).motionZ != 0) {

if (entities.get(i).motionY + yAdd != 0) {

zFall = 0.6;

} else if (yGround != 0) {

zFall = 0.6;

}

} else {

zFall = 0.6;

}

}

 

double dX = entities.get(i).posX - (entities.get(i).prevPosX - entities.get(i).posX) * partialTicks - (entities.get(i).motionX * xFall) * flyingMultiplier - tileEntity.getPos().getX() - 0.5;

double dY = entities.get(i).posY - yGround - (entities.get(i).prevPosY - entities.get(i).posY) * partialTicks - (entities.get(i).motionY + yAdd) * yFlying - tileEntity.getPos().getY() - 0.5;

double dZ = entities.get(i).posZ - (entities.get(i).prevPosZ - entities.get(i).posZ) * partialTicks - (entities.get(i).motionZ * zFall) * flyingMultiplier - tileEntity.getPos().getZ() - 0.5;

dY += entities.get(i).getEyeHeight();

 

Rotation code

//get Y angle
double yAngle = Math.atan2(0 - dX, 0 - dZ);
//convert angle to degrees
yAngle = yAngle * (180 / Math.PI);
yAngle = yAngle < 0 ? 360 - (-yAngle) : yAngle;
//rotate by angle
GlStateManager.rotate((float) yAngle + 90, 0, 1, 0);
//rotate object (It starts facing down, I want it to start facing up)
GlStateManager.rotate(180, 1, 0, 0);

//get Up/Down (X/Z) angle
double _Angle = Math.atan2(dY, Math.sqrt(dX * dX + dZ * dZ));
//convert angle to degrees
_Angle = _Angle * (180 / Math.PI);
_Angle = _Angle < 0 ? 360 - (-_Angle) : _Angle;
//rotate by angle
GlStateManager.rotate(90 - (float) _Angle, 0, 0, 1);

//...draw object

 

GitHub perma-link (High-accuracy entity positioning and object rotation)

https://github.com/Cadiboo/WIPTech/blob/1bc15df55251b6631d31b6d101ae5a729ed2a4ca/src/main/java/cadiboo/wiptech/client/render/tileentity/TESRWire.java#L77-L126

Edited by Cadiboo
added GitHub perma-link

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.
Note: Your post will require moderator approval before it will be visible.

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

    • User was banned for piracy. Buy the game.
    • So, i have installed some mods and i keep getting this error when loading or creating worlds. Here is the crash report:       ---- Minecraft Crash Report ---- // I let you down. Sorry Time: 2021.12.01. 12:05 Description: Ticking player java.lang.BootstrapMethodError: java.lang.LinkageError: loader constraint violation: loader (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading for a different type with name "org/apache/logging/log4j/util/MessageSupplier"     at net.minecraftforge.eventbus.EventBus.handleException(EventBus.java:316) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:307) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.common.ForgeHooks.onLivingUpdate(ForgeHooks.java:340) ~[?:?] {re:classloading}     at net.minecraft.entity.LivingEntity.func_70071_h_(LivingEntity.java:2112) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:LivingEntityMixin,pl:mixin:APP:assets/botania/botania.mixins.json:AccessorLivingEntity,pl:mixin:A}     at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:223) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:tlskincape:PlayerEntityTransformer,re:classloading,pl:accesstransformer:B,xf:fml:tlskincape:PlayerEntityTransformer,pl:mixin:APP:assets/botania/botania.mixins.json:MixinPlayerEntity,pl:mixin:A,re:computing_frames,pl:accesstransformer:B,xf:fml:tlskincape:PlayerEntityTransformer}     at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:404) ~[?:?] {re:classloading,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}     at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:207) ~[?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:226) ~[?:?] {re:classloading,re:mixin}     at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) ~[?:?] {re:classloading}     at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) ~[?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:118) ~[?:?] {re:classloading,xf:OptiFine:default}     at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) [?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) [?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer$$Lambda$12200/991723054.run(Unknown Source) [?:?] {}     at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51] {} Caused by: java.lang.LinkageError: loader constraint violation: loader (instance of sun/misc/Launcher$AppClassLoader) previously initiated loading for a different type with name "org/apache/logging/log4j/util/MessageSupplier"     at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_51] {}     at java.lang.ClassLoader.defineClass(ClassLoader.java:760) ~[?:1.8.0_51] {}     at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[?:1.8.0_51] {}     at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) ~[?:1.8.0_51] {}     at java.net.URLClassLoader.access$100(URLClassLoader.java:73) ~[?:1.8.0_51] {}     at java.net.URLClassLoader$1.run(URLClassLoader.java:368) ~[?:1.8.0_51] {}     at java.net.URLClassLoader$1.run(URLClassLoader.java:362) ~[?:1.8.0_51] {}     at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_51] {}     at java.net.URLClassLoader.findClass(URLClassLoader.java:361) ~[?:1.8.0_51] {}     at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_51] {}     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) ~[?:1.8.0_51] {}     at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_51] {}     ... 17 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Thread: Server thread Stacktrace:     at net.minecraftforge.eventbus.EventBus.handleException(EventBus.java:316) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:307) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.eventbus.EventBus.post(EventBus.java:283) ~[eventbus-4.0.0.jar:?] {}     at net.minecraftforge.common.ForgeHooks.onLivingUpdate(ForgeHooks.java:340) ~[?:?] {re:classloading}     at net.minecraft.entity.LivingEntity.func_70071_h_(LivingEntity.java:2112) ~[?:?] {re:mixin,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:classloading,pl:accesstransformer:B,pl:mixin:APP:citadel.mixins.json:LivingEntityMixin,pl:mixin:APP:assets/botania/botania.mixins.json:AccessorLivingEntity,pl:mixin:A}     at net.minecraft.entity.player.PlayerEntity.func_70071_h_(PlayerEntity.java:223) ~[?:?] {re:mixin,pl:accesstransformer:B,xf:fml:tlskincape:PlayerEntityTransformer,re:classloading,pl:accesstransformer:B,xf:fml:tlskincape:PlayerEntityTransformer,pl:mixin:APP:assets/botania/botania.mixins.json:MixinPlayerEntity,pl:mixin:A,re:computing_frames,pl:accesstransformer:B,xf:fml:tlskincape:PlayerEntityTransformer} -- Player being ticked -- Details:     Entity Type: minecraft:player (net.minecraft.entity.player.ServerPlayerEntity)     Entity ID: 150     Entity Name: thisnot5544324     Entity's Exact location: 154.50, 62.00, 128.50     Entity's Block location: World: (154,62,128), Chunk: (at 10,3,0 in 9,8; contains blocks 144,0,128 to 159,255,143), Region: (0,0; contains chunks 0,0 to 31,31, blocks 0,0,0 to 511,255,511)     Entity's Momentum: 0.00, 0.00, 0.00     Entity's Passengers: []     Entity's Vehicle: ~~ERROR~~ NullPointerException: null Stacktrace:     at net.minecraft.entity.player.ServerPlayerEntity.func_71127_g(ServerPlayerEntity.java:404) ~[?:?] {re:classloading,pl:accesstransformer:B,re:computing_frames,pl:accesstransformer:B,re:mixin,pl:accesstransformer:B}     at net.minecraft.network.play.ServerPlayNetHandler.func_73660_a(ServerPlayNetHandler.java:207) ~[?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.network.NetworkManager.func_74428_b(NetworkManager.java:226) ~[?:?] {re:classloading,re:mixin}     at net.minecraft.network.NetworkSystem.func_151269_c(NetworkSystem.java:134) ~[?:?] {re:classloading}     at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:865) ~[?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:787) ~[?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.integrated.IntegratedServer.func_71217_p(IntegratedServer.java:118) ~[?:?] {re:classloading,xf:OptiFine:default}     at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:642) [?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer.func_240783_a_(MinecraftServer.java:232) [?:?] {re:classloading,pl:accesstransformer:B}     at net.minecraft.server.MinecraftServer$$Lambda$12200/991723054.run(Unknown Source) [?:?] {}     at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51] {} -- System Details -- Details:     Minecraft Version: 1.16.5     Minecraft Version ID: 1.16.5     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: 5907582904 bytes (5633 MB) / 8556380160 bytes (8160 MB) up to 8556380160 bytes (8160 MB)     CPUs: 4     JVM Flags: 11 total; -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump -Xss1M -XX:+IgnoreUnrecognizedVMOptions -Xmn128M -Xmx8132M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M     ModLauncher: 8.0.9+86+master.3cf110c     ModLauncher launch target: fmlclient     ModLauncher naming: srg     ModLauncher services:          /mixin-0.8.4.jar mixin PLUGINSERVICE          /eventbus-4.0.0.jar eventbus PLUGINSERVICE          /forge-1.16.5-36.2.19.jar object_holder_definalize PLUGINSERVICE          /forge-1.16.5-36.2.19.jar runtime_enum_extender PLUGINSERVICE          /accesstransformers-3.0.1.jar accesstransformer PLUGINSERVICE          /forge-1.16.5-36.2.19.jar capability_inject_definalize PLUGINSERVICE          /forge-1.16.5-36.2.19.jar runtimedistcleaner PLUGINSERVICE          /mixin-0.8.4.jar mixin TRANSFORMATIONSERVICE          /OptiFine-1.16.5_HD_U_G8_pre2.jar OptiFine TRANSFORMATIONSERVICE          /forge-1.16.5-36.2.19.jar fml TRANSFORMATIONSERVICE      FML: 36.2     Forge: net.minecraftforge:36.2.19     FML Language Providers:          javafml@36.2         minecraft@1     Mod List:          ExtraWeaponsModv1.16.0.0.b270.jar                 |Extra Weapons                 |extraweapons                  |1.16.0.0.270        |DONE      |Manifest: NOSIGNATURE         mowziesmobs-1.5.19.jar                            |Mowzie's Mobs                 |mowziesmobs                   |1.5.19              |DONE      |Manifest: NOSIGNATURE         Randomizer-2.0.0.jar                              |Randomizer                    |randomizer                    |1.0.0               |DONE      |Manifest: NOSIGNATURE         jei-1.16.5-7.7.1.126.jar                          |Just Enough Items             |jei                           |7.7.1.126           |DONE      |Manifest: NOSIGNATURE         goblintraders-1.6.0-1.16.3.jar                    |Goblin Traders                |goblintraders                 |1.6.0               |DONE      |Manifest: NOSIGNATURE         torohealth-1.16.4-forge-4.jar                     |ToroHealth                    |torohealth                    |NONE                |DONE      |Manifest: NOSIGNATURE         gildedarmor-forge-1.16.5-1.1.4.jar                |Gilded Armor                  |gildedarmor                   |1.1.4               |DONE      |Manifest: NOSIGNATURE         BlockArmor-1.16.5-2.6.3.jar                       |Block Armor                   |blockarmor                    |2.6.3               |DONE      |Manifest: NOSIGNATURE         Neat+1.7-27.jar                                   |Neat                          |neat                          |1.7-27              |DONE      |Manifest: NOSIGNATURE         Waystones_1.16.5-7.6.3.jar                        |Waystones                     |waystones                     |7.6.3               |DONE      |Manifest: NOSIGNATURE         EpicFightMod-1.16.5-5.1.3.jar                     |Epic Fight Mod                |epicfight                     |5.1.0               |DONE      |Manifest: NOSIGNATURE         OresAboveDiamonds-1.16.5-v6.4.1.jar               |Ores Above Diamonds           |oresabovediamonds             |6.4.1               |DONE      |Manifest: NOSIGNATURE         journeymap-1.16.5-5.7.3.jar                       |Journeymap                    |journeymap                    |5.7.3               |DONE      |Manifest: NOSIGNATURE         citadel-1.8.1-1.16.5.jar                          |Citadel                       |citadel                       |1.8.1               |DONE      |Manifest: NOSIGNATURE         alexsmobs-1.12.1.jar                              |Alex's Mobs                   |alexsmobs                     |1.12.1              |DONE      |Manifest: NOSIGNATURE         TravelersBackpack-1.16.5-5.4.5.jar                |Traveler's Backpack           |travelersbackpack             |5.4.5               |DONE      |Manifest: NOSIGNATURE         NaturesCompass-1.16.5-1.9.1-forge.jar             |Nature's Compass              |naturescompass                |1.16.5-1.9.1-forge  |DONE      |Manifest: NOSIGNATURE         netheritehorsearmor-1.7.jar                       |Netherite Horse Armor Mod     |netheritehorsearmor           |1.7                 |DONE      |Manifest: NOSIGNATURE         MutantBeasts-1.16.4-1.1.3.jar                     |Mutant Beasts                 |mutantbeasts                  |1.16.4-1.1.3        |DONE      |Manifest: d9:be:bd:b6:9a:e4:14:aa:05:67:fb:84:06:77:a0:c5:10:ec:27:15:1b:d6:c0:88:49:9a:ef:26:77:61:0b:5e         guardvillagers-1.16.5.1.2.6.jar                   |Guard Villagers               |guardvillagers                |1.2.6               |DONE      |Manifest: NOSIGNATURE         u_team_core-1.16.5-3.2.1.196.jar                  |U Team Core                   |uteamcore                     |3.2.1.196           |DONE      |Manifest: f4:a6:0b:ee:cb:8a:1a:ea:9f:9d:45:91:8f:8b:b3:ae:26:f3:bf:05:86:1d:90:9e:f6:32:2a:1a:ed:1d:ce:b0         mcw-doors-1.0.3-mc1.16.5.jar                      |Macaw's Doors                 |mcwdoors                      |1.0.3               |DONE      |Manifest: NOSIGNATURE         inventorypets-1.16.5-2.0.15.jar                   |Inventory Pets                |inventorypets                 |2.0.15              |DONE      |Manifest: NOSIGNATURE         carryon-1.16.5-1.15.5.15.jar                      |Carry On                      |carryon                       |1.15.5.15           |DONE      |Manifest: 8c:03:ac:7d:21:62:65:e2:83:91:f3:22:57:99:ed:75:78:1e:db:de:03:99:ef:53:3b:59:95:18:01:bc:84:a9         Exp+Ore+Mod+-+1.16.5+-+1.3.jar                    |Exp Ore Block                 |exp_ore                       |1.3                 |DONE      |Manifest: NOSIGNATURE         forge-1.16.5-36.2.19-universal.jar                |Forge                         |forge                         |36.2.19             |DONE      |Manifest: 22:af:21:d8:19:82:7f:93:94:fe:2b:ac:b7:e4:41:57:68:39:87:b1:a7:5c:c6:44:f9:25:74:21:14:f5:0d:90         twilightforest-1.16.5-4.0.546-universal.jar       |The Twilight Forest           |twilightforest                |NONE                |DONE      |Manifest: NOSIGNATURE         tl_skin_cape_forge_1.16.5-1.17.jar                |TLSkinCape                    |tlskincape                    |1.17                |DONE      |Manifest: 19:f5:ce:44:81:0c:e4:22:05:5e:73:c5:a8:cd:de:f3:c8:cf:a9:b3:01:70:40:a0:ee:2d:50:7a:1c:3d:1c:8a         SimpleOres2-1.16.5-2.4.7.2.jar                    |Simple Ores                   |simpleores                    |1.16.5-2.4.7.2      |DONE      |Manifest: NOSIGNATURE         ironchest-1.16.5-11.2.13.jar                      |Iron Chests                   |ironchest                     |1.16.5-11.2.13      |DONE      |Manifest: NOSIGNATURE         forge-1.16.5-36.2.19-client.jar                   |Minecraft                     |minecraft                     |1.16.5              |DONE      |Manifest: NOSIGNATURE         luckyblock-1.16.5-1.jar                           |Lucky Block                   |lucky                         |1.16.5-1            |DONE      |Manifest: NOSIGNATURE         useful_backpacks-1.16.5-1.12.1.90.jar             |Useful Backpacks              |usefulbackpacks               |1.12.1.90           |DONE      |Manifest: f4:a6:0b:ee:cb:8a:1a:ea:9f:9d:45:91:8f:8b:b3:ae:26:f3:bf:05:86:1d:90:9e:f6:32:2a:1a:ed:1d:ce:b0         BiomesOPlenty-1.16.5-13.1.0.482-universal.jar     |Biomes O' Plenty              |biomesoplenty                 |1.16.5-13.1.0.482   |DONE      |Manifest: NOSIGNATURE         ironfurnaces-1.16.5-2.7.7.jar                     |Iron Furnaces                 |ironfurnaces                  |2.7.7               |DONE      |Manifest: NOSIGNATURE         SimpleCoreLib-1.16.5-2.0.8.22.jar                 |SimpleCoreLib                 |simplecorelib                 |1.16.5-2.0.8.22     |DONE      |Manifest: NOSIGNATURE         Botania-1.16.5-419.jar                            |Botania                       |botania                       |1.16.5-419          |DONE      |Manifest: NOSIGNATURE         curios-forge-1.16.5-4.0.5.3.jar                   |Curios API                    |curios                        |1.16.5-4.0.5.3      |DONE      |Manifest: NOSIGNATURE         SpartanShields-1.16.5-2.1.2.jar                   |Spartan Shields               |spartanshields                |2.1.2               |DONE      |Manifest: NOSIGNATURE         Patchouli-1.16.4-53.2.jar                         |Patchouli                     |patchouli                     |1.16.4-53.2         |DONE      |Manifest: NOSIGNATURE         gravestone-1.16.5-1.0.7.jar                       |Gravestone Mod                |gravestone                    |1.16.5-1.0.7        |DONE      |Manifest: NOSIGNATURE         [1.16.5]+SecurityCraft+v1.8.23.jar                |SecurityCraft                 |securitycraft                 |v1.8.23             |DONE      |Manifest: NOSIGNATURE         sit-1.16.5-v1.3.1.jar                             |Sit                           |sit                           |v1.3.1              |DONE      |Manifest: NOSIGNATURE         OreExcavation-1.8.157.jar                         |Ore Excavation                |oreexcavation                 |1.8.157             |DONE      |Manifest: e7:68:1c:0d:b9:7e:cf:f8:f3:40:9c:84:c5:39:d7:a4:59:78:b0:6b:c3:fd:b7:4f:69:18:a3:88:e3:76:8c:3f         obfuscate-0.6.2-1.16.3.jar                        |Obfuscate                     |obfuscate                     |0.6.2               |DONE      |Manifest: e1:59:1a:56:ec:97:b3:d0:b3:4b:25:06:1f:83:b0:f4:fd:0c:24:e3:6d:ea:94:b1:9f:22:b0:38:13:60:88:ea         vehicle-mod-0.45.2-1.16.3.jar                     |MrCrayfish's Vehicle Mod      |vehicle                       |0.45.2              |DONE      |Manifest: NOSIGNATURE         morevanillaarmor-1.16.4-1.2.4.jar                 |MoreVanillaArmor              |morevanillaarmor              |1.16.4-1.2.4        |DONE      |Manifest: NOSIGNATURE         SpartanWeaponry-1.16.4-2.1.0-beta-4.jar           |Spartan Weaponry              |spartanweaponry               |2.1.0 beta 4        |DONE      |Manifest: NOSIGNATURE         cfm-7.0.0pre22-1.16.3.jar                         |MrCrayfish's Furniture Mod    |cfm                           |7.0.0-pre22         |DONE      |Manifest: NOSIGNATURE         appleskin-forge-mc1.16.x-2.1.0.jar                |AppleSkin                     |appleskin                     |mc1.16.4-2.1.0      |DONE      |Manifest: NOSIGNATURE         MoreTool-ver-1.0.2.jar                            |More Tool                     |moretool                      |1.0.1               |DONE      |Manifest: NOSIGNATURE         cloth-config-4.11.26-forge.jar                    |Cloth Config v4 API           |cloth-config                  |4.11.26             |DONE      |Manifest: NOSIGNATURE         FallingTree-1.16.5-2.11.5.jar                     |FallingTree                   |fallingtree                   |2.11.5              |DONE      |Manifest: 3c:8e:df:6c:df:a6:2a:9f:af:64:ea:04:9a:cf:65:92:3b:54:93:0e:96:50:b4:52:e1:13:42:18:2b:ae:40:29         mcsa-forge-2.2.2-Forge.jar                        |Mcsa Forge                    |mcsaforge                     |2.2.2-Forge         |DONE      |Manifest: NOSIGNATURE         geckolib-forge-1.16.5-3.0.48.jar                  |GeckoLib                      |geckolib3                     |3.0.48              |DONE      |Manifest: NOSIGNATURE         supertools-1.16.5-4.5.jar                         |Vanilla+ Tools                |supertools                    |version             |DONE      |Manifest: NOSIGNATURE         Cyclic-1.16.5-1.5.6.jar                           |Cyclic                        |cyclic                        |1.16.5-1.5.6        |DONE      |Manifest: 1f:47:ac:b1:61:82:96:b8:47:19:16:d2:61:81:11:60:3a:06:4b:61:31:56:7d:44:31:1e:0c:6f:22:5b:4c:ed     Crash Report UUID: c169c3a4-33c1-4794-a733-01b772ca267f     Patchouli open book context: n/a     Player Count: 1 / 8; [ServerPlayerEntity['thisnot5544324'/150, l='ServerLevel[New World]', x=154.50, y=62.00, z=128.50]]     Data Packs: vanilla, mod:extraweapons, mod:mowziesmobs (incompatible), mod:randomizer, mod:jei, mod:goblintraders, mod:torohealth, mod:gildedarmor, mod:blockarmor, mod:neat (incompatible), mod:waystones (incompatible), mod:epicfight, mod:oresabovediamonds (incompatible), mod:journeymap (incompatible), mod:citadel (incompatible), mod:alexsmobs, mod:travelersbackpack (incompatible), mod:naturescompass (incompatible), mod:netheritehorsearmor, mod:mutantbeasts (incompatible), mod:guardvillagers, mod:uteamcore, mod:mcwdoors, mod:inventorypets (incompatible), mod:carryon, mod:exp_ore (incompatible), mod:forge, mod:twilightforest, mod:tlskincape (incompatible), mod:simpleores, mod:ironchest, mod:lucky (incompatible), mod:usefulbackpacks, mod:biomesoplenty, mod:ironfurnaces, mod:simplecorelib, mod:botania, mod:curios, mod:spartanshields, mod:patchouli (incompatible), mod:gravestone, mod:securitycraft (incompatible), mod:sit, mod:oreexcavation, mod:obfuscate (incompatible), mod:vehicle (incompatible), mod:morevanillaarmor (incompatible), mod:spartanweaponry, mod:cfm (incompatible), mod:appleskin, mod:moretool, mod:cloth-config (incompatible), mod:fallingtree, mod:mcsaforge, mod:geckolib3 (incompatible), mod:supertools (incompatible), mod:cyclic (incompatible)     Type: Integrated Server (map_client.txt)     Is Modded: Definitely; Client brand changed to 'forge'     OptiFine Version: OptiFine_1.16.5_HD_U_G8_pre2     OptiFine Build: 20210305-002749     Render Distance Chunks: 8     Mipmaps: 4     Anisotropic Filtering: 1     Antialiasing: 0     Multitexture: false     Shaders: null     OpenGlVersion: 4.6.0 NVIDIA 456.71     OpenGlRenderer: GeForce GTX 1050 Ti/PCIe/SSE2     OpenGlVendor: NVIDIA Corporation     CpuCount: 4
    • Thanks, but I had already solved it.
    • You should read the documentation from mcforge.readthedocs.io. "On RenderPlayerEvent.Pre" is exactly what is sounds like : on that event, do as instructed above. "I even know java, c++ and python" irrelevant. Programming is not necessarily about how many languages you've learned, but how well you can use one of them. Just being familiar with an OOP language would have made it possible to study the vanilla code.  I'll tell you again. On RenderPlayerEvent.Pre set the visible field on the rightArm model to false, and in post, set it to true, then set it's x, y, z position and rotation values (look at how vanilla does it). Then call the render method passing in the matrix from the event object. Also see how vanilla does it. This example is not very good for practical purposes, but I hope is enough to satisfy the stack overflow trend: @SubscribeEvent public void renderPlayerPre(RenderPlayerEvent.Pre event) { event.getRenderer().getModel().rightArm.visible = false; } @SubscribeEvent public void renderPlayerPost(RenderPlayerEvent.Post event) { PlayerEntity player = event.getPlayer(); PlayerModel<AbstractClientPlayerEntity> model = event.getRenderer().getModel(); ModelRenderer rightArm = model.rightArm; rightArm.visible = true; // rotation point rightArm.x = -MathHelper.cos((float) Math.toRadians(player.yRot)) * 5.0F; rightArm.y = 20; rightArm.z = -MathHelper.sin((float) Math.toRadians(player.yRot)) * 5.0F; // rotation rightArm.xRot = (float) Math.toRadians(42); rightArm.yRot = (float) -Math.toRadians(player.yBodyRot); rightArm.render( event.getMatrixStack(), event.getBuffers().getBuffer(RenderType.entitySolid(((AbstractClientPlayerEntity)player).getSkinTextureLocation())), Minecraft.getInstance().getEntityRenderDispatcher().getPackedLightCoords(player, 1f), OverlayTexture.NO_OVERLAY); }  
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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