Skip to content

Commit

Permalink
fix tools not checking harvest type on block breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
progwml6 committed Feb 15, 2014
1 parent e707916 commit a8d8a56
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/main/java/tconstruct/TConstruct.java
Expand Up @@ -87,9 +87,6 @@ public class TConstruct

public TConstruct()
{
LoggerConfig fml = new LoggerConfig(FMLCommonHandler.instance().getFMLLogger().getName(), Level.ALL, true);
LoggerConfig modConf = new LoggerConfig(logger.getName(), Level.ALL, true);
modConf.setParent(fml);

//logger.setParent(FMLCommonHandler.instance().getFMLLogger());
if (Loader.isModLoaded("Natura"))
Expand Down
8 changes: 6 additions & 2 deletions src/main/java/tconstruct/library/tools/DualHarvestTool.java
Expand Up @@ -29,8 +29,12 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
Block block = player.worldObj.getBlock(x, y, z);
if (block == null || block == Blocks.air)
return false;
int hlvl = block.getHarvestLevel(meta);
int shlvl = block.getHarvestLevel(meta);
int hlvl = -1;
int shlvl = -1;
if (block.getHarvestTool(meta).equals(getHarvestType()))
hlvl = block.getHarvestLevel(meta);
if (block.getHarvestTool(meta).equals(getSecondHarvestType()))
shlvl = block.getHarvestLevel(meta);

if (hlvl <= tags.getInteger("HarvestLevel") && shlvl <= tags.getInteger("HarvestLevel2"))
{
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/tconstruct/library/tools/HarvestTool.java
Expand Up @@ -33,8 +33,10 @@ public boolean onBlockStartBreak (ItemStack stack, int x, int y, int z, EntityPl
//Block block = Block.blocksList[bID];
if (block == null || block == Blocks.air)
return false;
int hlvl = block.getHarvestLevel(meta);

int hlvl = -1;
if (block.getHarvestTool(meta).equals(getHarvestType()))
hlvl = block.getHarvestLevel(meta);
// int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType());
if (hlvl <= tags.getInteger("HarvestLevel"))
{
boolean cancelHarvest = false;
Expand Down

0 comments on commit a8d8a56

Please sign in to comment.