Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified contrib/wrench.xcf
Binary file not shown.
16 changes: 8 additions & 8 deletions dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
// Add your dependencies here

dependencies {
api('com.github.GTNewHorizons:Botania:1.12.22-GTNH:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.429:dev')
api('com.github.GTNewHorizons:Botania:1.13.6-GTNH:dev')
api('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.126:dev')
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
api("com.github.GTNewHorizons:StructureLib:1.4.18:dev")
api("com.github.GTNewHorizons:Avaritia:1.72:dev")
api("com.github.GTNewHorizons:StructureLib:1.4.24:dev")
api("com.github.GTNewHorizons:Avaritia:1.78:dev")

compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.77-GTNH:dev')
compileOnly("com.github.GTNewHorizons:Chisel:2.16.11-GTNH:dev") {transitive = false}
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.40-GTNH:dev')
compileOnly("com.github.GTNewHorizons:Chisel:2.17.5-GTNH:dev") {transitive = false}

runtimeOnly('com.github.GTNewHorizons:Baubles-Expanded:2.1.13-GTNH:dev')
runtimeOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.2-GTNH:dev')

devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.7.77-GTNH:dev')
devOnlyNonPublishable('com.github.GTNewHorizons:NotEnoughItems:2.8.40-GTNH:dev')
}

