3131import net .coreprotect .thread .NetworkHandler ;
3232import net .coreprotect .utility .Chat ;
3333import net .coreprotect .utility .Color ;
34- import net .coreprotect .utility .Util ;
34+ import net .coreprotect .utility .EntityUtils ;
35+ import net .coreprotect .utility .MaterialUtils ;
36+ import net .coreprotect .utility .VersionUtils ;
37+ import net .coreprotect .utility .WorldUtils ;
3538
3639public class CommandHandler implements CommandExecutor {
3740 private static CommandHandler instance ;
@@ -210,7 +213,7 @@ else if (cCount == 2) {
210213 }
211214 if (cCount > 1 ) {
212215 if (location == null && worldId > 0 ) {
213- location = new Location (Bukkit .getWorld (Util .getWorldName (worldId )), 0 , 0 , 0 );
216+ location = new Location (Bukkit .getWorld (WorldUtils .getWorldName (worldId )), 0 , 0 , 0 );
214217 }
215218 if (location != null ) {
216219 int worldMaxHeight = location .getWorld ().getMaxHeight () - 1 ;
@@ -279,12 +282,12 @@ else if (next == 5 || argument.startsWith("e:") || argument.startsWith("exclude:
279282 String [] i2 = argument .split ("," );
280283 for (String i3 : i2 ) {
281284 if (!checkTags (i3 , excluded )) {
282- Material i3_material = Util .getType (i3 );
285+ Material i3_material = MaterialUtils .getType (i3 );
283286 if (i3_material != null && (i3_material .isBlock () || argAction .contains (4 ))) {
284287 excluded .put (i3_material , false );
285288 }
286289 else {
287- EntityType i3_entity = Util .getEntityType (i3 );
290+ EntityType i3_entity = EntityUtils .getEntityType (i3 );
288291 if (i3_entity != null ) {
289292 excluded .put (i3_entity , false );
290293 }
@@ -303,12 +306,12 @@ else if (i3_material != null) {
303306 }
304307 else {
305308 if (!checkTags (argument , excluded )) {
306- Material iMaterial = Util .getType (argument );
309+ Material iMaterial = MaterialUtils .getType (argument );
307310 if (iMaterial != null && (iMaterial .isBlock () || argAction .contains (4 ))) {
308311 excluded .put (iMaterial , false );
309312 }
310313 else {
311- EntityType iEntity = Util .getEntityType (argument );
314+ EntityType iEntity = EntityUtils .getEntityType (argument );
312315 if (iEntity != null ) {
313316 excluded .put (iEntity , false );
314317 }
@@ -354,12 +357,12 @@ else if (next == 5 || argument.startsWith("e:") || argument.startsWith("exclude:
354357 isBlock = true ;
355358 }
356359 else {
357- Material i3_material = Util .getType (i3 );
360+ Material i3_material = MaterialUtils .getType (i3 );
358361 if (i3_material != null ) {
359362 isBlock = true ;
360363 }
361364 else {
362- EntityType i3Entity = Util .getEntityType (i3 );
365+ EntityType i3Entity = EntityUtils .getEntityType (i3 );
363366 if (i3Entity != null ) {
364367 isBlock = true ;
365368 }
@@ -382,12 +385,12 @@ else if (next == 5 || argument.startsWith("e:") || argument.startsWith("exclude:
382385 isBlock = true ;
383386 }
384387 else {
385- Material iMaterial = Util .getType (argument );
388+ Material iMaterial = MaterialUtils .getType (argument );
386389 if (iMaterial != null ) {
387390 isBlock = true ;
388391 }
389392 else {
390- EntityType entityType = Util .getEntityType (argument );
393+ EntityType entityType = EntityUtils .getEntityType (argument );
391394 if (entityType != null ) {
392395 isBlock = true ;
393396 }
@@ -429,7 +432,7 @@ else if (next == 2 || argument.startsWith("r:") || argument.startsWith("radius:"
429432 result = true ;
430433 }
431434 else if (argument .startsWith ("#" )) {
432- int worldId = Util .matchWorld (argument );
435+ int worldId = WorldUtils .matchWorld (argument );
433436 if (worldId > 0 ) {
434437 result = true ;
435438 }
@@ -622,12 +625,12 @@ else if (next == 4 || argument.startsWith("i:") || argument.startsWith("include:
622625 String [] i2 = argument .split ("," );
623626 for (String i3 : i2 ) {
624627 if (!checkTags (argument , restricted )) {
625- Material i3_material = Util .getType (i3 );
628+ Material i3_material = MaterialUtils .getType (i3 );
626629 if (i3_material != null && (i3_material .isBlock () || argAction .contains (4 ))) {
627630 restricted .add (i3_material );
628631 }
629632 else {
630- EntityType i3_entity = Util .getEntityType (i3 );
633+ EntityType i3_entity = EntityUtils .getEntityType (i3 );
631634 if (i3_entity != null ) {
632635 restricted .add (i3_entity );
633636 }
@@ -651,12 +654,12 @@ else if (i3_material != null) {
651654 }
652655 else {
653656 if (!checkTags (argument , restricted )) {
654- Material material = Util .getType (argument );
657+ Material material = MaterialUtils .getType (argument );
655658 if (material != null && (material .isBlock () || argAction .contains (4 ))) {
656659 restricted .add (material );
657660 }
658661 else {
659- EntityType entityType = Util .getEntityType (argument );
662+ EntityType entityType = EntityUtils .getEntityType (argument );
660663 if (entityType != null ) {
661664 restricted .add (entityType );
662665 }
@@ -1041,7 +1044,7 @@ else if (next == 2 || inputProcessed.startsWith("r:") || inputProcessed.startsWi
10411044 world_id = 0 ;
10421045 }
10431046 else if (inputProcessed .startsWith ("#" )) {
1044- world_id = Util .matchWorld (inputProcessed );
1047+ world_id = WorldUtils .matchWorld (inputProcessed );
10451048 if (world_id == -1 && !requireLoaded ) {
10461049 world_id = ConfigHandler .worlds .getOrDefault (argument .replaceFirst ("#" , "" ), -1 );
10471050 }
@@ -1275,7 +1278,7 @@ else if (corecommand.equals("network-debug")) {
12751278 NetworkDebugCommand .runCommand (user , permission , argumentArray );
12761279 }
12771280 else if (corecommand .equals ("migrate-db" )) {
1278- if (!Util .validDonationKey ()) {
1281+ if (!VersionUtils .validDonationKey ()) {
12791282 Chat .sendMessage (user , Color .DARK_AQUA + "CoreProtect " + Color .WHITE + "- " + Phrase .build (Phrase .DONATION_KEY_REQUIRED ));
12801283 }
12811284 else {
@@ -1300,7 +1303,7 @@ class updateAlert implements Runnable {
13001303 public void run () {
13011304 try {
13021305 Thread .sleep (5000 );
1303- Chat .sendMessage (user , Color .WHITE + "----- " + Color .DARK_AQUA + Phrase .build (Phrase .UPDATE_HEADER , "CoreProtect" + (Util .isCommunityEdition () ? " " + ConfigHandler .COMMUNITY_EDITION : "" )) + Color .WHITE + " -----" );
1306+ Chat .sendMessage (user , Color .WHITE + "----- " + Color .DARK_AQUA + Phrase .build (Phrase .UPDATE_HEADER , "CoreProtect" + (VersionUtils .isCommunityEdition () ? " " + ConfigHandler .COMMUNITY_EDITION : "" )) + Color .WHITE + " -----" );
13041307 if (latestVersion != null ) {
13051308 Chat .sendMessage (user , Color .DARK_AQUA + Phrase .build (Phrase .UPDATE_NOTICE , Color .WHITE , "CoreProtect CE v" + latestVersion ));
13061309 Chat .sendMessage (user , Color .DARK_AQUA + Phrase .build (Phrase .LINK_DOWNLOAD , Color .WHITE , "www.coreprotect.net/download/" ));
0 commit comments