aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures
diff options
context:
space:
mode:
authorDavid Mills <85420839+Keebler408@users.noreply.github.com>2021-09-11 10:35:55 -0500
committerDavid Mills <85420839+Keebler408@users.noreply.github.com>2021-09-11 10:35:55 -0500
commite0a71fdc7a1bf466992fc6db96a15b778909cc18 (patch)
treef8e4a9e183333e96748d1baeadcfa7798f6aef2b /src/main/java/io/github/moulberry/notenoughupdates/miscfeatures
parent29cea4c4922443ae78c47cd49e4a74ab67eb15f2 (diff)
downloadnotenoughupdates-e0a71fdc7a1bf466992fc6db96a15b778909cc18.tar.gz
notenoughupdates-e0a71fdc7a1bf466992fc6db96a15b778909cc18.tar.bz2
notenoughupdates-e0a71fdc7a1bf466992fc6db96a15b778909cc18.zip
Fix jitter, improve metal detector beacon
- Fix jitter caused by location coord truncation from double to int - Move remaining fairy souls beacon rendering into RenderUtils.java - Add beacon option to enable depth testing when player is close by - Use new rendering for metal detector to make beacons more visible
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java12
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java32
2 files changed, 3 insertions, 41 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java
index 1172f1c5..5e9c59ac 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java
@@ -108,24 +108,16 @@ public class CrystalMetalDetectorSolver {
if (SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("crystal_hollows") &&
SBInfo.getInstance().location.equals("Mines of Divan")) {
- BlockPos viewer = RenderUtils.getCurrentViewer(partialTicks);
if (possibleBlocks.size() == 1) {
BlockPos block = possibleBlocks.get(0);
- double x = block.getX() - viewer.getX();
- double y = block.getY() - viewer.getY();
- double z = block.getZ() - viewer.getZ();
- RenderUtils.renderBeaconBeam(x, y, z, beaconRGB, 1.0f, partialTicks);
+ RenderUtils.renderBeaconBeam(block, beaconRGB, 1.0f, partialTicks);
RenderUtils.renderWayPoint("Treasure", possibleBlocks.get(0).add(0, 2.5, 0), partialTicks);
} else if (possibleBlocks.size() > 1 && (locations.size() > 1 || possibleBlocks.size() < 10) &&
NotEnoughUpdates.INSTANCE.config.mining.metalDetectorShowPossible) {
for (BlockPos block : possibleBlocks) {
- double x = block.getX() - viewer.getX();
- double y = block.getY() - viewer.getY();;
- double z = block.getZ() - viewer.getZ();;
-
- RenderUtils.renderBeaconBeam(x, y, z, beaconRGB, 1.0f, partialTicks);
+ RenderUtils.renderBeaconBeam(block, beaconRGB, 1.0f, partialTicks);
RenderUtils.renderWayPoint("Possible Treasure Location", block.add(0, 2.5, 0), partialTicks);
}
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java
index 260b94ae..ac1d2fd9 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FairySouls.java
@@ -6,26 +6,17 @@ import com.google.gson.JsonObject;
import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
import io.github.moulberry.notenoughupdates.commands.SimpleCommand;
import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils;
-import io.github.moulberry.notenoughupdates.options.NEUConfig;
import io.github.moulberry.notenoughupdates.util.Constants;
import io.github.moulberry.notenoughupdates.util.SBInfo;
import io.github.moulberry.notenoughupdates.util.SpecialColour;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.client.renderer.Tessellator;
-import net.minecraft.client.renderer.WorldRenderer;
-import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.command.ICommandSender;
-import net.minecraft.entity.Entity;
import net.minecraft.util.*;
-import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.client.event.ClientChatReceivedEvent;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.world.WorldEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-import net.minecraftforge.fml.common.gameevent.TickEvent;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.util.vector.Vector3f;
import java.io.*;
import java.nio.charset.StandardCharsets;
@@ -177,32 +168,11 @@ public class FairySouls {
Set<Integer> found = foundSouls.computeIfAbsent(location, k -> new HashSet<>());
- BlockPos viewer = RenderUtils.getCurrentViewer(event.partialTicks);
-
int rgb = 0xa839ce;
for(int i=0; i<currentSoulListClose.size(); i++) {
BlockPos currentSoul = currentSoulListClose.get(i);
- double x = currentSoul.getX() - viewer.getX();
- double y = currentSoul.getY() - viewer.getY();
- double z = currentSoul.getZ() - viewer.getZ();
-
- double distSq = x*x + y*y + z*z;
-
- AxisAlignedBB bb = new AxisAlignedBB(x, y, z, x+1, y+1, z+1);
-
- GlStateManager.disableDepth();
- GlStateManager.disableCull();
- GlStateManager.disableTexture2D();
- CustomItemEffects.drawFilledBoundingBox(bb, 1f, SpecialColour.special(0, 100, rgb));
-
- if(distSq > 10*10) {
- RenderUtils.renderBeaconBeam(x, y, z, rgb, 1.0f, event.partialTicks);
- }
+ RenderUtils.renderBeaconBeamOrBoundingBox(currentSoul, rgb, 1.0f, event.partialTicks);
}
-
- GlStateManager.disableLighting();
- GlStateManager.enableTexture2D();
- GlStateManager.enableDepth();
}
public static class FairySoulsCommandAlt extends SimpleCommand {