Skip to content

Commit

Permalink
Improved mining laser render a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHillcox committed Aug 21, 2020
1 parent fdc85d4 commit 61c4301
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,6 @@ dependencies {
compileOnly fg.deobf("mezz.jei:jei-${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_version}")

runtimeOnly fg.deobf("cpw.mods:cpw_inventorysorter_master:18.0.0")

// You may put jars on which you depend on in ./libs or you may define them like so..
// compile "some.group:artifact:version:classifier"
// compile "some.group:artifact:version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.direwolf20.mininggadgets.common.items.upgrade.Upgrade;
import com.direwolf20.mininggadgets.common.items.upgrade.UpgradeTools;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.IVertexBuilder;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.player.ClientPlayerEntity;
Expand Down Expand Up @@ -67,7 +66,7 @@ private static void drawLasers(RenderWorldLastEvent event, Vector3d from, RayTra

IVertexBuilder builder;
ItemStack stack = player.getHeldItem(activeHand);
double distance = from.subtract(trace.getHitVec()).length();
double distance = Math.max(1, from.subtract(trace.getHitVec()).length());
long gameTime = player.world.getGameTime();
double v = gameTime * speedModifier;
float additiveThickness = (thickness * 3.5f) * calculateLaserFlickerModifier(gameTime);
Expand Down Expand Up @@ -128,8 +127,8 @@ private static void drawBeam(double xOffset, double yOffset, double zOffset, IVe
}
float f = (MathHelper.lerp(ticks, player.prevRotationPitch, player.rotationPitch) - MathHelper.lerp(ticks, player.prevRenderArmPitch, player.renderArmPitch));
float f1 = (MathHelper.lerp(ticks, player.prevRotationYaw, player.rotationYaw) - MathHelper.lerp(ticks, player.prevRenderArmYaw, player.renderArmYaw));
startXOffset = startXOffset + (f1 / 100000000);
startYOffset = startYOffset + (f / 100000000);
startXOffset = startXOffset + (f1 / 750);
startYOffset = startYOffset + (f / 750);

Vector4f vec1 = new Vector4f(startXOffset, -thickness + startYOffset, startZOffset, 1.0F);
vec1.transform(positionMatrix);
Expand Down

0 comments on commit 61c4301

Please sign in to comment.