本文整理汇总了Java中net.minecraft.util.Session.getUsername方法的典型用法代码示例。如果您正苦于以下问题:Java Session.getUsername方法的具体用法?Java Session.getUsername怎么用?Java Session.getUsername使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.util.Session
的用法示例。
在下文中一共展示了Session.getUsername方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preInit
import net.minecraft.util.Session; //导入方法依赖的package包/类
@Override
public void preInit(final @Nonnull FMLPreInitializationEvent event) {
super.preInit(event);
Log.log = event.getModLog();
Config.init(event.getSuggestedConfigurationFile());
// Setup stencil clip
// StencilClip.init();
// Setup location
Client.initLocation(new Locations(event.getSourceFile(), getDataDirectory()));
// Get Id
final String id = Client.mc.getSession().getPlayerID();
try {
final Object o = UUIDTypeAdapter.fromString(id);
if (o!=null) {
Client.id = id;
final Session s = Client.mc.getSession();
Client.name = s.getUsername();
Client.token = s.getToken();
}
} catch (final IllegalArgumentException e) {
}
}
示例2: func_146821_q
import net.minecraft.util.Session; //导入方法依赖的package包/类
private void func_146821_q()
{
Session var1 = this.mc.getSession();
McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
String var3 = var2.func_148708_h(this.field_146846_h);
Clipboard var4 = Toolkit.getDefaultToolkit().getSystemClipboard();
var4.setContents(new StringSelection(var3), (ClipboardOwner)null);
this.func_146823_a(var3);
}
catch (ExceptionMcoService var5)
{
logger.error("Couldn\'t download world data");
}
}
示例3: func_146778_a
import net.minecraft.util.Session; //导入方法依赖的package包/类
private void func_146778_a(long p_146778_1_)
{
Session var3 = this.mc.getSession();
McoClient var4 = new McoClient(var3.getSessionID(), var3.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
ValueObjectSubscription var5 = var4.func_148705_g(p_146778_1_);
this.field_146785_r = var5.field_148789_b;
this.field_146784_s = this.func_146776_b(var5.field_148790_a);
}
catch (ExceptionMcoService var6)
{
logger.error("Couldn\'t get subscription");
}
catch (IOException var7)
{
logger.error("Couldn\'t parse response subscribing");
}
}
示例4: func_146816_h
import net.minecraft.util.Session; //导入方法依赖的package包/类
private void func_146816_h()
{
Session var1 = this.mc.getSession();
final McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
(new Thread()
{
private static final String __OBFID = "CL_00000771";
public void run()
{
try
{
GuiScreenBuyRealms.this.field_146820_h = var2.func_148690_i();
}
catch (ExceptionMcoService var2x)
{
GuiScreenBuyRealms.logger.error("Could not get stat");
}
}
}).start();
}
示例5: func_146677_c
import net.minecraft.util.Session; //导入方法依赖的package包/类
private McoServer func_146677_c(long p_146677_1_)
{
Session var3 = this.mc.getSession();
McoClient var4 = new McoClient(var3.getSessionID(), var3.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
return var4.func_148709_a(p_146677_1_);
}
catch (ExceptionMcoService var6)
{
logger.error("Couldn\'t get own world");
}
catch (IOException var7)
{
logger.error("Couldn\'t parse response getting own world");
}
return null;
}
示例6: func_146853_g
import net.minecraft.util.Session; //导入方法依赖的package包/类
private void func_146853_g()
{
Session var1 = this.mc.getSession();
McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
String var3 = this.field_146863_h.getText() != null && !this.field_146863_h.getText().trim().equals("") ? this.field_146863_h.getText() : null;
var2.func_148689_a(this.field_146861_r.field_148812_a, this.field_146864_i.getText(), var3, this.field_146854_w.field_148402_e, this.field_146854_w.field_148399_f);
this.field_146861_r.func_148803_a(this.field_146864_i.getText());
this.field_146861_r.func_148804_b(this.field_146863_h.getText());
this.field_146861_r.field_148820_i = this.field_146854_w.field_148402_e;
this.field_146861_r.field_148817_j = this.field_146854_w.field_148399_f;
this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_146857_g, this.field_146861_r));
}
catch (ExceptionMcoService var4)
{
logger.error("Couldn\'t edit world");
}
catch (UnsupportedEncodingException var5)
{
logger.error("Couldn\'t edit world");
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:25,代码来源:GuiScreenEditOnlineWorld.java
示例7: func_146768_g
import net.minecraft.util.Session; //导入方法依赖的package包/类
private void func_146768_g()
{
Session var1 = this.mc.getSession();
McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
var2.func_148714_h();
GuiScreenLongRunningTask var3 = new GuiScreenLongRunningTask(this.mc, this, new TaskOnlineConnect(this, this.field_146771_g));
var3.func_146902_g();
this.mc.displayGuiScreen(var3);
}
catch (ExceptionMcoService var4)
{
logger.error("Couldn\'t agree to TOS");
}
}
示例8: func_146876_g
import net.minecraft.util.Session; //导入方法依赖的package包/类
private void func_146876_g()
{
Session var1 = this.mc.getSession();
McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
Boolean var3 = var2.func_148692_e(this.field_146885_g.field_148812_a);
if (var3.booleanValue())
{
this.field_146883_D = true;
this.field_146885_g.field_148808_d = "OPEN";
this.initGui();
}
}
catch (ExceptionMcoService var4)
{
logger.error("Couldn\'t open world");
}
catch (IOException var5)
{
logger.error("Could not parse response opening world");
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:26,代码来源:GuiScreenConfigureWorld.java
示例9: func_146882_h
import net.minecraft.util.Session; //导入方法依赖的package包/类
private void func_146882_h()
{
Session var1 = this.mc.getSession();
McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
boolean var3 = var2.func_148700_f(this.field_146885_g.field_148812_a).booleanValue();
if (var3)
{
this.field_146883_D = true;
this.field_146885_g.field_148808_d = "CLOSED";
this.initGui();
}
}
catch (ExceptionMcoService var4)
{
logger.error("Couldn\'t close world");
}
catch (IOException var5)
{
logger.error("Could not parse response closing world");
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:26,代码来源:GuiScreenConfigureWorld.java
示例10: func_140005_i
import net.minecraft.util.Session; //导入方法依赖的package包/类
protected void func_140005_i()
{
Session var1 = this.mc.getSession();
McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.9", Minecraft.getMinecraft().getProxy());
try
{
if (var2.func_148695_c().booleanValue())
{
this.mc.displayGuiScreen(new GuiScreenClientOutdated(this));
}
else
{
this.mc.displayGuiScreen(new GuiScreenOnlineServers(this));
}
}
catch (ExceptionMcoService var4)
{
logger.error("Couldn\'t connect to realms");
}
catch (IOException var5)
{
logger.error("Couldn\'t connect to realms");
}
}
示例11: run
import net.minecraft.util.Session; //导入方法依赖的package包/类
public void run()
{
String var1 = I18n.format("mco.create.world.wait", new Object[0]);
this.func_148417_b(var1);
Session var2 = GuiScreenCreateOnlineWorld.this.mc.getSession();
McoClient var3 = new McoClient(var2.getSessionID(), var2.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
if (this.field_148426_d != null)
{
var3.func_148707_a(this.field_148427_c, this.field_148426_d.field_148787_a);
}
else
{
var3.func_148707_a(this.field_148427_c, "-1");
}
GuiScreenCreateOnlineWorld.this.mc.displayGuiScreen(GuiScreenCreateOnlineWorld.this.field_146758_f);
}
catch (ExceptionMcoService var5)
{
GuiScreenCreateOnlineWorld.logger.error("Couldn\'t create world");
this.func_148416_a(var5.toString());
}
catch (UnsupportedEncodingException var6)
{
GuiScreenCreateOnlineWorld.logger.error("Couldn\'t create world");
this.func_148416_a(var6.getLocalizedMessage());
}
catch (Exception var8)
{
GuiScreenCreateOnlineWorld.logger.error("Could not create world");
this.func_148416_a(var8.getLocalizedMessage());
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:37,代码来源:GuiScreenCreateOnlineWorld.java
示例12: confirmClicked
import net.minecraft.util.Session; //导入方法依赖的package包/类
public void confirmClicked(boolean par1, int par2)
{
if (par2 == 3)
{
if (par1)
{
Session var3 = this.mc.getSession();
McoClient var4 = new McoClient(var3.getSessionID(), var3.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
try
{
var4.func_148694_a(this.field_146885_g.field_148812_a, this.field_146894_u);
}
catch (ExceptionMcoService var6)
{
logger.error("Couldn\'t uninvite user");
}
this.func_146875_d(this.field_146895_t);
}
this.mc.displayGuiScreen(new GuiScreenConfigureWorld(this.field_146884_f, this.field_146885_g));
}
if (par2 == 1)
{
if (par1)
{
this.func_146882_h();
}
this.mc.displayGuiScreen(this);
}
}
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:35,代码来源:GuiScreenConfigureWorld.java
示例13: StatsSyncher
import net.minecraft.util.Session; //导入方法依赖的package包/类
public StatsSyncher(Session par1Session, StatFileWriter par2StatFileWriter, File par3File)
{
String s = par1Session.getUsername();
String s1 = s.toLowerCase();
this.unsentDataFile = new File(par3File, "stats_" + s1 + "_unsent.dat");
this.dataFile = new File(par3File, "stats_" + s1 + ".dat");
this.unsentOldFile = new File(par3File, "stats_" + s1 + "_unsent.old");
this.oldFile = new File(par3File, "stats_" + s1 + ".old");
this.unsentTempFile = new File(par3File, "stats_" + s1 + "_unsent.tmp");
this.tempFile = new File(par3File, "stats_" + s1 + ".tmp");
if (!s1.equals(s))
{
this.func_77412_a(par3File, "stats_" + s + "_unsent.dat", this.unsentDataFile);
this.func_77412_a(par3File, "stats_" + s + ".dat", this.dataFile);
this.func_77412_a(par3File, "stats_" + s + "_unsent.old", this.unsentOldFile);
this.func_77412_a(par3File, "stats_" + s + ".old", this.oldFile);
this.func_77412_a(par3File, "stats_" + s + "_unsent.tmp", this.unsentTempFile);
this.func_77412_a(par3File, "stats_" + s + ".tmp", this.tempFile);
}
this.statFileWriter = par2StatFileWriter;
this.theSession = par1Session;
if (this.unsentDataFile.exists())
{
par2StatFileWriter.writeStats(this.func_77417_a(this.unsentDataFile, this.unsentTempFile, this.unsentOldFile));
}
this.beginReceiveStats();
}
示例14: userName
import net.minecraft.util.Session; //导入方法依赖的package包/类
public static String userName()
{
Session session = Minecraft.getMinecraft().getSession();
return session == null ? null : session.getUsername();
}
示例15: run
import net.minecraft.util.Session; //导入方法依赖的package包/类
public void run()
{
this.func_148417_b(I18n.format("mco.backup.restoring", new Object[0]));
try
{
if (this.func_148418_c())
{
return;
}
Session var1 = GuiScreenBackup.this.mc.getSession();
McoClient var2 = new McoClient(var1.getSessionID(), var1.getUsername(), "1.7.2", Minecraft.getMinecraft().getProxy());
var2.func_148712_c(GuiScreenBackup.this.field_146846_h, this.field_148424_c.field_148780_a);
try
{
Thread.sleep(1000L);
}
catch (InterruptedException var4)
{
Thread.currentThread().interrupt();
}
if (this.func_148418_c())
{
return;
}
this.func_148413_b().displayGuiScreen(GuiScreenBackup.this.field_146842_g);
}
catch (ExceptionMcoService var5)
{
if (this.func_148418_c())
{
return;
}
GuiScreenBackup.logger.error("Couldn\'t restore backup");
this.func_148416_a(var5.toString());
}
catch (Exception var6)
{
if (this.func_148418_c())
{
return;
}
GuiScreenBackup.logger.error("Couldn\'t restore backup");
this.func_148416_a(var6.getLocalizedMessage());
}
}