@rian8337/osu-base 4.0.0-beta.95 → 4.0.0-beta.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +20 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -7294,20 +7294,33 @@ class Beatmap {
7294
7294
  // Convert
7295
7295
  const converted = new BeatmapConverter(this).convert();
7296
7296
  const adjustmentMods = new ModMap();
7297
+ const applicableMods = new ModMap();
7297
7298
  for (const mod of mods.values()) {
7299
+ switch (mode) {
7300
+ case exports.Modes.Droid:
7301
+ if (mod.isApplicableToDroid()) {
7302
+ applicableMods.set(mod);
7303
+ }
7304
+ break;
7305
+ case exports.Modes.Osu:
7306
+ if (mod.isApplicableToOsu()) {
7307
+ applicableMods.set(mod);
7308
+ }
7309
+ break;
7310
+ }
7298
7311
  if (mod.facilitatesAdjustment()) {
7299
7312
  adjustmentMods.set(mod);
7300
7313
  }
7301
7314
  }
7302
7315
  // Apply difficulty mods
7303
- mods.forEach((mod) => {
7316
+ applicableMods.forEach((mod) => {
7304
7317
  if (mod.isApplicableToDifficulty()) {
7305
7318
  mod.applyToDifficulty(mode, converted.difficulty, adjustmentMods);
7306
7319
  }
7307
7320
  });
7308
- mods.forEach((mod) => {
7321
+ applicableMods.forEach((mod) => {
7309
7322
  if (mod.isApplicableToDifficultyWithMods()) {
7310
- mod.applyToDifficultyWithMods(mode, converted.difficulty, mods);
7323
+ mod.applyToDifficultyWithMods(mode, converted.difficulty, applicableMods);
7311
7324
  }
7312
7325
  });
7313
7326
  const processor = new BeatmapProcessor(converted);
@@ -7316,22 +7329,22 @@ class Beatmap {
7316
7329
  converted.hitObjects.objects.forEach((hitObject) => {
7317
7330
  hitObject.applyDefaults(converted.controlPoints, converted.difficulty, mode);
7318
7331
  });
7319
- mods.forEach((mod) => {
7332
+ applicableMods.forEach((mod) => {
7320
7333
  if (mod.isApplicableToHitObject()) {
7321
7334
  for (const hitObject of converted.hitObjects.objects) {
7322
7335
  mod.applyToHitObject(mode, hitObject, adjustmentMods);
7323
7336
  }
7324
7337
  }
7325
7338
  });
7326
- mods.forEach((mod) => {
7339
+ applicableMods.forEach((mod) => {
7327
7340
  if (mod.isApplicableToHitObjectWithMods()) {
7328
7341
  for (const hitObject of converted.hitObjects.objects) {
7329
- mod.applyToHitObjectWithMods(mode, hitObject, mods);
7342
+ mod.applyToHitObjectWithMods(mode, hitObject, applicableMods);
7330
7343
  }
7331
7344
  }
7332
7345
  });
7333
7346
  processor.postProcess();
7334
- mods.forEach((mod) => {
7347
+ applicableMods.forEach((mod) => {
7335
7348
  if (mod.isApplicableToBeatmap()) {
7336
7349
  mod.applyToBeatmap(converted);
7337
7350
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rian8337/osu-base",
3
- "version": "4.0.0-beta.95",
3
+ "version": "4.0.0-beta.96",
4
4
  "description": "Base module for all osu! related modules.",
5
5
  "keywords": [
6
6
  "osu",
@@ -35,5 +35,5 @@
35
35
  "publishConfig": {
36
36
  "access": "public"
37
37
  },
38
- "gitHead": "b07790be9c9dd737170d2d576bf02298ec607ab9"
38
+ "gitHead": "13af8d35ad74141c270c6b985941b5f2a14e248b"
39
39
  }