fixed the bronze ingot crucible upgrades, need to modify the casting recipes and the nbtcrucible model to open top
This commit is contained in:
@@ -58,10 +58,25 @@ public class NBTCrucible extends BlockContainer implements ITileEntityProvider {
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing face, float hitX, float hitY, float hitZ) {
|
||||
|
||||
if (!world.isRemote) {
|
||||
if(hand == player.getActiveHand()) {
|
||||
TileNBTCrucible tile = (TileNBTCrucible) world.getTileEntity(pos);
|
||||
ItemStack pItem = player.inventory.getCurrentItem();
|
||||
ItemStack pItem1 = new ItemStack(pItem.getItem(), 1);
|
||||
|
||||
System.out.println(tile.getStatus());
|
||||
/**PICKS UP THE CRUCIBLE**/
|
||||
if (player.isSneaking() == false) {
|
||||
if (pItem.isEmpty()) {
|
||||
CrucibleCrafting recipe = CrucibleCrafting.getRecipe(tile.ingList.get(0), tile.ingList.get(1), tile.ingList.get(2), tile.ingList.get(3), tile.ingList.get(4));
|
||||
if (recipe != null) {
|
||||
tile.setDrops(recipe.getDropsRaw());
|
||||
}
|
||||
PlayerHelper.playerTakeItem(world, pos, EnumFacing.DOWN, player, player.getActiveHand(), this.getItem(world, pos, state));
|
||||
world.setBlockState(pos, this.getReplacementBlock(world, pos, state));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**SET INGREDIENT ARRAY FOR THE CRUCIBLE NOW**/
|
||||
if (player.isSneaking() == false) {
|
||||
if (!pItem.isEmpty()) {
|
||||
@@ -83,6 +98,7 @@ public class NBTCrucible extends BlockContainer implements ITileEntityProvider {
|
||||
/**CLEARS THE INVENTORY**/
|
||||
if (player.isSneaking() == true) {
|
||||
if (pItem.isEmpty()) {
|
||||
if (!tile.getStatus()) {
|
||||
for (int i = 0; i < tile.ingList.size(); i++) {
|
||||
if (!tile.ingList.get(i).isEmpty()) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, tile.ingList.get(i));
|
||||
@@ -94,20 +110,21 @@ public class NBTCrucible extends BlockContainer implements ITileEntityProvider {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/**PICKS UP THE CRUCIBLE**/
|
||||
if(player.isSneaking() == false) {
|
||||
|
||||
if(pItem.isEmpty()){
|
||||
CrucibleCrafting recipe = CrucibleCrafting.getRecipe(tile.ingList.get(0), tile.ingList.get(1), tile.ingList.get(2), tile.ingList.get(3), tile.ingList.get(4));
|
||||
if(recipe != null){
|
||||
tile.setDrops(recipe.getDropsRaw());
|
||||
}
|
||||
PlayerHelper.playerTakeItem(world, pos, EnumFacing.DOWN, player, player.getActiveHand(), this.getItem(world, pos, state));
|
||||
world.setBlockState(pos, this.getReplacementBlock(world, pos, state));
|
||||
/**REMOVE COOKED ITEM**/
|
||||
if (player.isSneaking() == true) {
|
||||
if (pItem.isEmpty()) {
|
||||
if (tile.getStatus()) {
|
||||
PlayerHelper.spawnItemOnPlayer(world, player, tile.getDrops());
|
||||
tile.setStatus(false);
|
||||
tile.update();
|
||||
tile.markDirty();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ public class ModCrafting{
|
||||
redBronze,
|
||||
100,
|
||||
100,
|
||||
1000);
|
||||
100);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -87,7 +87,7 @@ public class TileNBTCrucible extends BaseTile implements ITickable {
|
||||
this.setHot(false);
|
||||
CrucibleCrafting recipe = CrucibleCrafting.getRecipe(ingList.get(0), ingList.get(1), ingList.get(2), ingList.get(3), ingList.get(4));
|
||||
this.setDrops(recipe.getDropsCooked());
|
||||
this.setStatus(false);
|
||||
this.setStatus(true);
|
||||
System.out.println("Ready to harvest: " + this.getDrops());
|
||||
world.setBlockState(pos, state.withProperty(PrimalAPI.States.ACTIVE, false), 2);
|
||||
this.updateBlock();
|
||||
|
||||
Reference in New Issue
Block a user