Commits

Mitchell Sulkowski authored and md_5 committed 3ad0fb1c046
#901: Fix PlayerStatisticIncrementEvent spam
No tags

src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java

Modified
1386 1386 case HORSE_ONE_CM:
1387 1387 case MINECART_ONE_CM:
1388 1388 case PIG_ONE_CM:
1389 1389 case PLAY_ONE_MINUTE:
1390 1390 case SWIM_ONE_CM:
1391 1391 case WALK_ONE_CM:
1392 1392 case SPRINT_ONE_CM:
1393 1393 case CROUCH_ONE_CM:
1394 1394 case TIME_SINCE_DEATH:
1395 1395 case SNEAK_TIME:
1396 + case TOTAL_WORLD_TIME:
1397 + case TIME_SINCE_REST:
1398 + case AVIATE_ONE_CM:
1399 + case STRIDER_ONE_CM:
1396 1400 // Do not process event for these - too spammy
1397 1401 return null;
1398 1402 default:
1399 1403 }
1400 1404 if (stat.getType() == Type.UNTYPED) {
1401 1405 event = new PlayerStatisticIncrementEvent(player, stat, current, newValue);
1402 1406 } else if (stat.getType() == Type.ENTITY) {
1403 1407 EntityType entityType = CraftStatistic.getEntityTypeFromStatistic((net.minecraft.stats.Statistic<EntityTypes<?>>) statistic);
1404 1408 event = new PlayerStatisticIncrementEvent(player, stat, current, newValue, entityType);
1405 1409 } else {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut