mirror of
https://github.com/NoCheatPlus/NoCheatPlus.git
synced 2024-09-18 18:01:17 +02:00
More workarounds for wooden pick + efficiency.
This commit is contained in:
parent
56f0fa9c3c
commit
d0000bb141
@ -994,11 +994,27 @@ public class BlockProperties {
|
|||||||
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.
|
||||||
}
|
}
|
||||||
|
// Formula from MC wiki.
|
||||||
|
// TODO: Formula from mc wiki does not match well (too fast for obsidian).
|
||||||
|
// duration /= (1.0 + 0.5 * efficiency);
|
||||||
|
|
||||||
// More Workarounds:
|
// More Workarounds:
|
||||||
|
// TODO: Consider checking a generic workaround (based on duration, assuming some dig packets lost, proportional to duration etc.).
|
||||||
if (toolProps.materialBase == MaterialBase.WOOD){
|
if (toolProps.materialBase == MaterialBase.WOOD){
|
||||||
if (blockId == Material.LOG.getId()) duration -= efficiency >= 4 ? 250 : 400;
|
if (toolProps.toolType == ToolType.PICKAXE && (blockProps == ironDoorType || blockProps == dispenserType)){
|
||||||
|
// Special correction.
|
||||||
|
// TODO: Uncomfortable: hide this in the blocks by some flags / other type of workarounds !
|
||||||
|
if (blockProps == dispenserType){
|
||||||
|
duration = (long) (duration / 1.5 - (efficiency - 1) * 60);
|
||||||
|
}
|
||||||
|
else if (blockProps == ironDoorType){
|
||||||
|
duration = (long) (duration / 1.5 - (efficiency - 1) * 100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else 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;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (toolProps.materialBase == MaterialBase.STONE){
|
else if (toolProps.materialBase == MaterialBase.STONE){
|
||||||
if (blockId == Material.LOG.getId()) duration -= 100;
|
if (blockId == Material.LOG.getId()) duration -= 100;
|
||||||
|
Loading…
Reference in New Issue
Block a user