fixed Anvil unable to accept upgrades, fixed crucibles not returning cooked output, fixed molten layer model for hot crucibles in blockstate

This commit is contained in:
Mohammad-Ali Minaie
2018-09-13 08:23:54 -04:00
parent 4d889481c0
commit 83a3061a99
6 changed files with 125 additions and 486 deletions

View File

@@ -16,14 +16,11 @@ you'll need to update the annotation @GameRegistry.ObjectHolder(ModInfo.MOD_ID)
- [ ] Bronze Plate Cast - [ ] Bronze Plate Cast
- [ ] Craft Tweaker Support - [ ] Craft Tweaker Support
- [ ] JEI Support - [ ] JEI Support
- [ ] People seem to not like being able to put anything in the Crucible
- [ ] Apply Forge turn off logic to Bloomery - [ ] Apply Forge turn off logic to Bloomery
- [ ] Update SoftCrucible Model - [ ] Update SoftCrucible Model
- [ ] Mass Ore Production - [x] Crucibles were returning input ingredients even after cooked
- [ ] Gold Production - [x] Hot Crucible doesn't have hot molten layer
- [ ] Silver/Lead Production - [x] Can't add upgrades to the anvil
- [ ] Hot Crucible doesn't have hot molten layer
- [ ] Can't add upgrades to the anvil
- [x] Steel Plate Recipe #37 - [x] Steel Plate Recipe #37
- [x] Damascus Recipes - [x] Damascus Recipes
- [x] Damascus Weapons - [x] Damascus Weapons
@@ -63,6 +60,8 @@ you'll need to update the annotation @GameRegistry.ObjectHolder(ModInfo.MOD_ID)
- [ ] Create lock assembly item - [ ] Create lock assembly item
## Backlog ## Backlog
- [ ] Mass Ore Production
- [ ] Silver/Lead Production
- [ ] Sparks to forging - [ ] Sparks to forging
- [x] Move Ingot break into chunks logic out of the block and into the ForgeHammer - [x] Move Ingot break into chunks logic out of the block and into the ForgeHammer
- [ ] Add Iron Ring Recipe - [ ] Add Iron Ring Recipe

View File

@@ -54,8 +54,6 @@ public class AnvilStone extends AnvilBase {
tempwootzchunk.setTagCompound(tempTag); tempwootzchunk.setTagCompound(tempTag);
tempwootzchunk.getTagCompound().setBoolean("hot", true); tempwootzchunk.getTagCompound().setBoolean("hot", true);
System.out.println(stack12.getTagCompound());
if (stack12.getItem().equals(ModItems.ironingotball) && stack12.getTagCompound().getBoolean("hot")) { if (stack12.getItem().equals(ModItems.ironingotball) && stack12.getTagCompound().getBoolean("hot")) {
tile.setSlotStack(6, tempironchunk); tile.setSlotStack(6, tempironchunk);
tile.setSlotStack(7, tempironchunk); tile.setSlotStack(7, tempironchunk);
@@ -128,7 +126,6 @@ public class AnvilStone extends AnvilBase {
doAnvilRecipe(pItem, tempArray, world, tile, pos, player); doAnvilRecipe(pItem, tempArray, world, tile, pos, player);
return true; return true;
} }
System.out.println("Calling Inventory Manager");
doAnvilInventoryManager(pItem, world, tile, pos, hitx, hity, hitz, state, player); doAnvilInventoryManager(pItem, world, tile, pos, hitx, hity, hitz, state, player);
return true; return true;
} }

View File

