Skip to content

Instantly share code, notes, and snippets.

@entrypointkr
Created December 15, 2016 16:47
Show Gist options
  • Save entrypointkr/ec9d7dab9ec39e7650cb3a5827cc36e9 to your computer and use it in GitHub Desktop.
Save entrypointkr/ec9d7dab9ec39e7650cb3a5827cc36e9 to your computer and use it in GitHub Desktop.
CommandHelper subset_of() example
/* 아이템 배열 비교 */
@parent = array('type': 32, 'meta': array(
'lore': array('a', 'b', 'c'),
'display': 'Test'
))
@item = array('data': 0, 'type': 32, 'qty': 10, 'flags': array(), 'meta': array(
'lore': array('a', 'b', 'c'),
'display': 'Test'
))
if (_subset_of(@parent, @item)) {
broadcast(true)
}
/* 위치 배열 비교 */
@parent = array('x': 1, 'y': 2, 'z': 3, 'world': 'world')
@loc = array(0: 1, 1: 1, 2: 2, 3: 'world', 'x': 1, 'y': 2, 'z': 3, 'world': 'world')
if (_subset_of(@parent, @loc)) {
broadcast(true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment