-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
61 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package functions; | ||
|
||
import mindustry.gen.Player; | ||
|
||
|
||
public class PlayerFunctions { | ||
public static void err(Player player, String fmt, Object... msg) { | ||
player.sendMessage("[scarlet]Error: " + String.format(fmt, msg)); | ||
} | ||
public static void info(Player player, String fmt, Object... msg) { | ||
player.sendMessage("Info: " + String.format(fmt, msg)); | ||
} | ||
public static void warn(Player player, String fmt, Object... msg) { | ||
player.sendMessage("[gold]Warning: []" + String.format(fmt, msg)); | ||
} | ||
|
||
//check the player if admin | ||
public static boolean adminCheck(Player player) { | ||
if(!player.admin()){ | ||
player.sendMessage("[scarlet]This command is only for admins!"); | ||
return false; | ||
} else return true; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package functions; | ||
|
||
import java.io.Serializable; | ||
import java.util.HashMap; | ||
|
||
@SuppressWarnings("serial") | ||
public class TempPlayerData implements Serializable { | ||
public static HashMap<String, TempPlayerData> tempPlayerDatas = new HashMap<>(); // uuid, data | ||
public Integer hue; | ||
public String realName; | ||
public String nameNotSpace; | ||
public String nameNotColor; | ||
public int id; | ||
|
||
public TempPlayerData(Integer hue, String name, int id){ | ||
this.hue = hue; | ||
this.realName = name; | ||
this.nameNotSpace = name.replaceAll("\\s+", "_"); | ||
this.nameNotColor = name.replaceAll("\\[", "[["); | ||
this.id = id; | ||
} | ||
public void setHue(int i) { | ||
this.hue = i; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters