Java 类net.minecraftforge.fml.common.network.NetworkCheckHandler 实例源码
项目:geomastery
文件:Geomastery.java
@NetworkCheckHandler
public static boolean networkCheck(Map<String, String> mods, Side side) {
if (mods.containsKey(MODID)) {
if (COMPATIBLE_RANGE.containsVersion(new DefaultArtifactVersion(mods.get(MODID)))) {
LOG.info("{} version {} compatible with version {} {}, allowing connection", MODID, VERSION, mods.get(MODID), side);
return true;
}
LOG.info("{} version {} not compatible with version {} {}, denying connection", MODID, VERSION, mods.get(MODID), side);
return false;
}
LOG.info("{} not found on {}, denying connection", MODID, side);
return false;
}
项目:sprinkles_for_vanilla
文件:SprinklesForVanilla.java
@SuppressWarnings("SameReturnValue")
@NetworkCheckHandler
public boolean checkIfServer(Map<String, String> serverMods, Side remoteSide)
{
if (remoteSide == Side.CLIENT)
return true;
isOnServer = false;
for (String modName : serverMods.keySet())
{
if (modName.equals("sprinkles_for_vanilla"))
{
isOnServer = true;
}
}
if (!isOnServer && ConfigurationHandler.configLoaded)
{
Settings.copyClientToServer();
}
return true;
}
项目:Battlegear2
文件:Battlegear.java
/**
* 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;
}
项目:DynamicSurroundings
文件:DSurround.java
@NetworkCheckHandler
public boolean checkModLists(@Nonnull final Map<String, String> modList, @Nonnull final Side side) {
if (side == Side.SERVER) {
installedOnServer = modList.containsKey(DSurround.MOD_ID);
}
return true;
}
项目:multi-hotbar
文件:MultiHotbar.java
@SuppressWarnings("unused")
@NetworkCheckHandler
public boolean networkCheck(Map<String, String> mods, Side side) {
// Ignore if the request is on the server
if (side.isClient())
return true;
boolean hasCore = false;
for (String mod : mods.keySet())
if (mod.equals("multihotbarcore"))
hasCore = true;
HotbarLogic.setHasCoreMod(hasCore);
HotbarLogic.setSentPlayerMessage(false);
return true;
}
项目:ServerObserver
文件:ServerObserver.java
@NetworkCheckHandler
public boolean checkModList(final @Nonnull Map<String, String> versions, final @Nonnull Side side) {
return true;
}
项目:ServerObserver
文件:ServerObserver.java
@NetworkCheckHandler
public boolean checkModList(final @Nonnull Map<String, String> versions, final @Nonnull Side side) {
return true;
}
项目:ServerObserver
文件:ServerObserver.java
@NetworkCheckHandler
public boolean checkModList(final @Nonnull Map<String, String> versions, final @Nonnull Side side) {
return true;
}
项目:ServerObserver
文件:ServerObserver.java
@NetworkCheckHandler
public boolean checkModList(final @Nonnull Map<String, String> versions, final @Nonnull Side side) {
return true;
}
项目:ServerObserver
文件:ServerObserver.java
@NetworkCheckHandler
public boolean checkModList(final @Nonnull Map<String, String> versions, final @Nonnull Side side) {
return true;
}
项目:ServerObserver
文件:ServerObserver.java
@NetworkCheckHandler
public boolean checkModList(final @Nonnull Map<String, String> versions, final @Nonnull Side side) {
return true;
}
项目:CustomWorldGen
文件:FMLContainer.java
@NetworkCheckHandler
public boolean checkModLists(Map<String,String> modList, Side side)
{
return Loader.instance().checkRemoteModList(modList,side);
}
项目:InspiringWorld
文件:HelperMod.java
@NetworkCheckHandler
public boolean acceptModList(Map<String, String> modList, Side side)
{
return ModRestriction.acceptModList(modList, side);
}
项目:OpenHarvest
文件:OpenHarvest.java
/** make sure to accept clients without this mod! */
@NetworkCheckHandler
public boolean networkCheck(Map<String, String> map, Side side) {
return true;
}
项目:Tracer
文件:Tracer.java
@NetworkCheckHandler
public boolean checkModList(final Map<String, String> versions, final Side side) {
return true;
}
项目:Dump-OreDictionary
文件:DumpOreDictionary.java
@NetworkCheckHandler
public boolean checkModList(final Map<String, String> versions, final Side side) {
return true;
}
项目:Extension-Fixer
文件:ExtensionFixer.java
@NetworkCheckHandler
public boolean checkModList(Map<String, String> versions, Side side) {
return true;
}
项目:SlackMC
文件:Slack.java
@NetworkCheckHandler
public boolean networkCheckHandler(Map<String, String> map, Side side)
{
return true;
}
项目:ForgeSubWhitelist
文件:ForgeSubWhitelist.java
@NetworkCheckHandler
public boolean networkCheckHandler(Map<String, String> map, Side side)
{
return true;
}
项目:EnchantView
文件:EnchantView.java
/**
* Do not reject vanilla clients or vanilla servers.
*/
@NetworkCheckHandler
public boolean checkNetwork(Map<String, String> modsList, Side remote){
return true;
}
项目:FloodLights
文件:FloodLights.java
@NetworkCheckHandler()
public boolean matchModVersions(Map<String, String> remoteVersions, Side side) {
return remoteVersions.containsKey("FloodLights") && Reference.VERSION.equals(remoteVersions.get("FloodLights"));
}
项目:LunatriusCore
文件:LunatriusCore.java
@NetworkCheckHandler
public boolean checkModList(final Map<String, String> versions, final Side side) {
return true;
}
项目:Laser-Level
文件:LaserLevel.java
@NetworkCheckHandler
public boolean checkModList(final Map<String, String> versions, final Side side) {
return true;
}
项目:Arrow-Flight-Path
文件:ArrowFlightPath.java
@NetworkCheckHandler
public boolean checkModList(final Map<String, String> versions, final Side side) {
final String version = versions.get(Reference.MODID);
return version == null || Reference.VERSION.equals(version);
}
项目:IGW-mod
文件:IGWMod.java
/**
* This method is used to reject connection when the server has server info available for IGW-mod. Unless the properties.txt explicitly says
* it's okay to connect without IGW-Mod, by setting "optional=true".
* @param installedMods
* @param side
* @return
*/
@NetworkCheckHandler
public boolean onConnectRequest(Map<String, String> installedMods, Side side){
if(side == Side.SERVER || proxy == null) return true;
File serverFolder = new File(proxy.getSaveLocation() + File.separator + "igwmod" + File.separator);
if(serverFolder.exists() || new File(proxy.getSaveLocation() + File.separator + "igwmodServer" + File.separator).exists()) {//TODO remove legacy
String str = proxy.getSaveLocation() + File.separator + "igwmod" + File.separator + "properties.txt";
File file = new File(str);
if(!file.exists()) {
file = new File(proxy.getSaveLocation() + File.separator + "igwmodServer" + File.separator + "properties.txt");//TODO remove legacy
}
if(file.exists()) {
try {
FileInputStream stream = new FileInputStream(file);
BufferedReader br = new BufferedReader(new InputStreamReader(stream, "UTF-8"));
List<String> textList = new ArrayList<String>();
String line = br.readLine();
while(line != null) {
textList.add(line);
line = br.readLine();
}
br.close();
if(textList != null) {
for(String s : textList) {
String[] entry = s.split("=");
if(entry[0].equals("optional")) {
if(Boolean.parseBoolean(entry[1])) return true;
}
}
}
} catch(Exception e) {
e.printStackTrace();
}
}
String version = installedMods.get(Constants.MOD_ID);
if(version.equals("${version}")) return true;
return version != null && version.equals(Constants.fullVersionString());
} else {
return true;
}
}
项目:Easy-Editors
文件:EasyEditors.java
/**
* A client-side mod must always accept remote clients and servers
*
* @param mods
* @param remoteSide
* @return
*/
@NetworkCheckHandler
public boolean acceptsRemote(Map<String, String> mods, Side remoteSide) {
return true;
}