<commit_before>package net.nunnerycode.bukkit.mythicdrops.socketting;

import net.nunnerycode.bukkit.mythicdrops.api.socketting.EffectTarget;
import net.nunnerycode.bukkit.mythicdrops.api.socketting.SocketEffect;

import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

public final class SocketPotionEffect implements SocketEffect {

  private final PotionEffectType potionEffectType;
  private final int intensity;
  private final int duration;
  private final int radius;
  private final EffectTarget effectTarget;
  private final boolean affectsWielder;
  private final boolean affectsTarget;
  private static final int MS_PER_TICK = 50;

  public SocketPotionEffect(PotionEffectType potionEffectType, int intensity, int duration,
                            int radius, EffectTarget effectTarget, boolean affectsWielder,
                            boolean affectsTarget) {
    this.potionEffectType = potionEffectType;
    this.intensity = intensity;
    this.duration = duration;
    this.radius = radius;
    this.effectTarget = effectTarget;
    this.affectsWielder = affectsWielder;
    this.affectsTarget = affectsTarget;
  }

  public PotionEffectType getPotionEffectType() {
    return potionEffectType;
  }

  @Override
  public int getIntensity() {
    return intensity;
  }

  @Override
  public int getDuration() {
    return duration;
  }

  @Override
  public EffectTarget getEffectTarget() {
    return effectTarget;
  }

  @Override
  public int getRadius() {
    return radius;
  }

  @Override
  public boolean isAffectsWielder() {
    return affectsWielder;
  }

  @Override
  public boolean isAffectsTarget() {
    return affectsTarget;
  }

  @Override
  public void apply(LivingEntity target) {
    if (potionEffectType == null) {
      return;
    }
    target.addPotionEffect(new PotionEffect(potionEffectType, duration / MS_PER_TICK, intensity),
                           true);
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }<commit_msg>fix for an issue with potion effects<commit_after>package net.nunnerycode.bukkit.mythicdrops.socketting;

import net.nunnerycode.bukkit.mythicdrops.api.socketting.EffectTarget;
import net.nunnerycode.bukkit.mythicdrops.api.socketting.SocketEffect;

import org.bukkit.entity.LivingEntity;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

public final class SocketPotionEffect implements SocketEffect {

  private final PotionEffectType potionEffectType;
  private final int intensity;
  private final int duration;
  private final int radius;
  private final EffectTarget effectTarget;
  private final boolean affectsWielder;
  private final boolean affectsTarget;
  private static final int MS_PER_TICK = 50;

  public SocketPotionEffect(PotionEffectType potionEffectType, int intensity, int duration,
                            int radius, EffectTarget effectTarget, boolean affectsWielder,
                            boolean affectsTarget) {
    this.potionEffectType = potionEffectType;
    this.intensity = intensity;
    this.duration = duration;
    this.radius = radius;
    this.effectTarget = effectTarget;
    this.affectsWielder = affectsWielder;
    this.affectsTarget = affectsTarget;
  }

  public PotionEffectType getPotionEffectType() {
    return potionEffectType;
  }

  @Override
  public int getIntensity() {
    return intensity;
  }

  @Override
  public int getDuration() {
    return duration;
  }

  @Override
  public EffectTarget getEffectTarget() {
    return effectTarget;
  }

  @Override
  public int getRadius() {
    return radius;
  }

  @Override
  public boolean isAffectsWielder() {
    return affectsWielder;
  }

  @Override
  public boolean isAffectsTarget() {
    return affectsTarget;
  }

  @Override
  public void apply(LivingEntity target) {
    if (potionEffectType == null) {
      return;
    }
    target.addPotionEffect(new PotionEffect(potionEffectType, duration / MS_PER_TICK, intensity));
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
{'fraction_non_alphanumeric': 0.0762279888785913, 'fraction_numerical': 0.0009267840593141798, 'mean_word_length': 3.436793422404933, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7664035', 'n_tokens_mistral': 1315, 'n_tokens_neox': 1259, 'n_words': 313}