Fix missing ModOnly-IC2 annotations (#14)

* Update buildscript&dependencies

* Fix missing ModOnly-IC2 annotations
This commit is contained in:
Raven Szewczyk authored and GitHub committed 2023-07-04 22:00:09 +01:00
1 parent 03ca9b2055
commit 9a2373b343
7 files changed
+75 -92

No files matched your search

-51
View File
@@ -1,51 +0,0 @@
#!/usr/bin/env bash
# bashsupport disable=BP5006 # Global environment variables
RUNDIR="run" \
CRASH="crash-reports" \
SERVERLOG="server.log"
# enable nullglob to get 0 results when no match rather than the pattern
shopt -s nullglob
# store matches in array
crash_reports=("$RUNDIR/$CRASH/crash"*.txt)
# if array not empty there are crash_reports
if [ "${#crash_reports[@]}" -gt 0 ]; then
# get the latest crash_report from array
latest_crash_report="${crash_reports[-1]}"
{
printf 'Latest crash report detected %s:\n' "${latest_crash_report##*/}"
cat "$latest_crash_report"
} >&2
exit 1
fi
if grep --quiet --fixed-strings 'Fatal errors were detected' "$SERVERLOG"; then
{
printf 'Fatal errors detected:\n'
cat server.log
} >&2
exit 1
fi
if grep --quiet --fixed-strings 'The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED' \
"$SERVERLOG"; then
{
printf 'Server force stopped:'
cat server.log
} >&2
exit 1
fi
if ! grep --quiet --perl-regexp --only-matching '.+Done \(.+\)\! For help, type "help" or "\?"' "$SERVERLOG"; then
{
printf 'Server did not finish startup:'
cat server.log
} >&2
exit 1
fi
printf 'No crash reports detected'
exit 0
+39 -4
View File
@@ -1,4 +1,4 @@
//version: 1682280358
//version: 1685785062
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -69,8 +69,11 @@ plugins {
id 'com.diffplug.spotless' version '6.13.0' apply false // 6.13.0 is the last jvm8 supporting version
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.2'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.14'
}
print("You might want to check out './gradlew :faq' if your build fails.\n")
boolean settingsupdated = verifySettingsGradle()
settingsupdated = verifyGitAttributes() || settingsupdated
if (settingsupdated)
@@ -219,6 +222,8 @@ if (enableModernJavaSyntax.toBoolean()) {
dependencies {
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:1.0.0'
// workaround for https://github.com/bsideup/jabel/issues/174
annotationProcessor 'net.java.dev.jna:jna-platform:5.13.0'
compileOnly('com.github.bsideup.jabel:jabel-javac-plugin:1.0.0') {
transitive = false // We only care about the 1 annotation class
}
@@ -564,9 +569,10 @@ repositories {
def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins"
def mixinProviderVersion = "0.1.6"
def mixinProviderVersion = "0.1.7.1"
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec
dependencies {
if (usesMixins.toBoolean()) {
@@ -724,7 +730,7 @@ dependencies {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.8')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.13')
}
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
@@ -817,6 +823,18 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
}
this.classpath(project.java17DependenciesCfg)
}
public void setup(Project project) {
super.setup(project)
if (project.usesMixins.toBoolean()) {
this.extraJvmArgs.addAll(project.provider(() -> {
def mixinCfg = project.configurations.detachedConfiguration(project.dependencies.create(project.mixinProviderSpec))
mixinCfg.canBeConsumed = false
mixinCfg.transitive = false
enableHotswap ? ["-javaagent:" + mixinCfg.singleFile.absolutePath] : []
}))
}
}
}
def runClient17Task = tasks.register("runClient17", RunHotswappableMinecraftTask, Distribution.CLIENT, "runClient")
@@ -1252,6 +1270,23 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA
}
}
// If you want to add more cases to this task, implement them as arguments if total amount to print gets too large
tasks.register('faq') {
group = 'GTNH Buildscript'
description = 'Prints frequently asked questions about building a project'
doLast {
print("If your build fails to fetch dependencies, run './gradlew updateDependencies'. " +
"Or you can manually check if the versions are still on the distributing sites - " +
"the links can be found in repositories.gradle and build.gradle:repositories, " +
"but not build.gradle:buildscript.repositories - those ones are for gradle plugin metadata.\n\n" +
"If your build fails to recognize the syntax of new Java versions, enable Jabel in your " +
"gradle.properties. See how it's done in GTNH ExampleMod/gradle.properties. " +
"However, keep in mind that Jabel enables only syntax features, but not APIs that were introduced in " +
"Java 9 or later.")
}
}
static URL availableBuildScriptUrl() {
new URL("https://raw.githubusercontent.com/GTNewHorizons/ExampleMod1.7.10/master/build.gradle")
}
+2 -2
View File
@@ -1,5 +1,5 @@
dependencies {
shadowImplementation("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH")
implementation("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
implementation("com.github.GTNewHorizons:NotEnoughItems:2.3.45-GTNH:dev")
implementation("com.github.GTNewHorizons:NotEnoughItems:2.3.63-GTNH:dev")
compileOnly("net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev")
}
-7
View File
@@ -1,11 +1,4 @@
// Add any additional repositories for your dependencies here
repositories {
maven {
name = "GTNH Maven"
url = "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
}
maven {
url "https://cursemaven.com"
}
}
@@ -1,6 +1,7 @@
package minetweaker.mods.ic2.crops;
import ic2.api.crops.CropCard;
import minetweaker.annotations.ModOnly;
import stanhebben.zenscript.annotations.ZenCaster;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenGetter;
@@ -8,11 +9,12 @@ import stanhebben.zenscript.annotations.ZenMethod;
/**
* Read-only data accessor for crops
*
*
* @author ben
*
*/
@ZenClass("mods.ic2.Crop")
@ModOnly("IC2")
public class Crop {
private CropCard cc;
@@ -1,5 +1,6 @@
package minetweaker.mods.ic2.crops;
import minetweaker.annotations.ModOnly;
import minetweaker.api.item.IItemStack;
import stanhebben.zenscript.annotations.ZenClass;
import stanhebben.zenscript.annotations.ZenGetter;
@@ -7,11 +8,12 @@ import stanhebben.zenscript.annotations.ZenSetter;
/**
* Contains all of the growth requirements for an IC2 crop in one easy place
*
*
* @author ben
*
*/
@ZenClass("mods.ic2.GrowthRequirements")
@ModOnly("IC2")
public class GrowthRequirements {
private int minNutrients;
@@ -25,7 +27,7 @@ public class GrowthRequirements {
/**
* Get the minimum amount of nutrients this plant needs to grow
*
*
* @return The minimum amount of nutrients this plant needs
*/
@ZenGetter("minNutrients")
@@ -35,7 +37,7 @@ public class GrowthRequirements {
/**
* Set the minimum amount of nutrients this plant needs to grow
*
*
* @param minNutrients The new minimum amount of nutrients this plant requires
*/
@ZenSetter("minNutrients")
@@ -45,7 +47,7 @@ public class GrowthRequirements {
/**
* Get the minimum amount of humidity this plant requires
*
*
* @return The minimum amount of humidity this plant requires
*/
@ZenGetter("minHumidity")
@@ -55,7 +57,7 @@ public class GrowthRequirements {
/**
* Set the minimum amount of humidity this plant requires
*
*
* @param minHumidity The new minimum amount of humidity this plant requires
*/
@ZenSetter("minHumidity")
@@ -65,7 +67,7 @@ public class GrowthRequirements {
/**
* Get the minimum air quality this plant requires
*
*
* @return The minimum air quality this plant requires
*/
@ZenGetter("minAirQuality")
@@ -75,7 +77,7 @@ public class GrowthRequirements {
/**
* Set the minimum air quality this plant requires
*
*
* @param minAirQuality The new amount of air quality this plant requires
*/
@ZenSetter("minAirQuality")
@@ -85,7 +87,7 @@ public class GrowthRequirements {
/**
* Get the minimum amount of light this plant requires
*
*
* @return The minimum amount of light this plant requires
*/
@ZenGetter("minLight")
@@ -95,7 +97,7 @@ public class GrowthRequirements {
/**
* Set the minimum amount of light this plant requires
*
*
* @param minLight The new minimum amount of light this plant requires
*/
@ZenSetter("minLight")
@@ -105,7 +107,7 @@ public class GrowthRequirements {
/**
* Get the maximum amount of light this plant can have
*
*
* @return The maximum amount of light this plant can have
*/
@ZenGetter("maxLight")
@@ -115,7 +117,7 @@ public class GrowthRequirements {
/**
* Set the maximum amount of light this plant can have
*
*
* @param maxLight The new maximum amount of light thi plant can have
*/
@ZenSetter("maxLight")
@@ -125,7 +127,7 @@ public class GrowthRequirements {
/**
* Get the block that is required to be below this one
*
*
* @return The block required to be below this one
*/
@ZenGetter("requiredBlock")
@@ -135,7 +137,7 @@ public class GrowthRequirements {
/**
* Set the block required to be below this one
*
*
* @param requiredBlock The new block required to be below this one
*/
@ZenSetter("requiredBlock")
@@ -9,6 +9,7 @@ import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.crops.CropCard;
import ic2.api.crops.ICropTile;
import minetweaker.MineTweakerAPI;
import minetweaker.annotations.ModOnly;
import minetweaker.api.item.IItemStack;
import minetweaker.api.minecraft.MineTweakerMC;
import stanhebben.zenscript.annotations.ZenClass;
@@ -18,17 +19,18 @@ import stanhebben.zenscript.annotations.ZenSetter;
/**
* A synthetic crop, created in ZS
*
*
* For your crop textures to be picked up, put them at owner + ":crops/crop" + name + "." + size where owner is the mod
* responsible for the crop name is the name of the crop size is the current size of the crop, starting at 0 for new
* crops
*
*
* Localizations will be looked for at owner + ".crop." + name where each field has the value it has above
*
*
* @author ben
*
*/
@ZenClass("mods.ic2.SyntheticCrop")
@ModOnly("IC2")
public class SyntheticCrop extends CropCard {
private String name;
@@ -48,7 +50,7 @@ public class SyntheticCrop extends CropCard {
/**
* Create a new synthetic crop
*
*
* @param cropName The name of this crop
* @param cropOwner The mod creating this crop
*/
@@ -94,7 +96,7 @@ public class SyntheticCrop extends CropCard {
/**
* Gets the value of a particular stat for this crop
*
*
* Stats: - 0: Chemistry (Industrial uses based on chemical plant components) - 1: Consumable (Food, potion
* ingredients, stuff meant to be eaten or similarly used) - 2: Defensive (Plants with defense capabilities
* (damaging, explosive, chemical) or special abilities in general) - 3: Colorful (How
@@ -186,7 +188,7 @@ public class SyntheticCrop extends CropCard {
/**
* Sets the tier of this crop
*
*
* @param tier The new tier of this crop
*/
@ZenSetter("tier")
@@ -196,7 +198,7 @@ public class SyntheticCrop extends CropCard {
/**
* Sets all of the stats for this crop
*
*
* @param stats The new stats to give to this crop
*/
@ZenSetter("stats")
@@ -206,7 +208,7 @@ public class SyntheticCrop extends CropCard {
/**
* Sets an individual stat for this crop
*
*
* @param stat The stat to set a value for
* @param val The new value for this stat
*/
@@ -221,7 +223,7 @@ public class SyntheticCrop extends CropCard {
/**
* Sets the additional attributes for this crop
*
*
* @param attributes Sets the attributes of this crop
*/
@ZenSetter("attributes")
@@ -231,7 +233,7 @@ public class SyntheticCrop extends CropCard {
/**
* Sets the maximum size this crop goes to
*
*
* @param maxSize The new max size of this crop
*/
@ZenSetter("maxSize")
@@ -241,7 +243,7 @@ public class SyntheticCrop extends CropCard {
/**
* Sets the item this crop gives when harvested
*
*
* @param fruit The item to give from the crop
*/
@ZenSetter("fruit")
@@ -251,7 +253,7 @@ public class SyntheticCrop extends CropCard {
/**
* Sets the chance for this plant to yield its fruit
*
*
* @param dropChance The new chance for this plant to yield fruit
*/
@ZenSetter("dropChance")
@@ -261,7 +263,7 @@ public class SyntheticCrop extends CropCard {
/**
* Get the current requirements for this plant to grow
*
*
* @return The current growth requirements for this plant
*/
public GrowthRequirements getReqs() {
@@ -270,7 +272,7 @@ public class SyntheticCrop extends CropCard {
/**
* Set the current growth requirements for this plant to grow
*
*
* @param reqs The new requirements for this plant to grow
*/
public void setReqs(GrowthRequirements reqs) {