Compare commits

...
2 Commits
Author SHA1 Message Date
Martin Robertz 1ff37c0e3d Update dependencies.gradle 2023-01-25 22:47:12 +01:00
Raven Szewczyk 045c1ba13a Java 12 compat: don't resize the potion array if already big enough. (#41)
The actual compatible resizing is done in Hodgepodge.
2023-01-25 22:27:27 +01:00
3 changed files with 31 additions and 25 deletions

No files matched your search

+8 -3
View File
@@ -1,4 +1,4 @@
//version: 1673027205
//version: 1674409054
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -144,6 +144,7 @@ propertyDefaultIfUnset("modrinthProjectId", "")
propertyDefaultIfUnset("modrinthRelations", "")
propertyDefaultIfUnset("curseForgeProjectId", "")
propertyDefaultIfUnset("curseForgeRelations", "")
propertyDefaultIfUnset("minimizeShadowedDependencies", true)
String javaSourceDir = "src/main/java/"
String scalaSourceDir = "src/main/scala/"
@@ -411,7 +412,9 @@ shadowJar {
attributes(getManifestAttributes())
}
minimize() // This will only allow shading for actually used classes
if (minimizeShadowedDependencies.toBoolean()) {
minimize() // This will only allow shading for actually used classes
}
configurations = [
project.configurations.shadowImplementation,
project.configurations.shadowCompile
@@ -554,7 +557,9 @@ task shadowDevJar(type: ShadowJar) {
attributes(getManifestAttributes())
}
minimize() // This will only allow shading for actually used classes
if (minimizeShadowedDependencies.toBoolean()) {
minimize() // This will only allow shading for actually used classes
}
configurations = [
project.configurations.shadowImplementation,
project.configurations.shadowCompile
+7 -7
View File
@@ -2,32 +2,32 @@
dependencies {
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.40.31:dev") {
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.41.242:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Botania:1.9.5-GTNH:api") {
compileOnly("com.github.GTNewHorizons:Botania:1.9.14-GTNH:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ForestryMC:4.4.4:api") {
compileOnly("com.github.GTNewHorizons:ForestryMC:4.5.6:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.2.7:dev") {
compileOnly("com.github.GTNewHorizons:ForgeMultipart:1.3.1:dev") {
transitive = false
}
compile("com.github.GTNewHorizons:CodeChickenLib:1.1.5.7:dev")
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.3.20-GTNH:dev") {
compileOnly("com.github.GTNewHorizons:NotEnoughItems:2.3.21-GTNH:dev") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Chisel:2.10.6-GTNH:api") {
compileOnly("com.github.GTNewHorizons:Chisel:2.10.16-GTNH:api") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:ZenScript:1.0.0-GTNH") {
transitive = false
}
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.6:dev") {
compileOnly("com.github.GTNewHorizons:CraftTweaker:3.2.9:dev") {
transitive = false
}
@@ -463,24 +463,25 @@ public class AlchemicalWizardry {
BloodMagicConfiguration.init(new File(event.getModConfigurationDirectory(), "AWWayofTime.cfg"));
// Custom config stuff goes here
Potion[] potionTypes;
for (Field f : Potion.class.getDeclaredFields()) {
f.setAccessible(true);
if (Potion.potionTypes.length < 256) {
for (Field f : Potion.class.getDeclaredFields()) {
f.setAccessible(true);
try {
if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
potionTypes = (Potion[]) f.get(null);
final Potion[] newPotionTypes = new Potion[256];
System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
f.set(null, newPotionTypes);
try {
if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
Field modfield = Field.class.getDeclaredField("modifiers");
modfield.setAccessible(true);
modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
final Potion[] oldPotionTypes = Potion.potionTypes;
final Potion[] newPotionTypes = new Potion[256];
System.arraycopy(oldPotionTypes, 0, newPotionTypes, 0, oldPotionTypes.length);
f.set(null, newPotionTypes);
}
} catch (Exception e) {
System.err.println("Severe error, please report this to the mod author:");
System.err.println(e);
}
} catch (Exception e) {
System.err.println("Severe error, please report this to the mod author:");
System.err.println(e);
}
}
AlchemicalWizardry.lifeEssenceFluid = new LifeEssence("LifeEssence");