mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
New scripting features
This commit is contained in:
parent
05fe86e64c
commit
faabb8178a
10 changed files with 129 additions and 43 deletions
|
|
@ -259,10 +259,23 @@ void PlayerController::updateInteraction(){
|
|||
}
|
||||
}
|
||||
|
||||
if (lclick) {
|
||||
if (!input.shift && item->rt.funcsset.on_use_on_block) {
|
||||
if (scripting::on_item_break_block(player, item, x, y, z))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Block* target = contentIds->getBlockDef(vox->id);
|
||||
if (lclick && target->breakable){
|
||||
blocksController->breakBlock(player, target, x, y, z);
|
||||
}
|
||||
if (rclick) {
|
||||
if (!input.shift && item->rt.funcsset.on_use_on_block) {
|
||||
if (scripting::on_item_use_on_block(player, item, x, y, z))
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (def && rclick){
|
||||
if (!input.shift && target->rt.funcsset.oninteract) {
|
||||
scripting::on_block_interact(player, target, x, y, z);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue