Skip to content
This repository has been archived by the owner on May 25, 2024. It is now read-only.

Commit

Permalink
Cleanup noXXXYYY methods (#96)
Browse files Browse the repository at this point in the history
* updateBuildScript

* Update dependencies

* Cleanup noXXXYYY methods

* Fix wildcard import
  • Loading branch information
miozune authored Sep 23, 2023
1 parent 74e1d09 commit bda461c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 40 deletions.
60 changes: 51 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//version: 1692122114
//version: 1695409603
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
Expand Down Expand Up @@ -89,6 +89,23 @@ def out = services.get(StyledTextOutputFactory).create('an-output')
def projectJavaVersion = JavaLanguageVersion.of(8)

boolean disableSpotless = project.hasProperty("disableSpotless") ? project.disableSpotless.toBoolean() : false
boolean disableCheckstyle = project.hasProperty("disableCheckstyle") ? project.disableCheckstyle.toBoolean() : false

final String CHECKSTYLE_CONFIG = """
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<module name="TreeWalker">
<!-- Use CHECKSTYLE:OFF and CHECKSTYLE:ON comments to suppress checkstyle lints in a block -->
<module name="SuppressionCommentFilter"/>
<module name="AvoidStarImport">
<!-- Allow static wildcard imports for cases like Opcodes and LWJGL classes, these don't get created accidentally by the IDE -->
<property name="allowStaticMemberImports" value="true"/>
</module>
</module>
</module>
"""

checkPropertyExists("modName")
checkPropertyExists("modId")
Expand Down Expand Up @@ -140,6 +157,17 @@ if (!disableSpotless) {
apply from: Blowdryer.file('spotless.gradle')
}

if (!disableCheckstyle) {
apply plugin: 'checkstyle'
tasks.named("checkstylePatchedMc") { enabled = false }
tasks.named("checkstyleMcLauncher") { enabled = false }
tasks.named("checkstyleIdeVirtualMain") { enabled = false }
tasks.named("checkstyleInjectedTags") { enabled = false }
checkstyle {
config = resources.text.fromString(CHECKSTYLE_CONFIG)
}
}

String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
String kotlinSourceDir = "src/main/kotlin/"
Expand Down Expand Up @@ -600,15 +628,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()
Expand Down Expand Up @@ -1576,6 +1599,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'
Expand Down
24 changes: 12 additions & 12 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
*/

dependencies {
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.43.187:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.44.22:dev')
api("com.github.GTNewHorizons:EnderCore:0.2.17:dev")
api("com.github.GTNewHorizons:EnderIO:2.4.24:dev")
api("com.github.GTNewHorizons:EnderIO:2.5.0:dev")
api("com.github.GTNewHorizons:ForestryMC:4.6.14:dev")
api("com.github.GTNewHorizons:ModularUI:1.1.16:dev")
api("com.github.GTNewHorizons:ModularUI:1.1.18:dev")
api("com.github.GTNewHorizons:Mobs-Info:0.1.6-GTNH:dev")
devOnlyNonPublishable("com.github.GTNewHorizons:Infernal-Mobs:1.7.9-GTNH:dev")
//compileOnly("curse.maven:extrautilities-225561:2264384") {
// transitive = false
//}
compileOnly("com.github.GTNewHorizons:GTplusplus:1.9.83:dev")
compileOnly("com.github.GTNewHorizons:GTplusplus:1.10.10:dev")
{
transitive = false
}
Expand All @@ -61,15 +61,15 @@ dependencies {
{
transitive = false
}
compileOnly("com.github.GTNewHorizons:bartworks:0.7.39:dev")
compileOnly("com.github.GTNewHorizons:bartworks:0.8.5:dev")
{
transitive = false
}
compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.1.109:dev")
compileOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.8:dev")
{
transitive = false
}
compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.4.4-GTNH:dev")
compileOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.5.0-GTNH:dev")
{
transitive = false
}
Expand All @@ -83,15 +83,15 @@ dependencies {
*/

// For testing
//runtimeOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.4.4-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:GTplusplus:1.9.83:dev")
//runtimeOnly("com.github.GTNewHorizons:BetterLoadingScreen:1.5.0-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:GTplusplus:1.10.10:dev")
//runtimeOnly("com.github.GTNewHorizons:harvestcraft:1.1.1-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.1.109:dev")
//runtimeOnly("com.github.GTNewHorizons:NewHorizonsCoreMod:2.2.8:dev")
//runtimeOnly("com.github.GTNewHorizons:OpenBlocks:1.7.0-GTNH:dev")
//runtimeOnly("com.github.GTNewHorizons:bartworks:0.7.39:dev")
//runtimeOnly("com.github.GTNewHorizons:bartworks:0.8.5:dev")
//runtimeOnly("com.github.GTNewHorizons:CraftTweaker:3.2.13:dev")
//api("com.github.GTNewHorizons:SpecialMobs:3.4.3:dev")
//api("com.github.GTNewHorizons:twilightforest:2.4.5:dev")
//api("com.github.GTNewHorizons:twilightforest:2.5.0:dev")
//api("com.github.GTNewHorizons:EnderZoo:1.0.23:dev")
//runtimeOnly("com.github.GTNewHorizons:Draconic-Evolution:1.1.19-GTNH:dev")
//runtimeOnly("thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev")
Expand Down
18 changes: 0 additions & 18 deletions src/main/java/kubatech/loaders/RecipeLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ public static void addRecipes() {
.fluidInputs(
FluidRegistry.getFluidStack("molten.indalloy140", 28800),
FluidRegistry.getFluidStack("for.honey", 20000))
.noFluidOutputs()
.itemOutputs(ExtremeIndustrialApiary.get(1))
.eut(2_048_000)
.duration(5 * MINUTES)
Expand Down Expand Up @@ -233,7 +232,6 @@ private static void RegisterTeaLine() {
.itemInputs(TeaLeafDehydrated.get(1))
.itemOutputs(SteamedTeaLeaf.get(1))
.fluidInputs(FluidRegistry.getFluidStack("water", 50))
.noFluidOutputs()
.eut(32)
.duration(5 * SECONDS)
.addTo(sMixerRecipes);
Expand All @@ -248,8 +246,6 @@ private static void RegisterTeaLine() {
GT_Values.RA.stdBuilder()
.itemInputs(TeaLeafDehydrated.get(1))
.itemOutputs(RolledTeaLeaf.get(1))
.noFluidInputs()
.noFluidOutputs()
.eut(32)
.duration(5 * SECONDS)
.addTo(sBenderRecipes);
Expand All @@ -264,8 +260,6 @@ private static void RegisterTeaLine() {
GT_Values.RA.stdBuilder()
.itemInputs(RolledTeaLeaf.get(1), GT_Utility.getIntegratedCircuit(1))
.itemOutputs(OxidizedTeaLeaf.get(1))
.noFluidInputs()
.noFluidOutputs()
.eut(32)
.duration(5 * SECONDS)
.addTo(UniversalChemical);
Expand All @@ -280,8 +274,6 @@ private static void RegisterTeaLine() {
GT_Values.RA.stdBuilder()
.itemInputs(RolledTeaLeaf.get(1), GT_Utility.getIntegratedCircuit(2))
.itemOutputs(FermentedTeaLeaf.get(1))
.noFluidInputs()
.noFluidOutputs()
.eut(32)
.duration(10 * SECONDS)
.addTo(UniversalChemical);
Expand All @@ -296,16 +288,12 @@ private static void RegisterTeaLine() {
GT_Values.RA.stdBuilder()
.itemInputs(TeaLeafDehydrated.get(1))
.itemOutputs(BruisedTeaLeaf.get(1))
.noFluidInputs()
.noFluidOutputs()
.eut(32)
.duration(5 * SECONDS)
.addTo(sCutterRecipes);
GT_Values.RA.stdBuilder()
.itemInputs(BruisedTeaLeaf.get(1), GT_Utility.getIntegratedCircuit(1))
.itemOutputs(PartiallyOxidizedTeaLeaf.get(1))
.noFluidInputs()
.noFluidOutputs()
.eut(32)
.duration(2 * SECONDS + 10 * TICKS)
.addTo(UniversalChemical);
Expand All @@ -323,8 +311,6 @@ private static void RegisterTeaLine() {
GT_Values.RA.stdBuilder()
.itemInputs(BlackTea.get(1), GameRegistry.findItemStack("harvestcraft", "limejuiceItem", 1))
.itemOutputs(EarlGrayTea.get(1))
.noFluidInputs()
.noFluidOutputs()
.eut(32)
.duration(5 * SECONDS)
.addTo(sMixerRecipes);
Expand All @@ -333,15 +319,13 @@ private static void RegisterTeaLine() {
.itemInputs(BlackTea.get(1))
.itemOutputs(LemonTea.get(1))
.fluidInputs(FluidRegistry.getFluidStack("potion.lemonjuice", 1000))
.noFluidOutputs()
.eut(32)
.duration(5 * SECONDS)
.addTo(sMixerRecipes);
GT_Values.RA.stdBuilder()
.itemInputs(BlackTea.get(1))
.itemOutputs(MilkTea.get(1))
.fluidInputs(FluidRegistry.getFluidStack("milk", 1000))
.noFluidOutputs()
.eut(32)
.duration(5 * SECONDS)
.addTo(sMixerRecipes);
Expand All @@ -350,7 +334,6 @@ private static void RegisterTeaLine() {
.itemInputs(GameRegistry.findItemStack("harvestcraft", "peppermintItem", 1))
.itemOutputs(PeppermintTea.get(1))
.fluidInputs(FluidRegistry.getFluidStack("water", 1000))
.noFluidOutputs()
.eut(32)
.duration(5 * SECONDS)
.addTo(sMixerRecipes);
Expand All @@ -372,7 +355,6 @@ private static void RegisterTeaLine() {
new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L },
new Object[] { OrePrefixes.circuit.get(Materials.SuperconductorUHV), 4L })
.fluidInputs(FluidRegistry.getFluidStack("molten.indalloy140", 28800))
.noFluidOutputs()
.itemOutputs(TeaAcceptor.get(1))
.eut(2_048_000)
.duration(5 * MINUTES)
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/kubatech/standalone.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package kubatech;

import javax.swing.*;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;

public class standalone {

Expand Down

0 comments on commit bda461c

Please sign in to comment.