Compare commits

...
4 Commits
Author SHA1 Message Date
Martin Robertz e5964f67aa update 2025-12-09 16:00:43 +01:00
Martin Robertz 1f251703aa Merge branch 'master' into dev 2025-12-09 16:00:19 +01:00
Martin Robertz 65f1627a97 update 2025-11-14 21:25:50 +01:00
Fabian Maurer dde6c79f9e Move out larvae from splicer even when no serum is present anymore 2025-11-12 23:13:18 +01:00
10 changed files with 76 additions and 13 deletions

No files matched your search

+4 -4
View File
@@ -1,12 +1,12 @@
// Add your dependencies here
dependencies {
api('com.github.GTNewHorizons:ForestryMC:4.10.17:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.7.0:dev')
api('com.github.GTNewHorizons:ForestryMC:4.11.2:dev')
implementation('com.github.GTNewHorizons:GTNHLib:0.8.25:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.0-GTNH:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.40-GTNH:dev')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.44:api')
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.47:api')
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:dev')
compileOnly("curse.maven:extrabiomesxl-60041:2273301")
}
+9 -1
View File
@@ -96,7 +96,9 @@ usesMixinDebug = false
# Specify the location of your implementation of IMixinConfigPlugin. Leave it empty otherwise.
mixinPlugin =
# Specify the package that contains all of your Mixins. You may only place Mixins in this package or the build will fail!
# Specify the package that contains all of your Mixins. The package must exist or
# the build will fail. If you have a package property defined in your mixins.<modid>.json,
# it must match with this or the build will fail.
mixinsPackage =
# Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin!
@@ -172,6 +174,12 @@ curseForgeRelations =
# projects. New projects should not use this parameter.
customArchiveBaseName = binnie-mods
# Optional parameter to customize the default working directory used by the runClient* tasks. Relative to the project directory.
# runClientWorkingDirectory = run/client
# Optional parameter to customize the default working directory used by the runServer* tasks. Relative to the project directory.
# runServerWorkingDirectory = run/server
# Optional parameter to have the build automatically fail if an illegal version is used.
# This can be useful if you e.g. only want to allow versions in the form of '1.1.xxx'.
# The check is ONLY performed if the version is a git tag.
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.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Vendored
+2 -2
View File
@@ -114,7 +114,7 @@ case "$( uname )" in #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
CLASSPATH="\\\"\\\""
# Determine the Java command to use to start the JVM.
@@ -213,7 +213,7 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
Vendored
+2 -2
View File
@@ -70,11 +70,11 @@ goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
set CLASSPATH=
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
+1 -1
View File
@@ -17,5 +17,5 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.43'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
}
@@ -9,4 +9,11 @@ public interface IProcess extends IErrorStateSource {
boolean isInProgress();
ProcessInfo getInfo();
/***
* Returns true if the current target got worked on at least once.
*/
default boolean workedOnTarget() {
return false;
}
}
@@ -19,6 +19,10 @@ import forestry.api.genetics.IIndividual;
public class SplicerComponentLogic extends ComponentProcessSetCost implements IProcess {
// Needed to keep stack. If user takes out target slot and it gets automatically refilled, this happens in the same
// tick
private ItemStack workedOnStack = null;
public int nOfGenes;
public SplicerComponentLogic(Machine machine) {
@@ -50,6 +54,11 @@ public class SplicerComponentLogic extends ComponentProcessSetCost implements IP
public void onInventoryUpdate() {
super.onInventoryUpdate();
nOfGenes = getGenesToUse();
ItemStack newTarget = getUtil().getStack(Splicer.SLOT_TARGET);
if (newTarget == null || !ItemStack.areItemStacksEqual(workedOnStack, newTarget)) {
workedOnStack = null;
}
}
protected int getGenesToUse() {
@@ -190,5 +199,31 @@ public class SplicerComponentLogic extends ComponentProcessSetCost implements IP
Splicer.setGene(gene, target, 1);
}
getUtil().damageItem(Splicer.SLOT_SERUM_VIAL, 1);
workedOnStack = getUtil().getStack(Splicer.SLOT_TARGET).copy();
}
@Override
public boolean workedOnTarget() {
return ItemStack.areItemStacksEqual(workedOnStack, getUtil().getStack(Splicer.SLOT_TARGET));
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
NBTTagCompound tagWorkedOnStack = (NBTTagCompound) nbt.getTag("workedOnStack");
if (tagWorkedOnStack != null) {
workedOnStack = ItemStack.loadItemStackFromNBT(tagWorkedOnStack);
}
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
if (workedOnStack != null) {
NBTTagCompound tagWorkedOnStack = new NBTTagCompound();
workedOnStack.writeToNBT(tagWorkedOnStack);
// Need to save, in case inventory is full it might need to get moved out way later.
nbt.setTag("workedOnStack", tagWorkedOnStack);
}
}
}
@@ -3,6 +3,7 @@ package binnie.genetics.machine.splicer;
import net.minecraft.item.ItemStack;
import binnie.core.craftgui.minecraft.IMachineInformation;
import binnie.core.machines.IMachine;
import binnie.core.machines.Machine;
import binnie.core.machines.inventory.ComponentInventorySlots;
import binnie.core.machines.inventory.ComponentInventoryTransfer;
@@ -79,8 +80,20 @@ public class SplicerPackage extends AdvGeneticMachine.PackageAdvGeneticBase impl
@Override
public boolean fufilled(ItemStack stack) {
return stack != null && transfer.getMachine().getMachineUtil().getStack(Splicer.SLOT_SERUM_VIAL) != null
&& transfer.getMachine().getInterface(SplicerComponentLogic.class).isValidSerum() != null;
if (stack == null) {
return false;
}
IMachine machine = transfer.getMachine();
boolean hasSerum = machine.getMachineUtil().getStack(Splicer.SLOT_SERUM_VIAL) != null;
if (hasSerum) {
// Move item if it can't be processed anymore with current serum.
boolean validSerum = machine.getInterface(SplicerComponentLogic.class).isValidSerum() == null;
return !validSerum;
} else {
// Move item if there is no serum and item got processed already
return machine.getMachineUtil().getProcess().workedOnTarget();
}
}
});