aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java
index b96fefef..e953ba60 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalOverlay.java
@@ -129,6 +129,7 @@ public class CrystalOverlay {
private static ExecutorService es = Executors.newSingleThreadExecutor();
public static void tick() {
+ if(!NotEnoughUpdates.INSTANCE.config.itemOverlays.enableCrystalOverlay) return;
if(Minecraft.getMinecraft().theWorld == null) return;
EntityPlayerSP p = Minecraft.getMinecraft().thePlayer;
@@ -136,23 +137,28 @@ public class CrystalOverlay {
long currentTime = System.currentTimeMillis();
- if(currentTime - displayMillis > 10*1000) {
- crystals.clear();
- displayMillis = -1;
- }
+ if(NotEnoughUpdates.INSTANCE.config.itemOverlays.alwaysShowCrystal) {
+ displayMillis = currentTime;
+ } else {
+ if(currentTime - displayMillis > 10*1000) {
+ crystals.clear();
+ displayMillis = -1;
+ }
- ItemStack held = p.getHeldItem();
- String internal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(held);
- if(internal != null) {
- if(internal.endsWith("_CRYSTAL") && !internal.equals("POWER_CRYSTAL")) {
- displayMillis = System.currentTimeMillis();
+ ItemStack held = p.getHeldItem();
+ String internal = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(held);
+ if(internal != null) {
+ if(internal.endsWith("_CRYSTAL") && !internal.equals("POWER_CRYSTAL")) {
+ displayMillis = currentTime;
+ }
}
- }
- if(displayMillis < 0) {
- return;
+ if(displayMillis < 0) {
+ return;
+ }
}
+
Set<CrystalType> foundTypes = new HashSet<>();
for(Entity entity : Minecraft.getMinecraft().theWorld.loadedEntityList) {
if(entity instanceof EntityArmorStand) {
@@ -198,6 +204,8 @@ public class CrystalOverlay {
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
+ if(!NotEnoughUpdates.INSTANCE.config.itemOverlays.enableCrystalOverlay) return;
+
if(displayMillis < 0) {
return;
}
@@ -248,6 +256,8 @@ public class CrystalOverlay {
@SubscribeEvent
public void onRenderLast(RenderWorldLastEvent event) {
+ if(!NotEnoughUpdates.INSTANCE.config.itemOverlays.enableCrystalOverlay) return;
+
if(displayMillis < 0) {
return;
}