{"action":"created","issue":{"url":"https://api.github.com/repos/ModCoderPack/MCPBot-Issues/issues/501","repository_url":"https://api.github.com/repos/ModCoderPack/MCPBot-Issues","labels_url":"https://api.github.com/repos/ModCoderPack/MCPBot-Issues/issues/501/labels{/name}","comments_url":"https://api.github.com/repos/ModCoderPack/MCPBot-Issues/issues/501/comments","events_url":"https://api.github.com/repos/ModCoderPack/MCPBot-Issues/issues/501/events","html_url":"https://github.com/ModCoderPack/MCPBot-Issues/issues/501","id":258128118,"number":501,"title":"MCP's decompile.sh script fails on mac due to narrator library natives","user":{"login":"Pokechu22","id":8334194,"avatar_url":"https://avatars2.githubusercontent.com/u/8334194?v=4","gravatar_id":"","url":"https://api.github.com/users/Pokechu22","html_url":"https://github.com/Pokechu22","followers_url":"https://api.github.com/users/Pokechu22/followers","following_url":"https://api.github.com/users/Pokechu22/following{/other_user}","gists_url":"https://api.github.com/users/Pokechu22/gists{/gist_id}","starred_url":"https://api.github.com/users/Pokechu22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pokechu22/subscriptions","organizations_url":"https://api.github.com/users/Pokechu22/orgs","repos_url":"https://api.github.com/users/Pokechu22/repos","events_url":"https://api.github.com/users/Pokechu22/events{/privacy}","received_events_url":"https://api.github.com/users/Pokechu22/received_events","type":"User","site_admin":false},"labels":[{"id":494921242,"url":"https://api.github.com/repos/ModCoderPack/MCPBot-Issues/labels/mcp","name":"mcp","color":"c2e0c6","default":false}],"state":"open","locked":false,"assignee":{"login":"bspkrs","id":1561582,"avatar_url":"https://avatars1.githubusercontent.com/u/1561582?v=4","gravatar_id":"","url":"https://api.github.com/users/bspkrs","html_url":"https://github.com/bspkrs","followers_url":"https://api.github.com/users/bspkrs/followers","following_url":"https://api.github.com/users/bspkrs/following{/other_user}","gists_url":"https://api.github.com/users/bspkrs/gists{/gist_id}","starred_url":"https://api.github.com/users/bspkrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bspkrs/subscriptions","organizations_url":"https://api.github.com/users/bspkrs/orgs","repos_url":"https://api.github.com/users/bspkrs/repos","events_url":"https://api.github.com/users/bspkrs/events{/privacy}","received_events_url":"https://api.github.com/users/bspkrs/received_events","type":"User","site_admin":false},"assignees":[{"login":"bspkrs","id":1561582,"avatar_url":"https://avatars1.githubusercontent.com/u/1561582?v=4","gravatar_id":"","url":"https://api.github.com/users/bspkrs","html_url":"https://github.com/bspkrs","followers_url":"https://api.github.com/users/bspkrs/followers","following_url":"https://api.github.com/users/bspkrs/following{/other_user}","gists_url":"https://api.github.com/users/bspkrs/gists{/gist_id}","starred_url":"https://api.github.com/users/bspkrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bspkrs/subscriptions","organizations_url":"https://api.github.com/users/bspkrs/orgs","repos_url":"https://api.github.com/users/bspkrs/repos","events_url":"https://api.github.com/users/bspkrs/events{/privacy}","received_events_url":"https://api.github.com/users/bspkrs/received_events","type":"User","site_admin":false}],"milestone":null,"comments":22,"created_at":"2017-09-15T18:37:31Z","updated_at":"2018-04-08T17:01:49Z","closed_at":null,"author_association":"NONE","body":"This was reported by NarcolepticFrog elsewhere recently, though it was also mentioned in `#mcp`.\r\n\r\nRunning `decompile.sh` on mac with MC 1.12 causes this:\r\n\r\n```\r\nERROR:root:FATAL ERROR\r\nTraceback (most recent call last):\r\n  File \"./runtime/decompile.py\", line 61, in decompile\r\n    commands = Commands(conffile, verify=True, no_patch=no_patch, workdir=workdir, json=json)\r\n  File \"/Users/tdick/mcps/mcp-1.12-940/runtime/commands.py\", line 178, in __init__\r\n    normalStart = self.readconf(workdir, json)\r\n  File \"/Users/tdick/mcps/mcp-1.12-940/runtime/commands.py\", line 568, in readconf\r\n    self.mcLibraries = MinecraftDiscovery.getLibraries(mcDir, self.jsonFile, osKeyword)\r\n  File \"/Users/tdick/mcps/mcp-1.12-940/runtime/MinecraftDiscovery.py\", line 158, in getLibraries\r\n    libFilename = \"%s-%s-%s.jar\"%(libSubdir, libVersion, substitueString(library['natives'][osKeyword]))\r\nKeyError: 'osx'\r\n```\r\n\r\nI personally do not use a mac, but I do know how version JSONs work.  Here's the relevant data for the narrator library:\r\n\r\n```json\r\n    {\r\n      \"name\": \"com.mojang:text2speech:1.10.3\",\r\n      \"downloads\": {\r\n        \"artifact\": {\r\n          \"url\": \"https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3.jar\",\r\n          \"sha1\": \"48fd510879dff266c3815947de66e3d4809f8668\",\r\n          \"size\": 11055\r\n        },\r\n        \"classifiers\": {\r\n          \"natives-linux\": {\r\n            \"url\": \"https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3-natives-linux.jar\",\r\n            \"sha1\": \"ab7896aec3b3dd272b06194357f2d98f832c0cfc\",\r\n            \"size\": 7833\r\n          },\r\n          \"natives-windows\": {\r\n            \"url\": \"https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3-natives-windows.jar\",\r\n            \"sha1\": \"84a4b856389cc4f485275b1f63497a95a857a443\",\r\n            \"size\": 81217\r\n          }\r\n        }\r\n      }\r\n    },\r\n    {\r\n      \"name\": \"com.mojang:text2speech:1.10.3\",\r\n      \"natives\": {\r\n        \"linux\": \"natives-linux\",\r\n        \"windows\": \"natives-windows\"\r\n      },\r\n      \"extract\": {\r\n        \"exclude\": [\r\n          \"META-INF/\"\r\n        ]\r\n      },\r\n      \"downloads\": {\r\n        \"artifact\": {\r\n          \"url\": \"https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3.jar\",\r\n          \"sha1\": \"48fd510879dff266c3815947de66e3d4809f8668\",\r\n          \"size\": 11055\r\n        },\r\n        \"classifiers\": {\r\n          \"natives-linux\": {\r\n            \"url\": \"https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3-natives-linux.jar\",\r\n            \"sha1\": \"ab7896aec3b3dd272b06194357f2d98f832c0cfc\",\r\n            \"size\": 7833\r\n          },\r\n          \"natives-windows\": {\r\n            \"url\": \"https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3-natives-windows.jar\",\r\n            \"sha1\": \"84a4b856389cc4f485275b1f63497a95a857a443\",\r\n            \"size\": 81217\r\n          }\r\n        }\r\n      }\r\n    },\r\n    {\r\n      \"name\": \"ca.weblite:java-objc-bridge:1.0.0\",\r\n      \"rules\": [\r\n        {\r\n          \"action\": \"allow\",\r\n          \"os\": {\r\n            \"name\": \"osx\"\r\n          }\r\n        }\r\n      ],\r\n      \"natives\": {\r\n        \"osx\": \"natives-osx\"\r\n      },\r\n      \"extract\": {\r\n        \"exclude\": [\r\n          \"META-INF/\"\r\n        ]\r\n      },\r\n      \"downloads\": {\r\n        \"artifact\": {\r\n          \"url\": \"https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar\",\r\n          \"sha1\": \"6ef160c3133a78de015830860197602ca1c855d3\",\r\n          \"size\": 40502\r\n        },\r\n        \"classifiers\": {\r\n          \"natives-osx\": {\r\n            \"url\": \"https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-natives-osx.jar\",\r\n            \"sha1\": \"08befab4894d55875f33c3d300f4f71e6e828f64\",\r\n            \"size\": 5629\r\n          }\r\n        }\r\n      }\r\n    },\r\n    {\r\n      \"name\": \"ca.weblite:java-objc-bridge:1.0.0\",\r\n      \"rules\": [\r\n        {\r\n          \"action\": \"allow\",\r\n          \"os\": {\r\n            \"name\": \"osx\"\r\n          }\r\n        }\r\n      ],\r\n      \"downloads\": {\r\n        \"artifact\": {\r\n          \"url\": \"https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0.jar\",\r\n          \"sha1\": \"6ef160c3133a78de015830860197602ca1c855d3\",\r\n          \"size\": 40502\r\n        },\r\n        \"classifiers\": {\r\n          \"natives-osx\": {\r\n            \"url\": \"https://libraries.minecraft.net/ca/weblite/java-objc-bridge/1.0.0/java-objc-bridge-1.0.0-natives-osx.jar\",\r\n            \"sha1\": \"08befab4894d55875f33c3d300f4f71e6e828f64\",\r\n            \"size\": 5629\r\n          }\r\n        }\r\n      }\r\n    }\r\n  ],\r\n```\r\n\r\nThere are 4 libraries specified there:\r\n\r\n* `com.mojang:text2speech:1.10.3`\r\n* `com.mojang:text2speech:1.10.3` again, but with `\"natives\"` and `\"extract\"`\r\n* `ca.weblite:java-objc-bridge:1.0.0`\r\n* `ca.weblite:java-objc-bridge:1.0.0` again, but with `\"natives\"` and `\"extract\"`\r\n\r\nWhat's going on here (and you can see this pretty well if you take a look at the [sources](https://libraries.minecraft.net/com/mojang/text2speech/1.10.3/text2speech-1.10.3-sources.jar) for text2speech) is that text2speech uses a library to interact with ObjectiveC code to communicate with whatever text2speech system is included with mac, while on windows and linux it directly access native code without needing a separate library.  But this means that `text2speech` only has natives for windows and linux, while the objectivec bridge has natives for OSX only.  However, the text2speech natives does not have a rule defined to limit it to windows and linux (perhaps this is a mistake with the version JSON).\r\n\r\nThis should be fixable by changing this (in `MinecraftDiscovery.py`):\r\n\r\n```python\r\n        if 'natives' in library:\r\n            libFilename = \"%s-%s-%s.jar\"%(libSubdir, libVersion, substitueString(library['natives'][osKeyword]))\r\n```\r\n\r\nto this:\r\n\r\n```python\r\n        if 'natives' in library:\r\n            if osKeyword not in library['natives']:\r\n                continue\r\n            libFilename = \"%s-%s-%s.jar\"%(libSubdir, libVersion, substitueString(library['natives'][osKeyword]))\r\n```\r\n\r\nOr Mojang should be able to fix this by adding\r\n\r\n```json\r\n      \"rules\": [\r\n        {\r\n          \"action\": \"allow\"\r\n        },\r\n        {\r\n          \"action\": \"disallow\",\r\n          \"os\": {\r\n            \"name\": \"osx\"\r\n          }\r\n        }\r\n      ],\r\n```\r\n\r\nto the narrator natives library (but not the narrator library itself).  MCP itself would handle this correctly, and I think that this would be the logically correct version JSON.  (I haven't created an MCL issue for this, but I may later if it seems like a good idea)"},"comment":{"url":"https://api.github.com/repos/ModCoderPack/MCPBot-Issues/issues/comments/379565290","html_url":"https://github.com/ModCoderPack/MCPBot-Issues/issues/501#issuecomment-379565290","issue_url":"https://api.github.com/repos/ModCoderPack/MCPBot-Issues/issues/501","id":379565290,"user":{"login":"Pokechu22","id":8334194,"avatar_url":"https://avatars2.githubusercontent.com/u/8334194?v=4","gravatar_id":"","url":"https://api.github.com/users/Pokechu22","html_url":"https://github.com/Pokechu22","followers_url":"https://api.github.com/users/Pokechu22/followers","following_url":"https://api.github.com/users/Pokechu22/following{/other_user}","gists_url":"https://api.github.com/users/Pokechu22/gists{/gist_id}","starred_url":"https://api.github.com/users/Pokechu22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Pokechu22/subscriptions","organizations_url":"https://api.github.com/users/Pokechu22/orgs","repos_url":"https://api.github.com/users/Pokechu22/repos","events_url":"https://api.github.com/users/Pokechu22/events{/privacy}","received_events_url":"https://api.github.com/users/Pokechu22/received_events","type":"User","site_admin":false},"created_at":"2018-04-08T17:01:49Z","updated_at":"2018-04-08T17:01:49Z","author_association":"NONE","body":"MCP does have a license (LICENSE.txt) and it's pretty explicit:\r\n\r\n> MCP - Mod Coder Pack\r\n> MCP is (c) Copyright by the MCP Team\r\n> \r\n> License and terms of use.\r\n> \r\n> No warranties. If MCP does not work for you, or causes any damage, it's your problem. Use it at own risk.\r\n> \r\n> You are allowed to:\r\n> - Use MCP to decompile the Minecraft client and server jar files.\r\n> - Use the decompiled source code to create mods for Minecraft.\r\n> - Recompile modified versions of Minecraft.\r\n> - Reobfuscate the classes of your mod for Minecraft.\r\n> \r\n> You are NOT allowed to:\r\n> - Use MCP to do anything that violated Mojangs terms of use for Minecraft.\r\n> - Release Minecraft versions or modifications that allow you to play without having bought Minecraft from Mojang.\r\n> - Release modified or unmodified versions of MCP anywhere.\r\n> - Use any of MCPs scripts, tools or data files without explicit written permission.\r\n> - Make money with anything based on MCP (excluding Minecraft mods created by using MCP).\r\n> - Use MCP to create clients that are used for griefing or exploiting server bugs.\r\n> - Release the decompiled source code of Minecraft in any way.\r\n\r\nThe license in turn references the [Minecraft EULA](https://account.mojang.com/documents/minecraft_eula), which you should have already read."}}
{"actor":{"display_login":"Pokechu22"}}