aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexdoru <57050655+Alexdoru@users.noreply.github.com>2023-09-22 22:28:02 +0200
committerGitHub <noreply@github.com>2023-09-22 22:28:02 +0200
commitf7b8ef396c94b8787e98fa35f35ec799751dcad6 (patch)
tree0047bb0937d284de59f1b5b94b768e76bf42c85d
parent432c8974343d1cc276ff5f83417dd2e9225de57e (diff)
downloadGT5-Unofficial-f7b8ef396c94b8787e98fa35f35ec799751dcad6.tar.gz
GT5-Unofficial-f7b8ef396c94b8787e98fa35f35ec799751dcad6.tar.bz2
GT5-Unofficial-f7b8ef396c94b8787e98fa35f35ec799751dcad6.zip
format the eu/t number in the scanner data of the Naquadah reactor multi (#210)
* format the eu/t number in the scanner data of the Naquadah reactor multi * update buildscript
-rw-r--r--build.gradle32
-rw-r--r--src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java2
2 files changed, 24 insertions, 10 deletions
diff --git a/build.gradle b/build.gradle
index b894d64772..ac9652d0a3 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,4 +1,4 @@
-//version: 1692122114
+//version: 1695323114
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -600,15 +600,10 @@ repositories {
}
maven {
name = "ic2"
- url = "https://maven.ic2.player.to/"
- metadataSources {
- mavenPom()
- artifact()
+ url = getURL("https://maven.ic2.player.to/", "https://maven2.ic2.player.to/")
+ content {
+ includeGroup "net.industrial-craft"
}
- }
- maven {
- name = "ic2-mirror"
- url = "https://maven2.ic2.player.to/"
metadataSources {
mavenPom()
artifact()
@@ -1576,6 +1571,25 @@ def getSecondaryArtifacts() {
return secondaryArtifacts
}
+def getURL(String main, String fallback) {
+ return pingURL(main, 10000) ? main : fallback
+}
+
+// credit: https://stackoverflow.com/a/3584332
+def pingURL(String url, int timeout) {
+ url = url.replaceFirst("^https", "http") // Otherwise an exception may be thrown on invalid SSL certificates.
+ try {
+ HttpURLConnection connection = (HttpURLConnection) new URL(url).openConnection()
+ connection.setConnectTimeout(timeout)
+ connection.setReadTimeout(timeout)
+ connection.setRequestMethod("HEAD")
+ int responseCode = connection.getResponseCode()
+ return 200 <= responseCode && responseCode <= 399
+ } catch (IOException ignored) {
+ return false
+ }
+}
+
// For easier scripting of things that require variables defined earlier in the buildscript
if (file('addon.late.gradle.kts').exists()) {
apply from: 'addon.late.gradle.kts'
diff --git a/src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java b/src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java
index c0f500b7b4..161360f66f 100644
--- a/src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java
+++ b/src/main/java/goodgenerator/blocks/tileEntity/MultiNqGenerator.java
@@ -254,7 +254,7 @@ public class MultiNqGenerator extends GT_MetaTileEntity_TooltipMultiBlockBase_EM
public String[] getInfoData() {
String[] info = super.getInfoData();
info[4] = "Probably makes: " + EnumChatFormatting.RED
- + Math.abs(this.trueOutput)
+ + GT_Utility.formatNumbers(Math.abs(this.trueOutput))
+ EnumChatFormatting.RESET
+ " EU/t";
info[6] = "Problems: " + EnumChatFormatting.RED