本文整理汇总了Java中codechicken.core.ServerUtils类的典型用法代码示例。如果您正苦于以下问题:Java ServerUtils类的具体用法?Java ServerUtils怎么用?Java ServerUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServerUtils类属于codechicken.core包,在下文中一共展示了ServerUtils类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: toggleRaining
import codechicken.core.ServerUtils; //导入依赖的package包/类
public static void toggleRaining(World world, boolean notify) {
boolean raining = !world.isRaining();
if (!raining)//turn off
((WorldServer) world).provider.resetRainAndThunder();
else
world.getWorldInfo().setRaining(!isRaining(world));
if (notify)
ServerUtils.sendChatToAll(new ChatComponentTranslation("nei.chat.rain." + (raining ? "on" : "off")));
}
开发者ID:4Space,项目名称:4Space-5,代码行数:11,代码来源:NEIServerUtils.java
示例2: setHourForward
import codechicken.core.ServerUtils; //导入依赖的package包/类
public static void setHourForward(World world, int hour, boolean notify) {
long day = (getTime(world) / 24000L) * 24000L;
long newTime = day + 24000L + hour * 1000;
setTime(newTime, world);
if (notify)
ServerUtils.sendChatToAll(new ChatComponentTranslation("nei.chat.time", getTime(world) / 24000L, hour));
}
开发者ID:4Space,项目名称:4Space-5,代码行数:8,代码来源:NEIServerUtils.java
示例3: sendNotice
import codechicken.core.ServerUtils; //导入依赖的package包/类
public static void sendNotice(ICommandSender sender, IChatComponent msg, String permission) {
ChatComponentTranslation notice = new ChatComponentTranslation("chat.type.admin", sender.getCommandSenderName(), msg.createCopy());
notice.getChatStyle().setColor(EnumChatFormatting.GRAY).setItalic(true);
if (NEIServerConfig.canPlayerPerformAction("CONSOLE", permission))
MinecraftServer.getServer().addChatMessage(notice);
for (EntityPlayer p : ServerUtils.getPlayers())
if(p == sender)
p.addChatComponentMessage(msg);
else if (NEIServerConfig.canPlayerPerformAction(p.getCommandSenderName(), permission))
p.addChatComponentMessage(notice);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:14,代码来源:NEIServerUtils.java
示例4: isPlayerInList
import codechicken.core.ServerUtils; //导入依赖的package包/类
public static boolean isPlayerInList(String playername, Set<String> list, boolean allowCards) {
if (playername.equals("CONSOLE"))
return list.contains(playername);
playername = playername.toLowerCase();
if (allowCards) {
if (list.contains("ALL"))
return true;
if ((ServerUtils.isPlayerOP(playername) || ServerUtils.isPlayerOwner(playername)) && list.contains("OP"))
return true;
}
return list.contains(playername);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:16,代码来源:NEIServerConfig.java
示例5: PlayerSave
import codechicken.core.ServerUtils; //导入依赖的package包/类
public PlayerSave(String playername, File saveLocation) {
username = playername;
wasOp = ServerUtils.isPlayerOP(playername);
saveFile = new File(saveLocation, username + ".dat");
if (!saveFile.getParentFile().exists())
saveFile.getParentFile().mkdirs();
load();
}
开发者ID:4Space,项目名称:4Space-5,代码行数:10,代码来源:PlayerSave.java
示例6: updateOpChange
import codechicken.core.ServerUtils; //导入依赖的package包/类
public void updateOpChange(EntityPlayerMP player) {
boolean isOp = ServerUtils.isPlayerOP(username);
if (isOp != wasOp) {
NEISPH.sendHasServerSideTo(player);
wasOp = isOp;
}
}
开发者ID:4Space,项目名称:4Space-5,代码行数:8,代码来源:PlayerSave.java
示例7: canCommandSenderUseCommand
import codechicken.core.ServerUtils; //导入依赖的package包/类
@Override
public boolean canCommandSenderUseCommand(ICommandSender var1)
{
if(OPOnly())
{
if(var1 instanceof EntityPlayer)
return ServerUtils.isPlayerOP(var1.getCommandSenderName());
else if(var1 instanceof MinecraftServer)
return true;
else
return false;
}
return true;
}
开发者ID:4Space,项目名称:4Space-5,代码行数:15,代码来源:CoreCommand.java
示例8: enableAction
import codechicken.core.ServerUtils; //导入依赖的package包/类
public void enableAction(String name, boolean enabled) {
getEnabledActions().setBoolean(name, enabled);
NEISPH.sendActionEnabled(ServerUtils.getPlayer(username), name, enabled);
setDirty();
}
开发者ID:4Space,项目名称:4Space-5,代码行数:6,代码来源:PlayerSave.java
示例9: getPlayer
import codechicken.core.ServerUtils; //导入依赖的package包/类
public final EntityPlayerMP getPlayer(String name)
{
return ServerUtils.getPlayer(name);
}
开发者ID:4Space,项目名称:4Space-5,代码行数:5,代码来源:CoreCommand.java
注:本文中的codechicken.core.ServerUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论