mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Fix JABBA-related issues with crafting station slots (#54)
* Fix shift-merging tools voiding items fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392> * Change 0-sized ItemStacks into null stacks in crafting station attached slots Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425> * Update buildscript * spotlessApply
This commit is contained in:
1 parent
18bfeaff32
commit
39be06c23b
571 files changed
+25959
-28223
No files matched your search
@@ -1,36 +1,29 @@
|
||||
package tconstruct.plugins.nei;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import mantle.utils.ItemMetaWrapper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import tconstruct.library.crafting.Smeltery;
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
public class RecipeHandlerMelting extends RecipeHandlerBase
|
||||
{
|
||||
public class RecipeHandlerMelting extends RecipeHandlerBase {
|
||||
|
||||
public static final Rectangle MOLTEN_TANK = new Rectangle(115, 20, 18, 18);
|
||||
|
||||
public class CachedMeltingRecipe extends CachedBaseRecipe
|
||||
{
|
||||
public class CachedMeltingRecipe extends CachedBaseRecipe {
|
||||
private PositionedStack input;
|
||||
private int temperature;
|
||||
private FluidTankElement output;
|
||||
|
||||
public CachedMeltingRecipe(ItemStack input)
|
||||
{
|
||||
public CachedMeltingRecipe(ItemStack input) {
|
||||
this.input = new PositionedStack(input, 28, 21);
|
||||
this.temperature = Smeltery.getLiquifyTemperature(input);
|
||||
this.output = new FluidTankElement(MOLTEN_TANK, 1, Smeltery.getSmelteryResult(input));
|
||||
@@ -38,20 +31,17 @@ public class RecipeHandlerMelting extends RecipeHandlerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getIngredient ()
|
||||
{
|
||||
public PositionedStack getIngredient() {
|
||||
return this.input;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult ()
|
||||
{
|
||||
public PositionedStack getResult() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<FluidTankElement> getFluidTanks ()
|
||||
{
|
||||
public List<FluidTankElement> getFluidTanks() {
|
||||
List<FluidTankElement> tanks = new ArrayList<FluidTankElement>();
|
||||
tanks.add(this.output);
|
||||
return tanks;
|
||||
@@ -59,82 +49,66 @@ public class RecipeHandlerMelting extends RecipeHandlerBase
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName ()
|
||||
{
|
||||
public String getRecipeName() {
|
||||
return StatCollector.translateToLocal("tconstruct.nei.melting");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeID ()
|
||||
{
|
||||
public String getRecipeID() {
|
||||
return "tconstruct.smeltery.melting";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture ()
|
||||
{
|
||||
public String getGuiTexture() {
|
||||
return "tinker:textures/gui/nei/smeltery.png";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects ()
|
||||
{
|
||||
this.transferRects.add(new RecipeTransferRect(new Rectangle(72, 20, 16, 34), this.getRecipeID(), new Object[0]));
|
||||
public void loadTransferRects() {
|
||||
this.transferRects.add(
|
||||
new RecipeTransferRect(new Rectangle(72, 20, 16, 34), this.getRecipeID(), new Object[0]));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBackground (int recipe)
|
||||
{
|
||||
public void drawBackground(int recipe) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GuiDraw.changeTexture(this.getGuiTexture());
|
||||
GuiDraw.drawTexturedModalRect(0, 0, 0, 0, 160, 55);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras (int recipe)
|
||||
{
|
||||
public void drawExtras(int recipe) {
|
||||
int temperature = ((CachedMeltingRecipe) this.arecipes.get(recipe)).temperature;
|
||||
GuiDraw.drawStringC(temperature + " C", 81, 9, 0x808080, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (String outputId, Object... results)
|
||||
{
|
||||
if (outputId.equals(getRecipeID()))
|
||||
{
|
||||
for (ItemMetaWrapper key : Smeltery.getSmeltingList().keySet())
|
||||
{
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
if (outputId.equals(getRecipeID())) {
|
||||
for (ItemMetaWrapper key : Smeltery.getSmeltingList().keySet()) {
|
||||
this.arecipes.add(new CachedMeltingRecipe(new ItemStack(key.item, 1, key.meta)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes (FluidStack result)
|
||||
{
|
||||
for (Entry<ItemMetaWrapper, FluidStack> pair : Smeltery.getSmeltingList().entrySet())
|
||||
{
|
||||
if (areFluidsEqual(pair.getValue(), result))
|
||||
{
|
||||
public void loadCraftingRecipes(FluidStack result) {
|
||||
for (Entry<ItemMetaWrapper, FluidStack> pair :
|
||||
Smeltery.getSmeltingList().entrySet()) {
|
||||
if (areFluidsEqual(pair.getValue(), result)) {
|
||||
this.arecipes.add(new CachedMeltingRecipe(new ItemStack(pair.getKey().item, 1, pair.getKey().meta)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes (ItemStack ingred)
|
||||
{
|
||||
for (ItemMetaWrapper key : Smeltery.getSmeltingList().keySet())
|
||||
{
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(key.item, 1, key.meta), ingred))
|
||||
{
|
||||
public void loadUsageRecipes(ItemStack ingred) {
|
||||
for (ItemMetaWrapper key : Smeltery.getSmeltingList().keySet()) {
|
||||
if (NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(key.item, 1, key.meta), ingred)) {
|
||||
this.arecipes.add(new CachedMeltingRecipe(new ItemStack(key.item, 1, key.meta)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user