public static String[] collectFiles(IResourcePack p_collectFiles_0_, String p_collectFiles_1_, String p_collectFiles_2_, String[] p_collectFiles_3_) { if (p_collectFiles_0_ instanceof DefaultResourcePack) { return collectFilesFixed(p_collectFiles_0_, p_collectFiles_3_); } else if (!(p_collectFiles_0_ instanceof AbstractResourcePack)) { return new String[0]; } else { AbstractResourcePack abstractresourcepack = (AbstractResourcePack)p_collectFiles_0_; File file1 = ResourceUtils.getResourcePackFile(abstractresourcepack); return file1 == null ? new String[0] : (file1.isDirectory() ? collectFilesFolder(file1, "", p_collectFiles_1_, p_collectFiles_2_) : (file1.isFile() ? collectFilesZIP(file1, p_collectFiles_1_, p_collectFiles_2_) : new String[0])); } }
public static String[] collectFiles(IResourcePack p_collectFiles_0_, String[] p_collectFiles_1_, String[] p_collectFiles_2_, String[] p_collectFiles_3_) { if (p_collectFiles_0_ instanceof DefaultResourcePack) { return collectFilesFixed(p_collectFiles_0_, p_collectFiles_3_); } else if (!(p_collectFiles_0_ instanceof AbstractResourcePack)) { return new String[0]; } else { AbstractResourcePack abstractresourcepack = (AbstractResourcePack)p_collectFiles_0_; File file1 = abstractresourcepack.resourcePackFile; return file1 == null ? new String[0] : (file1.isDirectory() ? collectFilesFolder(file1, "", p_collectFiles_1_, p_collectFiles_2_) : (file1.isFile() ? collectFilesZIP(file1, p_collectFiles_1_, p_collectFiles_2_) : new String[0])); } }
private static String[] collectFiles(IResourcePack p_collectFiles_0_, String p_collectFiles_1_, String p_collectFiles_2_) { if (p_collectFiles_0_ instanceof DefaultResourcePack) { return collectFilesDefault(p_collectFiles_0_); } else if (!(p_collectFiles_0_ instanceof AbstractResourcePack)) { return new String[0]; } else { AbstractResourcePack abstractresourcepack = (AbstractResourcePack)p_collectFiles_0_; File file1 = ResourceUtils.getResourcePackFile(abstractresourcepack); return file1 == null ? new String[0] : (file1.isDirectory() ? collectFilesFolder(file1, "", p_collectFiles_1_, p_collectFiles_2_) : (file1.isFile() ? collectFilesZIP(file1, p_collectFiles_1_, p_collectFiles_2_) : new String[0])); } }
public static BufferedImage getBedrockImage() { if (TConTextureResourcePackBedrockium.bedrockImage == null) { final ResourceLocation bedrockLocation = new ResourceLocation("minecraft", "textures/blocks/bedrock.png"); try { final DefaultResourcePack mcDefaultResourcePack = (DefaultResourcePack)ObfuscationReflectionHelper.getPrivateValue((Class)Minecraft.class, (Object)Minecraft.getMinecraft(), new String[] { "field_110450_ap", "mcDefaultResourcePack" }); InputStream inputStream = mcDefaultResourcePack.getInputStream(bedrockLocation); final List<ResourcePackRepository.Entry> t = (List<ResourcePackRepository.Entry>)Minecraft.getMinecraft().getResourcePackRepository().getRepositoryEntries(); for (final ResourcePackRepository.Entry entry : t) { final IResourcePack resourcePack = entry.getResourcePack(); if (resourcePack.resourceExists(bedrockLocation)) { inputStream = resourcePack.getInputStream(bedrockLocation); } } TConTextureResourcePackBedrockium.bedrockImage = ImageIO.read(inputStream); } catch (IOException e) { throw Throwables.propagate((Throwable)e); } } return TConTextureResourcePackBedrockium.bedrockImage; }
public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str) { theMinecraft = this; this.mcDataDir = par6File; this.fileAssets = par7File; this.fileResourcepacks = par8File; this.launchedVersion = par10Str; this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets); this.addDefaultResourcePack(); this.proxy = par9Proxy == null ? Proxy.NO_PROXY : par9Proxy; this.startTimerHackThread(); this.session = par1Session; logger.info("Setting user: " + par1Session.getUsername()); logger.info("(Session ID is " + par1Session.getSessionID() + ")"); this.isDemo = par5; this.displayWidth = par2; this.displayHeight = par3; this.tempDisplayWidth = par2; this.tempDisplayHeight = par3; this.fullscreen = par4; this.jvm64bit = isJvm64bit(); ImageIO.setUseCache(false); Bootstrap.func_151354_b(); }
private static String[] collectFiles(IResourcePack rp, String prefix, String suffix) { if (rp instanceof DefaultResourcePack) { return collectFilesDefault(rp); } else if (!(rp instanceof AbstractResourcePack)) { return new String[0]; } else { AbstractResourcePack arp = (AbstractResourcePack)rp; File tpFile = ResourceUtils.getResourcePackFile(arp); return tpFile == null ? new String[0] : (tpFile.isDirectory() ? collectFilesFolder(tpFile, "", prefix, suffix) : (tpFile.isFile() ? collectFilesZIP(tpFile, prefix, suffix) : new String[0])); } }
public Minecraft(Session p_i1103_1_, int p_i1103_2_, int p_i1103_3_, boolean p_i1103_4_, boolean p_i1103_5_, File p_i1103_6_, File p_i1103_7_, File p_i1103_8_, Proxy p_i1103_9_, String p_i1103_10_, Multimap p_i1103_11_, String p_i1103_12_) { theMinecraft = this; this.mcDataDir = p_i1103_6_; this.fileAssets = p_i1103_7_; this.fileResourcepacks = p_i1103_8_; this.launchedVersion = p_i1103_10_; this.field_152356_J = p_i1103_11_; this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(p_i1103_7_, p_i1103_12_)).func_152782_a()); this.addDefaultResourcePack(); this.proxy = p_i1103_9_ == null ? Proxy.NO_PROXY : p_i1103_9_; this.field_152355_az = (new YggdrasilAuthenticationService(p_i1103_9_, UUID.randomUUID().toString())).createMinecraftSessionService(); this.startTimerHackThread(); this.session = p_i1103_1_; logger.info("Setting user: " + p_i1103_1_.getUsername()); this.isDemo = p_i1103_5_; this.displayWidth = p_i1103_2_; this.displayHeight = p_i1103_3_; this.tempDisplayWidth = p_i1103_2_; this.tempDisplayHeight = p_i1103_3_; this.fullscreen = p_i1103_4_; this.jvm64bit = isJvm64bit(); ImageIO.setUseCache(false); Bootstrap.func_151354_b(); }
public Minecraft(Session p_i1014_1_, int p_i1014_2_, int p_i1014_3_, boolean p_i1014_4_, boolean p_i1014_5_, File p_i1014_6_, File p_i1014_7_, File p_i1014_8_, Proxy p_i1014_9_, String p_i1014_10_) { field_71432_P = this; this.field_94139_O = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(p_i1014_6_, "output-client.log")).getAbsolutePath()); this.field_71412_D = p_i1014_6_; this.field_110446_Y = p_i1014_7_; this.field_130070_K = p_i1014_8_; this.field_110447_Z = p_i1014_10_; this.field_110450_ap = new DefaultResourcePack(this.field_110446_Y); this.func_110435_P(); this.field_110453_aa = p_i1014_9_; this.func_71389_H(); this.field_71449_j = p_i1014_1_; this.field_94139_O.func_98233_a("Setting user: " + p_i1014_1_.func_111285_a()); this.field_94139_O.func_98233_a("(Session ID is " + p_i1014_1_.func_111286_b() + ")"); this.field_71459_aj = p_i1014_5_; this.field_71443_c = p_i1014_2_; this.field_71440_d = p_i1014_3_; this.field_71436_X = p_i1014_2_; this.field_71435_Y = p_i1014_3_; this.field_71431_Q = p_i1014_4_; ImageIO.setUseCache(false); StatList.func_75919_a(); }
public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str) { theMinecraft = this; this.mcLogAgent = new LogAgent("Minecraft-Client", " [CLIENT]", (new File(par6File, "output-client.log")).getAbsolutePath()); this.mcDataDir = par6File; this.fileAssets = par7File; this.fileResourcepacks = par8File; this.launchedVersion = par10Str; this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets); this.addDefaultResourcePack(); this.proxy = par9Proxy; this.startTimerHackThread(); this.session = par1Session; this.mcLogAgent.logInfo("Setting user: " + par1Session.getUsername()); //this.mcLogAgent.logInfo("(Session ID is " + par1Session.getSessionID() + ")"); //don't print the session to the console.. that's stupid... this.isDemo = par5; this.displayWidth = par2; this.displayHeight = par3; this.tempDisplayWidth = par2; this.tempDisplayHeight = par3; this.fullscreen = par4; ImageIO.setUseCache(false); StatList.nopInit(); }
public Minecraft(GameConfiguration gameConfig) { theMinecraft = this; this.mcDataDir = gameConfig.folderInfo.mcDataDir; this.fileAssets = gameConfig.folderInfo.assetsDir; this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir; this.launchedVersion = gameConfig.gameInfo.version; this.twitchDetails = gameConfig.userInfo.userProperties; this.field_181038_N = gameConfig.userInfo.field_181172_c; this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(gameConfig.folderInfo.assetsDir, gameConfig.folderInfo.assetIndex)).getResourceMap()); this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy; this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); this.session = gameConfig.userInfo.session; logger.info("Setting user: " + this.session.getUsername()); logger.info("(Session ID is " + this.session.getSessionID() + ")"); this.isDemo = gameConfig.gameInfo.isDemo; this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; this.tempDisplayWidth = gameConfig.displayInfo.width; this.tempDisplayHeight = gameConfig.displayInfo.height; this.fullscreen = gameConfig.displayInfo.fullscreen; this.jvm64bit = isJvm64bit(); this.theIntegratedServer = new IntegratedServer(this); if (gameConfig.serverInfo.serverName != null) { this.serverName = gameConfig.serverInfo.serverName; this.serverPort = gameConfig.serverInfo.serverPort; } ImageIO.setUseCache(false); Bootstrap.register(); }
public Minecraft(GameConfiguration gameConfig) { theMinecraft = this; this.mcDataDir = gameConfig.folderInfo.mcDataDir; this.fileAssets = gameConfig.folderInfo.assetsDir; this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir; this.launchedVersion = gameConfig.gameInfo.version; this.twitchDetails = gameConfig.userInfo.userProperties; this.field_181038_N = gameConfig.userInfo.field_181172_c; this.mcDefaultResourcePack = new DefaultResourcePack( (new ResourceIndex(gameConfig.folderInfo.assetsDir, gameConfig.folderInfo.assetIndex)) .getResourceMap()); this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy; this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); this.session = gameConfig.userInfo.session; logger.info("Setting user: " + this.session.getUsername()); logger.info("(Session ID is " + this.session.getSessionID() + ")"); this.isDemo = gameConfig.gameInfo.isDemo; this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; this.tempDisplayWidth = gameConfig.displayInfo.width; this.tempDisplayHeight = gameConfig.displayInfo.height; this.fullscreen = gameConfig.displayInfo.fullscreen; this.jvm64bit = isJvm64bit(); this.theIntegratedServer = new IntegratedServer(this); if (gameConfig.serverInfo.serverName != null) { this.serverName = gameConfig.serverInfo.serverName; this.serverPort = gameConfig.serverInfo.serverPort; } ImageIO.setUseCache(false); Bootstrap.register(); }
public Minecraft(GameConfiguration gameConfig) { theMinecraft = this; this.mcDataDir = gameConfig.folderInfo.mcDataDir; this.fileAssets = gameConfig.folderInfo.assetsDir; this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir; this.launchedVersion = gameConfig.gameInfo.version; this.versionType = gameConfig.gameInfo.versionType; this.twitchDetails = gameConfig.userInfo.userProperties; this.profileProperties = gameConfig.userInfo.profileProperties; this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex()); this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy; this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); this.session = gameConfig.userInfo.session; LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()}); LOGGER.debug("(Session ID is {})", new Object[] {this.session.getSessionID()}); this.isDemo = gameConfig.gameInfo.isDemo; this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; this.tempDisplayWidth = gameConfig.displayInfo.width; this.tempDisplayHeight = gameConfig.displayInfo.height; this.fullscreen = gameConfig.displayInfo.fullscreen; this.jvm64bit = isJvm64bit(); this.theIntegratedServer = null; if (gameConfig.serverInfo.serverName != null) { this.serverName = gameConfig.serverInfo.serverName; this.serverPort = gameConfig.serverInfo.serverPort; } ImageIO.setUseCache(false); Bootstrap.register(); this.dataFixer = DataFixesManager.createFixer(); //-ZMod-core---------------------------------------------------------- ZHandle.onMinecraftInit(this); //-------------------------------------------------------------------- }
public Minecraft(GameConfiguration gameConfig) { theMinecraft = this; this.mcDataDir = gameConfig.folderInfo.mcDataDir; this.fileAssets = gameConfig.folderInfo.assetsDir; this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir; this.launchedVersion = gameConfig.gameInfo.version; this.versionType = gameConfig.gameInfo.versionType; this.twitchDetails = gameConfig.userInfo.userProperties; this.profileProperties = gameConfig.userInfo.profileProperties; this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex()); this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy; this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); this.session = gameConfig.userInfo.session; LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()}); LOGGER.debug("(Session ID is {})", new Object[] {this.session.getSessionID()}); this.isDemo = gameConfig.gameInfo.isDemo; this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; this.tempDisplayWidth = gameConfig.displayInfo.width; this.tempDisplayHeight = gameConfig.displayInfo.height; this.fullscreen = gameConfig.displayInfo.fullscreen; this.jvm64bit = isJvm64bit(); this.theIntegratedServer = null; if (gameConfig.serverInfo.serverName != null) { this.serverName = gameConfig.serverInfo.serverName; this.serverPort = gameConfig.serverInfo.serverPort; } ImageIO.setUseCache(false); Locale.setDefault(Locale.ROOT); Bootstrap.register(); this.dataFixer = DataFixesManager.createFixer(); }
public Minecraft(GameConfiguration gameConfig) { theMinecraft = this; this.mcDataDir = gameConfig.folderInfo.mcDataDir; this.fileAssets = gameConfig.folderInfo.assetsDir; this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir; this.launchedVersion = gameConfig.gameInfo.version; this.versionType = gameConfig.gameInfo.versionType; this.twitchDetails = gameConfig.userInfo.userProperties; this.profileProperties = gameConfig.userInfo.profileProperties; this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex()); this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy; this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService(); this.session = gameConfig.userInfo.session; LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()}); this.isDemo = gameConfig.gameInfo.isDemo; this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1; this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1; this.tempDisplayWidth = gameConfig.displayInfo.width; this.tempDisplayHeight = gameConfig.displayInfo.height; this.fullscreen = gameConfig.displayInfo.fullscreen; this.jvm64bit = isJvm64bit(); this.theIntegratedServer = null; if (gameConfig.serverInfo.serverName != null) { this.serverName = gameConfig.serverInfo.serverName; this.serverPort = gameConfig.serverInfo.serverPort; } ImageIO.setUseCache(false); Bootstrap.register(); this.dataFixer = DataFixesManager.createFixer(); }
public static void createFrame(DefaultResourcePack mcDefaultResourcePack, Logger logger) throws LWJGLException { // check if frame should be created if (!isAutoMaximize() && !WurstBot.isEnabled()) return; // create frame frame = new JFrame("Minecraft 1.8"); // add LWJGL Canvas canvas = new Canvas(); canvas.setBackground(new Color(16, 16, 16)); Display.setParent(canvas); Minecraft mc = Minecraft.getMinecraft(); canvas.setSize(mc.displayWidth, mc.displayHeight); frame.add(canvas); // configure frame frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.pack(); frame.setLocationRelativeTo(null); // add icons InputStream icon16 = null; InputStream icon32 = null; try { icon16 = mcDefaultResourcePack.func_152780_c(new ResourceLocation("icons/icon_16x16.png")); icon32 = mcDefaultResourcePack.func_152780_c(new ResourceLocation("icons/icon_32x32.png")); ArrayList<BufferedImage> icons = new ArrayList<>(); icons.add(ImageIO.read(icon16)); icons.add(ImageIO.read(icon32)); frame.setIconImages(icons); } catch (Exception e) { logger.error("Couldn't set icon", e); } finally { IOUtils.closeQuietly(icon16); IOUtils.closeQuietly(icon32); } // show frame if (!WurstBot.isEnabled()) frame.setVisible(true); }
public static void createFrame(DefaultResourcePack mcDefaultResourcePack, Logger logger) throws LWJGLException { // check if frame should be created if(!isAutoMaximize() && !WurstBot.isEnabled()) return; // create frame frame = new JFrame("Minecraft " + WMinecraft.DISPLAY_VERSION); // add LWJGL Canvas canvas = new Canvas(); canvas.setBackground(new Color(16, 16, 16)); Display.setParent(canvas); Minecraft mc = Minecraft.getMinecraft(); canvas.setSize(mc.displayWidth, mc.displayHeight); frame.add(canvas); // configure frame frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setLocationRelativeTo(null); // add icons InputStream icon16 = null; InputStream icon32 = null; try { icon16 = mcDefaultResourcePack.getInputStreamAssets( new ResourceLocation("icons/icon_16x16.png")); icon32 = mcDefaultResourcePack.getInputStreamAssets( new ResourceLocation("icons/icon_32x32.png")); ArrayList<BufferedImage> icons = new ArrayList<>(); icons.add(ImageIO.read(icon16)); icons.add(ImageIO.read(icon32)); frame.setIconImages(icons); }catch(Exception e) { logger.error("Couldn't set icon", e); }finally { IOUtils.closeQuietly(icon16); IOUtils.closeQuietly(icon32); } // show frame if(!WurstBot.isEnabled()) frame.setVisible(true); }
public static String[] collectFiles(IResourcePack p_collectFiles_0_, String[] p_collectFiles_1_, String[] p_collectFiles_2_, String[] p_collectFiles_3_) { if (p_collectFiles_0_ instanceof DefaultResourcePack) { return collectFilesFixed(p_collectFiles_0_, p_collectFiles_3_); } else { if (p_collectFiles_0_ instanceof LegacyV2Adapter) { IResourcePack iresourcepack = (IResourcePack)Reflector.getFieldValue(p_collectFiles_0_, Reflector.LegacyV2Adapter_pack); if (iresourcepack == null) { Config.warn("LegacyV2Adapter base resource pack not found: " + p_collectFiles_0_); return new String[0]; } p_collectFiles_0_ = iresourcepack; } if (!(p_collectFiles_0_ instanceof AbstractResourcePack)) { Config.warn("Unknown resource pack type: " + p_collectFiles_0_); return new String[0]; } else { AbstractResourcePack abstractresourcepack = (AbstractResourcePack)p_collectFiles_0_; File file1 = abstractresourcepack.resourcePackFile; if (file1 == null) { return new String[0]; } else if (file1.isDirectory()) { return collectFilesFolder(file1, "", p_collectFiles_1_, p_collectFiles_2_); } else if (file1.isFile()) { return collectFilesZIP(file1, p_collectFiles_1_, p_collectFiles_2_); } else { Config.warn("Unknown resource pack file: " + file1); return new String[0]; } } } }
@Override protected IResource getResource(ResourceLocation location) throws IOException { DefaultResourcePack pack = Minecraft.getMinecraft().mcDefaultResourcePack; return new SimpleResource(pack.getPackName(), location, pack.getInputStream(location), null, null); }