MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / consumeItems

Method consumeItems

source/game/objects/StarContainerObject.cpp:293–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293RpcPromise<bool> ContainerObject::consumeItems(ItemDescriptor const& descriptor) {
294 if (isSlave()) {
295 return world()->sendEntityMessage(entityId(), "consumeItems", {descriptor.toJson()}).wrap([](Json res) {
296 return res.toBool();
297 });
298 } else {
299 return RpcPromise<bool>::createFulfilled(doConsumeItems(descriptor));
300 }
301}
302
303RpcPromise<bool> ContainerObject::consumeItems(size_t pos, size_t count) {
304 if (isSlave()) {

Callers 4

tickCraftingMethod · 0.45
doConsumeItemsMethod · 0.45
containerConsumeMethod · 0.45
containerConsumeAtMethod · 0.45

Calls 4

toBoolMethod · 0.80
wrapMethod · 0.45
sendEntityMessageMethod · 0.45
toJsonMethod · 0.45

Tested by

no test coverage detected