New scripting features

This commit is contained in:
MihailRis
2024-01-12 12:16:54 +03:00
parent 05fe86e64c
commit faabb8178a
10 changed files with 129 additions and 43 deletions
+13
View File
@@ -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);