Files

24 lines
859 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# chroma_trail.js — saveBlock() (satır 884)
[← chroma_trail.js](index.md) · [← Master](../../wiki.md)
```javascript
function saveBlock(p, st, data) {
var spec = getSpec(st);
var id = trim(data.has("block") ? data.getString("block") : spec.id);
var metaStr = trim(data.has("meta") ? data.getString("meta") : String(spec.meta));
if (id.length === 0) return "Blok id bos olamaz. Ornek: blockbuster:green";
if (id.indexOf(":") === -1) id = "minecraft:" + id;
var meta = metaStr.length === 0 ? 0 : Number(metaStr);
if (!isFinite(meta) || meta < 0 || meta > 15 || Math.floor(meta) !== meta) return "Meta 0-15 arasi tam sayi olmali.";
var err = trailError(id, meta, p.getGameMode());
if (err) return err;
st.setString(K_BLOCK, id);
st.setNumber(K_META, meta);
return null;
}
```