repositories {
Expand Down
10 changes: 9 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down Expand Up @@ -172,6 +174,12 @@ curseForgeRelations =
# projects. New projects should not use this parameter.
customArchiveBaseName = BotanicHorizons

# 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.
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ pluginManagement {
}

plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.48'
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package net.fuzzycraft.botanichorizons.addons.tileentity;

import cpw.mods.fml.common.FMLLog;
import net.fuzzycraft.botanichorizons.util.Facing2D;
import net.fuzzycraft.botanichorizons.util.multiblock.MultiblockHelper;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import vazkii.botania.api.recipe.RecipeManaInfusion;
import vazkii.botania.common.block.tile.mana.TilePool;

import static net.fuzzycraft.botanichorizons.util.Constants.MC_BLOCK_SEND_TO_CLIENT;
import static net.fuzzycraft.botanichorizons.util.Constants.MC_BLOCK_UPDATE;
Expand Down Expand Up @@ -54,10 +58,17 @@ protected void updateEntityCrafting() {
@Override
public int getAvailableParallels(@NotNull RecipeManaInfusion recipe) {
int parallel = MAX_PARALLELS;

int recipeManaCost = recipe.getManaToConsume();

if (parallel * recipeManaCost < storedMana) {
return parallel;
}

int externalMana = getExternalMana();
int totalReservoir = storedMana + externalMana;

if (recipeManaCost > 0) {
int manaParallel = storedMana / recipeManaCost;
int manaParallel = totalReservoir / recipeManaCost;
parallel = Math.min(parallel, manaParallel);
}

Expand All @@ -67,8 +78,42 @@ public int getAvailableParallels(@NotNull RecipeManaInfusion recipe) {
@Override
void consumeNonItemResources(RecipeManaInfusion recipe, int parallel) {
storedMana -= parallel * recipe.getManaToConsume();

if (storedMana < 0) {
int deficit = -storedMana;
TilePool pool = getExternalPool();
if (pool != null && pool.getCurrentMana() >= deficit) {
pool.recieveMana(-deficit);
storedMana = 0;
} else {
FMLLog.bigWarning("Exploit: External mana is no longer available");
isOnline = false;
worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, facing.index << 1, MC_BLOCK_UPDATE + MC_BLOCK_SEND_TO_CLIENT);
}
}
}

@Nullable
private TilePool getExternalPool() {
int poolX = xCoord - 4 * facing.dx;
int poolZ = zCoord - 4 * facing.dz;
int poolY = yCoord + 1;
TileEntity rawPoolTE = worldObj.getTileEntity(poolX, poolY, poolZ);
if (rawPoolTE instanceof TilePool pool) {
return pool;
} else {
FMLLog.warning("Not a pool at %d %d %d", poolX, poolY, poolZ);
return null;
}
}

private int getExternalMana() {
TilePool pool = getExternalPool();
return (pool != null) ? pool.getCurrentMana() : 0;
}

// SimpleAutomationTileEntity

@Override
public int getRecipeInputStackSize(@NotNull RecipeManaInfusion recipe) {
return 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class ForgeMod {
public static final String MOD_NAME = MOD_ID;
public static final String VERSION = "GRADLETOKEN_VERSION";

public static final String DEPENDENCIES = "required-after:Baubles;required-after:Thaumcraft;required-after:Botania;required-after:gregtech;after:witchery;after:BiomesOPlenty;after:dreamcraft;required-after:TConstruct;required-after:Avaritia;after:chisel;after:StructureLib";
public static final String DEPENDENCIES = "required-after:Baubles;required-after:Thaumcraft;required-after:Botania;required-after:gregtech;after:witchery;after:BiomesOPlenty;after:dreamcraft;required-after:TConstruct;required-after:Avaritia;after:chisel;after:StructureLib;after:etfuturum";
//public static final String DEPENDENCIES = "required-after:Botania"; // developer mode

@Mod.Instance(MOD_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ public static void applyPatches() {
whitelistBlockIfExists("BiomesOPlenty:ivy");
whitelistBlockIfExists("BiomesOPlenty:flowerVine");
whitelistBlockIfExists("Natura:Thornvines");
whitelistBlockIfExists("etfuturum:lily_of_the_valley");
whitelistBlockIfExists("etfuturum:cornflower");
whitelistBlockIfExists("etfuturum:wither_rose");
whitelistBlockIfExists("etfuturum:rose");
whitelistBlockIfExists("etfuturum:pink_petals");
whitelistBlockIfExists("etfuturum:cave_vine");
whitelistBlockIfExists("etfuturum:cave_vine_plant");
CustomBotaniaAPI.extraFlowerComponents.put(Item.getItemFromBlock(Blocks.red_flower), alwaysAllowHandler);
CustomBotaniaAPI.extraFlowerComponents.put(Item.getItemFromBlock(Blocks.yellow_flower), alwaysAllowHandler);
CustomBotaniaAPI.extraFlowerComponents.put(Item.getItemFromBlock(Blocks.vine), alwaysAllowHandler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import gregtech.api.util.GTModHandler;
import gregtech.api.util.GTOreDictUnificator;
import gregtech.api.util.GTRecipeBuilder;
import gregtech.api.util.GTUtility;
import net.fuzzycraft.botanichorizons.addons.BHBlocks;
import net.fuzzycraft.botanichorizons.util.Constants;
import net.fuzzycraft.botanichorizons.util.OreDict;
Expand Down Expand Up @@ -148,7 +147,8 @@ public static void applyPatches() {

// Reeds compress to plantballs by default
GTValues.RA.stdBuilder()
.itemInputs(new ItemStack(Items.reeds, 8), GTUtility.getIntegratedCircuit(16))
.itemInputs(new ItemStack(Items.reeds, 8))
.circuit(16)
.itemOutputs(new ItemStack(ModBlocks.reedBlock))
.duration(4*SECONDS)
.eut(24)
Expand All @@ -157,8 +157,8 @@ public static void applyPatches() {
// Livingwood and Crystal Bows
GTValues.RA.stdBuilder()
.itemInputs(new ItemStack(ModItems.manaResource, 3, Constants.MANARESOURCE_META_TWIG_WOOD),
new ItemStack(ModItems.manaResource, 3, Constants.MANARESOURCE_META_STRING),
GTUtility.getIntegratedCircuit(1))
new ItemStack(ModItems.manaResource, 3, Constants.MANARESOURCE_META_STRING))
.circuit(1)
.itemOutputs(new ItemStack(ModItems.livingwoodBow))
.duration(4*SECONDS)
.eut(24)
Expand All @@ -184,7 +184,8 @@ public static void applyPatches() {
'S', LibOreDict.MANAWEAVE_CLOTH
);
GTValues.RA.stdBuilder()
.itemInputs(fabric, new ItemStack(choice, 2, i % 16), GTUtility.getIntegratedCircuit(2))
.itemInputs(fabric, new ItemStack(choice, 2, i % 16))
.circuit(2)
.itemOutputs(output)
.duration(6*SECONDS)
.eut(80)
Expand Down Expand Up @@ -315,19 +316,13 @@ private static void compressAndExtract(ItemStack uncompressed, ItemStack compres
addIC2CompressorRecipe(compressed, uncompressed);
}

private static void addAssemblerCrafting(ItemStack output, int circuit, ItemStack... inputs) {
private static void addAssemblerCrafting(ItemStack output, int circuitNumber, ItemStack... inputs) {

Object[] realInputs;
if (circuit > 0) {
realInputs = new ItemStack[inputs.length + 1];
System.arraycopy(inputs, 0, realInputs, 0, inputs.length);
realInputs[inputs.length] = GTUtility.getIntegratedCircuit(circuit);
} else {
realInputs = inputs;
GTRecipeBuilder recipeBuilder = GTValues.RA.stdBuilder();
if (circuitNumber > 0) {
recipeBuilder.circuit(circuitNumber);
}

GTValues.RA.stdBuilder()
.itemInputs(realInputs)
recipeBuilder.itemInputs(inputs)
.itemOutputs(output)
.duration(5 * SECONDS)
.eut(16)
Expand All @@ -345,30 +340,27 @@ private static void addAssemblerArmour(ItemStack helmet, ItemStack chest, ItemSt
addAssemblerCrafting(leggings, 7, new ItemStack(ingredient.getItem(), 7, ingredient.getItemDamage()));
}
if (boots != null) {
addAssemblerCrafting(boots, 4, new ItemStack(ingredient.getItem(), 4, ingredient.getItemDamage()));
addAssemblerCrafting(boots, 6, new ItemStack(ingredient.getItem(), 4, ingredient.getItemDamage()));
}
}

@Nullable
private static IRecipe addSlabRecipe(ItemStack output, ItemStack input, int circuit, int volt, int ticks) {
private static IRecipe addSlabRecipe(ItemStack output, ItemStack input, int circuitNumber, int volt, int ticks) {
GTRecipeBuilder recipeBuilder = GTValues.RA.stdBuilder();
ItemStack[] inputs;
if (circuit == 0) {
inputs = new ItemStack[]{input};
} else {
ItemStack circuitStack = GTUtility.getIntegratedCircuit(circuit);
inputs = new ItemStack[]{input, circuitStack};
if (circuitNumber > 0) {
recipeBuilder.circuit(circuitNumber);
}
GTValues.RA.stdBuilder()
.itemInputs(inputs)
.itemOutputs(output)
.duration(ticks)
.eut(volt)
.addTo(cutterRecipes);
recipeBuilder.itemInputs(input)
.itemOutputs(output)
.duration(ticks)
.eut(volt)
.addTo(cutterRecipes);

if (volt < 32 && (output.stackSize % 2) == 0) {
ItemStack half_output = new ItemStack(output.getItem(), output.stackSize / 2, output.getItemDamage());
String r1 = (circuit <= 1) ? "sR" : "s ";
String r2 = (circuit <= 1) ? " " : "R ";
String r1 = (circuitNumber <= 1) ? "sR" : "s ";
String r2 = (circuitNumber <= 1) ? " " : "R ";
GTModHandler.addCraftingRecipe(
half_output,
new Object[]{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,19 @@ private static void applyCrossModPatches() {
oredictThirdPartyBlocks("BiomesOPlenty:mushrooms",
"listInedibleMushroom", "listInedibleMushroom", "listInedibleMushroom", "listInedibleMushroom", "listInedibleMushroom", "listInedibleMushroom");

oredictThirdPartyBlocks("etfuturum:lily_of_the_valley", "flowerWhite");
oredictThirdPartyBlocks("etfuturum:lily_of_the_valley", "flowerLilyValley");
oredictThirdPartyBlocks("etfuturum:cornflower", "flowerBlue");
oredictThirdPartyBlocks("etfuturum:cornflower", "flowerCorn");
oredictThirdPartyBlocks("etfuturum:wither_rose", "flowerBlack");
oredictThirdPartyBlocks("etfuturum:wither_rose", "flowerRoseWither");
oredictThirdPartyBlocks("etfuturum:rose", "flowerRed");
oredictThirdPartyBlocks("etfuturum:rose", "flowerRose");
oredictThirdPartyBlocks("etfuturum:pink_petals", "flowerPink");
oredictThirdPartyBlocks("etfuturum:pink_petals", "flowerPinkPetals");

oredictThirdPartyBlocks("etfuturum:cave_vine", "cropVine");
oredictThirdPartyBlocks("etfuturum:cave_vine_plant", "cropVine");

oredictThirdPartyItem("witchery:ingredient", 14, "itemMutandis");
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.