interact with inventory objects
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit

This commit is contained in:
austin 2025-05-13 14:19:47 -04:00
parent e68e637a84
commit 5c062ac984
4 changed files with 26 additions and 0 deletions

View File

@ -27,6 +27,22 @@
"offsetY" : 0,
"offsetZ" : 0
},
"buttonInteraction" : {
"onInteract" : "inventory",
"interactionShape" : {
"type" : "CUBE",
"dimension1" : 2.0,
"dimension2" : 2.0,
"dimension3" : 2.0,
"rotX": 0,
"rotY": 0,
"rotZ": 0,
"rotW": 1,
"offsetX" : 0.0,
"offsetY" : 0.0,
"offsetZ" : 0.0
}
},
"tokens": [
"GRAVITY"
],

View File

@ -1746,6 +1746,7 @@ Enitity id collision validation
Full-sized wheat plants spawn in forest now
Natural inventory size explicitly defined in data
Fix server life tree missing nullcheck
Inventory interaction type

View File

@ -13,6 +13,7 @@ import electrosphere.entity.state.equip.ClientEquipState;
import electrosphere.entity.state.inventory.InventoryUtils;
import electrosphere.entity.types.common.CommonEntityFlags;
import electrosphere.entity.types.common.CommonEntityUtils;
import electrosphere.logger.LoggerInterface;
import electrosphere.net.parser.net.message.EntityMessage;
/**
@ -61,6 +62,9 @@ public class ButtonInteraction {
case InteractionData.ON_INTERACT_DIALOG: {
DialogMenuGenerator.displayEntityDialog(target);
} break;
case InteractionData.ON_INTERACT_INVENTORY: {
LoggerInterface.loggerEngine.WARNING("Interacting with inventory");
} break;
default: {
throw new Error("Unhandled interaction signal " + interactionData.getOnInteract());
}

View File

@ -26,6 +26,11 @@ public class InteractionData {
* A dialog interaction
*/
public static final String ON_INTERACT_DIALOG = "dialog";
/**
* An inventory interaction
*/
public static final String ON_INTERACT_INVENTORY = "inventory";
/**
* The function to run on interaction