Java 类cpw.mods.fml.common.functions.GenericIterableFactory 实例源码
项目:TRHS_Club_Mod_2016
文件:FMLServerHandler.java
@Override
public void queryUser(StartupQuery query) throws InterruptedException
{
if (query.getResult() == null)
{
FMLLog.warning("%s", query.getText());
query.finish();
}
else
{
String text = query.getText() +
"\n\nRun the command /fml confirm or or /fml cancel to proceed." +
"\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer.";
FMLLog.warning("%s", text);
if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever)
boolean done = false;
while (!done && server.func_71278_l())
{
if (Thread.interrupted()) throw new InterruptedException();
DedicatedServer dedServer = (DedicatedServer) server;
// rudimentary command processing, check for fml confirm/cancel and stop commands
synchronized (dedServer.field_71341_l)
{
for (Iterator<ServerCommand> it = GenericIterableFactory.newCastingIterable(dedServer.field_71341_l, ServerCommand.class).iterator(); it.hasNext(); )
{
String cmd = it.next().field_73702_a.trim().toLowerCase();
if (cmd.equals("/fml confirm"))
{
FMLLog.info("confirmed");
query.setResult(true);
done = true;
it.remove();
}
else if (cmd.equals("/fml cancel"))
{
FMLLog.info("cancelled");
query.setResult(false);
done = true;
it.remove();
}
else if (cmd.equals("/stop"))
{
StartupQuery.abort();
}
}
}
Thread.sleep(10L);
}
query.finish();
}
}
项目:TRHS_Club_Mod_2016
文件:FMLControlledNamespacedRegistry.java
public Iterable<I> typeSafeIterable()
{
return GenericIterableFactory.newCastingIterable(super.iterator(), superType);
}
项目:CauldronGit
文件:FMLServerHandler.java
@Override
public void queryUser(StartupQuery query) throws InterruptedException
{
if (query.getResult() == null)
{
FMLLog.warning("%s", query.getText());
query.finish();
}
else
{
String text = query.getText() +
"\n\nRun the command /fml confirm or or /fml cancel to proceed." +
"\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer.";
FMLLog.warning("%s", text);
if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever)
boolean done = false;
while (!done && server.isServerRunning())
{
if (Thread.interrupted()) throw new InterruptedException();
DedicatedServer dedServer = (DedicatedServer) server;
// rudimentary command processing, check for fml confirm/cancel and stop commands
synchronized (dedServer.pendingCommandList)
{
for (Iterator<ServerCommand> it = GenericIterableFactory.newCastingIterable(dedServer.pendingCommandList, ServerCommand.class).iterator(); it.hasNext(); )
{
String cmd = it.next().command.trim().toLowerCase();
if (cmd.equals("/fml confirm"))
{
FMLLog.info("confirmed");
query.setResult(true);
done = true;
it.remove();
}
else if (cmd.equals("/fml cancel"))
{
FMLLog.info("cancelled");
query.setResult(false);
done = true;
it.remove();
}
else if (cmd.equals("/stop"))
{
StartupQuery.abort();
}
}
}
Thread.sleep(10L);
}
query.finish();
}
}
项目:CauldronGit
文件:FMLControlledNamespacedRegistry.java
public Iterable<I> typeSafeIterable()
{
Iterable<?> self = this;
return GenericIterableFactory.newCastingIterable(self, superType);
}
项目:Cauldron
文件:FMLServerHandler.java
@Override
public void queryUser(StartupQuery query) throws InterruptedException
{
if (query.getResult() == null)
{
FMLLog.warning("%s", query.getText());
query.finish();
}
else
{
String text = query.getText() +
"\n\nRun the command /fml confirm or or /fml cancel to proceed." +
"\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer.";
FMLLog.warning("%s", text);
if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever)
boolean done = false;
while (!done && server.isServerRunning())
{
if (Thread.interrupted()) throw new InterruptedException();
DedicatedServer dedServer = (DedicatedServer) server;
// rudimentary command processing, check for fml confirm/cancel and stop commands
synchronized (dedServer.pendingCommandList)
{
for (Iterator<ServerCommand> it = GenericIterableFactory.newCastingIterable(dedServer.pendingCommandList, ServerCommand.class).iterator(); it.hasNext(); )
{
String cmd = it.next().command.trim().toLowerCase();
if (cmd.equals("/fml confirm"))
{
FMLLog.info("confirmed");
query.setResult(true);
done = true;
it.remove();
}
else if (cmd.equals("/fml cancel"))
{
FMLLog.info("cancelled");
query.setResult(false);
done = true;
it.remove();
}
else if (cmd.equals("/stop"))
{
StartupQuery.abort();
}
}
}
Thread.sleep(10L);
}
query.finish();
}
}
项目:Cauldron
文件:FMLControlledNamespacedRegistry.java
public Iterable<I> typeSafeIterable()
{
Iterable<?> self = this;
return GenericIterableFactory.newCastingIterable(self, superType);
}
项目:Cauldron
文件:FMLServerHandler.java
@Override
public void queryUser(StartupQuery query) throws InterruptedException
{
if (query.getResult() == null)
{
FMLLog.warning("%s", query.getText());
query.finish();
}
else
{
String text = query.getText() +
"\n\nRun the command /fml confirm or or /fml cancel to proceed." +
"\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer.";
FMLLog.warning("%s", text);
if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever)
boolean done = false;
while (!done && server.isServerRunning())
{
if (Thread.interrupted()) throw new InterruptedException();
DedicatedServer dedServer = (DedicatedServer) server;
// rudimentary command processing, check for fml confirm/cancel and stop commands
synchronized (dedServer.pendingCommandList)
{
for (Iterator<ServerCommand> it = GenericIterableFactory.newCastingIterable(dedServer.pendingCommandList, ServerCommand.class).iterator(); it.hasNext(); )
{
String cmd = it.next().command.trim().toLowerCase();
if (cmd.equals("/fml confirm"))
{
FMLLog.info("confirmed");
query.setResult(true);
done = true;
it.remove();
}
else if (cmd.equals("/fml cancel"))
{
FMLLog.info("cancelled");
query.setResult(false);
done = true;
it.remove();
}
else if (cmd.equals("/stop"))
{
StartupQuery.abort();
}
}
}
Thread.sleep(10L);
}
query.finish();
}
}
项目:Cauldron
文件:FMLControlledNamespacedRegistry.java
public Iterable<I> typeSafeIterable()
{
Iterable<?> self = this;
return GenericIterableFactory.newCastingIterable(self, superType);
}
项目:Cauldron
文件:FMLServerHandler.java
@Override
public void queryUser(StartupQuery query) throws InterruptedException
{
if (query.getResult() == null)
{
FMLLog.warning("%s", query.getText());
query.finish();
}
else
{
String text = query.getText() +
"\n\nRun the command /fml confirm or or /fml cancel to proceed." +
"\nAlternatively start the server with -Dfml.queryResult=confirm or -Dfml.queryResult=cancel to preselect the answer.";
FMLLog.warning("%s", text);
if (!query.isSynchronous()) return; // no-op until mc does commands in another thread (if ever)
boolean done = false;
while (!done && server.isServerRunning())
{
if (Thread.interrupted()) throw new InterruptedException();
DedicatedServer dedServer = (DedicatedServer) server;
// rudimentary command processing, check for fml confirm/cancel and stop commands
synchronized (dedServer.pendingCommandList)
{
for (Iterator<ServerCommand> it = GenericIterableFactory.newCastingIterable(dedServer.pendingCommandList, ServerCommand.class).iterator(); it.hasNext(); )
{
String cmd = it.next().command.trim().toLowerCase();
if (cmd.equals("/fml confirm"))
{
FMLLog.info("confirmed");
query.setResult(true);
done = true;
it.remove();
}
else if (cmd.equals("/fml cancel"))
{
FMLLog.info("cancelled");
query.setResult(false);
done = true;
it.remove();
}
else if (cmd.equals("/stop"))
{
StartupQuery.abort();
}
}
}
Thread.sleep(10L);
}
query.finish();
}
}
项目:Cauldron
文件:FMLControlledNamespacedRegistry.java
public Iterable<I> typeSafeIterable()
{
Iterable<?> self = this;
return GenericIterableFactory.newCastingIterable(self, superType);
}