@@ -99,6 +99,7 @@ public class NBTCrucible extends BlockContainer implements ITileEntityProvider {
if (player.isSneaking() == true) { if (player.isSneaking() == true) {
if (pItem.isEmpty()) { if (pItem.isEmpty()) {
if (tile.getHot()!=15) { if (tile.getHot()!=15) {
if (!tile.getStatus()) {
for (int i = 0; i < tile.ingList.size(); i++) { for (int i = 0; i < tile.ingList.size(); i++) {
if (!tile.ingList.get(i).isEmpty()) { if (!tile.ingList.get(i).isEmpty()) {
PlayerHelper.spawnItemOnPlayer(world, player, tile.ingList.get(i)); PlayerHelper.spawnItemOnPlayer(world, player, tile.ingList.get(i));
@@ -114,6 +115,7 @@ public class NBTCrucible extends BlockContainer implements ITileEntityProvider {
} }
} }
} }
}
/**REMOVE COOKED ITEM**/ /**REMOVE COOKED ITEM**/
if (player.isSneaking() == true) { if (player.isSneaking() == true) {
if (pItem.isEmpty()) { if (pItem.isEmpty()) {

View File

@@ -273,6 +273,10 @@ public class ModCrafting{
RecipeHandler.addShapedOreRecipe(new ItemStack(ModItems.slottedtongs, 1), RecipeHandler.addShapedOreRecipe(new ItemStack(ModItems.slottedtongs, 1),
"X X", "YSY", 'X', Blocks.STONE, 'S', Items.STRING, 'Y', Items.STICK); "X X", "YSY", 'X', Blocks.STONE, 'S', Items.STRING, 'Y', Items.STICK);
/***Anvil***/
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.stoneanvil, 1),
" ", " I ", " S ", 'I', ModItems.ironingotball, 'S', Blocks.STONE);
/***RAW CRUCIBLES***/ /***RAW CRUCIBLES***/
/* /*
RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawironcrucible), RecipeHandler.addShapedOreRecipe(new ItemStack(ModBlocks.rawironcrucible),

View File

@@ -4,11 +4,14 @@ import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World; import net.minecraft.world.World;
import nmd.primal.core.api.PrimalAPI;
import nmd.primal.core.common.items.tools.Gallagher; import nmd.primal.core.common.items.tools.Gallagher;
import nmd.primal.forgecraft.CommonUtils; import nmd.primal.forgecraft.CommonUtils;
import nmd.primal.forgecraft.blocks.IngotBall; import nmd.primal.forgecraft.blocks.IngotBall;
@@ -65,7 +68,7 @@ public interface AnvilHandler {
world.playEvent(1031, pos, 0); world.playEvent(1031, pos, 0);
if (ThreadLocalRandom.current().nextInt(0, 2)==0) { if (ThreadLocalRandom.current().nextInt(0, 2) == 0) {
if (recipe.getOutput().getItem() instanceof ToolPart) { if (recipe.getOutput().getItem() instanceof ToolPart) {
@@ -163,19 +166,15 @@ public interface AnvilHandler {
} }
/***************************************************************************** /*****************************************************************************
Adding and Removing Inventory With Tongs Adding and Removing Inventory With Tongs
*****************************************************************************/ *****************************************************************************/
default boolean doAnvilInventoryManager(ItemStack pItem, World world, TileAnvil tile, BlockPos pos, float hitx, float hity, float hitz, IBlockState state, EntityPlayer player) { default boolean doAnvilInventoryManager(ItemStack pItem, World world, TileAnvil tile, BlockPos pos, float hitx, float hity, float hitz, IBlockState state, EntityPlayer player) {
if ( (!(pItem.getItem() instanceof Gallagher)) || (!(pItem.getItem() instanceof ForgeHammer)) ) { if ((!(pItem.getItem() instanceof Gallagher)) || (!(pItem.getItem() instanceof ForgeHammer))) {
if(pItem.getItem() instanceof BaseMultiItem) { if (pItem.getItem() instanceof BaseMultiItem) {
return false; return false;
} }
System.out.println("We are in Inventory Manager");
if (state.getValue(FACING) == EnumFacing.NORTH) { if (state.getValue(FACING) == EnumFacing.NORTH) {
int counter = 0; int counter = 0;
for (int z = 0; z < 5; z++) { for (int z = 0; z < 5; z++) {
@@ -235,7 +234,7 @@ public interface AnvilHandler {
static boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) { static boolean doWork(ItemStack pItem, Integer counter, TileAnvil tile, World world, BlockPos pos, EntityPlayer player) {
if(!world.isRemote) { if (!world.isRemote) {
if (pItem.getItem().equals(ModItems.slottedtongs)) { if (pItem.getItem().equals(ModItems.slottedtongs)) {
SlottedTongs tongs = (SlottedTongs) pItem.getItem(); SlottedTongs tongs = (SlottedTongs) pItem.getItem();
@@ -246,7 +245,6 @@ public interface AnvilHandler {
ItemStack tempStack = tile.getSlotStack(counter).copy(); ItemStack tempStack = tile.getSlotStack(counter).copy();
tongs.setSlotList(tempStack); tongs.setSlotList(tempStack);
tile.setSlotStack(counter, ItemStack.EMPTY); tile.setSlotStack(counter, ItemStack.EMPTY);
System.out.println("Tongs should have an item");
return true; return true;
} }
} }
@@ -256,349 +254,10 @@ public interface AnvilHandler {
ItemStack tempStack = tongs.getSlotList().get(0).copy(); ItemStack tempStack = tongs.getSlotList().get(0).copy();
tile.setSlotStack(counter, tempStack); tile.setSlotStack(counter, tempStack);
tongs.setSlotList(ItemStack.EMPTY); tongs.setSlotList(ItemStack.EMPTY);
System.out.println("Tongs should not an item");
return true; return true;
} }
} }
} }
}
return false;
}
/*if ((pItem.getTagCompound().getInteger("type") == 6) ||
(pItem.getTagCompound().getInteger("type") == 7) ||
(pItem.getTagCompound().getInteger("type") == 8) ||
(pItem.getTagCompound().getInteger("type") == 9) ||
(pItem.getTagCompound().getInteger("type") == 10) ||
(pItem.getTagCompound().getInteger("type") == 11) ||
(pItem.getTagCompound().getInteger("type") == 15) ||
(pItem.getTagCompound().getInteger("type") == 16) ||
(pItem.getTagCompound().getInteger("type") == 17) ||
(pItem.getTagCompound().getInteger("type") == 18) ||
(pItem.getTagCompound().getInteger("type") == 19) ||
(pItem.getTagCompound().getInteger("type") == 20) ||
(pItem.getTagCompound().getInteger("type") == 24) ||
(pItem.getTagCompound().getInteger("type") == 25) ||
(pItem.getTagCompound().getInteger("type") == 26) ||
(pItem.getTagCompound().getInteger("type") == 27) ||
(pItem.getTagCompound().getInteger("type") == 28) ||
(pItem.getTagCompound().getInteger("type") == 29) ||
(pItem.getTagCompound().getInteger("type") == 0)) {
//System.out.println("Level 1");
/*if (!tile.getSlotStack(counter).isEmpty()) {
if (pItem.getTagCompound().getInteger("type") == 0) {
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironingotballhot)) {
pItem.getTagCompound().setInteger("type", 6);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironchunkhot)) {
pItem.getTagCompound().setInteger("type", 7);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironcleaningotballhot)) {
pItem.getTagCompound().setInteger("type", 15);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironcleanchunkhot)) {
pItem.getTagCompound().setInteger("type", 16);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.steelingotballhot)) {
pItem.getTagCompound().setInteger("type", 24);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.steelchunkhot)) {
pItem.getTagCompound().setInteger("type", 25);
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
}*/
//if (tile.getSlotStack(counter).isEmpty()) {
//System.out.println("Activating");
/*if (pItem.getTagCompound().getInteger("type") == 6) {
//System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.ironingotballhot, 1));
pItem.getTagCompound().setInteger("type", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 7) {
//System.out.println("Tongs meta = 7");
tile.setSlotStack((counter), new ItemStack(ModItems.ironchunkhot, 1));
pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter));
return true;
}
if (pItem.getTagCompound().getInteger("type") == 8) {
ItemStack tempStack = new ItemStack(ModItems.pickaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 9) {
ItemStack tempStack = new ItemStack(ModItems.ironaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 10) {
ItemStack tempStack = new ItemStack(ModItems.ironshovelhead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 11) {
ItemStack tempStack = new ItemStack(ModItems.ironhoehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
*/
/*********************************
* Clean Iron *
*********************************/
/*if (pItem.getTagCompound().getInteger("type") == 15) {
//System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.ironcleaningotballhot, 1));
pItem.getTagCompound().setInteger("type", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 16) {
//System.out.println("Tongs meta = 7");
tile.setSlotStack((counter), new ItemStack(ModItems.ironcleanchunkhot, 1));
pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter));
return true;
}
if (pItem.getTagCompound().getInteger("type") == 17) {
ItemStack tempStack = new ItemStack(ModItems.cleanironpickaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 18) {
ItemStack tempStack = new ItemStack(ModItems.cleanironaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 19) {
ItemStack tempStack = new ItemStack(ModItems.cleanironshovelhead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 20) {
ItemStack tempStack = new ItemStack(ModItems.cleanironhoehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
*/
/*********************************
* Steel *
*********************************/
/*
if (pItem.getTagCompound().getInteger("type") == 24) {
//System.out.println("Tongs meta = 6");
tile.setSlotStack((counter), new ItemStack(ModItems.steelingotballhot, 1));
pItem.getTagCompound().setInteger("type", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 25) {
//System.out.println("Tongs meta = 7");
tile.setSlotStack((counter), new ItemStack(ModItems.steelchunkhot, 1));
pItem.getTagCompound().setInteger("type", 0);
///System.out.println(counter);
//System.out.println(tile.getSlotStack(counter));
return true;
}
if (pItem.getTagCompound().getInteger("type") == 26) {
ItemStack tempStack = new ItemStack(ModItems.steelpickaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 27) {
ItemStack tempStack = new ItemStack(ModItems.steelaxehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 28) {
ItemStack tempStack = new ItemStack(ModItems.steelshovelhead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
if (pItem.getTagCompound().getInteger("type") == 29) {
ItemStack tempStack = new ItemStack(ModItems.steelhoehead, 1);
tempStack.setTagCompound(new NBTTagCompound());
NBTTagCompound tags = pItem.getSubCompound("tags").copy();
tempStack.getTagCompound().setTag("tags", tags);
tempStack.setItemDamage(pItem.getTagCompound().getInteger("tempDamage"));
tile.setSlotStack((counter), tempStack);
pItem.getTagCompound().setInteger("type", 0);
pItem.getSubCompound("tags").setBoolean("hot", false);
pItem.getSubCompound("tags").setBoolean("emerald", false);
pItem.getSubCompound("tags").setInteger("diamond", 0);
pItem.getSubCompound("tags").setInteger("redstone", 0);
pItem.getSubCompound("tags").setInteger("lapis", 0);
pItem.getSubCompound("tags").setInteger("modifiers", 0);
pItem.getTagCompound().setInteger("tempDamage", 0);
return true;
}
}
}
}
if (pItem.getItem().equals(Items.AIR) && player.isSneaking()) { if (pItem.getItem().equals(Items.AIR) && player.isSneaking()) {
@@ -634,46 +293,22 @@ public interface AnvilHandler {
return true; return true;
} }
if (Block.getBlockFromItem(tile.getSlotStack(counter).getItem()) instanceof IngotBall ) { if (tile.getSlotStack(counter).getItem() instanceof BaseMultiItem) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter)); CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY); tile.setSlotStack(counter, ItemStack.EMPTY);
return true; return true;
} }
//TODO REFACTOR THIS CODE }
if (tile.getSlotStack(counter).getItem().equals(ModItems.pickaxehead)) { if(tile.getSlotStack(counter).getItem() instanceof ToolPart){
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) { if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter)); CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY); tile.setSlotStack(counter, ItemStack.EMPTY);
return true; return true;
} }
} }
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironaxehead)) {
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironshovelhead)) {
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
if (tile.getSlotStack(counter).getItem().equals(ModItems.ironhoehead)) {
if (tile.getSlotStack(counter).getSubCompound("tags").getBoolean("hot") == false) {
CommonUtils.spawnItemEntityFromWorld(world, pos, tile.getSlotStack(counter));
tile.setSlotStack(counter, ItemStack.EMPTY);
return true;
}
}
}
if (pItem.getItem().equals(Items.DIAMOND)) { if (pItem.getItem().equals(Items.DIAMOND)) {
//System.out.println("It Is Diamond");
if (tile.getSlotStack(counter).isEmpty()) { if (tile.getSlotStack(counter).isEmpty()) {
//System.out.println("Slot is empty");
tile.setSlotStack(counter, new ItemStack(pItem.getItem(), 1)); tile.setSlotStack(counter, new ItemStack(pItem.getItem(), 1));
pItem.shrink(1); pItem.shrink(1);
return true; return true;
@@ -718,8 +353,10 @@ public interface AnvilHandler {
pItem.shrink(1); pItem.shrink(1);
return true; return true;
} }
}*/ }
}
return false;
}
static void doDrops(World world, BlockPos pos) { static void doDrops(World world, BlockPos pos) {
if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops")) { if (!world.isRemote && world.getGameRules().getBoolean("doTileDrops")) {

View File

@@ -134,7 +134,7 @@
"texture": "forgecraft:blocks/stone_slab_hot", "texture": "forgecraft:blocks/stone_slab_hot",
"texture1": "forgecraft:items/hot_bronze" "texture1": "forgecraft:items/hot_bronze"
}, },
"model": "forgecraft:castingcrucible3" "model": "forgecraft:castingcrucible"
} }
} }
} }