23 package com.realtime.crossfire.jxclient.stats;
32 import org.jetbrains.annotations.NotNull;
33 import org.jetbrains.annotations.Nullable;
56 @SuppressWarnings(
"FieldAccessedSynchronizedAndUnsynchronized")
63 private final Object
sync = new Object();
76 @SuppressWarnings("FieldCanBeLocal")
80 public void commandDrawextinfoReceived(
final int color,
final int type,
final int subtype, @NotNull
final String message) {
85 public void setDebugMode(
final boolean printMessageTypes) {
95 @SuppressWarnings(
"FieldCanBeLocal")
99 public void markSent(
final int tag) {
100 synchronized (
sync) {
106 public void replySent() {
117 @SuppressWarnings(
"FieldCanBeLocal")
121 public void playerChanged(@Nullable
final CfItem player) {
126 public void openContainerChanged(
final int tag) {
139 public void itemChanged(
final int tag) {
141 throw new IllegalArgumentException(
"tag="+tag+
" but expecting currentPlayerTag="+
currentPlayerTag);
147 public void itemRemoved(
final int tag) {
152 public void inventoryAdded(
final int tag,
final int index, @NotNull
final CfItem item) {
154 throw new IllegalArgumentException(
"tag="+tag+
" but expecting currentPlayerTag="+
currentPlayerTag);
160 public void inventoryRemoved(
final int tag,
final int index) {
162 throw new IllegalArgumentException(
"tag="+tag+
" but expecting currentPlayerTag="+
currentPlayerTag);
176 crossfireServerConnection.addCrossfireDrawinfoListener((text, type) ->
check(text));
188 private void check(@NotNull
final String message) {
189 synchronized (
sync) {
205 if (this.currentPlayerTag != -1) {
209 if (this.currentPlayerTag != -1) {