MCPcopy Create free account
hub / github.com/cabaletta/baritone / potionAmplifier

Method potionAmplifier

src/main/java/baritone/utils/ToolSet.java:246–268  ·  view source on GitHub ↗

Calculates any modifier to breaking time based on status effects. @return a double to scale block breaking speed.

()

Source from the content-addressed store, hash-verified

244 * @return a double to scale block breaking speed.
245 */
246 private double potionAmplifier() {
247 double speed = 1;
248 if (player.hasEffect(MobEffects.HASTE)) {
249 speed *= 1 + (player.getEffect(MobEffects.HASTE).getAmplifier() + 1) * 0.2;
250 }
251 if (player.hasEffect(MobEffects.MINING_FATIGUE)) {
252 switch (player.getEffect(MobEffects.MINING_FATIGUE).getAmplifier()) {
253 case 0:
254 speed *= 0.3;
255 break;
256 case 1:
257 speed *= 0.09;
258 break;
259 case 2:
260 speed *= 0.0027; // you might think that 0.09*0.3 = 0.027 so that should be next, that would make too much sense. it's 0.0027.
261 break;
262 default:
263 speed *= 0.00081;
264 break;
265 }
266 }
267 return speed;
268 }
269}

Callers 1

ToolSetMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected