Skip to content
This repository has been archived by the owner on Feb 9, 2025. It is now read-only.

Commit

Permalink
extra update for 1.19.2
Browse files Browse the repository at this point in the history
  • Loading branch information
LucunJi committed Sep 14, 2023
1 parent 5441e49 commit 96acc90
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 20 deletions.
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/use
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.2
loader_version=0.14.21
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
loader_version=0.14.22
# Mod Properties
maven_group=github.io.lucunji
# Dependencies
# Fabric api
fabric_version=0.85.0+1.19.4
fabric_version=0.76.0+1.19.2
# malilib
malilib_minecraft_version=1.19.4
malilib_version=0.15.4
malilib_minecraft_version=1.19.2
malilib_version=0.13.0
# mod menu
mod_menu_version=6.2.3
mod_menu_version=4.1.2
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import net.minecraft.util.math.*;
import net.minecraft.world.LightType;
import net.minecraft.world.World;
import org.joml.*;

import java.lang.Math;
import java.util.List;
Expand Down Expand Up @@ -144,7 +143,7 @@ public boolean needFixMirrorItem() {

private double getPoseOffsetY(LivingEntity targetEntity, float partialTicks, IConfigOptionListEntry poseOffsetMethod) {
if (poseOffsetMethod == PoseOffsetMethod.AUTO) {
final float defaultPlayerEyeHeight = PlayerEntity.DEFAULT_EYE_HEIGHT;
final float defaultPlayerEyeHeight = PlayerEntity.field_30651;
final float defaultPlayerSwimmingBBHeight = PlayerEntity.field_30650;
final float eyeHeightRatio = 0.85f;
if (targetEntity.isFallFlying()) {
Expand All @@ -154,7 +153,7 @@ private double getPoseOffsetY(LivingEntity targetEntity, float partialTicks, ICo
} else if (!targetEntity.isInSwimmingPose() && targetEntity.getLeaningPitch(partialTicks) > 0) { // for swimming/crawling pose, only smooth the falling edge
return (defaultPlayerEyeHeight - defaultPlayerSwimmingBBHeight * eyeHeightRatio * 0.85) * targetEntity.getLeaningPitch(partialTicks);
} else {
return PlayerEntity.DEFAULT_EYE_HEIGHT - targetEntity.getStandingEyeHeight();
return defaultPlayerEyeHeight - targetEntity.getStandingEyeHeight();
}
} else if (poseOffsetMethod == PoseOffsetMethod.MANUAL) {
if (targetEntity.isFallFlying()) {
Expand Down Expand Up @@ -232,19 +231,19 @@ private void performRendering(Entity targetEntity, double posX, double posY, dou
matrixStack1.push();
matrixStack1.translate(0, 0, 550.0D);
matrixStack1.scale(mirror ? -1 : 1, 1, -1);
matrixStack1.multiply(RotationAxis.POSITIVE_Y.rotationDegrees((float) lightDegree));
matrixStack1.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion((float) lightDegree));

RenderSystem.applyModelViewMatrix();

MatrixStack matrixStack2 = new MatrixStack();
matrixStack2.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(-(float) lightDegree));
matrixStack2.multiply(Vec3f.POSITIVE_Y.getDegreesQuaternion(-(float) lightDegree));
matrixStack2.translate((mirror ? -1 : 1) * posX, posY, 1000.0D);
matrixStack2.scale((float) size, (float) size, (float) size);
Quaternionf quaternion = RotationAxis.POSITIVE_Z.rotationDegrees(180.0F);
Quaternionf quaternion2 = RotationAxis.POSITIVE_X.rotationDegrees((float) Configs.ROTATION_X.getDoubleValue());
quaternion2.mul(RotationAxis.POSITIVE_Y.rotationDegrees((float) Configs.ROTATION_Y.getDoubleValue()));
quaternion2.mul(RotationAxis.POSITIVE_Z.rotationDegrees((float) Configs.ROTATION_Z.getDoubleValue()));
quaternion.mul(quaternion2);
Quaternion quaternion = Vec3f.POSITIVE_Z.getDegreesQuaternion(180.0F);
Quaternion quaternion2 = Vec3f.POSITIVE_X.getDegreesQuaternion((float) Configs.ROTATION_X.getDoubleValue());
quaternion2.hamiltonProduct(Vec3f.POSITIVE_Y.getDegreesQuaternion((float) Configs.ROTATION_Y.getDoubleValue()));
quaternion2.hamiltonProduct(Vec3f.POSITIVE_Z.getDegreesQuaternion((float) Configs.ROTATION_Z.getDoubleValue()));
quaternion.hamiltonProduct(quaternion2);
matrixStack2.multiply(quaternion);

DiffuseLighting.method_34742();
Expand Down Expand Up @@ -280,8 +279,8 @@ private void performRendering(Entity targetEntity, double posX, double posY, dou
private static int getLight(Entity entity, float tickDelta) {
if (Configs.USE_WORLD_LIGHT.getBooleanValue()) {
World world = entity.getWorld();
int blockLight = world.getLightLevel(LightType.BLOCK, BlockPos.ofFloored(entity.getCameraPosVec(tickDelta)));
int skyLight = world.getLightLevel(LightType.SKY, BlockPos.ofFloored(entity.getCameraPosVec(tickDelta)));
int blockLight = world.getLightLevel(LightType.BLOCK, new BlockPos(entity.getCameraPosVec(tickDelta)));
int skyLight = world.getLightLevel(LightType.SKY, new BlockPos(entity.getCameraPosVec(tickDelta)));
int min = Configs.WORLD_LIGHT_MIN.getIntegerValue();
blockLight = MathHelper.clamp(blockLight, min, 15);
skyLight = MathHelper.clamp(skyLight, min, 15);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"depends": {
"malilib": "*",
"fabricloader": ">=0.14.20",
"minecraft": "~1.19.4"
"minecraft": "<=1.19.2"
},
"suggests": {
"modmenu": "*"
Expand Down

0 comments on commit 96acc90

Please sign in to comment.