Skip to content

Commit

Permalink
Add item property handled lists
Browse files Browse the repository at this point in the history
  • Loading branch information
MusicScore committed Jan 23, 2019
1 parent e42972a commit b62d57c
Show file tree
Hide file tree
Showing 26 changed files with 222 additions and 0 deletions.
Expand Up @@ -24,6 +24,14 @@ public static ItemApple getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"apple_enchanted"
};

public static final String[] handledMechs = new String[] {
"apple_enchanted"
};


private ItemApple(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -33,6 +33,14 @@ public static ItemAttributeNBT getFrom(dObject item) {
}
}

public static final String[] handledTags = new String[]{
"nbt_attributes"
};

public static final String[] handledMechs = new String[] {
"nbt_attributes"
};

private ItemAttributeNBT(dItem item) {
this.item = item;
}
Expand Down
Expand Up @@ -34,6 +34,14 @@ public static ItemBaseColor getFrom(dObject item) {
}
}

public static final String[] handledTags = new String[]{
"base_color"
};

public static final String[] handledMechs = new String[] {
"base_color"
};


private ItemBaseColor(dItem item) {
this.item = item;
Expand Down
Expand Up @@ -32,6 +32,14 @@ public static ItemBook getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"book"
};

public static final String[] handledMechs = new String[] {
"book"
};


private ItemBook(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -30,6 +30,15 @@ public static ItemCanDestroy getFrom(dObject item) {
}
}

public static final String[] handledTags = new String[]{
"can_destroy"
};

public static final String[] handledMechs = new String[] {
"can_destroy"
};


private ItemCanDestroy(dItem item) {
this.item = item;
}
Expand Down
Expand Up @@ -30,6 +30,15 @@ public static ItemCanPlaceOn getFrom(dObject item) {
}
}

public static final String[] handledTags = new String[]{
"can_place_on"
};

public static final String[] handledMechs = new String[] {
"can_place_on"
};


private ItemCanPlaceOn(dItem item) {
this.item = item;
}
Expand Down
Expand Up @@ -37,6 +37,15 @@ public static ItemColor getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"color", "dye_color"
};

public static final String[] handledMechs = new String[] {
"color", "dye_color", "dye"
};


private ItemColor(dItem _item) {
item = _item;
}
Expand Down
Expand Up @@ -25,6 +25,15 @@ public static ItemDisplayname getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"display", "has_display"
};

public static final String[] handledMechs = new String[] {
"display_name"
};


private ItemDisplayname(dItem _item) {
item = _item;
}
Expand Down
Expand Up @@ -23,6 +23,14 @@ public static ItemDurability getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"durability", "max_durability"
};

public static final String[] handledMechs = new String[] {
"durability"
};


private ItemDurability(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -31,6 +31,14 @@ public static ItemEnchantments getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"is_enchanted", "enchantments"
};

public static final String[] handledMechs = new String[] {
"remove_enchantments", "enchantments"
};


private ItemEnchantments(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -34,6 +34,14 @@ public static ItemFirework getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"firework"
};

public static final String[] handledMechs = new String[] {
"firework"
};


private ItemFirework(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -27,6 +27,15 @@ public static ItemFlags getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"flags"
};

public static final String[] handledMechs = new String[] {
"flags"
};


private ItemFlags(dItem _item) {
item = _item;
}
Expand Down
Expand Up @@ -29,6 +29,15 @@ public static ItemInventory getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"inventory"
};

public static final String[] handledMechs = new String[] {
"inventory"
};


private dInventory getItemInventory() {
return dInventory.mirrorBukkitInventory(((InventoryHolder) ((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState()).getInventory());
}
Expand Down
Expand Up @@ -28,6 +28,15 @@ public static ItemLock getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"lock", "is_locked"
};

public static final String[] handledMechs = new String[] {
"lock"
};


private String getItemLock() {
return ((Lockable) ((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState()).getLock();
}
Expand Down
Expand Up @@ -31,6 +31,15 @@ public static ItemLore getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"lore", "has_lore"
};

public static final String[] handledMechs = new String[] {
"lore"
};


public boolean hasLore() {
return item.getItemStack().hasItemMeta()
&& (item.getItemStack().getItemMeta().hasLore());
Expand Down
Expand Up @@ -29,6 +29,14 @@ public static ItemMap getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"map"
};

public static final String[] handledMechs = new String[] {
"map"
};


private ItemMap(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -29,6 +29,15 @@ public static ItemNBT getFrom(dObject item) {
}
}

public static final String[] handledTags = new String[]{
"has_nbt", "nbt_keys", "nbt"
};

public static final String[] handledMechs = new String[] {
"remove_nbt", "nbt"
};


private ItemNBT(dItem item) {
this.item = item;
}
Expand Down
Expand Up @@ -41,6 +41,14 @@ public static ItemPatterns getFrom(dObject item) {
}
}

public static final String[] handledTags = new String[]{
"patterns"
};

public static final String[] handledMechs = new String[] {
"patterns"
};


private ItemPatterns(dItem item) {
this.item = item;
Expand Down
Expand Up @@ -37,6 +37,14 @@ public static ItemPlantgrowth getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"plant_growth"
};

public static final String[] handledMechs = new String[] {
"plant_growth"
};


private ItemPlantgrowth(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -42,6 +42,15 @@ public static ItemPotion getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"potion_base", "has_potion_effect", "potion_effect"
};

public static final String[] handledMechs = new String[] {
"potion_effects"
};


private ItemPotion(dItem item) {
this.item = item;
}
Expand Down
Expand Up @@ -23,6 +23,14 @@ public static ItemQuantity getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"quantity", "qty", "max_stack"
};

public static final String[] handledMechs = new String[] {
"quantity"
};


private ItemQuantity(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -23,6 +23,15 @@ public static ItemScript getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"has_script", "scriptname", "script"
};

public static final String[] handledMechs = new String[] {
"script"
};


private ItemScript(dItem _item) {
item = _item;
}
Expand Down
Expand Up @@ -31,6 +31,15 @@ public static ItemSignContents getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"sign_contents"
};

public static final String[] handledMechs = new String[] {
"sign_contents"
};


private dList getSignContents() {
return new dList(Arrays.asList(((Sign) ((BlockStateMeta) item.getItemStack().getItemMeta()).getBlockState()).getLines()));
}
Expand Down
Expand Up @@ -32,6 +32,15 @@ public static ItemSkullskin getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"skin", "has_skin"
};

public static final String[] handledMechs = new String[] {
"skull_skin"
};



private ItemSkullskin(dItem _item) {
item = _item;
Expand Down
Expand Up @@ -31,6 +31,14 @@ public static ItemSpawnEgg getFrom(dObject _item) {
}
}

public static final String[] handledTags = new String[]{
"spawn_id", "spawn_egg_entity", "spawn_type"
};

public static final String[] handledMechs = new String[] {
"spawn_id", "spawn_egg", "spawn_type"
};


private ItemSpawnEgg(dItem _item) {
item = _item;
Expand Down

0 comments on commit b62d57c

Please sign in to comment.