@@ -182,6 +182,8 @@ public String getString(UUID uuid, String key) {
182182 public void set (UUID uuid , String key , Boolean value ) {
183183 if (!getRegistry ().getDefaultBools ().containsKey (key )) return ;
184184 if (!getRegistry ().getPlayers ().containsKey (uuid )) return ;
185+ this .getPlugin ().getServer ().getPluginManager ().callEvent (new PlayerDataChangeEvent (this .getPlugin ().getServer ().getPlayer (uuid ), data ,key ));
186+
185187 PlayerData data = getRegistry ().getPlayers ().get (uuid );
186188 Boolean defaultValue = getRegistry ().getDefaultBools ().get (key );
187189 if (value .equals (defaultValue )) {
@@ -191,13 +193,14 @@ public void set(UUID uuid, String key, Boolean value) {
191193 }
192194 data .getBooleans ().put (key , value );
193195 getRegistry ().savePlayer (uuid );
194- this .getPlugin ().getServer ().getPluginManager ().callEvent (new PlayerDataChangeEvent (this .getPlugin ().getServer ().getPlayer (uuid ), data ,key ));
195196
196197 }
197198
198199 public void set (UUID uuid , String key , Integer value ) {
199200 if (!getRegistry ().getDefaultInts ().containsKey (key )) return ;
200201 if (!getRegistry ().getPlayers ().containsKey (uuid )) return ;
202+ this .getPlugin ().getServer ().getPluginManager ().callEvent (new PlayerDataChangeEvent (this .getPlugin ().getServer ().getPlayer (uuid ), data ,key ));
203+
201204 PlayerData data = getRegistry ().getPlayers ().get (uuid );
202205 Integer defaultValue = getRegistry ().getDefaultInts ().get (key );
203206 if (value .equals (defaultValue )) {
@@ -207,13 +210,14 @@ public void set(UUID uuid, String key, Integer value) {
207210 }
208211 data .getInts ().put (key , value );
209212 getRegistry ().savePlayer (uuid );
210- this .getPlugin ().getServer ().getPluginManager ().callEvent (new PlayerDataChangeEvent (this .getPlugin ().getServer ().getPlayer (uuid ), data ,key ));
211213
212214 }
213215
214216 public void set (UUID uuid , String key , String value ) {
215217 if (!getRegistry ().getDefaultStrings ().containsKey (key )) return ;
216218 if (!getRegistry ().getPlayers ().containsKey (uuid )) return ;
219+ this .getPlugin ().getServer ().getPluginManager ().callEvent (new PlayerDataChangeEvent (this .getPlugin ().getServer ().getPlayer (uuid ), data ,key ));
220+
217221 PlayerData data = getRegistry ().getPlayers ().get (uuid );
218222 String defaultValue = getRegistry ().getDefaultStrings ().get (key );
219223 if (value .equals (defaultValue )) {
@@ -223,7 +227,6 @@ public void set(UUID uuid, String key, String value) {
223227 }
224228 data .getStrings ().put (key , value );
225229 getRegistry ().savePlayer (uuid );
226- this .getPlugin ().getServer ().getPluginManager ().callEvent (new PlayerDataChangeEvent (this .getPlugin ().getServer ().getPlayer (uuid ), data ,key ));
227230
228231 }
229232}
0 commit comments