diff --git a/apps/src/craft/agent/blocks.js b/apps/src/craft/agent/blocks.js index b65ae526e024f..99afbbc659256 100644 --- a/apps/src/craft/agent/blocks.js +++ b/apps/src/craft/agent/blocks.js @@ -186,36 +186,6 @@ exports.install = function (blockly, blockInstallOptions) { return 'destroyBlock(\'block_id_' + this.id + '\');\n'; }; - blockly.Blocks.craft_whileBlockAhead = { - helpUrl: '', - init: function () { - var dropdownOptions = keysToDropdownOptions(craftBlockOptions.ifBlockOptions || allDropdownBlocks); - var dropdown = new blockly.FieldDropdown(dropdownOptions); - dropdown.setValue(dropdownOptions[0][1]); - - this.setHSV(322, 0.90, 0.95); - this.appendDummyInput() - .appendTitle(i18n.blockWhileXAheadWhile()) - .appendTitle(dropdown, 'TYPE') - .appendTitle(i18n.blockWhileXAheadAhead()); - this.appendStatementInput('DO') - .appendTitle(i18n.blockWhileXAheadDo()); - this.setPreviousStatement(true); - this.setNextStatement(true); - } - }; - - blockly.Generator.get('JavaScript').craft_whileBlockAhead = function () { - var innerCode = blockly.Generator.get('JavaScript').statementToCode(this, 'DO'); - var blockType = this.getTitleValue('TYPE'); - return 'whileBlockAhead(\'block_id_' + this.id + '\',\n"' + - blockType + '", ' + - ' function() { '+ - innerCode + - ' }' + - ');\n'; - }; - blockly.Blocks.craft_ifBlockAhead = { helpUrl: '', init: function () { diff --git a/apps/src/craft/agent/craft.js b/apps/src/craft/agent/craft.js index 6b9f927d6186e..e5980ed287591 100644 --- a/apps/src/craft/agent/craft.js +++ b/apps/src/craft/agent/craft.js @@ -693,22 +693,7 @@ export default class Craft { destroyBlock: function (blockID) { appCodeOrgAPI.destroyBlock(studioApp().highlight.bind(studioApp(), blockID), 'PlayerAgent'); }, - whilePathAhead: function (blockID, callback) { - // if resurrected, move blockID be last parameter to fix "Show Code" - appCodeOrgAPI.whilePathAhead(studioApp().highlight.bind(studioApp(), blockID), - '', - 'PlayerAgent', - callback); - }, - whileBlockAhead: function (blockID, blockType, callback) { - // if resurrected, move blockID be last parameter to fix "Show Code" - appCodeOrgAPI.whilePathAhead(studioApp().highlight.bind(studioApp(), blockID), - blockType, - 'PlayerAgent', - callback); - }, ifLavaAhead: function (callback, blockID) { - // if resurrected, move blockID be last parameter to fix "Show Code" appCodeOrgAPI.ifBlockAhead(studioApp().highlight.bind(studioApp(), blockID), "lava", 'PlayerAgent', diff --git a/apps/src/craft/code-connection/utils.js b/apps/src/craft/code-connection/utils.js index dc64d77cfcadb..81dc85efe3523 100644 --- a/apps/src/craft/code-connection/utils.js +++ b/apps/src/craft/code-connection/utils.js @@ -187,44 +187,6 @@ const blockConversions = Object.freeze({ `); }, - craft_whileBlockAhead: function (xml) { - const statement = getChildNodeByName(xml, 'statement'); - const next = getChildNodeByName(xml, 'next'); - const title = getChildNodeByName(xml, 'title'); - - let blockType = title.textContent; - if (blockTypes[blockType]) { - blockType = blockTypes[blockType]; - } - - return (` - - WHILE - - - EQ - - - forward - - - - - - - ${blockType} - - - - - - - ${statement ? serialize(statement) : ''} - ${next ? serialize(next) : ''} - - `); - }, - craft_ifBlockAhead: function (xml) { const statement = getChildNodeByName(xml, 'statement'); const next = getChildNodeByName(xml, 'next'); diff --git a/apps/src/craft/simple/blocks.js b/apps/src/craft/simple/blocks.js index b5026c3c08779..00584fb0338fc 100644 --- a/apps/src/craft/simple/blocks.js +++ b/apps/src/craft/simple/blocks.js @@ -176,36 +176,6 @@ exports.install = function (blockly, blockInstallOptions) { return 'shear(\'block_id_' + this.id + '\');\n'; }; - blockly.Blocks.craft_whileBlockAhead = { - helpUrl: '', - init: function () { - var dropdownOptions = keysToDropdownOptions(craftBlockOptions.ifBlockOptions || allDropdownBlocks); - var dropdown = new blockly.FieldDropdown(dropdownOptions); - dropdown.setValue(dropdownOptions[0][1]); - - this.setHSV(322, 0.90, 0.95); - this.appendDummyInput() - .appendTitle(i18n.blockWhileXAheadWhile()) - .appendTitle(dropdown, 'TYPE') - .appendTitle(i18n.blockWhileXAheadAhead()); - this.appendStatementInput('DO') - .appendTitle(i18n.blockWhileXAheadDo()); - this.setPreviousStatement(true); - this.setNextStatement(true); - } - }; - - blockly.Generator.get('JavaScript').craft_whileBlockAhead = function () { - var innerCode = blockly.Generator.get('JavaScript').statementToCode(this, 'DO'); - var blockType = this.getTitleValue('TYPE'); - return 'whileBlockAhead(\'block_id_' + this.id + '\',\n"' + - blockType + '", ' + - ' function() { '+ - innerCode + - ' }' + - ');\n'; - }; - blockly.Blocks.craft_ifBlockAhead = { helpUrl: '', init: function () { diff --git a/apps/src/craft/simple/craft.js b/apps/src/craft/simple/craft.js index 05599b9845fc4..6746510492849 100644 --- a/apps/src/craft/simple/craft.js +++ b/apps/src/craft/simple/craft.js @@ -649,22 +649,7 @@ Craft.executeUserCode = function () { tillSoil: function (blockID) { appCodeOrgAPI.tillSoil(studioApp().highlight.bind(studioApp(), blockID), 'Player'); }, - whilePathAhead: function (blockID, callback) { - // if resurrected, move blockID be last parameter to fix "Show Code" - appCodeOrgAPI.whilePathAhead(studioApp().highlight.bind(studioApp(), blockID), - '', - 'Player', - callback); - }, - whileBlockAhead: function (blockID, blockType, callback) { - // if resurrected, move blockID be last parameter to fix "Show Code" - appCodeOrgAPI.whilePathAhead(studioApp().highlight.bind(studioApp(), blockID), - blockType, - 'Player', - callback); - }, ifLavaAhead: function (callback, blockID) { - // if resurrected, move blockID be last parameter to fix "Show Code" appCodeOrgAPI.ifBlockAhead(studioApp().highlight.bind(studioApp(), blockID), "lava", 'Player', diff --git a/apps/test/unit/craft/code-connection/utilsTest.js b/apps/test/unit/craft/code-connection/utilsTest.js index e6011fb870914..657748af27c16 100644 --- a/apps/test/unit/craft/code-connection/utilsTest.js +++ b/apps/test/unit/craft/code-connection/utilsTest.js @@ -21,11 +21,6 @@ describe('convertBlocksXml', () => { `, - ` - - dirt - - `, ]; const expected = [ @@ -44,30 +39,6 @@ describe('convertBlocksXml', () => { forward `, - ` - - WHILE - - - EQ - - - forward - - - - - - - dirt - - - - - - - - `, ]; sources.forEach((source, i) => { @@ -93,7 +64,7 @@ describe('convertBlocksXml', () => { blocks.forEach((block, i) => { const xml = ` - + ${block} diff --git a/dashboard/app/models/levels/craft.rb b/dashboard/app/models/levels/craft.rb index 7e7695ea06176..8a26625525230 100644 --- a/dashboard/app/models/levels/craft.rb +++ b/dashboard/app/models/levels/craft.rb @@ -610,7 +610,6 @@ def common_blocks(type) <<-XML.chomp #{level_specific_blocks} - 5