com.mojang.authlib.minecraft.MinecraftSessionService Java Examples

The following examples show how to use com.mojang.authlib.minecraft.MinecraftSessionService. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PacketEncryption.java    From The-5zig-Mod with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void handle() {
	final SecretKey secretKey = CryptManager.createNewSharedKey();
	String hash = (new BigInteger(CryptManager.getServerIdHash("", publicKey, secretKey))).toString(16);
	MinecraftSessionService yggdrasil = new YggdrasilAuthenticationService(The5zigMod.getVars().getProxy(), UUID.randomUUID().toString()).createMinecraftSessionService();
	try {
		yggdrasil.joinServer(The5zigMod.getVars().getGameProfile(), The5zigMod.getDataManager().getSession(), hash);
	} catch (AuthenticationException e) {
		The5zigMod.getNetworkManager().disconnect(I18n.translate("connection.bad_login"));
		throw new RuntimeException(e);
	}
	The5zigMod.getNetworkManager().sendPacket(new PacketEncryption(secretKey, publicKey, verifyToken), new ChannelFutureListener() {
		@Override
		public void operationComplete(ChannelFuture channelFuture) throws Exception {
			The5zigMod.getNetworkManager().enableEncryption(secretKey);
		}
	});
}
 
Example #2
Source File: PacketEncryption.java    From The-5zig-Mod with MIT License 6 votes vote down vote up
@Override
public void handle() {
	final SecretKey secretKey = CryptManager.createNewSharedKey();
	String hash = (new BigInteger(CryptManager.getServerIdHash("", publicKey, secretKey))).toString(16);
	MinecraftSessionService yggdrasil = new YggdrasilAuthenticationService(The5zigMod.getVars().getProxy(), UUID.randomUUID().toString()).createMinecraftSessionService();
	try {
		yggdrasil.joinServer(The5zigMod.getVars().getGameProfile(), The5zigMod.getDataManager().getSession(), hash);
	} catch (AuthenticationException e) {
		The5zigMod.getNetworkManager().disconnect(I18n.translate("connection.bad_login"));
		throw new RuntimeException(e);
	}
	The5zigMod.getNetworkManager().sendPacket(new PacketEncryption(secretKey, publicKey, verifyToken), new ChannelFutureListener() {
		@Override
		public void operationComplete(ChannelFuture channelFuture) throws Exception {
			The5zigMod.getNetworkManager().enableEncryption(secretKey);
		}
	});
}
 
Example #3
Source File: ClientProxy.java    From Et-Futurum with The Unlicense 5 votes vote down vote up
@SuppressWarnings("unchecked")
private void registerEntityRenderers() {
	if (EtFuturum.enableArmourStand)
		RenderingRegistry.registerEntityRenderingHandler(EntityArmourStand.class, new ArmourStandRenderer());
	if (EtFuturum.enableEndermite)
		RenderingRegistry.registerEntityRenderingHandler(EntityEndermite.class, new EndermiteRenderer());
	if (EtFuturum.enableRabbit)
		RenderingRegistry.registerEntityRenderingHandler(EntityRabbit.class, new RabbitRenderer());
	if (EtFuturum.enableLingeringPotions) {
		RenderingRegistry.registerEntityRenderingHandler(EntityLingeringPotion.class, new LingeringPotionRenderer());
		RenderingRegistry.registerEntityRenderingHandler(EntityLingeringEffect.class, new LingeringEffectRenderer());
	}
	if (EtFuturum.enableVillagerZombies)
		RenderingRegistry.registerEntityRenderingHandler(EntityZombieVillager.class, new VillagerZombieRenderer());
	if (EtFuturum.enableDragonRespawn)
		RenderingRegistry.registerEntityRenderingHandler(EntityPlacedEndCrystal.class, new PlacedEndCrystalRenderer());
	if (EtFuturum.enablePlayerSkinOverlay) {
		TextureManager texManager = Minecraft.getMinecraft().renderEngine;
		File fileAssets = ReflectionHelper.getPrivateValue(Minecraft.class, Minecraft.getMinecraft(), "fileAssets", "field_110446_Y", " field_110607_c");
		File skinFolder = new File(fileAssets, "skins");
		MinecraftSessionService sessionService = Minecraft.getMinecraft().func_152347_ac();
		ReflectionHelper.setPrivateValue(Minecraft.class, Minecraft.getMinecraft(), new NewSkinManager(Minecraft.getMinecraft().func_152342_ad(), texManager, skinFolder, sessionService), "field_152350_aA");

		RenderManager.instance.entityRenderMap.put(EntityPlayer.class, new NewRenderPlayer());
	}
	if (EtFuturum.enableShearableGolems)
		RenderingRegistry.registerEntityRenderingHandler(EntityNewSnowGolem.class, new NewSnowGolemRenderer());
}
 
Example #4
Source File: PaperAuthenticationService.java    From Kettle with GNU General Public License v3.0 4 votes vote down vote up
@Override
public MinecraftSessionService createMinecraftSessionService() {
    return new PaperMinecraftSessionService(this);
}
 
Example #5
Source File: YggdrasilAuthenticationService.java    From Launcher with GNU General Public License v3.0 4 votes vote down vote up
@Override
public MinecraftSessionService createMinecraftSessionService() {
    return new YggdrasilMinecraftSessionService(this);
}
 
Example #6
Source File: MixinIntegratedServer.java    From litematica with GNU Lesser General Public License v3.0 4 votes vote down vote up
private MixinIntegratedServer(File anvilFileIn, Proxy proxyIn, DataFixer dataFixerIn,
        YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn,
        GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    super(anvilFileIn, proxyIn, dataFixerIn, authServiceIn, sessionServiceIn, profileRepoIn, profileCacheIn);
}
 
Example #7
Source File: NewSkinManager.java    From Et-Futurum with The Unlicense 4 votes vote down vote up
public NewSkinManager(SkinManager oldManager, TextureManager textureManager, File skinFolder, MinecraftSessionService sessionService) {
	super(textureManager, skinFolder, sessionService);

	this.textureManager = textureManager;
	this.skinFolder = skinFolder;
}