<commit_before>package net.gtaun.shoebill.label;

import net.gtaun.shoebill.Shoebill;
import net.gtaun.shoebill.Streamer;
import net.gtaun.shoebill.data.Color;
import net.gtaun.shoebill.data.Location;
import net.gtaun.shoebill.event.destroyable.DestroyEvent;
import net.gtaun.shoebill.event.player.PlayerDisconnectEvent;
import net.gtaun.shoebill.object.Player;
import net.gtaun.shoebill.object.PlayerLabel;
import net.gtaun.shoebill.object.Vehicle;
import net.gtaun.util.event.EventManager;
import net.gtaun.util.event.EventManagerNode;

import java.util.*;

// Created by marvin on 28.12.14 in project shoebill-streamer.
// Copyright (c) 2014 <NAME>. All rights reserved.
class DynamicLabelImpl implements DynamicLabel {

    public static EventManager eventManager = Shoebill.get().getResourceManager().getPlugin(Streamer.class).getEventManager();

    private String text;
    private Color color;
    private Player attachedPlayer;
    private Vehicle attachedVehicle;
    private Location location;
    private float drawDistance, streamDistance;
    private boolean testLOS;
    private int id;
    private EventManagerNode eventManagerNode;
    private WeakHashMap<Player, PlayerLabel> visibleLabels;


    public DynamicLabelImpl(String text, Color color, Player attachedPlayer, Vehicle attachedVehicle, Location location,
                            float drawDistance, float streamDistance, boolean testLOS) {
        this.text = text;
        this.color = color;
        this.attachedPlayer = attachedPlayer;
        this.attachedVehicle = attachedVehicle;
        this.location = location;
        this.drawDistance = drawDistance;
        this.streamDistance = streamDistance;
        this.testLOS = testLOS;
        this.eventManagerNode = eventManager.createChildNode();
        this.id = objectPool.pullId();
        this.visibleLabels = new WeakHashMap<>();
        eventManagerNode.registerHandler(PlayerDisconnectEvent.class, (e) -> removeLabelForPlayer(e.getPlayer()));
    }

    private void createPlayerLabel(Player player) {
        PlayerLabel pObject = null;<commit_msg>important bug fix<commit_after>package net.gtaun.shoebill.label;

import net.gtaun.shoebill.Shoebill;
import net.gtaun.shoebill.Streamer;
import net.gtaun.shoebill.data.Color;
import net.gtaun.shoebill.data.Location;
import net.gtaun.shoebill.event.destroyable.DestroyEvent;
import net.gtaun.shoebill.event.player.PlayerDisconnectEvent;
import net.gtaun.shoebill.object.Player;
import net.gtaun.shoebill.object.PlayerLabel;
import net.gtaun.shoebill.object.Vehicle;
import net.gtaun.util.event.EventManager;
import net.gtaun.util.event.EventManagerNode;

import java.util.*;

// Created by marvin on 28.12.14 in project shoebill-streamer.
// Copyright (c) 2014 <NAME>. All rights reserved.
class DynamicLabelImpl implements DynamicLabel {

    public static EventManager eventManager = Shoebill.get().getResourceManager().getPlugin(Streamer.class).getEventManager();

    private String text;
    private Color color;
    private Player attachedPlayer;
    private Vehicle attachedVehicle;
    private Location location;
    private float drawDistance, streamDistance;
    private boolean testLOS;
    private int id;
    private EventManagerNode eventManagerNode;
    private WeakHashMap<Player, PlayerLabel> visibleLabels;


    public DynamicLabelImpl(String text, Color color, Player attachedPlayer, Vehicle attachedVehicle, Location location,
                            float drawDistance, float streamDistance, boolean testLOS) {
        this.text = text;
        this.color = color;
        this.attachedPlayer = attachedPlayer;
        this.attachedVehicle = attachedVehicle;
        this.location = location;
        this.drawDistance = drawDistance;
        this.streamDistance = streamDistance;
        this.testLOS = testLOS;
        this.eventManagerNode = eventManager.createChildNode();
        this.id = objectPool.pullId();
        this.visibleLabels = new WeakHashMap<>();
        objectPool.addObject(this);
        eventManagerNode.registerHandler(PlayerDisconnectEvent.class, (e) -> removeLabelForPlayer(e.getPlayer()));
    }

    private void createPlayerLabel(Player player) {
        PlayerLabel pObject = null;
{'fraction_non_alphanumeric': 0.08786017949929145, 'fraction_numerical': 0.004723665564478035, 'mean_word_length': 3.8734177215189876, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '2012871', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1215, 'n_words': 266}