MCPcopy Create free account
hub / github.com/GregTech6/gregtech6 / getMOP

Method getMOP

src/main/java/gregapi/util/WD.java:150–164  ·  view source on GitHub ↗
(World aWorld, EntityPlayer aPlayer, boolean aFlag)

Source from the content-addressed store, hash-verified

148 }
149
150 public static MovingObjectPosition getMOP(World aWorld, EntityPlayer aPlayer, boolean aFlag) {
151 Vec3 vec3 = Vec3.createVectorHelper(
152 aPlayer.prevPosX + (aPlayer.posX - aPlayer.prevPosX)
153 , aPlayer.prevPosY + (aPlayer.posY - aPlayer.prevPosY) + (aWorld.isRemote ? aPlayer.getEyeHeight() - aPlayer.getDefaultEyeHeight() : aPlayer.getEyeHeight()) // isRemote check to revert changes to ray trace position due to adding the eye height clientside and player yOffset differences
154 , aPlayer.prevPosZ + (aPlayer.posZ - aPlayer.prevPosZ)
155 );
156 float tPitch = aPlayer.prevRotationPitch + (aPlayer.rotationPitch - aPlayer.prevRotationPitch);
157 float tYaw = aPlayer.prevRotationYaw + (aPlayer.rotationYaw - aPlayer.prevRotationYaw );
158 float tZ = MathHelper.cos(-tYaw * 0.017453292F - (float)Math.PI);
159 float tX = MathHelper.sin(-tYaw * 0.017453292F - (float)Math.PI);
160 float tW = -MathHelper.cos(-tPitch * 0.017453292F);
161 float tY = MathHelper.sin(-tPitch * 0.017453292F);
162 double tReach = (aPlayer instanceof EntityPlayerMP ? ((EntityPlayerMP)aPlayer).theItemInWorldManager.getBlockReachDistance() : 5);
163 return aWorld.func_147447_a(vec3, vec3.addVector(tX * tW * tReach, tY * tReach, tZ * tW * tReach), aFlag, !aFlag, F);
164 }
165
166 public static boolean dimOverworldLike(World aWorld) {return aWorld != null && dimOverworldLike(aWorld.provider);}
167 public static boolean dimOverworldLike(WorldProvider aProvider) {return aProvider.dimensionId == 0 || dimOverworldLike(aProvider, UT.Reflection.getLowercaseClass(aProvider));}

Callers 6

onItemRightClickMethod · 0.95
onItemRightClickMethod · 0.95
onItemRightClickMethod · 0.95
onItemRightClickMethod · 0.95
onPlayerInteractionMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected