mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-12 00:07:33 +00:00
Few things for new updated mods.
This commit is contained in:
1 parent
dfe178ec51
commit
a1696fe91b
4 files changed
+58
-65
No files matched your search
@@ -3,6 +3,7 @@ package codechicken.core;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.command.CommandHandler;
|
||||
import net.minecraft.inventory.Container;
|
||||
@@ -43,18 +44,20 @@ public class ServerUtils extends CommonUtils
|
||||
player.openContainer.addCraftingToCrafters(player);
|
||||
}
|
||||
|
||||
public static GameProfile getGameProfile(String username) {
|
||||
return mc().func_152358_ax().func_152655_a(username);
|
||||
}
|
||||
|
||||
public static boolean isPlayerOP(String username) {
|
||||
return mc().getConfigurationManager().func_152596_g(getPlayer(username).getGameProfile());
|
||||
GameProfile prof = getGameProfile(username);
|
||||
if(prof == null) return false;
|
||||
return mc().getConfigurationManager().func_152596_g(getGameProfile(username));
|
||||
}
|
||||
|
||||
public static boolean isPlayerOwner(String username) {
|
||||
return mc().isSinglePlayer() && mc().getServerOwner().equalsIgnoreCase(username);
|
||||
}
|
||||
|
||||
public static void registerCommand(ICommand command) {
|
||||
((CommandHandler) mc().getCommandManager()).registerCommand(command);
|
||||
}
|
||||
|
||||
public static void sendChatToAll(IChatComponent msg) {
|
||||
for(EntityPlayer p : getPlayers())
|
||||
p.addChatComponentMessage(msg);
|
||||
|
||||
Reference in new issue
Block a user