Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
28f4def938 | ||
|
|
5e12defde0 | ||
|
|
e4c8acdd4f | ||
|
|
470601170a | ||
|
|
40c0ea5f53 |
No files matched your search
@@ -1,27 +1,27 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.21-GTNH:dev')
|
||||
api('com.github.GTNewHorizons:Baubles-Expanded:2.2.25-GTNH:dev')
|
||||
api('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev') {transitive=false}
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-994-GTNH:api')
|
||||
api('com.github.GTNewHorizons:ThaumicBoots:1.5.12:dev') {transitive=false}
|
||||
api('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-999-GTNH:api')
|
||||
api('com.github.GTNewHorizons:ThaumicBoots:1.5.13:dev') {transitive=false}
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.13.25-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.5.14:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.31:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.8.3:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.19.30:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.14.93-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.7.10:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenCore:1.4.16:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.47-GTNH:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:Botania:1.13.39-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderCore:0.5.15:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderIO:2.10.49:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:EnderStorage:1.8.9:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.19.34:api') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:TinkersConstruct:1.14.120-GTNH:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:ForgeMultipart:1.7.18:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:CodeChickenCore:1.4.22:dev') {transitive=false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.64-GTNH:api') {transitive=false}
|
||||
compileOnly('net.industrial-craft:industrialcraft-2:2.2.828-experimental:api') {transitive=false}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.54.01:dev") {exclude group: 'com.github.GTNewHorizons', module: 'ThaumicTinkerer'}
|
||||
compileOnly("com.github.GTNewHorizons:GT5-Unofficial:5.09.54.242:dev") {exclude group: 'com.github.GTNewHorizons', module: 'ThaumicTinkerer'}
|
||||
compileOnly('curse.maven:computercraft-67504:2269339')
|
||||
compileOnly('curse.maven:cofh-core-69162:2388751')
|
||||
|
||||
// For testing purposes
|
||||
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:Electro-Magic-Tools:1.7.24:dev")
|
||||
//runtimeOnlyNonPublishable("com.github.GTNewHorizons:Electro-Magic-Tools:1.7.25:dev")
|
||||
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.3:dev')
|
||||
devOnlyNonPublishable('com.github.GTNewHorizons:AspectRecipeIndex:1.1.5:dev')
|
||||
}
|
||||
@@ -186,6 +186,11 @@ modrinthRelations =
|
||||
# Leave this empty if you don't want to publish on CurseForge.
|
||||
curseForgeProjectId =
|
||||
|
||||
# Comma-separated supported CurseForge environments: client, server (case-insensitive).
|
||||
# Use client or server for mods that only support one environment. Defaults to client,server.
|
||||
# These tags describe where the mod can run, not whether installation is required on both sides.
|
||||
curseForgeEnvironments = client,server
|
||||
|
||||
# The project's relations on CurseForge. You can use this to refer to other projects on CurseForge.
|
||||
# Syntax: type1:name1;type2:name2;...
|
||||
# Where type can be one of [requiredDependency, embeddedLibrary, optionalDependency, tool, incompatible],
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#This file is generated by updateDaemonJvm
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/redirect
|
||||
toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/9064f22734b42ac03e85df04b632e167/redirect
|
||||
toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4d0277c49991306ac78048580fe34bcf/redirect
|
||||
toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/539ea72837c6244075f8ee037babc29e/redirect
|
||||
toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/876dbbf00bf4ef6190f7da074cee903a/redirect
|
||||
toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/a9fa3b809e484a1e1ac4308a5dda661a/redirect
|
||||
toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/aa99913fa6d767d899ffc96082da01ca/redirect
|
||||
toolchainVersion=25
|
||||
@@ -1,7 +1,9 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.7.1-bin.zip
|
||||
networkTimeout=10000
|
||||
retries=0
|
||||
retryBackOffMs=500
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
# gradlew start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
@@ -29,7 +29,7 @@
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
# ksh gradlew
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
@@ -57,7 +57,7 @@
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/b631911858264c0b6e4d6603d677ff5218766cee/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
|
||||
@@ -19,12 +19,12 @@
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem gradlew startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
@rem Set local scope for the variables, and ensure extensions are enabled
|
||||
setlocal EnableExtensions
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@@ -51,7 +51,7 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
@@ -65,29 +65,18 @@ echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
"%COMSPEC%" /c exit 1
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
|
||||
@rem Execute gradlew
|
||||
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
|
||||
@rem which allows us to clear the local environment before executing the java command
|
||||
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
:exitWithErrorLevel
|
||||
@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts
|
||||
"%COMSPEC%" /c exit %ERRORLEVEL%
|
||||
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("com.gtnewhorizons.gtnhsettingsconvention") version "2.0.26"
|
||||
id("com.gtnewhorizons.gtnhsettingsconvention") version "2.0.34"
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ public final class LibResources {
|
||||
public static final String GUI_ICHOR_POUCH = PREFIX_GUI + "ichorPouch.png";
|
||||
public static final String GUI_WARP_GATE = PREFIX_GUI + "warpGate.png";
|
||||
public static final String GUI_REMOTE_PLACER = PREFIX_GUI + "remotePlacer.png";
|
||||
public static final String NEI_RECIPE_ARROW = PREFIX_GUI + "neiRecipeArrow.png";
|
||||
|
||||
public static final String MISC_R_ENCHANTING = PREFIX_MISC + "r_enchanting.png";
|
||||
public static final String MISC_AT_CENTER = PREFIX_MISC + "atCenter.png";
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package thaumic.tinkerer.client.nei;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
@@ -12,6 +13,10 @@ public class NEIConfig implements IConfigureNEI {
|
||||
public void loadConfig() {
|
||||
if (!LoadedMods.aspectRecipeIndexLoaded) return;
|
||||
AspectRecipeIndexIntegration.register();
|
||||
|
||||
NEIInfusedSeedRecipeHandler seedHandler = new NEIInfusedSeedRecipeHandler();
|
||||
API.registerRecipeHandler(seedHandler);
|
||||
API.registerUsageHandler(seedHandler);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
package thaumic.tinkerer.client.nei;
|
||||
|
||||
import static thaumic.tinkerer.client.lib.LibResources.NEI_RECIPE_ARROW;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumic.tinkerer.common.core.helper.AspectCropLootManager;
|
||||
import thaumic.tinkerer.common.core.helper.AspectCropLootManager.LootEntry;
|
||||
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
|
||||
public class NEIInfusedSeedRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public static final String OVERLAY = "thaumictinkerer.infusedseeds";
|
||||
private static final int SLOT_NUM_X = 9;
|
||||
private static final int SLOT_TEXTURE_U = 7;
|
||||
private static final int SLOT_TEXTURE_V = 17;
|
||||
private static final DecimalFormat CHANCE_FORMAT = new DecimalFormat("#.##");
|
||||
|
||||
public static class DropInfo {
|
||||
|
||||
public final ItemStack stack;
|
||||
public final float chance;
|
||||
|
||||
public DropInfo(ItemStack stack, float chance) {
|
||||
this.stack = stack;
|
||||
this.chance = chance;
|
||||
}
|
||||
}
|
||||
|
||||
public static class SeedDropRecipeWrapper {
|
||||
|
||||
public final ItemStack seed;
|
||||
public final List<DropInfo> drops;
|
||||
|
||||
public SeedDropRecipeWrapper(ItemStack seed, List<DropInfo> drops) {
|
||||
this.seed = seed;
|
||||
this.drops = drops;
|
||||
}
|
||||
}
|
||||
|
||||
public class CachedSeedRecipe extends CachedRecipe {
|
||||
|
||||
private final List<PositionedStack> input = new ArrayList<>();
|
||||
private final List<PositionedStack> outputs = new ArrayList<>();
|
||||
public final SeedDropRecipeWrapper wrapper;
|
||||
public int rows = 0;
|
||||
|
||||
public CachedSeedRecipe(SeedDropRecipeWrapper recipe) {
|
||||
this.wrapper = recipe;
|
||||
this.input.add(new PositionedStack(recipe.seed, 74, 4));
|
||||
|
||||
int row = 0;
|
||||
int col = 0;
|
||||
|
||||
for (DropInfo drop : recipe.drops) {
|
||||
int xPos = 3 + 18 * col;
|
||||
int yPos = 36 + 18 * row;
|
||||
|
||||
this.outputs.add(new PositionedStack(drop.stack, xPos, yPos));
|
||||
|
||||
col++;
|
||||
if (col >= SLOT_NUM_X) {
|
||||
col = 0;
|
||||
row++;
|
||||
}
|
||||
}
|
||||
|
||||
this.rows = col == 0 ? row - 1 : row;
|
||||
if (this.rows < 0) this.rows = 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks() {
|
||||
return outputs;
|
||||
}
|
||||
}
|
||||
|
||||
private List<SeedDropRecipeWrapper> getSeedRecipes() {
|
||||
List<SeedDropRecipeWrapper> recipes = new ArrayList<>();
|
||||
Map<Aspect, List<LootEntry>> allLoot = AspectCropLootManager.getAllLoot();
|
||||
|
||||
for (Map.Entry<Aspect, List<LootEntry>> entry : allLoot.entrySet()) {
|
||||
Aspect aspect = entry.getKey();
|
||||
List<LootEntry> lootList = entry.getValue();
|
||||
|
||||
if (lootList == null || lootList.isEmpty()) continue;
|
||||
|
||||
int totalWeight = 0;
|
||||
for (LootEntry loot : lootList) {
|
||||
totalWeight += loot.weight;
|
||||
}
|
||||
|
||||
List<DropInfo> drops = new ArrayList<>();
|
||||
for (LootEntry loot : lootList) {
|
||||
if (loot.stack != null) {
|
||||
float chance = ((float) loot.weight / totalWeight) * 100f;
|
||||
drops.add(new DropInfo(loot.stack.copy(), chance));
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack seedStack = ItemInfusedSeeds.getStackFromAspect(aspect);
|
||||
|
||||
recipes.add(new SeedDropRecipeWrapper(seedStack, drops));
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(73, 22, 18, 12), getOverlayIdentifier()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(getOverlayIdentifier()) && getClass() == NEIInfusedSeedRecipeHandler.class) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
}
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
for (DropInfo drop : recipe.drops) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(result, drop.stack)) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
if (ingredient != null && ingredient.getItem() instanceof ItemInfusedSeeds) {
|
||||
Aspect aspectIn = ItemInfusedSeeds.getAspect(ingredient);
|
||||
|
||||
if (aspectIn != null) {
|
||||
for (SeedDropRecipeWrapper recipe : getSeedRecipes()) {
|
||||
Aspect aspectRecipe = ItemInfusedSeeds.getAspect(recipe.seed);
|
||||
if (aspectIn == aspectRecipe || aspectIn.getTag().equals(aspectRecipe.getTag())) {
|
||||
arecipes.add(new CachedSeedRecipe(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeHeight(int recipeIndex) {
|
||||
return 36 + 18 * (((CachedSeedRecipe) this.arecipes.get(recipeIndex)).rows + 1) + 6;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground(int recipeIndex) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
GuiDraw.changeTexture(getGuiTexture());
|
||||
|
||||
GuiDraw.drawTexturedModalRect(74, 3, SLOT_TEXTURE_U, SLOT_TEXTURE_V, 18, 18);
|
||||
|
||||
CachedSeedRecipe recipe = (CachedSeedRecipe) this.arecipes.get(recipeIndex);
|
||||
int totalDrops = recipe.outputs.size();
|
||||
|
||||
int rows = Math.max(1, (totalDrops + SLOT_NUM_X - 1) / SLOT_NUM_X);
|
||||
|
||||
int totalSlotsToDraw = rows * SLOT_NUM_X;
|
||||
|
||||
for (int i = 0; i < totalSlotsToDraw; i++) {
|
||||
int col = i % SLOT_NUM_X;
|
||||
int row = i / SLOT_NUM_X;
|
||||
int xPos = 2 + 18 * col;
|
||||
int yPos = 35 + 18 * row;
|
||||
|
||||
GuiDraw.drawTexturedModalRect(xPos, yPos, SLOT_TEXTURE_U, SLOT_TEXTURE_V, 18, 18);
|
||||
}
|
||||
|
||||
GuiDraw.changeTexture(NEI_RECIPE_ARROW);
|
||||
|
||||
GuiDraw.drawTexturedModalRect(74, 20, 0, 0, 18, 14);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> handleItemTooltip(GuiRecipe<?> gui, ItemStack stack, List<String> currenttip, int recipeIndex) {
|
||||
CachedSeedRecipe recipe = (CachedSeedRecipe) this.arecipes.get(recipeIndex);
|
||||
|
||||
for (DropInfo drop : recipe.wrapper.drops) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(stack, drop.stack)) {
|
||||
|
||||
String chancePrefix = StatCollector.translateToLocal("tt.nei.chance");
|
||||
|
||||
String chanceStr = CHANCE_FORMAT.format(drop.chance) + "%";
|
||||
currenttip.add(EnumChatFormatting.GRAY + chancePrefix + ": " + EnumChatFormatting.YELLOW + chanceStr);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return currenttip;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return "minecraft:textures/gui/container/generic_54.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getOverlayIdentifier() {
|
||||
return OVERLAY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getHandlerId() {
|
||||
return NEIInfusedSeedRecipeHandler.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tt.nei.category.infusedseeds");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package thaumic.tinkerer.common.core.helper;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
@@ -22,29 +24,46 @@ import thaumic.tinkerer.common.item.ItemBrightNitor;
|
||||
import thaumic.tinkerer.common.item.ItemInfusedGrain;
|
||||
|
||||
/**
|
||||
* Created by pixlepix on 8/7/14.
|
||||
* Created by pixlepix on 8/7/14, reworked by Spaghetti on 2026-08-21 These very lines of code will cause great trouble
|
||||
* in the future. However, they have proven to be less chaotic than anticipated in the past, so they live on ... even if
|
||||
* that means nerfing them to the ground.
|
||||
*/
|
||||
public class AspectCropLootManager {
|
||||
|
||||
private static HashMap<Aspect, HashMap<ItemStack, Integer>> lootMap = new HashMap<>();
|
||||
public static class LootEntry {
|
||||
|
||||
public final ItemStack stack;
|
||||
public final int weight;
|
||||
|
||||
public LootEntry(ItemStack stack, int weight) {
|
||||
this.stack = stack;
|
||||
this.weight = weight;
|
||||
}
|
||||
}
|
||||
|
||||
private static final Random RAND = new Random();
|
||||
|
||||
private static HashMap<Aspect, List<LootEntry>> lootMap = new HashMap<>();
|
||||
|
||||
public static ItemStack getLootForAspect(Aspect aspect) {
|
||||
HashMap<ItemStack, Integer> aspectHashmap = lootMap.get(aspect);
|
||||
// Find total value of the possible ItemStacks for the aspect
|
||||
if (aspectHashmap == null) return null;
|
||||
int sum = 0;
|
||||
List<LootEntry> aspectLootList = lootMap.get(aspect);
|
||||
|
||||
for (Integer i : aspectHashmap.values()) {
|
||||
sum += i;
|
||||
if (aspectLootList == null || aspectLootList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int sum = 0;
|
||||
for (LootEntry entry : aspectLootList) {
|
||||
sum += entry.weight;
|
||||
}
|
||||
|
||||
if (sum > 0) {
|
||||
Random rand = new Random();
|
||||
int randInt = rand.nextInt(sum);
|
||||
for (Map.Entry<ItemStack, Integer> pair : aspectHashmap.entrySet()) {
|
||||
if (randInt < pair.getValue()) {
|
||||
return pair.getKey().copy();
|
||||
int randInt = RAND.nextInt(sum);
|
||||
for (LootEntry entry : aspectLootList) {
|
||||
if (randInt < entry.weight) {
|
||||
return entry.stack.copy();
|
||||
}
|
||||
randInt -= pair.getValue();
|
||||
randInt -= entry.weight;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
@@ -59,10 +78,14 @@ public class AspectCropLootManager {
|
||||
}
|
||||
|
||||
public static void addAspectLoot(Aspect aspect, String target, int count) {
|
||||
String capitalized = WordUtils.capitalizeFully(target);
|
||||
for (String ore : OreDictionary.getOreNames()) {
|
||||
if (ore.contains(WordUtils.capitalizeFully(target)) || ore.contains(target)) {
|
||||
if (ore.contains(capitalized) || ore.contains(target)) {
|
||||
for (ItemStack stack : OreDictionary.getOres(ore)) {
|
||||
ItemStack newStack = stack.copy();
|
||||
if (newStack.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
|
||||
newStack.setItemDamage(0);
|
||||
}
|
||||
newStack.stackSize = count;
|
||||
addAspectLoot(aspect, newStack);
|
||||
}
|
||||
@@ -71,12 +94,21 @@ public class AspectCropLootManager {
|
||||
}
|
||||
|
||||
public static void addAspectLoot(Aspect aspect, ItemStack stack, int power) {
|
||||
lootMap.get(aspect).put(stack, power);
|
||||
if (stack == null || stack.getItem() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
lootMap.putIfAbsent(aspect, new ArrayList<>());
|
||||
lootMap.get(aspect).add(new LootEntry(stack.copy(), power));
|
||||
}
|
||||
|
||||
public static Map<Aspect, List<LootEntry>> getAllLoot() {
|
||||
return lootMap;
|
||||
}
|
||||
|
||||
public static void populateLootMap() {
|
||||
for (Aspect a : Aspect.aspects.values()) {
|
||||
lootMap.put(a, new HashMap<>());
|
||||
lootMap.put(a, new ArrayList<>());
|
||||
}
|
||||
addAspectLoot(
|
||||
Aspect.AIR,
|
||||
@@ -103,16 +135,15 @@ public class AspectCropLootManager {
|
||||
1,
|
||||
ItemInfusedGrain.getMetaForAspect(Aspect.WATER)));
|
||||
|
||||
addAspectLoot(Aspect.ORDER, new ItemStack(Blocks.glass, 64));
|
||||
addAspectLoot(Aspect.ENTROPY, new ItemStack(Blocks.sand, 64));
|
||||
addAspectLoot(Aspect.ORDER, new ItemStack(Blocks.glass, 16));
|
||||
addAspectLoot(Aspect.ENTROPY, new ItemStack(Blocks.sand, 16));
|
||||
|
||||
addAspectLoot(Aspect.ELDRITCH, new ItemStack(Items.ender_pearl, 4), 10);
|
||||
addAspectLoot(Aspect.ELDRITCH, new ItemStack(Items.ender_eye, 4), 5);
|
||||
addAspectLoot(Aspect.ELDRITCH, "bucketEnder");
|
||||
addAspectLoot(Aspect.ELDRITCH, new ItemStack(ConfigItems.itemResource, 1, 17)); // void seed
|
||||
|
||||
// addAspectLoot(Aspect.TREE, "wood");
|
||||
|
||||
addAspectLoot(Aspect.TREE, new ItemStack(Blocks.log));
|
||||
addAspectLoot(Aspect.TREE, "logWood");
|
||||
|
||||
for (Aspect tag : Aspect.aspects.values()) {
|
||||
ItemStack i = new ItemStack(ConfigItems.itemWispEssence, 1, 0);
|
||||
@@ -120,33 +151,32 @@ public class AspectCropLootManager {
|
||||
addAspectLoot(Aspect.AURA, i);
|
||||
}
|
||||
|
||||
for (int i = 0; i < 24; i++) {
|
||||
addAspectLoot(Aspect.BEAST, new ItemStack(Items.spawn_egg, 1, i));
|
||||
}
|
||||
|
||||
addAspectLoot(Aspect.MIND, new ItemStack(Items.paper, 64), 15);
|
||||
addAspectLoot(Aspect.MIND, new ItemStack(Items.book, 32), 10);
|
||||
addAspectLoot(Aspect.MIND, new ItemStack(Blocks.bookshelf, 16), 5);
|
||||
addAspectLoot(Aspect.MIND, new ItemStack(ConfigItems.itemResource, 4, 9), 5); // knowledge fragment
|
||||
|
||||
addAspectLoot(Aspect.FLESH, new ItemStack(ConfigItems.itemResource, 16, 5), 4);
|
||||
addAspectLoot(Aspect.FLESH, new ItemStack(ConfigItems.itemResource, 16, 5), 1);
|
||||
|
||||
addAspectLoot(Aspect.UNDEAD, new ItemStack(Items.rotten_flesh, 32));
|
||||
addAspectLoot(Aspect.UNDEAD, new ItemStack(Items.bone, 24));
|
||||
|
||||
addAspectLoot(
|
||||
Aspect.CRAFT,
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstBlockFromClass(BlockDarkQuartz.class), 32));
|
||||
addAspectLoot(Aspect.CRAFT, new ItemStack(ConfigBlocks.blockStoneDevice, 16));
|
||||
addAspectLoot(Aspect.CRAFT, new ItemStack(ConfigBlocks.blockStoneDevice, 16, 0)); // alchemical furnace
|
||||
addAspectLoot(Aspect.CRAFT, new ItemStack(Blocks.crafting_table, 4));
|
||||
|
||||
addAspectLoot(Aspect.HUNGER, new ItemStack(Items.nether_wart, 16));
|
||||
|
||||
addAspectLoot(Aspect.COLD, new ItemStack(Items.snowball, 16));
|
||||
addAspectLoot(Aspect.COLD, "rodBlizz");
|
||||
addAspectLoot(Aspect.COLD, new ItemStack(Blocks.ice, 2));
|
||||
addAspectLoot(Aspect.COLD, new ItemStack(Items.snowball, 64));
|
||||
addAspectLoot(Aspect.COLD, new ItemStack(Blocks.snow, 32));
|
||||
addAspectLoot(Aspect.COLD, new ItemStack(Blocks.snow_layer, 8));
|
||||
addAspectLoot(Aspect.COLD, "rodBlizz", 1);
|
||||
|
||||
addAspectLoot(Aspect.PLANT, "grass");
|
||||
addAspectLoot(Aspect.PLANT, "sapling");
|
||||
for (int i = 0; i < 6; i++) {
|
||||
addAspectLoot(Aspect.PLANT, new ItemStack(Blocks.sapling, 1, i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < 12; i++) {
|
||||
addAspectLoot(Aspect.MAN, new ItemStack(ConfigItems.itemGolemCore, 1, i));
|
||||
@@ -162,26 +192,27 @@ public class AspectCropLootManager {
|
||||
addAspectLoot(Aspect.WEAPON, new ItemStack(ConfigItems.itemSwordThaumium));
|
||||
addAspectLoot(Aspect.TOOL, new ItemStack(ConfigItems.itemShovelThaumium));
|
||||
addAspectLoot(Aspect.TOOL, new ItemStack(ConfigItems.itemAxeThaumium));
|
||||
addAspectLoot(Aspect.TRAVEL, new ItemStack(ConfigBlocks.blockCosmeticSolid, 8, 7));
|
||||
|
||||
addAspectLoot(Aspect.SLIME, new ItemStack(Items.slime_ball, 16));
|
||||
addAspectLoot(Aspect.SLIME, "slime");
|
||||
addAspectLoot(Aspect.SLIME, "slime", 4);
|
||||
|
||||
addAspectLoot(Aspect.GREED, new ItemStack(Items.gold_ingot, 4));
|
||||
addAspectLoot(Aspect.GREED, new ItemStack(Items.emerald, 2));
|
||||
|
||||
addAspectLoot(Aspect.LIGHT, new ItemStack(Items.glowstone_dust, 16), 5);
|
||||
addAspectLoot(Aspect.LIGHT, new ItemStack(ConfigItems.itemResource, 4, 1));
|
||||
addAspectLoot(Aspect.LIGHT, new ItemStack(ConfigItems.itemResource, 4, 1)); // nitor
|
||||
addAspectLoot(
|
||||
Aspect.LIGHT,
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBrightNitor.class)));
|
||||
|
||||
addAspectLoot(Aspect.MECHANISM, new ItemStack(Blocks.piston, 8));
|
||||
// addAspectLoot(Aspect.MECHANISM, "gear");
|
||||
addAspectLoot(Aspect.MECHANISM, new ItemStack(Blocks.hopper, 4));
|
||||
addAspectLoot(Aspect.MECHANISM, new ItemStack(Blocks.dropper, 8));
|
||||
addAspectLoot(Aspect.MECHANISM, new ItemStack(Blocks.dispenser, 8));
|
||||
|
||||
addAspectLoot(Aspect.CROP, new ItemStack(Items.wheat, 32));
|
||||
addAspectLoot(Aspect.CROP, "seed");
|
||||
|
||||
addAspectLoot(Aspect.METAL, new ItemStack(Items.iron_ingot, 4), 100);
|
||||
// addAspectLoot(Aspect.METAL, "iron");
|
||||
|
||||
addAspectLoot(Aspect.DEATH, new ItemStack(Items.bone, 32));
|
||||
|
||||
@@ -198,7 +229,7 @@ public class AspectCropLootManager {
|
||||
addAspectLoot(Aspect.EXCHANGE, "ingotCopper", 4);
|
||||
addAspectLoot(Aspect.EXCHANGE, new ItemStack(ConfigBlocks.blockCustomOre, 4));
|
||||
|
||||
addAspectLoot(Aspect.ENERGY, new ItemStack(ConfigItems.itemResource, 12));
|
||||
addAspectLoot(Aspect.ENERGY, new ItemStack(ConfigItems.itemResource, 12)); // alumentum
|
||||
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 0));
|
||||
addAspectLoot(Aspect.MAGIC, new ItemStack(ConfigItems.itemShard, 1, 1));
|
||||
@@ -210,29 +241,40 @@ public class AspectCropLootManager {
|
||||
|
||||
addAspectLoot(Aspect.HEAL, new ItemStack(Items.golden_apple));
|
||||
addAspectLoot(Aspect.HEAL, new ItemStack(Items.cake));
|
||||
addAspectLoot(Aspect.HEAL, new ItemStack(Items.potionitem, 1, 8261));
|
||||
|
||||
addAspectLoot(Aspect.SENSES, new ItemStack(Items.dye, 20, 4));
|
||||
for (int i = 0; i < 16; i++) {
|
||||
addAspectLoot(Aspect.SENSES, new ItemStack(Items.dye, 1, i));
|
||||
addAspectLoot(Aspect.SENSES, new ItemStack(Blocks.stained_glass, 1, i));
|
||||
addAspectLoot(Aspect.SENSES, new ItemStack(Blocks.stained_glass_pane, 2, i));
|
||||
}
|
||||
|
||||
addAspectLoot(Aspect.SOUL, new ItemStack(Blocks.soul_sand, 64), 2);
|
||||
addAspectLoot(Aspect.SOUL, new ItemStack(Blocks.netherrack, 64), 2);
|
||||
addAspectLoot(Aspect.SOUL, new ItemStack(Blocks.nether_brick));
|
||||
addAspectLoot(Aspect.SOUL, new ItemStack(Blocks.soul_sand, 16), 2);
|
||||
|
||||
addAspectLoot(Aspect.WEATHER, new ItemStack(Blocks.air));
|
||||
addAspectLoot(Aspect.WEATHER, "cloud", 100);
|
||||
addAspectLoot(Aspect.WEATHER, "cloud", 64);
|
||||
|
||||
addAspectLoot(Aspect.DARKNESS, new ItemStack(Blocks.obsidian, 10));
|
||||
|
||||
addAspectLoot(Aspect.VOID, new ItemStack(Items.bucket));
|
||||
addAspectLoot(Aspect.VOID, "bucket");
|
||||
addAspectLoot(Aspect.VOID, "bowl", 4);
|
||||
addAspectLoot(Aspect.VOID, "ingotVoid", 2);
|
||||
|
||||
addAspectLoot(Aspect.POISON, new ItemStack(ConfigItems.itemResource, 16, 3));
|
||||
addAspectLoot(Aspect.POISON, new ItemStack(ConfigItems.itemResource, 16, 3)); // quicksilver
|
||||
addAspectLoot(Aspect.POISON, new ItemStack(Items.spider_eye, 8));
|
||||
|
||||
addAspectLoot(Aspect.LIFE, new ItemStack(Items.egg, 8));
|
||||
|
||||
addAspectLoot(Aspect.TRAP, new ItemStack(Blocks.web, 4));
|
||||
addAspectLoot(Aspect.TRAP, "trapdoorWood");
|
||||
addAspectLoot(Aspect.TRAP, new ItemStack(ConfigItems.itemResource, 16, 6)); // amber
|
||||
|
||||
addAspectLoot(Aspect.TRAVEL, new ItemStack(ConfigBlocks.blockCosmeticSolid, 4, 2)); // paved stone of travel
|
||||
|
||||
addAspectLoot(Aspect.TAINT, new ItemStack(ConfigItems.itemResource, 4, 11));
|
||||
|
||||
addAspectLoot(Aspect.CRYSTAL, new ItemStack(Items.diamond));
|
||||
addAspectLoot(Aspect.CRYSTAL, new ItemStack(Items.diamond, 1));
|
||||
addAspectLoot(Aspect.CRYSTAL, new ItemStack(Items.quartz, 8));
|
||||
addAspectLoot(Aspect.CRYSTAL, new ItemStack(Blocks.glass, 32), 4);
|
||||
}
|
||||
}
|
||||
@@ -40,6 +40,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import dan200.computercraft.api.ComputerCraftAPI;
|
||||
import li.cil.oc.api.Driver;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.IEssentiaTransport;
|
||||
import thaumcraft.api.wands.WandCap;
|
||||
import thaumcraft.api.wands.WandRod;
|
||||
@@ -56,6 +57,7 @@ import thaumcraft.common.tiles.TileNode;
|
||||
import thaumcraft.common.tiles.TileSensor;
|
||||
import thaumcraft.common.tiles.TileTubeFilter;
|
||||
import thaumcraft.common.tiles.TileWandPedestal;
|
||||
import thaumic.tinkerer.client.nei.NEIInfusedSeedRecipeHandler;
|
||||
import thaumic.tinkerer.client.nei.NEINecromancyHandler;
|
||||
import thaumic.tinkerer.common.ThaumicTinkerer;
|
||||
import thaumic.tinkerer.common.block.BlockSummon;
|
||||
@@ -81,6 +83,7 @@ import thaumic.tinkerer.common.core.helper.NumericAspectHelper;
|
||||
import thaumic.tinkerer.common.enchantment.ModEnchantments;
|
||||
import thaumic.tinkerer.common.enchantment.core.EnchantmentManager;
|
||||
import thaumic.tinkerer.common.item.ItemBloodSword;
|
||||
import thaumic.tinkerer.common.item.ItemInfusedSeeds;
|
||||
import thaumic.tinkerer.common.item.SpellClothCraftingHandler;
|
||||
import thaumic.tinkerer.common.item.foci.ItemFocusDeflect;
|
||||
import thaumic.tinkerer.common.item.kami.wand.CapIchor;
|
||||
@@ -289,6 +292,11 @@ public class TTCommonProxy {
|
||||
Arrays.asList(
|
||||
new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemBloodSword.class)),
|
||||
necromancyTablet));
|
||||
|
||||
event.registerHandlerInfo(
|
||||
new HandlerInfo.Builder(NEIInfusedSeedRecipeHandler.class, LibMisc.MOD_NAME, LibMisc.MOD_ID)
|
||||
.setDisplayStack(ItemInfusedSeeds.getStackFromAspect(Aspect.AIR))
|
||||
.setShowFavoritesButton(false).setShowOverlayButton(false).build());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -654,3 +654,7 @@ ttwaila.pullingAdultType=Pulling: Adult %s
|
||||
ttwaila.pullingChildType=Pulling: Child %s
|
||||
ttwaila.pushingAdultType=Pushing: Adult %s
|
||||
ttwaila.pushingChildType=Pushing: Child %s
|
||||
|
||||
# -- NEI
|
||||
tt.nei.category.infusedseeds=Infused Seed Drops
|
||||
tt.nei.chance=Drop Chance
|
||||
|
After Width: | Height: | Size: 709 B |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 3.0 KiB |