Battlegear.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:Battlegear2 作者:
/**
 * Basic version checker, support having different build number on each side
 * @param mods the data sent from FML handshake packet
 * @param remoteParty the side that sent this data
 * @return true if we allow this to run
 */
@NetworkCheckHandler
public boolean checkRemote(Map<String,String> mods, Side remoteParty){
    if(mods.containsKey(MODID)){
        String remoteVersion = mods.get(MODID);
        if(remoteVersion!=null) {
            String internalVersion = FMLCommonHandler.instance().findContainerFor(this).getVersion();
            if(remoteVersion.equals(internalVersion))
                return true;
            else{
                internalVersion = internalVersion.substring(0, internalVersion.lastIndexOf("."));
                remoteVersion = remoteVersion.substring(0, remoteVersion.lastIndexOf("."));
                return remoteVersion.equals(internalVersion);
            }
        }
    }
    return false;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号