Compare commits

...
4 Commits
Author SHA1 Message Date
Martin Robertz 3dc2806b36 update bs+deps 2023-11-15 10:13:07 +01:00
Pelotrio a609f5dce5 Optimized flower color enumeration array retrieval (#40) 2023-11-15 00:19:42 +00:00
Martin Robertz 00c214ee5d update deps 2023-10-21 12:22:30 +02:00
miozune e497b9505a Optimize PlankType$ExtraBiomesPlank.getStack() (#39) 2023-10-21 10:55:44 +02:00
7 changed files with 31 additions and 21 deletions

No files matched your search

+7 -1
View File
@@ -26,7 +26,13 @@ whitelist.json
*.iml *.iml
*.ipr *.ipr
*.iws *.iws
src/main/resources/mixins.*.json src/main/resources/mixins.*([!.]).json
*.bat *.bat
*.DS_Store *.DS_Store
!gradlew.bat !gradlew.bat
.factorypath
addon.local.gradle
addon.local.gradle.kts
addon.late.local.gradle
addon.late.local.gradle.kts
layout.json
+4 -5
View File
@@ -1,4 +1,4 @@
//version: 1696952014 //version: 1699290261
/* /*
DO NOT CHANGE THIS FILE! DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available. Also, you may replace this file at any time if there is an update available.
@@ -646,7 +646,7 @@ repositories {
def mixinProviderGroup = "io.github.legacymoddingmc" def mixinProviderGroup = "io.github.legacymoddingmc"
def mixinProviderModule = "unimixins" def mixinProviderModule = "unimixins"
def mixinProviderVersion = "0.1.7.1" def mixinProviderVersion = "0.1.13"
def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}" def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}:${mixinProviderVersion}"
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev" def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec ext.mixinProviderSpec = mixinProviderSpec
@@ -798,7 +798,7 @@ dependencies {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}") java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
} }
if (modId != 'hodgepodge') { if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.7') java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17')
} }
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false} java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
@@ -1187,9 +1187,8 @@ publishing {
version = System.getenv("RELEASE_VERSION") ?: identifiedVersion version = System.getenv("RELEASE_VERSION") ?: identifiedVersion
} }
} }
repositories { repositories {
if (usesMavenPublishing.toBoolean()) { if (usesMavenPublishing.toBoolean() && System.getenv("MAVEN_USER") != null) {
maven { maven {
url = mavenPublishUrl url = mavenPublishUrl
allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven allowInsecureProtocol = mavenPublishUrl.startsWith("http://") // Mostly for the GTNH maven
+3 -2
View File
@@ -1,11 +1,12 @@
// Add your dependencies here // Add your dependencies here
dependencies { dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.6.14:dev') api('com.github.GTNewHorizons:ForestryMC:4.7.0:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.0.13:dev') implementation('com.github.GTNewHorizons:GTNHLib:0.0.13:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.4.3-GTNH:dev') devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.4.12-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.36:api') compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.36:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev') compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
} }
@@ -92,6 +92,7 @@ public enum EnumFlowerColor implements IFlowerColor {
YELLOW("yellow", 0xffff00), YELLOW("yellow", 0xffff00),
YELLOW_GREEN("yellowGreen", 0x9acd32); YELLOW_GREEN("yellowGreen", 0x9acd32);
private static final EnumFlowerColor[] ALL_VALUES = values();
private int color; private int color;
private int colorDis; private int colorDis;
private String name; private String name;
@@ -2963,7 +2964,7 @@ public enum EnumFlowerColor implements IFlowerColor {
} }
public static EnumFlowerColor get(int i) { public static EnumFlowerColor get(int i) {
return values()[Math.max(0, i) % values().length]; return ALL_VALUES[Math.max(0, i) % ALL_VALUES.length];
} }
@Override @Override
+2
View File
@@ -12,6 +12,7 @@ public class Mods {
public static Mod forestry; public static Mod forestry;
public static Mod ic2; public static Mod ic2;
public static Mod botania; public static Mod botania;
public static Mod extraBiomes;
private static Item findItem(String modId, String name) { private static Item findItem(String modId, String name) {
Item stack = GameRegistry.findItem(modId, name); Item stack = GameRegistry.findItem(modId, name);
@@ -41,6 +42,7 @@ public class Mods {
Mods.forestry = new Mod("Forestry"); Mods.forestry = new Mod("Forestry");
Mods.ic2 = new Mod("IC2"); Mods.ic2 = new Mod("IC2");
Mods.botania = new Mod("Botania"); Mods.botania = new Mod("Botania");
Mods.extraBiomes = new Mod("ExtrabiomesXL");
} }
public static class Mod { public static class Mod {
@@ -8,13 +8,12 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon; import net.minecraft.util.IIcon;
import com.google.common.base.Optional;
import binnie.core.Mods; import binnie.core.Mods;
import binnie.core.block.TileEntityMetadata; import binnie.core.block.TileEntityMetadata;
import binnie.core.util.I18N; import binnie.core.util.I18N;
import binnie.extratrees.ExtraTrees; import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.CarpentryManager; import binnie.extratrees.api.CarpentryManager;
import extrabiomes.api.Stuff;
public class PlankType { public class PlankType {
@@ -267,13 +266,10 @@ public class PlankType {
@Override @Override
public ItemStack getStack() { public ItemStack getStack() {
try { if (!Mods.extraBiomes.active()) {
Class clss = Class.forName("extrabiomes.api.Stuff");
Block block = (Block) ((Optional) clss.getField("planks").get(null)).get();
return new ItemStack(block, 1, ordinal());
} catch (Exception e) {
return null; return null;
} }
return Stuff.planks.transform(block -> new ItemStack(block, 1, ordinal())).orNull();
} }
@Override @Override
@@ -8,6 +8,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import binnie.core.Mods;
import binnie.core.block.TileEntityMetadata; import binnie.core.block.TileEntityMetadata;
import binnie.extratrees.ExtraTrees; import binnie.extratrees.ExtraTrees;
import binnie.extratrees.api.CarpentryManager; import binnie.extratrees.api.CarpentryManager;
@@ -17,6 +18,8 @@ import binnie.extratrees.block.decor.FenceType;
public class WoodManager { public class WoodManager {
private static List<IPlankType> allPlankTypes;
public static IPlankType getPlankType(int index) { public static IPlankType getPlankType(int index) {
IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index); IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
if (wood instanceof IPlankType) { if (wood instanceof IPlankType) {
@@ -97,16 +100,18 @@ public class WoodManager {
} }
public static List<IPlankType> getAllPlankTypes() { public static List<IPlankType> getAllPlankTypes() {
if (allPlankTypes != null) {
return allPlankTypes;
}
List<IPlankType> list = new ArrayList<>(); List<IPlankType> list = new ArrayList<>();
Collections.addAll(list, PlankType.ExtraTreePlanks.values()); Collections.addAll(list, PlankType.ExtraTreePlanks.values());
Collections.addAll(list, PlankType.ForestryPlanks.values()); Collections.addAll(list, PlankType.ForestryPlanks.values());
for (IPlankType type : PlankType.ExtraBiomesPlank.values()) { if (Mods.extraBiomes.active()) {
if (type.getStack() != null) { Collections.addAll(list, PlankType.ExtraBiomesPlank.values());
list.add(type);
}
} }
Collections.addAll(list, PlankType.VanillaPlanks.values()); Collections.addAll(list, PlankType.VanillaPlanks.values());
allPlankTypes = list;
return list; return list;
} }