{"id":1102,"date":"2015-11-04T13:08:57","date_gmt":"2015-11-04T13:08:57","guid":{"rendered":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/?page_id=1102"},"modified":"2016-03-04T14:44:37","modified_gmt":"2016-03-04T14:44:37","slug":"source-code","status":"publish","type":"page","link":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/source-code\/","title":{"rendered":"Source Code"},"content":{"rendered":"<p>HTML generated using <a href=\"http:\/\/hilite.me\">hilite.me<\/a><\/p>\n<div style=\"background: #ffffff;overflow: auto;width: auto;border: solid gray;border-width: .1em .1em .1em .8em;padding: .2em .6em\">\n<table>\n<tbody>\n<tr>\n<td>\n<pre style=\"margin: 0;line-height: 125%\"><span style=\"color: #008800;font-weight: bold\">import<\/span> <span style=\"color: #0e84b5;font-weight: bold\">sys<\/span>\n<span style=\"color: #008800;font-weight: bold\">import<\/span> <span style=\"color: #0e84b5;font-weight: bold\">mcpi.minecraft<\/span> <span style=\"color: #008800;font-weight: bold\">as<\/span> <span style=\"color: #0e84b5;font-weight: bold\">minecraft<\/span>\n<span style=\"color: #008800;font-weight: bold\">import<\/span> <span style=\"color: #0e84b5;font-weight: bold\">mcpi.block<\/span> <span style=\"color: #008800;font-weight: bold\">as<\/span> <span style=\"color: #0e84b5;font-weight: bold\">block<\/span>\n \nmc <span style=\"color: #333333\">=<\/span> minecraft<span style=\"color: #333333\">.<\/span>Minecraft<span style=\"color: #333333\">.<\/span>create()\nmc<span style=\"color: #333333\">.<\/span>setBlocks(<span style=\"color: #333333\">-<\/span><span style=\"color: #0000dd;font-weight: bold\">128<\/span>,<span style=\"color: #0000dd;font-weight: bold\">0<\/span>,<span style=\"color: #333333\">-<\/span><span style=\"color: #0000dd;font-weight: bold\">128<\/span>,<span style=\"color: #0000dd;font-weight: bold\">128<\/span>,<span style=\"color: #0000dd;font-weight: bold\">64<\/span>,<span style=\"color: #0000dd;font-weight: bold\">128<\/span>,<span style=\"color: #0000dd;font-weight: bold\">0<\/span>)\n<span style=\"color: #008800;font-weight: bold\">if<\/span>(<span style=\"color: #007020\">len<\/span>(sys<span style=\"color: #333333\">.<\/span>argv) <span style=\"color: #333333\">&amp;<\/span>gt; <span style=\"color: #0000dd;font-weight: bold\">1<\/span>):\n        bid <span style=\"color: #333333\">=<\/span> <span style=\"color: #007020\">int<\/span>(sys<span style=\"color: #333333\">.<\/span>argv[<span style=\"color: #0000dd;font-weight: bold\">1<\/span>])\n<span style=\"color: #008800;font-weight: bold\">else<\/span>:\n        bid <span style=\"color: #333333\">=<\/span> block<span style=\"color: #333333\">.<\/span>SANDSTONE<span style=\"color: #333333\">.<\/span>id\n \n<span style=\"color: #008800;font-weight: bold\">if<\/span> bid  <span style=\"color: #0000dd;font-weight: bold\">108<\/span>:\n        bid <span style=\"color: #333333\">=<\/span> block<span style=\"color: #333333\">.<\/span>SANDSTONE<span style=\"color: #333333\">.<\/span>id\n \nmc<span style=\"color: #333333\">.<\/span>setBlocks(<span style=\"color: #333333\">-<\/span><span style=\"color: #0000dd;font-weight: bold\">128<\/span>,<span style=\"color: #0000dd;font-weight: bold\">0<\/span>,<span style=\"color: #333333\">-<\/span><span style=\"color: #0000dd;font-weight: bold\">128<\/span>,<span style=\"color: #0000dd;font-weight: bold\">128<\/span>,<span style=\"color: #333333\">-<\/span><span style=\"color: #0000dd;font-weight: bold\">64<\/span>,<span style=\"color: #0000dd;font-weight: bold\">128<\/span>,bid)\n<\/pre>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>HTML generated using hilite.me import sys import mcpi.minecraft as minecraft import mcpi.block as block mc = minecraft.Minecraft.create() mc.setBlocks(-128,0,-128,128,64,128,0) if(len(sys.argv) &amp;gt; 1): bid = int(sys.argv[1]) else: bid = block.SANDSTONE.id if bid 108: bid = block.SANDSTONE.id mc.setBlocks(-128,0,-128,128,-64,128,bid)<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-1102","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/wp-json\/wp\/v2\/pages\/1102","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/wp-json\/wp\/v2\/comments?post=1102"}],"version-history":[{"count":5,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/wp-json\/wp\/v2\/pages\/1102\/revisions"}],"predecessor-version":[{"id":1252,"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/wp-json\/wp\/v2\/pages\/1102\/revisions\/1252"}],"wp:attachment":[{"href":"https:\/\/blogs.glowscotland.org.uk\/nl\/JohnJohnston\/wp-json\/wp\/v2\/media?parent=1102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}