Skip to content

Commit

Permalink
添加4d皮肤块
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperIceCN committed Mar 16, 2020
1 parent 0e14d46 commit 2f03c33
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Binary file modified BlocklyNukkit.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 @@ -366,6 +366,7 @@
<block type="player_setmaxhealth"></block>
<block type="player_getposition"></block>
<block type="player_teleport"></block>
<block type="player_buildskin"></block>
</category>
<category name="事件" colour=10>
<block type="event_setCancelled"></block>
Expand Down
34 changes: 34 additions & 0 deletions js/custom/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,38 @@ Blockly.JavaScript['player_teleport'] = function(block) {
Blockly.JavaScript.ORDER_FUNCTION_CALL) || '\'\'';
var text=playertmp+".teleport("+postmp+");\n"
return text;
};
Blockly.Blocks['player_buildskin'] = {
init: function() {
this.jsonInit({
"message0": '设置玩家 %1 的皮肤为名称是 %2 的皮肤',
"args0": [
{
"type": "input_value",
"name": "PLAYER",
"check": "Player"
},
{
"type": "input_value",
"name": "SKINNAME",
"check": "String"
}
],
"nextStatement": null,
"previousStatement": null,
"inputsInline": true,
"colour": 180,
"tooltip": "更改皮肤(manager.buildskin)",
"helpUrl": "#"
});
}
};
Blockly.JavaScript['player_buildskin'] = function(block) {
//String or array length.
var playertmp = Blockly.JavaScript.valueToCode(block, 'PLAYER',
Blockly.JavaScript.ORDER_FUNCTION_CALL) || '\'\'';
var skintmp = Blockly.JavaScript.valueToCode(block, 'SKINNAME',
Blockly.JavaScript.ORDER_FUNCTION_CALL) || '\'\'';
var text="manager.buildskin("+playertmp+","+skintmp+");\n"
return text;
};

0 comments on commit 2f03c33

Please sign in to comment.