Compare commits

...
4 Commits
Author SHA1 Message Date
Martin Robertz b5ac446e55 update bs+deps 2023-10-11 23:14:28 +02:00
ghostflyby c00e1b39da NEI item manager overlay integration (#38)
* New: NEI item manager overly integration

* update buildscript

* apply spotless

* Making nei really optional

* Fix wildcard

* Stream chain simplify

* Fix: NPE when events outside the Gui

* Fix: drag and mouse event

* Fix: call mouse event
2023-10-11 14:35:28 +09:00
Lyfts 6e6e806476 fix incubator for real this time (#37) 2023-09-06 19:48:53 +02:00
miozuneandMartin Robertz ef877e2f7d Fix NPE with Lumbermill (#35)
* Remove outdated script

* updateBuildScript

* Update dependencies

* Fix NPE with Lumbermill

---------

Co-authored-by: Martin Robertz <[email protected]>
2023-08-19 12:34:10 +02:00
23 changed files with 299 additions and 149 deletions

No files matched your search

-33
View File
@@ -1,33 +0,0 @@
#!/usr/bin/env bash
RUNDIR="run"
CRASH="crash-reports"
SERVERLOG="server.log"
if [[ -d $RUNDIR/$CRASH ]]; then
echo "Crash reports detected:"
cat $RUNDIR/$CRASH/crash*.txt
exit 1
fi
if grep --quiet "Fatal errors were detected" $SERVERLOG; then
echo "Fatal errors detected:"
cat server.log
exit 1
fi
if grep --quiet "The state engine was in incorrect state ERRORED and forced into state SERVER_STOPPED" $SERVERLOG; then
echo "Server force stopped:"
cat server.log
exit 1
fi
if ! grep --quiet -Po '.+Done \(.+\)\! For help, type "help" or "\?"' $SERVERLOG; then
echo "Server didn't finish startup:"
cat server.log
exit 1
fi
echo "No crash reports detected"
exit 0
+87 -68
View File
@@ -1,4 +1,4 @@
//version: 1689409577
//version: 1696952014
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -69,7 +69,7 @@ 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.19'
id 'com.gtnewhorizons.retrofuturagradle' version '1.3.24'
}
print("You might want to check out './gradlew :faq' if your build fails.\n")
@@ -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")
@@ -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/"
@@ -401,9 +429,13 @@ if (identifiedVersion == versionOverride) {
group = "com.github.GTNewHorizons"
if (project.hasProperty("customArchiveBaseName") && customArchiveBaseName) {
archivesBaseName = customArchiveBaseName
base {
archivesName = customArchiveBaseName
}
} else {
archivesBaseName = modId
base {
archivesName = modId
}
}
@@ -558,9 +590,6 @@ repositories {
maven {
name 'Overmind forge repo mirror'
url 'https://gregtech.overminddl1.com/'
mavenContent {
excludeGroup("net.minecraftforge") // missing the `universal` artefact
}
}
maven {
name = "GTNH Maven"
@@ -575,24 +604,34 @@ repositories {
}
}
if (includeWellKnownRepositories.toBoolean()) {
maven {
name "CurseMaven"
url "https://cursemaven.com"
content {
exclusiveContent {
forRepository {
maven {
name "CurseMaven"
url "https://cursemaven.com"
}
}
filter {
includeGroup "curse.maven"
}
}
exclusiveContent {
forRepository {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
}
}
filter {
includeGroup "maven.modrinth"
}
}
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()
@@ -612,6 +651,8 @@ def mixinProviderSpecNoClassifer = "${mixinProviderGroup}:${mixinProviderModule}
def mixinProviderSpec = "${mixinProviderSpecNoClassifer}:dev"
ext.mixinProviderSpec = mixinProviderSpec
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
dependencies {
if (usesMixins.toBoolean()) {
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
@@ -623,7 +664,7 @@ dependencies {
}
}
if (usesMixins.toBoolean()) {
implementation(mixinProviderSpec)
implementation(modUtils.enableMixins(mixinProviderSpec, mixingConfigRefMap))
} else if (forceEnableMixins.toBoolean()) {
runtimeOnlyNonPublishable(mixinProviderSpec)
}
@@ -676,11 +717,6 @@ if (file('dependencies.gradle.kts').exists()) {
throw new RuntimeException("Missing dependencies.gradle[.kts]")
}
def mixingConfigRefMap = 'mixins.' + modId + '.refmap.json'
def mixinTmpDir = buildDir.path + File.separator + 'tmp' + File.separator + 'mixins'
def refMap = "${mixinTmpDir}" + File.separator + mixingConfigRefMap
def mixinSrg = "${mixinTmpDir}" + File.separator + "mixins.srg"
tasks.register('generateAssets') {
group = "GTNH Buildscript"
description = "Generates a mixin config file at /src/main/resources/mixins.modid.json if needed"
@@ -711,46 +747,17 @@ tasks.register('generateAssets') {
}
if (usesMixins.toBoolean()) {
tasks.named("reobfJar", ReobfuscatedJar).configure {
extraSrgFiles.from(mixinSrg)
}
tasks.named("processResources").configure {
dependsOn("generateAssets")
}
tasks.named("compileJava", JavaCompile).configure {
doFirst {
new File(mixinTmpDir).mkdirs()
}
options.compilerArgs += [
"-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}",
"-AoutSrgFile=${mixinSrg}",
"-AoutRefMapFile=${refMap}",
// Elan: from what I understand they are just some linter configs so you get some warning on how to properly code
"-XDenableSunApiLintControl",
"-XDignore.symbol.file"
]
}
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
kapt {
correctErrorTypes = true
javacOptions {
option("-AreobfSrgFile=${tasks.reobfJar.srg.get().asFile}")
option("-AoutSrgFile=$mixinSrg")
option("-AoutRefMapFile=$refMap")
}
}
tasks.configureEach { task ->
if (task.name == "kaptKotlin") {
task.doFirst {
new File(mixinTmpDir).mkdirs()
}
}
}
}
}
tasks.named("processResources", ProcessResources).configure {
@@ -768,7 +775,6 @@ tasks.named("processResources", ProcessResources).configure {
}
if (usesMixins.toBoolean()) {
from refMap
dependsOn("compileJava", "compileScala")
}
}
@@ -787,23 +793,14 @@ ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies"
}
dependencies {
def lwjgl3ifyVersion = '1.4.0'
def asmVersion = '9.4'
def lwjgl3ifyVersion = '1.5.1'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.2.19')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.3.7')
}
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
java17PatchDependencies("org.ow2.asm:asm:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-commons:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-tree:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-analysis:${asmVersion}")
java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}")
java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1')
java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0")
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
}
@@ -1166,7 +1163,10 @@ tasks.named("processIdeaSettings").configure {
tasks.named("ideVirtualMainClasses").configure {
// Make IntelliJ "Build project" build the mod jars
dependsOn("jar", "reobfJar", "spotlessCheck")
dependsOn("jar", "reobfJar")
if (!disableSpotless) {
dependsOn("spotlessCheck")
}
}
// workaround variable hiding in pom processing
@@ -1311,7 +1311,7 @@ def addCurseForgeRelation(String type, String name) {
// Updating
def buildscriptGradleVersion = "8.1.1"
def buildscriptGradleVersion = "8.2.1"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
@@ -1590,6 +1590,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'
+3 -4
View File
@@ -1,12 +1,11 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.6.14:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.0.13:dev')
compile('com.github.GTNewHorizons:ForestryMC:4.6.13:dev')
compile('com.github.GTNewHorizons:NotEnoughItems:2.3.76-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.34:api')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.4.3-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.36:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly('curse.maven:cofh-lib-220333:2388748')
}
Binary file not shown.
+1 -1
View File
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+4 -3
View File
@@ -85,9 +85,6 @@ done
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -197,6 +194,10 @@ if "$cygwin" || "$msys" ; then
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
-22
View File
@@ -1,26 +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/'
allowInsecureProtocol
}
maven {
name 'ic2'
url 'http://maven.ic2.player.to/'
metadataSources {
mavenPom()
artifact()
}
}
maven {
url 'https://cursemaven.com'
content {
includeGroup 'curse.maven'
}
}
maven {
url 'https://jitpack.io'
}
}
@@ -11,6 +11,7 @@ import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.JsonToNBT;
import net.minecraft.nbt.NBTException;
@@ -30,6 +31,8 @@ import binnie.core.craftgui.events.EventMouse;
import binnie.core.craftgui.geometry.IArea;
import binnie.core.craftgui.geometry.IBorder;
import binnie.core.craftgui.geometry.IPoint;
import binnie.core.craftgui.minecraft.control.ControlSlot;
import binnie.core.nei.NEIHook;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@@ -76,6 +79,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override
public void drawScreen(int mouseX, int mouseY, float par3) {
NEIHook.preDraw();
window.setMousePosition(mouseX - (int) window.getPosition().x(), mouseY - (int) window.getPosition().y());
drawDefaultBackground();
@@ -89,6 +94,9 @@ public class GuiCraftGUI extends GuiContainer {
window.render();
RenderHelper.enableGUIStandardItemLighting();
NEIHook.renderObjects(window, mouseX, mouseY);
GL11.glPushMatrix();
GL11.glEnable(32826); // GL_RESCALE_NORMAL_EXT
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0f, 240.0f);
@@ -111,6 +119,8 @@ public class GuiCraftGUI extends GuiContainer {
window.getTooltip(tooltip);
}
NEIHook.renderToolTips(mouseX, mouseY);
if (tooltip.exists()) {
renderTooltip(new IPoint(mouseX, mouseY), tooltip);
}
@@ -219,6 +229,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override
protected void mouseClicked(int x, int y, int button) {
NEIHook.mouseClicked(x, y, button);
IWidget origin = window;
if (window.getMousedOverWidget() != null) {
origin = window.getMousedOverWidget();
@@ -228,6 +240,8 @@ public class GuiCraftGUI extends GuiContainer {
@Override
protected void keyTyped(char c, int key) {
NEIHook.lastKeyTyped(key, c);
if (key == 1 || (key == mc.gameSettings.keyBindInventory.getKeyCode() && window.getFocusedWidget() == null)) {
mc.thePlayer.closeScreen();
}
@@ -241,6 +255,7 @@ public class GuiCraftGUI extends GuiContainer {
if (button != -1) {
window.callEvent(new EventMouse.Up(origin, x, y, button));
}
NEIHook.mouseUp(x, y, button);
}
@Override
@@ -250,6 +265,8 @@ public class GuiCraftGUI extends GuiContainer {
if (dWheel != 0) {
window.callEvent(new EventMouse.Wheel(window, dWheel));
}
NEIHook.handleMouseWheel();
}
@Override
@@ -506,4 +523,9 @@ public class GuiCraftGUI extends GuiContainer {
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
public ItemStack getStackUnderMouse(int x, int y) {
return window.calculateMousedOverWidgets().stream().filter(widget -> widget instanceof ControlSlot).findFirst()
.map(w -> ((ControlSlot) w).slot).map(Slot::getStack).orElse(null);
}
}
@@ -122,7 +122,7 @@ public class TransferRequest {
|| ((IInventorySlots) destination).getSlot(slot) == null
|| !((IInventorySlots) destination).getSlot(slot).isRecipe()) {
if (destination.getStackInSlot(slot) != null) {
if (item.isStackable()) {
if (item.isStackable() && destination.getInventoryStackLimit() > 1) {
ItemStack merged = destination.getStackInSlot(slot).copy();
ItemStack[] newStacks = mergeStacks(item.copy(), merged.copy());
item = newStacks[0];
@@ -158,8 +158,9 @@ public class TransferRequest {
if (item.stackSize <= 0) {
item = null;
}
return item;
}
return item;
return null;
}
}
}
@@ -0,0 +1,49 @@
package binnie.core.nei;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import binnie.core.craftgui.minecraft.GuiCraftGUI;
import codechicken.nei.guihook.IContainerObjectHandler;
import cpw.mods.fml.common.Optional;
@Optional.Interface(
iface = "codechicken.nei.guihook.IContainerObjectHandler",
modid = "NotEnoughItems",
striprefs = true)
public final class ContainerObjectHandler implements IContainerObjectHandler {
@Override
public void guiTick(GuiContainer gui) {
}
@Override
public void refresh(GuiContainer gui) {
}
@Override
public void load(GuiContainer gui) {
}
@Override
public ItemStack getStackUnderMouse(GuiContainer gui, int mousex, int mousey) {
if (gui instanceof GuiCraftGUI) {
return ((GuiCraftGUI) gui).getStackUnderMouse(mousex, mousey);
} else {
return null;
}
}
@Override
public boolean objectUnderMouse(GuiContainer gui, int mousex, int mousey) {
return false;
}
@Override
public boolean shouldShowTooltip(GuiContainer gui) {
return true;
}
}
+107
View File
@@ -0,0 +1,107 @@
package binnie.core.nei;
import org.lwjgl.opengl.GL11;
import binnie.core.craftgui.minecraft.Window;
import codechicken.nei.guihook.GuiContainerManager;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public final class NEIHook {
public static boolean enabled = false;
static {
if (Loader.isModLoaded("NotEnoughItems")) {
enabled = true;
addHandler();
}
}
@Optional.Method(modid = "NotEnoughItems")
private static void addHandler() {
GuiContainerManager.addObjectHandler(new ContainerObjectHandler());
}
@Optional.Method(modid = "NotEnoughItems")
private static GuiContainerManager getManager() {
return GuiContainerManager.getManager();
}
@Optional.Method(modid = "NotEnoughItems")
private static void preDrawImpl() {
GuiContainerManager manager = getManager();
if (manager != null) manager.preDraw();
}
public static void preDraw() {
if (enabled) preDrawImpl();
}
@Optional.Method(modid = "NotEnoughItems")
private static void renderObjectsImpl(Window window, int mouseX, int mouseY) {
GL11.glPushMatrix();
GL11.glTranslatef(window.x(), window.y(), 0.0f);
GuiContainerManager manager = getManager();
if (manager != null) manager.renderObjects(mouseX, mouseY);
GL11.glTranslatef(-window.x(), -window.y(), 0.0f);
GL11.glPopMatrix();
}
public static void renderObjects(Window window, int mouseX, int mouseY) {
if (enabled) renderObjectsImpl(window, mouseX, mouseY);
}
@Optional.Method(modid = "NotEnoughItems")
private static void renderToolTipsImpl(int mouseX, int mouseY) {
GuiContainerManager manager = getManager();
if (manager != null) manager.renderToolTips(mouseX, mouseY);
}
public static void renderToolTips(int mouseX, int mouseY) {
if (enabled) renderToolTipsImpl(mouseX, mouseY);
}
@Optional.Method(modid = "NotEnoughItems")
private static void mouseClickedImpl(int x, int y, int button) {
GuiContainerManager manager = getManager();
if (manager != null) manager.mouseClicked(x, y, button);
}
public static void mouseClicked(int x, int y, int button) {
if (enabled) mouseClickedImpl(x, y, button);
}
@Optional.Method(modid = "NotEnoughItems")
private static void lastKeyTypedImpl(int k, char c) {
GuiContainerManager manager = getManager();
if (manager != null) manager.lastKeyTyped(k, c);
}
public static void lastKeyTyped(int k, char c) {
if (enabled) lastKeyTypedImpl(k, c);
}
@Optional.Method(modid = "NotEnoughItems")
private static void handleMouseWheelImpl() {
GuiContainerManager manager = getManager();
if (manager != null) manager.handleMouseWheel();
}
public static void handleMouseWheel() {
if (enabled) handleMouseWheelImpl();
}
@Optional.Method(modid = "NotEnoughItems")
private static void mouseUpImpl(int mouseX, int mouseY, int button) {
GuiContainerManager manager = getManager();
if (manager != null) manager.mouseUp(mouseX, mouseY, button);
}
public static void mouseUp(int mouseX, int mouseY, int button) {
if (enabled) mouseUpImpl(mouseX, mouseY, button);
}
}
+5 -1
View File
@@ -2,7 +2,11 @@ package binnie.core.nei;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.*;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidBlock;
import net.minecraftforge.fluids.IFluidContainerItem;
public class NEIUtils {
@@ -1,6 +1,7 @@
package binnie.core.nei;
import java.awt.*;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.core.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,7 @@
package binnie.core.nei;
import java.awt.*;
import java.awt.Point;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -4,7 +4,9 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import binnie.extrabees.genetics.requirements.*;
import binnie.extrabees.genetics.requirements.DummyMutationCondition;
import binnie.extrabees.genetics.requirements.IMutationRequirement;
import binnie.extrabees.genetics.requirements.RequirementPerson;
import forestry.api.apiculture.BeeManager;
import forestry.api.apiculture.IAlleleBeeSpecies;
import forestry.api.apiculture.IBeeGenome;
@@ -29,19 +29,18 @@ public class Lumbermill {
public static Map<ItemStack, ItemStack> recipes = new HashMap<>();
public static ItemStack getPlankProduct(ItemStack item) {
ItemStack stack = null;
if (Lumbermill.recipes.isEmpty()) {
calculateLumbermillProducts();
}
for (Map.Entry<ItemStack, ItemStack> entry : Lumbermill.recipes.entrySet()) {
if (entry.getKey().isItemEqual(item)) {
stack = entry.getValue().copy();
break;
ItemStack stack = entry.getValue().copy();
stack.stackSize = 6;
return stack;
}
}
stack.stackSize = 6;
return stack;
return null;
}
public static void calculateLumbermillProducts() {
@@ -1,6 +1,6 @@
package binnie.extratrees.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;
@@ -1,6 +1,6 @@
package binnie.genetics.nei;
import java.awt.*;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.List;