当前位置: 首页>>代码示例>>Java>>正文


Java UUIDTypeAdapter.fromString方法代码示例

本文整理汇总了Java中com.mojang.util.UUIDTypeAdapter.fromString方法的典型用法代码示例。如果您正苦于以下问题:Java UUIDTypeAdapter.fromString方法的具体用法?Java UUIDTypeAdapter.fromString怎么用?Java UUIDTypeAdapter.fromString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.mojang.util.UUIDTypeAdapter的用法示例。


在下文中一共展示了UUIDTypeAdapter.fromString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: preInit

import com.mojang.util.UUIDTypeAdapter; //导入方法依赖的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) {
	}
}
 
开发者ID:Team-Fruit,项目名称:SignPicture,代码行数:27,代码来源:ClientProxy.java

示例2: initializeMainframe

import com.mojang.util.UUIDTypeAdapter; //导入方法依赖的package包/类
public void initializeMainframe(String name, int i, int j, int k)
{
    Minecraft mc = Minecraft.getMinecraft();
    mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F));

    int oriScale = mc.gameSettings.guiScale;
    mc.gameSettings.guiScale = mc.gameSettings.guiScale == 1 ? 1 : 2;
    mainframe = new Mainframe();
    UUID uuid;
    try
    {
        uuid = UUIDTypeAdapter.fromString(mc.getSession().getPlayerID());
    }
    catch(IllegalArgumentException e)
    {
        uuid = UUIDTypeAdapter.fromString("deadbeef-dead-beef-dead-beefdeadbeef");
    }
    mainframe.addListener(mc.getSession().getUsername(), true);

    FMLClientHandler.instance().showGuiScreen(new GuiWorkspace(oriScale, false, true, name, i, j, k));
}
 
开发者ID:iChun,项目名称:Tabula,代码行数:22,代码来源:TickHandlerClient.java

示例3: getProfile

import com.mojang.util.UUIDTypeAdapter; //导入方法依赖的package包/类
public GameProfile getProfile()
{
    try
    {
        UUID uuid = UUIDTypeAdapter.fromString(this.getPlayerID());
        return new GameProfile(uuid, this.getUsername());
    }
    catch (IllegalArgumentException var2)
    {
        return new GameProfile((UUID)null, this.getUsername());
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:13,代码来源:Session.java

示例4: getProfile

import com.mojang.util.UUIDTypeAdapter; //导入方法依赖的package包/类
public GameProfile getProfile()
{
    try
    {
        UUID uuid = UUIDTypeAdapter.fromString(this.getPlayerID());
        GameProfile ret = new GameProfile(uuid, this.getUsername());    //Forge: Adds cached GameProfile properties to returned GameProfile.
        if (properties != null) ret.getProperties().putAll(properties); // Helps to cut down on calls to the session service,
        return ret;                                                     // which helps to fix MC-52974.
    }
    catch (IllegalArgumentException var2)
    {
        return new GameProfile(net.minecraft.entity.player.EntityPlayer.getUUID(new GameProfile((UUID)null, this.getUsername())), this.getUsername());
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:15,代码来源:Session.java

示例5: func_148256_e

import com.mojang.util.UUIDTypeAdapter; //导入方法依赖的package包/类
public GameProfile func_148256_e()
{
    try
    {
        UUID uuid = UUIDTypeAdapter.fromString(this.getPlayerID());
        return new GameProfile(uuid, this.getUsername());
    }
    catch (IllegalArgumentException illegalargumentexception)
    {
        return new GameProfile((UUID)null, this.getUsername());
    }
}
 
开发者ID:xtrafrancyz,项目名称:Cauldron,代码行数:13,代码来源:Session.java

示例6: readBuffer

import com.mojang.util.UUIDTypeAdapter; //导入方法依赖的package包/类
void readBuffer(PacketBuffer buffer) throws IOException {
    entityID = buffer.readVarIntFromBuffer();
    String struuid = buffer.readStringFromBuffer(36);
    UUID uuid = UUIDTypeAdapter.fromString(struuid);
    String name = buffer.readStringFromBuffer(16);
    profile = new GameProfile(uuid, name);
    ProfileCache.fillProfileProperties(profile, true);
    x = buffer.readInt();
    y = buffer.readInt();
    z = buffer.readInt();
    yaw = buffer.readByte();
    pitch = buffer.readByte();
    item = buffer.readShort();
    metadata = DataWatcher.readWatchedListFromPacketBuffer(buffer);
}
 
开发者ID:killjoy1221,项目名称:Protocol4,代码行数:16,代码来源:SpawnPlayer_4.java


注:本文中的com.mojang.util.UUIDTypeAdapter.fromString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。