fixed the bronze ingot crucible upgrades, need to modify the casting recipes and the nbtcrucible model to open top

This commit is contained in:
Mohammad-Ali Minaie
2018-06-02 14:56:45 -04:00
parent 2b4b432db1
commit fdc0d90144
3 changed files with 57 additions and 40 deletions

View File

@@ -58,14 +58,29 @@ 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()) {
if(pItem.getItem() instanceof SlottedTongs) {
if (player.isSneaking() == false) {
if (!pItem.isEmpty()) {
if (pItem.getItem() instanceof SlottedTongs) {
return false;
} else {
for (int i = 0; i < tile.ingList.size(); i++) {
@@ -82,7 +97,8 @@ public class NBTCrucible extends BlockContainer implements ITileEntityProvider {
}
/**CLEARS THE INVENTORY**/
if (player.isSneaking() == true) {
if(pItem.isEmpty()) {
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;
}

View File

@@ -131,7 +131,7 @@ public class ModCrafting{
redBronze,
100,
100,
1000);
100);
/*

View File

@@ -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();