• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java PropertyManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中net.minecraft.server.dedicated.PropertyManager的典型用法代码示例。如果您正苦于以下问题:Java PropertyManager类的具体用法?Java PropertyManager怎么用?Java PropertyManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PropertyManager类属于net.minecraft.server.dedicated包,在下文中一共展示了PropertyManager类的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: hasUnconvertablePlayerFiles

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
private static boolean hasUnconvertablePlayerFiles(PropertyManager properties)
{
    File file1 = getPlayersDirectory(properties);

    if (!file1.exists() || !file1.isDirectory() || file1.list().length <= 0 && file1.delete())
    {
        return true;
    }
    else
    {
        LOGGER.warn("**** DETECTED OLD PLAYER DIRECTORY IN THE WORLD SAVE");
        LOGGER.warn("**** THIS USUALLY HAPPENS WHEN THE AUTOMATIC CONVERSION FAILED IN SOME WAY");
        LOGGER.warn("** please restart the server and if the problem persists, remove the directory \'{}\'", new Object[] {file1.getPath()});
        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:PreYggdrasilConverter.java


示例2: hasUnconvertablePlayerFiles

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@SideOnly(Side.SERVER)
private static boolean hasUnconvertablePlayerFiles(PropertyManager properties)
{
    File file1 = getPlayersDirectory(properties);

    if (!file1.exists() || !file1.isDirectory() || file1.list().length <= 0 && file1.delete())
    {
        return true;
    }
    else
    {
        LOGGER.warn("**** DETECTED OLD PLAYER DIRECTORY IN THE WORLD SAVE");
        LOGGER.warn("**** THIS USUALLY HAPPENS WHEN THE AUTOMATIC CONVERSION FAILED IN SOME WAY");
        LOGGER.warn("** please restart the server and if the problem persists, remove the directory \'{}\'", new Object[] {file1.getPath()});
        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:18,代码来源:PreYggdrasilConverter.java


示例3: handleStringProperties

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@Redirect(method = "startServer", at = @At(value = "INVOKE",
        target = "Lnet/minecraft/server/dedicated/PropertyManager;"
                + "getStringProperty(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;"))
public String handleStringProperties(PropertyManager propertyManager, String key, String defaultValue) {
    if ("server-ip".equals(key)) {
        return Configuration.getServerConfig().getBindIp();
    } else if ("motd".equals(key)) {
        return Configuration.getServerConfig().getMotd();
    } else if ("level-name".equals(key)) {
        return Configuration.getServerConfig().getDefaultWorldName();
    } else if ("level-seed".equals(key)) {
        return Configuration.getWorldConfig(this.getFolderName() + "_NORMAL").getWorldSeed();
    } else if ("level-type".equals(key)) {
        return Configuration.getWorldConfig(this.getFolderName() + "_NORMAL").getWorldType().toString();
    } else if ("generator-type".equals(key)) {
        return Configuration.getWorldConfig(this.getFolderName() + "_NORMAL").getGeneratorSettings();
    } else {
        return propertyManager.getStringProperty(key, defaultValue);
    }
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:21,代码来源:MixinDedicatedServer.java


示例4: tryConvert

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static boolean tryConvert(PropertyManager properties)
{
    boolean flag = hasUnconvertableFiles(properties);
    flag = flag && hasUnconvertablePlayerFiles(properties);
    return flag;
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:PreYggdrasilConverter.java


示例5: getPlayersDirectory

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@SideOnly(Side.SERVER)
private static File getPlayersDirectory(PropertyManager properties)
{
    String s = properties.getStringProperty("level-name", "world");
    File file1 = new File(s);
    return new File(file1, "players");
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:8,代码来源:PreYggdrasilConverter.java


示例6: handleBooleanProperties

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@Redirect(method = "startServer", at = @At(value = "INVOKE",
        target = "Lnet/minecraft/server/dedicated/PropertyManager;"
                + "getBooleanProperty(Ljava/lang/String;Z)Z"))
public boolean handleBooleanProperties(PropertyManager propertyManager, String key, boolean defaultValue) {
    if ("online-mode".equals(key)) {
        return Configuration.getServerConfig().isOnlineMode();
    } else {
        return propertyManager.getBooleanProperty(key, defaultValue);
    }
}
 
开发者ID:NeptunePowered,项目名称:NeptuneMod,代码行数:11,代码来源:MixinDedicatedServer.java


示例7: set_mc_prop

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
public static JSONPacket set_mc_prop(JSONArgument data)
{
    PropertyManager pm = new PropertyManager(new File("server.properties"));
    pm.setProperty(data.mc_property, data.property_value);

    // Vanilla saves twice, so I guess I will as well?
    pm.saveProperties();
    pm.saveProperties();

    JSONArgument a = new JSONArgument();
    a.ret_code = "SUCCESS";
    return new JSONPacket(Command.SET_MC_PROP, a);
}
 
开发者ID:conman2305,项目名称:JSON-Manage,代码行数:14,代码来源:CommandTable.java


示例8: func_152714_a

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@SideOnly(Side.SERVER)
public static boolean func_152714_a(PropertyManager p_152714_0_)
{
    boolean flag = func_152712_b(p_152714_0_);
    flag = flag && func_152715_c(p_152714_0_);
    return flag;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:8,代码来源:PreYggdrasilConverter.java


示例9: func_152715_c

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@SideOnly(Side.SERVER)
private static boolean func_152715_c(PropertyManager p_152715_0_)
{
    File file1 = func_152725_d(p_152715_0_);

    if (file1.exists() && file1.isDirectory())
    {
        String[] astring = file1.list(new FilenameFilter()
        {
            private static final String __OBFID = "CL_00001906";
            public boolean accept(File p_accept_1_, String p_accept_2_)
            {
                return p_accept_2_.endsWith(".dat");
            }
        });

        if (astring.length > 0)
        {
            field_152732_e.warn("**** DETECTED OLD PLAYER FILES IN THE WORLD SAVE");
            field_152732_e.warn("**** THIS USUALLY HAPPENS WHEN THE AUTOMATIC CONVERSION FAILED IN SOME WAY");
            field_152732_e.warn("** please restart the server and if the problem persists, remove the directory \'{}\'", new Object[] {file1.getPath()});
            return false;
        }
    }

    return true;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:28,代码来源:PreYggdrasilConverter.java


示例10: func_152725_d

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@SideOnly(Side.SERVER)
private static File func_152725_d(PropertyManager p_152725_0_)
{
    String s = p_152725_0_.getStringProperty("level-name", "world");
    File file1 = new File(s);
    return new File(file1, "players");
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:8,代码来源:PreYggdrasilConverter.java


示例11: serverStarted

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@Mod.EventHandler
public void serverStarted(FMLServerStartedEvent event) {
    if (new File("server.properties").exists()) {
        PropertyManager manager = new PropertyManager(new File("server.properties"), null);
        maxSpawn = manager.getIntProperty("max_minion_spawn", -1);
    }
}
 
开发者ID:sirolf2009,项目名称:Necromancy,代码行数:8,代码来源:Necromancy.java


示例12: tryConvert

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
public static boolean tryConvert(PropertyManager properties)
{
    boolean flag = hasUnconvertableFiles(properties);
    flag = flag && hasUnconvertablePlayerFiles(properties);
    return flag;
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:PreYggdrasilConverter.java


示例13: hasUnconvertableFiles

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
private static boolean hasUnconvertableFiles(PropertyManager properties)
{
    boolean flag = false;

    if (OLD_PLAYERBAN_FILE.exists() && OLD_PLAYERBAN_FILE.isFile())
    {
        flag = true;
    }

    boolean flag1 = false;

    if (OLD_IPBAN_FILE.exists() && OLD_IPBAN_FILE.isFile())
    {
        flag1 = true;
    }

    boolean flag2 = false;

    if (OLD_OPS_FILE.exists() && OLD_OPS_FILE.isFile())
    {
        flag2 = true;
    }

    boolean flag3 = false;

    if (OLD_WHITELIST_FILE.exists() && OLD_WHITELIST_FILE.isFile())
    {
        flag3 = true;
    }

    if (!flag && !flag1 && !flag2 && !flag3)
    {
        return true;
    }
    else
    {
        LOGGER.warn("**** FAILED TO START THE SERVER AFTER ACCOUNT CONVERSION!");
        LOGGER.warn("** please remove the following files and restart the server:");

        if (flag)
        {
            LOGGER.warn("* " + OLD_PLAYERBAN_FILE.getName());
        }

        if (flag1)
        {
            LOGGER.warn("* " + OLD_IPBAN_FILE.getName());
        }

        if (flag2)
        {
            LOGGER.warn("* " + OLD_OPS_FILE.getName());
        }

        if (flag3)
        {
            LOGGER.warn("* " + OLD_WHITELIST_FILE.getName());
        }

        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:63,代码来源:PreYggdrasilConverter.java


示例14: getPlayersDirectory

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
private static File getPlayersDirectory(PropertyManager properties)
{
    String s = properties.getStringProperty("level-name", "world");
    File file1 = new File(s);
    return new File(file1, "players");
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:7,代码来源:PreYggdrasilConverter.java


示例15: hasUnconvertableFiles

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@SideOnly(Side.SERVER)
private static boolean hasUnconvertableFiles(PropertyManager properties)
{
    boolean flag = false;

    if (OLD_PLAYERBAN_FILE.exists() && OLD_PLAYERBAN_FILE.isFile())
    {
        flag = true;
    }

    boolean flag1 = false;

    if (OLD_IPBAN_FILE.exists() && OLD_IPBAN_FILE.isFile())
    {
        flag1 = true;
    }

    boolean flag2 = false;

    if (OLD_OPS_FILE.exists() && OLD_OPS_FILE.isFile())
    {
        flag2 = true;
    }

    boolean flag3 = false;

    if (OLD_WHITELIST_FILE.exists() && OLD_WHITELIST_FILE.isFile())
    {
        flag3 = true;
    }

    if (!flag && !flag1 && !flag2 && !flag3)
    {
        return true;
    }
    else
    {
        LOGGER.warn("**** FAILED TO START THE SERVER AFTER ACCOUNT CONVERSION!");
        LOGGER.warn("** please remove the following files and restart the server:");

        if (flag)
        {
            LOGGER.warn("* {}", new Object[] {OLD_PLAYERBAN_FILE.getName()});
        }

        if (flag1)
        {
            LOGGER.warn("* {}", new Object[] {OLD_IPBAN_FILE.getName()});
        }

        if (flag2)
        {
            LOGGER.warn("* {}", new Object[] {OLD_OPS_FILE.getName()});
        }

        if (flag3)
        {
            LOGGER.warn("* {}", new Object[] {OLD_WHITELIST_FILE.getName()});
        }

        return false;
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:64,代码来源:PreYggdrasilConverter.java


示例16: getPropertyManager

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@Override
public PropertyManager getPropertyManager()
{
    return null;
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:6,代码来源:IntegratedServer.java


示例17: func_152712_b

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
@SideOnly(Side.SERVER)
private static boolean func_152712_b(PropertyManager p_152712_0_)
{
    boolean flag = false;

    if (field_152729_b.exists() && field_152729_b.isFile())
    {
        flag = true;
    }

    boolean flag1 = false;

    if (field_152728_a.exists() && field_152728_a.isFile())
    {
        flag1 = true;
    }

    boolean flag2 = false;

    if (field_152730_c.exists() && field_152730_c.isFile())
    {
        flag2 = true;
    }

    boolean flag3 = false;

    if (field_152731_d.exists() && field_152731_d.isFile())
    {
        flag3 = true;
    }

    if (!flag && !flag1 && !flag2 && !flag3)
    {
        return true;
    }
    else
    {
        field_152732_e.warn("**** FAILED TO START THE SERVER AFTER ACCOUNT CONVERSION!");
        field_152732_e.warn("** please remove the following files and restart the server:");

        if (flag)
        {
            field_152732_e.warn("* " + field_152729_b.getName());
        }

        if (flag1)
        {
            field_152732_e.warn("* " + field_152728_a.getName());
        }

        if (flag2)
        {
            field_152732_e.warn("* " + field_152730_c.getName());
        }

        if (flag3)
        {
            field_152732_e.warn("* " + field_152731_d.getName());
        }

        return false;
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:64,代码来源:PreYggdrasilConverter.java


示例18: getPropertyManager

import net.minecraft.server.dedicated.PropertyManager; //导入依赖的package包/类
public abstract PropertyManager getPropertyManager(); 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:2,代码来源:MinecraftServer.java



注:本文中的net.minecraft.server.dedicated.PropertyManager类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java FontStyle类代码示例发布时间:2022-05-23
下一篇:
Java InvalidSurfaceException类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap