MCPcopy Index your code
hub / github.com/walterhiggins/ScriptCraft / _locationToJSON

Function _locationToJSON

src/main/js/modules/utils/utils.js:144–156  ·  view source on GitHub ↗

### utils.locationToJSON() function utils.locationToJSON() returns a [Location][cmloc] object in JSON form... { world: 'world5', x: 56.9324, y: 103.9954, z: 43.1323, yaw: 0.0, pitch: 0.0 } This can be useful if you write a plugin that needs to store location

(location)

Source from the content-addressed store, hash-verified

142
143***/
144function _locationToJSON(location) {
145 var yaw = __plugin.bukkit
146 ? location.yaw
147 : __plugin.canary ? location.rotation : 0;
148 return {
149 world: '' + location.world.name,
150 x: location.x,
151 y: location.y,
152 z: location.z,
153 yaw: yaw,
154 pitch: location.pitch
155 };
156}
157/*************************************************************************
158### utils.locationToString() function
159

Callers 1

utils.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected