Skip to content

Commit

Permalink
Anvil Recipes Change
Browse files Browse the repository at this point in the history
Barrel Bug Fix
  • Loading branch information
yuesha-yc committed Oct 18, 2020
1 parent 79d57c4 commit 60fd3c0
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 41 deletions.
3 changes: 3 additions & 0 deletions run/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore all but .gitignore
*
!.gitignore
5 changes: 2 additions & 3 deletions src/API/com/bioxx/tfc/api/Crafting/AnvilReq.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,15 @@ public enum AnvilReq
COPPER("Copper", 1),
BRONZE("Bronze", 2),
WROUGHTIRON("Wrought Iron", 3),
STEEL("Steel", 4),
STEEL("Steel", 5),
BLACKSTEEL("Black Steel", 5),
REDSTEEL("Red Steel", 6),
BLUESTEEL("Blue Steel", 6),
BISMUTHBRONZE("Bismuth Bronze", 2),
BLACKBRONZE("Black Bronze", 2),
ROSEGOLD("Rose Gold", 2);

public static final AnvilReq RULES[] = new AnvilReq[]{STONE, COPPER, BRONZE, WROUGHTIRON, STEEL, BLACKSTEEL, REDSTEEL, BLUESTEEL, BISMUTHBRONZE, BLACKBRONZE, ROSEGOLD};

public static final AnvilReq RULES[] = new AnvilReq[]{STONE, COPPER, BRONZE, WROUGHTIRON, STEEL, BLACKSTEEL, REDSTEEL, BLUESTEEL, BISMUTHBRONZE, BLACKBRONZE, ROSEGOLD};
public final int Tier;

public final String Name;
Expand Down
10 changes: 10 additions & 0 deletions src/Common/com/bioxx/tfc/Blocks/Devices/BlockBarrel.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@ protected boolean handleInteraction(EntityPlayer player, TEBarrel te)
{
if (!te.getSealed() && te.getInvCount() <= 1 && !te.getWorldObj().isRemote)
{

ItemStack equippedItem = player.getCurrentEquippedItem();
if(equippedItem == null)
return false;
Expand All @@ -343,6 +344,11 @@ protected boolean handleInteraction(EntityPlayer player, TEBarrel te)
|| equippedItem.getItem() instanceof IFluidContainerItem && ((IFluidContainerItem)equippedItem.getItem()).getFluid(equippedItem) != null)
&& !te.getSealed())
{
if (equippedItem.hasTagCompound())
{
return false;
}

ItemStack tmp = equippedItem.copy();
tmp.stackSize = 1;
ItemStack is = te.addLiquid(tmp);
Expand Down Expand Up @@ -376,6 +382,10 @@ protected boolean handleInteraction(EntityPlayer player, TEBarrel te)
}
else if(FluidContainerRegistry.isEmptyContainer(equippedItem) || equippedItem.getItem() instanceof IFluidContainerItem)
{
if (equippedItem.hasTagCompound())
{
return false;
}
ItemStack tmp = equippedItem.copy();
tmp.stackSize = 1;
ItemStack is = te.removeLiquid(tmp);
Expand Down
14 changes: 7 additions & 7 deletions src/Common/com/bioxx/tfc/Core/ItemHeat.java
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public static void setupItemHeat()
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.blackSteelUnfinishedGreaves,1,1), blackSteelRaw,new ItemStack(TFCItems.blackSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.blackSteelUnfinishedBoots,1,0), blackSteelRaw,new ItemStack(TFCItems.blackSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.blackSteelUnfinishedBoots,1,1), blackSteelRaw,new ItemStack(TFCItems.blackSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCBlocks.anvil, 1, 5), blackSteelRaw, null));

//Blue Steel
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.blueSteelIngot,1), blueSteelRaw,new ItemStack(TFCItems.blueSteelUnshaped,1)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.blueSteelIngot2x,1), blueSteelRaw,new ItemStack(TFCItems.blueSteelUnshaped,2,0)));
Expand All @@ -234,7 +234,7 @@ public static void setupItemHeat()
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.blueSteelUnfinishedGreaves,1,1), blueSteelRaw,new ItemStack(TFCItems.blueSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.blueSteelUnfinishedBoots,1,0), blueSteelRaw,new ItemStack(TFCItems.blueSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.blueSteelUnfinishedBoots,1,1), blueSteelRaw,new ItemStack(TFCItems.blueSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCBlocks.anvil, 1, 6), blueSteelRaw, null));

manager.addIndex(new HeatIndex(new ItemStack(TFCBlocks.oilLamp, 1, 5), blueSteelRaw, null));
//Brass
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.brassIngot,1), brassRaw,new ItemStack(TFCItems.brassUnshaped,1)));
Expand All @@ -256,7 +256,7 @@ public static void setupItemHeat()
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.bronzeUnfinishedGreaves,1,1), bronzeRaw,new ItemStack(TFCItems.bronzeUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.bronzeUnfinishedBoots,1,0), bronzeRaw,new ItemStack(TFCItems.bronzeUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.bronzeUnfinishedBoots,1,1), bronzeRaw,new ItemStack(TFCItems.bronzeUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCBlocks.anvil, 1, 2), bronzeRaw, null));

//Copper
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.copperIngot,1), copperRaw,new ItemStack(TFCItems.copperUnshaped,1)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.copperIngot2x,1), copperRaw,new ItemStack(TFCItems.copperUnshaped,2,0)));
Expand All @@ -271,7 +271,7 @@ public static void setupItemHeat()
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.copperUnfinishedGreaves,1,1), copperRaw,new ItemStack(TFCItems.copperUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.copperUnfinishedBoots,1,0), copperRaw,new ItemStack(TFCItems.copperUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.copperUnfinishedBoots,1,1), copperRaw,new ItemStack(TFCItems.copperUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCBlocks.anvil, 1, 1), copperRaw, null));

//Gold
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.goldIngot,1), goldRaw,new ItemStack(TFCItems.goldUnshaped,1)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.goldIngot2x,1), goldRaw,new ItemStack(TFCItems.goldUnshaped,2,0)));
Expand All @@ -298,7 +298,7 @@ public static void setupItemHeat()
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.wroughtIronUnfinishedBoots,1,0), ironRaw,new ItemStack(TFCItems.wroughtIronUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.wroughtIronUnfinishedBoots,1,1), ironRaw,new ItemStack(TFCItems.wroughtIronUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.wroughtIronKnifeHead, 1), ironRaw, new ItemStack(TFCItems.wroughtIronUnshaped, 1)));
manager.addIndex(new HeatIndex(new ItemStack(TFCBlocks.anvil, 1, 3), ironRaw, null));

//Lead
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.leadIngot,1), leadRaw,new ItemStack(TFCItems.leadUnshaped,1)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.leadIngot2x,1), leadRaw,new ItemStack(TFCItems.leadUnshaped,2,0)));
Expand Down Expand Up @@ -338,7 +338,7 @@ public static void setupItemHeat()
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.redSteelUnfinishedGreaves,1,1), redSteelRaw,new ItemStack(TFCItems.redSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.redSteelUnfinishedBoots,1,0), redSteelRaw,new ItemStack(TFCItems.redSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.redSteelUnfinishedBoots,1,1), redSteelRaw,new ItemStack(TFCItems.redSteelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCBlocks.anvil, 1, 7), redSteelRaw, null));

//Rose Gold
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.roseGoldIngot,1), roseGoldRaw,new ItemStack(TFCItems.roseGoldUnshaped,1)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.roseGoldIngot2x,1), roseGoldRaw,new ItemStack(TFCItems.roseGoldUnshaped,2,0)));
Expand Down Expand Up @@ -367,7 +367,7 @@ public static void setupItemHeat()
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.steelUnfinishedGreaves,1,1), steelRaw,new ItemStack(TFCItems.steelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.steelUnfinishedBoots,1,0), steelRaw,new ItemStack(TFCItems.steelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.steelUnfinishedBoots,1,1), steelRaw,new ItemStack(TFCItems.steelUnshaped,2,0)));
manager.addIndex(new HeatIndex(new ItemStack(TFCBlocks.anvil, 1, 4), steelRaw, null));

//Sterling Silver
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.sterlingSilverIngot,1), sterlingSilverRaw,new ItemStack(TFCItems.sterlingSilverUnshaped,1)));
manager.addIndex(new HeatIndex(new ItemStack(TFCItems.sterlingSilverIngot2x,1), sterlingSilverRaw,new ItemStack(TFCItems.sterlingSilverUnshaped,2,0)));
Expand Down
19 changes: 9 additions & 10 deletions src/Common/com/bioxx/tfc/Core/Recipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,16 +142,15 @@ else if(i/16 == 1)
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(TFCItems.powder, 6, 0), new ItemStack(TFCItems.oreChunk, 1, 32), "itemHammer"));

//Devices
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 1), "###"," # ","###", '#', "ingotDoubleCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 2), "###"," # ","###", '#', "ingotDoubleBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 3), "###"," # ","###", '#', "ingotDoubleWroughtIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 4), "###"," # ","###", '#', "ingotDoubleSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 5), "###"," # ","###", '#', "ingotDoubleBlackSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 6), "###"," # ","###", '#', "ingotDoubleBlueSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 7), "###"," # ","###", '#', "ingotDoubleRedSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil2, 1, 0), "###"," # ","###", '#', "ingotDoubleRoseGold"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil2, 1, 1), "###"," # ","###", '#', "ingotDoubleBismuthBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil2, 1, 2), "###"," # ","###", '#', "ingotDoubleBlackBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 1), "###"," D ","###", '#', "ingotCopper", 'D',"ingotDoubleCopper"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 2), "###"," D ","###", '#', "ingotBronze", 'D',"ingotDoubleBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 3), "###"," D ","###", '#', "ingotWroughtIron", 'D',"ingotDoubleWroughtIron"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 4), "###"," D ","###", '#', "ingotSteel", 'D',"ingotDoubleSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 6), "###"," D ","###", '#', "ingotBlueSteel", 'D',"ingotDoubleBlueSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil, 1, 7), "###"," D ","###", '#', "ingotRedSteel", 'D',"ingotDoubleRedSteel"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil2, 1, 0), "###"," D ","###", '#', "ingotRoseGold", 'D',"ingotDoubleRoseGold"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil2, 1, 1), "###"," D ","###", '#', "ingotBismuthBronze", 'D',"ingotDoubleBismuthBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.anvil2, 1, 2), "###"," D ","###", '#', "ingotBlackBronze", 'D',"ingotDoubleBlackBronze"));

GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.bloomery, 1), "PPP", "P P", "PPP", 'P', "plateDoubleAnyBronze"));
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(TFCBlocks.blastFurnace, 1), "PPP", "PCP", "PPP", 'P', "plateDoubleWroughtIron", 'C', new ItemStack(TFCBlocks.crucible, 1)));
Expand Down
12 changes: 12 additions & 0 deletions src/Common/com/bioxx/tfc/Handlers/Client/GuiHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.client.event.GuiOpenEvent;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cuchaz.ships.core.ShipIntermediary;

import com.bioxx.tfc.Core.Player.PlayerInfo;
import com.bioxx.tfc.Core.Player.PlayerManagerTFC;
import com.bioxx.tfc.Entities.Mobs.EntityHorseTFC;
import com.bioxx.tfc.GUI.*;
import com.bioxx.tfc.ModSupport.ShipsMod;
import com.bioxx.tfc.TileEntities.*;

public class GuiHandler extends com.bioxx.tfc.Handlers.GuiHandler
Expand All @@ -20,9 +24,17 @@ public class GuiHandler extends com.bioxx.tfc.Handlers.GuiHandler
public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z)
{
TileEntity te;

try
{
te= world.getTileEntity(x, y, z);
if (te == null && Loader.isModLoaded("cuchaz.ships"))
{
com.bioxx.tfc.ModSupport.ShipsMod shipsMod = new ShipsMod();
world = shipsMod.getShipsWorld(world, player.inventory);
te = world.getTileEntity(x, y, z);
}

}
catch(Exception e)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Common/com/bioxx/tfc/Items/ItemBlocks/ItemAnvil.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public EnumWeight getWeight(ItemStack is) {
@Override
public short getMetalReturnAmount(ItemStack is) {

return 1400;
return 800;
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/Common/com/bioxx/tfc/Reference.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Reference

public static final int VERSION_MAJOR = 0;
public static final int VERSION_MINOR = 80;
public static final int VERSION_REVISION = 7;
public static final int VERSION_REVISION = 4;

public static final String MOD_VERSION = VERSION_MAJOR+"."+VERSION_MINOR+"."+VERSION_REVISION;

Expand Down
33 changes: 14 additions & 19 deletions src/Common/com/bioxx/tfc/TileEntities/TEBarrel.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Random;
import java.util.Stack;

import net.minecraft.block.Block;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
Expand All @@ -28,7 +29,6 @@
import com.bioxx.tfc.api.Crafting.*;
import com.bioxx.tfc.api.Enums.EnumFoodGroup;
import com.bioxx.tfc.api.Interfaces.IFood;

public class TEBarrel extends NetworkTileEntity implements IInventory
{
public FluidStack fluid;
Expand Down Expand Up @@ -287,11 +287,7 @@ public ItemStack addLiquid(ItemStack is)
if(is == null || is.stackSize > 1)
return is;

// Check if it is AR tank, if it is, skips it.
boolean isArTank = is.hasTagCompound();
if (isArTank) isArTank = is.getTagCompound().hasKey("Amount");
if (isArTank) return is;


if(FluidContainerRegistry.isFilledContainer(is))
{
FluidStack fs = FluidContainerRegistry.getFluidForFilledItem(is);
Expand Down Expand Up @@ -723,20 +719,19 @@ else if(this.getFluidLevel() > 0 && getInputStack() == null && this.getInvCount(
ItemStack container = getInputStack();
FluidStack inLiquid = FluidContainerRegistry.getFluidForFilledItem(container);

if (container != null) {
boolean isArTank = container.hasTagCompound();
if (isArTank) {
isArTank = container.getTagCompound().hasKey("Amount");
if(container != null && container.getItem() instanceof IFluidContainerItem && !container.hasTagCompound())
{
FluidStack isfs = ((IFluidContainerItem)container.getItem()).getFluid(container);
if(isfs != null && addLiquid(isfs))
{
((IFluidContainerItem) container.getItem()).drain(container, ((IFluidContainerItem)container.getItem()).getCapacity(container), true);
}
if (container != null && container.getItem() instanceof IFluidContainerItem && !isArTank) {
FluidStack isfs = ((IFluidContainerItem) container.getItem()).getFluid(container);
if (isfs != null && addLiquid(isfs)) {
((IFluidContainerItem) container.getItem()).drain(container, ((IFluidContainerItem) container.getItem()).getCapacity(container), true);
}
} else if (inLiquid != null && container != null && container.stackSize == 1 && !isArTank) {
if (addLiquid(inLiquid)) {
this.setInventorySlotContents(0, FluidContainerRegistry.drainFluidContainer(container));
}
}
else if (inLiquid != null && container != null && container.stackSize == 1)
{
if(addLiquid(inLiquid))
{
this.setInventorySlotContents(0, FluidContainerRegistry.drainFluidContainer(container));
}
}
}
Expand Down

0 comments on commit 60fd3c0

Please sign in to comment.