mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-16 10:44:45 +00:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
064f31f8db | ||
|
|
9b081ed2a7 | ||
|
|
2fc2ecf082 | ||
|
|
bc7efcfce5 | ||
|
|
0c5af2b892 |
No files matched your search
+5
-20
@@ -1,4 +1,4 @@
|
||||
//version: 1699290261
|
||||
//version: 1701530445
|
||||
/*
|
||||
DO NOT CHANGE THIS FILE!
|
||||
Also, you may replace this file at any time if there is an update available.
|
||||
@@ -28,27 +28,12 @@ import java.util.concurrent.TimeUnit
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
maven {
|
||||
name 'forge'
|
||||
url 'https://maven.minecraftforge.net'
|
||||
}
|
||||
maven {
|
||||
// GTNH RetroFuturaGradle and ASM Fork
|
||||
name "GTNH Maven"
|
||||
url "http://jenkins.usrv.eu:8081/nexus/content/groups/public/"
|
||||
allowInsecureProtocol = true
|
||||
}
|
||||
maven {
|
||||
name 'sonatype'
|
||||
url 'https://oss.sonatype.org/content/repositories/snapshots/'
|
||||
}
|
||||
maven {
|
||||
name 'Scala CI dependencies'
|
||||
url 'https://repo1.maven.org/maven2/'
|
||||
}
|
||||
|
||||
mavenLocal()
|
||||
}
|
||||
}
|
||||
@@ -302,7 +287,7 @@ if (apiPackage) {
|
||||
}
|
||||
|
||||
if (accessTransformersFile) {
|
||||
for (atFile in accessTransformersFile.split(",")) {
|
||||
for (atFile in accessTransformersFile.split(" ")) {
|
||||
String targetFile = "src/main/resources/META-INF/" + atFile.trim()
|
||||
if (!getFile(targetFile).exists()) {
|
||||
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
|
||||
@@ -793,12 +778,12 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
def lwjgl3ifyVersion = '1.5.1'
|
||||
def lwjgl3ifyVersion = '1.5.7'
|
||||
if (modId != 'lwjgl3ify') {
|
||||
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
|
||||
}
|
||||
if (modId != 'hodgepodge') {
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.17')
|
||||
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.35')
|
||||
}
|
||||
|
||||
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
|
||||
@@ -1310,7 +1295,7 @@ def addCurseForgeRelation(String type, String name) {
|
||||
|
||||
// Updating
|
||||
|
||||
def buildscriptGradleVersion = "8.2.1"
|
||||
def buildscriptGradleVersion = "8.5"
|
||||
|
||||
tasks.named('wrapper', Wrapper).configure {
|
||||
gradleVersion = buildscriptGradleVersion
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:CodeChickenLib:1.1.8:dev')
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.1.11:dev')
|
||||
api('com.github.GTNewHorizons:CodeChickenLib:1.1.10:dev')
|
||||
api('com.github.GTNewHorizons:CodeChickenCore:1.1.13:dev')
|
||||
shadowImplementation('org.apache.commons:commons-csv:1.10.0')
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
+2
-1
@@ -1,6 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -130,10 +130,13 @@ location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
|
||||
@@ -177,29 +177,43 @@ public class BookmarkPanel extends PanelWidget {
|
||||
}
|
||||
|
||||
BookmarkStackMeta meta;
|
||||
boolean isFirstColumn = false;
|
||||
boolean isIngredient = false;
|
||||
int size = size();
|
||||
int idx = 0;
|
||||
|
||||
while (idx < size) {
|
||||
ArrayList<Integer> pmask = new ArrayList<>();
|
||||
int lastIdx = idx;
|
||||
|
||||
for (int i = 0, perPage = rows * columns; i < perPage && idx < size; i++) {
|
||||
|
||||
if (isInvalidSlot(i)) {
|
||||
pmask.add(null);
|
||||
} else {
|
||||
meta = getMetadata(idx);
|
||||
isFirstColumn = (i % columns) == 0;
|
||||
isIngredient = meta.recipeId != null && meta.ingredient;
|
||||
|
||||
if (idx > 0 && ((i % columns) == 0) == (meta.recipeId != null && meta.ingredient
|
||||
&& meta.recipeId.equals(getRecipeId(idx - 1)))) {
|
||||
pmask.add(null);
|
||||
} else {
|
||||
if (isFirstColumn && !isIngredient) {
|
||||
pmask.add(idx++);
|
||||
|
||||
if ((i % columns) == 0) {
|
||||
todoItemsCount++;
|
||||
}
|
||||
todoItemsCount++;
|
||||
} else if (isIngredient && (!isFirstColumn || i + 1 < perPage && isInvalidSlot(i + 1))) {
|
||||
// The ingredients that do not fit on the first line are moved to the second starting with
|
||||
// the second column. This condition checks whether the second column is available. If not
|
||||
// available, the ingredient takes the first column
|
||||
pmask.add(idx++);
|
||||
} else {
|
||||
pmask.add(null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (lastIdx == idx) {
|
||||
break;
|
||||
}
|
||||
|
||||
gridMask.add(pmask);
|
||||
|
||||
@@ -476,7 +476,6 @@ public class NEIClientConfig {
|
||||
RecipeInfo.load();
|
||||
LayoutManager.load();
|
||||
NEIController.load();
|
||||
RecipeCatalysts.loadCatalystInfo();
|
||||
BookmarkContainerInfo.load();
|
||||
mainNEIConfigLoaded = true;
|
||||
|
||||
@@ -502,6 +501,8 @@ public class NEIClientConfig {
|
||||
}
|
||||
}
|
||||
|
||||
RecipeCatalysts.loadCatalystInfo();
|
||||
|
||||
// Set pluginNEIConfigLoaded here before posting the NEIConfigsLoadedEvent. This used to be the other
|
||||
// way around, but apparently if your modpack includes 800 mods the event poster might not return in
|
||||
// time and cause issues when loading a world for a second time as configLoaded is still false. This may
|
||||
|
||||
@@ -10,10 +10,8 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
import com.google.common.collect.ForwardingList;
|
||||
|
||||
import codechicken.nei.NEIClientConfig;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
|
||||
// Do not directly extend ArrayList, see Effective Java Item 16
|
||||
public class CatalystInfoList extends ForwardingList<CatalystInfo> {
|
||||
|
||||
private final String handlerID;
|
||||
@@ -34,16 +32,21 @@ public class CatalystInfoList extends ForwardingList<CatalystInfo> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(@Nonnull CatalystInfo catalystInfo) {
|
||||
if (contains(catalystInfo)) {
|
||||
NEIClientConfig.logger.info(
|
||||
String.format(
|
||||
"catalyst %s is already registered to handler %s",
|
||||
catalystInfo.getStack().getDisplayName(),
|
||||
handlerID));
|
||||
return false;
|
||||
public boolean add(@Nonnull CatalystInfo element) {
|
||||
return doAdd(element);
|
||||
}
|
||||
|
||||
public boolean add(@Nonnull CatalystInfo catalystInfo, boolean overwrite) {
|
||||
if (overwrite || !contains(catalystInfo)) {
|
||||
return add(catalystInfo);
|
||||
}
|
||||
super.add(catalystInfo);
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean doAdd(@Nonnull CatalystInfo catalystInfo) {
|
||||
catalystInfoList
|
||||
.removeIf(c -> NEIServerUtils.areStacksSameTypeCraftingWithNBT(c.getStack(), catalystInfo.getStack()));
|
||||
catalystInfoList.add(catalystInfo);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +131,12 @@ public class HandlerInfo {
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDisplayImage(DrawableResource drawable) {
|
||||
info.itemStack = null;
|
||||
info.image = drawable;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder setDisplayImage(ResourceLocation location, int imageX, int imageY, int imageWidth,
|
||||
int imageHeight) {
|
||||
info.itemStack = null;
|
||||
|
||||
@@ -132,6 +132,8 @@ public class RecipeCatalysts {
|
||||
recipeCatalystMap.clear();
|
||||
URL handlerUrl = RecipeCatalysts.class.getResource("/assets/nei/csv/catalysts.csv");
|
||||
|
||||
resolveAdderQueue();
|
||||
|
||||
URL url;
|
||||
if (fromJar) {
|
||||
url = handlerUrl;
|
||||
@@ -183,7 +185,7 @@ public class RecipeCatalysts {
|
||||
if (itemName == null || itemName.isEmpty()) continue;
|
||||
ItemStack stack = NEIServerUtils.getModdedItem(itemName, record.get("nbtInfo"));
|
||||
if (stack == null) {
|
||||
NEIClientConfig.logger.warn("Couldn't find ItemStack " + itemName);
|
||||
NEIClientConfig.logger.debug("Couldn't find ItemStack " + itemName);
|
||||
continue;
|
||||
}
|
||||
CatalystInfo catalystInfo = new CatalystInfo(stack, priority);
|
||||
@@ -208,13 +210,23 @@ public class RecipeCatalysts {
|
||||
handlerID = handler;
|
||||
}
|
||||
|
||||
addOrPut(recipeCatalystMap, handlerID, catalystInfo);
|
||||
// Prefer info added by API if we're using default jar config.
|
||||
// If not, user config overwrites it.
|
||||
addOrPut(recipeCatalystMap, handlerID, catalystInfo, !fromJar);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
NEIClientConfig.logger.warn("Error parsing CSV");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
if (fromJar) {
|
||||
resolveRemoverQueue();
|
||||
}
|
||||
|
||||
updatePosition(getHeight(), true);
|
||||
}
|
||||
|
||||
private static void resolveAdderQueue() {
|
||||
for (Map.Entry<String, CatalystInfoList> entry : catalystsAdderFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
for (CatalystInfo catalyst : entry.getValue()) {
|
||||
@@ -243,6 +255,9 @@ public class RecipeCatalysts {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private static void resolveRemoverQueue() {
|
||||
for (Map.Entry<String, List<ItemStack>> entry : catalystsRemoverFromAPI.entrySet()) {
|
||||
String handlerID = entry.getKey();
|
||||
if (recipeCatalystMap.containsKey(handlerID)) {
|
||||
@@ -258,8 +273,6 @@ public class RecipeCatalysts {
|
||||
entry.getValue().forEach(catalysts::remove);
|
||||
}
|
||||
}
|
||||
|
||||
updatePosition(getHeight(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,8 +288,13 @@ public class RecipeCatalysts {
|
||||
}
|
||||
|
||||
public static void addOrPut(Map<String, CatalystInfoList> map, String handlerID, CatalystInfo catalyst) {
|
||||
addOrPut(map, handlerID, catalyst, false);
|
||||
}
|
||||
|
||||
public static void addOrPut(Map<String, CatalystInfoList> map, String handlerID, CatalystInfo catalyst,
|
||||
boolean overwrite) {
|
||||
if (map.containsKey(handlerID)) {
|
||||
map.get(handlerID).add(catalyst);
|
||||
map.get(handlerID).add(catalyst, overwrite);
|
||||
} else {
|
||||
map.put(handlerID, new CatalystInfoList(handlerID, catalyst));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user