本文整理汇总了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) {
}
}
示例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));
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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);
}