void LoadDefaultProps() { for (int b = 0; b < Props.Length; b++) { Props[b] = BlockOptions.DefaultProps(Props, this, (BlockID)b); } }
void ResetProps(Player p, BlockProps[] scope, BlockID block) { scope[block] = BlockOptions.DefaultProps(scope, p.level, block); string name = BlockOptions.Name(scope, p, block); p.Message("Reset properties of {0} to default", name); BlockOptions.ApplyChanges(scope, p.level, block, true); }
static void ResetProps(bool global, BlockID block, Player p) { BlockProps[] scope = global ? Block.Props : p.level.Props; int changed = scope[block].ChangedScope & BlockOptions.ScopeId(scope); if (changed != 0) { return; } // properties not manually modified, revert (e.g. make grass die in shadow again) scope[block] = BlockOptions.DefaultProps(scope, p.level, block); BlockOptions.ApplyChanges(scope, p.level, block, false); }