LookAtMySuitBot/js/node_modules/mineflayer/lib/math.js

9 lines
258 B
JavaScript
Raw Normal View History

2023-12-24 20:08:39 -05:00
exports.clamp = function clamp (min, x, max) {
return Math.max(min, Math.min(x, max))
}
exports.euclideanMod = function euclideanMod (numerator, denominator) {
const result = numerator % denominator
return result < 0 ? result + denominator : result
}