Skip to content

Commit

Permalink
更新1个块,缩小bn
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperIceCN committed Aug 3, 2020
1 parent 8c8c51e commit 7b2a8d6
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 2 deletions.
Binary file modified BlocklyNukkit.jar
Binary file not shown.
Binary file renamed pythonForBN.jar → PyBN.jar
Binary file not shown.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@
<block type="inv_addItemToInv"></block>
<block type="inv_removeItemFromInv"></block>
<block type="inv_getItemsInInv"></block>
<block type="inv_getItemInInv"></block>
</category>
<category name="生物" colour=248>
<block type="entity_playertoentity"></block>
Expand Down
35 changes: 33 additions & 2 deletions js/custom/inventory.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,41 @@ Blockly.Blocks['inv_getItemsInInv'] = {
};
Blockly.JavaScript['inv_getItemsInInv'] = function(block) {
//String or array length.
var itemtmp = Blockly.JavaScript.valueToCode(block, 'ITEM',
Blockly.JavaScript.ORDER_FUNCTION_CALL) || '\'\'';
var invtmp = Blockly.JavaScript.valueToCode(block, 'INV',
Blockly.JavaScript.ORDER_FUNCTION_CALL) || '\'\'';
var text="inventory.getItemsInInv("+invtmp+")";
return [text, Blockly.JavaScript.ORDER_MEMBER];
};
Blockly.Blocks['inv_getItemInInv'] = {
init: function() {
this.jsonInit({
"message0": inventory_line_280,
"args0": [
{
"type": "input_value",
"name": "INV",
"check": "Inventory"
},
{
"type": "input_value",
"name": "SLOT",
"check": "Number"
}
],
"output": "Item",
"colour": 290,
"tooltip": inventory_line_295,
"helpUrl": "#"
});
}
};
Blockly.JavaScript['inv_getItemInInv'] = function(block) {
//String or array length.
var slottmp = Blockly.JavaScript.valueToCode(block, 'SLOT',
Blockly.JavaScript.ORDER_FUNCTION_CALL) || '\'\'';
var invtmp = Blockly.JavaScript.valueToCode(block, 'INV',
Blockly.JavaScript.ORDER_FUNCTION_CALL) || '\'\'';
var text=invtmp+".getItem("+slottmp+")";
return [text, Blockly.JavaScript.ORDER_MEMBER];
};

4 changes: 4 additions & 0 deletions js/custom/language.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,3 +629,7 @@ var player_line_1062 = "获取玩家 %1 的经验等级"
var player_line_1072 = "获取玩家经验等级"
var player_line_1086 = "获取玩家 %1 的饥饿值"
var player_line_1096 = "获取玩家饥饿值"
//inventory.js update at 2020/7/4
//generated by python reMoudle
var inventory_line_280 = "获取物品栏 %1 槽位 %2 上的物品"
var inventory_line_295 = "获取物品栏槽位上的物品"

0 comments on commit 7b2a8d6

Please sign in to comment.