Wooden doors + efficiency + wrong tool [more ugly].

This commit is contained in:
asofold 2012-11-02 03:26:21 +01:00
parent f11a586302
commit c7e7077ced

View File

@ -711,20 +711,37 @@ public class BlockProperties {
} }
} }
// (sword vs web already counted) // (sword vs web already counted)
if (isValidTool || blockProps.tool.toolType == ToolType.NONE){ if (isValidTool || blockProps.tool.toolType == ToolType.NONE){
if (inWater && ! aquaAffinity) long mult = 1;
duration *= 5; if (inWater && !aquaAffinity) mult *= 5;
if (!onGround) if (!onGround) mult *= 5;
duration *= 5; duration *= mult;
// Efficiency level. // Efficiency level.
if (efficiency > 0){ if (efficiency > 0) {
// Workarounds ...
if (blockId == Material.WOODEN_DOOR.getId() && toolProps.toolType != ToolType.AXE) {
// Heck [Cleanup pending]...
switch (efficiency) {
case 1:
return 1500 * mult;
case 2:
return 750 * mult;
case 3:
return 450 * mult;
case 4:
return 250 * mult;
case 5:
return 150 * mult;
}
}
// This seems roughly correct. // This seems roughly correct.
for (int i = 0; i < efficiency; i++){ for (int i = 0; i < efficiency; i++){
duration /= 1.33; // Matches well with obsidian. duration /= 1.33; // Matches well with obsidian.
} }
// More Workarounds: // More Workarounds:
if (toolProps.materialBase == MaterialBase.WOOD){ if (toolProps.materialBase == MaterialBase.WOOD){
if (blockId == Material.LOG.getId()) duration -= efficiency >= 4 ? 250 : 400; if (blockId == Material.LOG.getId()) duration -= efficiency >= 4 ? 250 : 400;
else if (blockProps.tool.toolType == toolProps.toolType) duration -= 250; else if (blockProps.tool.toolType == toolProps.toolType) duration -= 250;
else duration -= efficiency * 30; else duration -= efficiency * 30;
@ -753,6 +770,7 @@ public class BlockProperties {
// (wood, sand, gravel, ice) // (wood, sand, gravel, ice)
if (blockId == Material.SNOW.getId()) return toolProps.toolType == ToolType.SPADE; if (blockId == Material.SNOW.getId()) return toolProps.toolType == ToolType.SPADE;
if (blockId == Material.WOOL.getId()) return true; if (blockId == Material.WOOL.getId()) return true;
if (blockId == Material.WOODEN_DOOR.getId()) return true;
if (blockProps.hardness <= 2 if (blockProps.hardness <= 2
&& (blockProps.tool.toolType == ToolType.AXE && (blockProps.tool.toolType == ToolType.AXE
|| blockProps.tool.toolType == ToolType.SPADE || blockProps.tool.toolType == ToolType.SPADE