mirror of
https://github.com/BentoBoxWorld/Challenges.git
synced 2025-01-04 23:37:47 +01:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
303d9a95dc
@ -11,3 +11,9 @@ permissions:
|
|||||||
bskyblock.admin.challenges:
|
bskyblock.admin.challenges:
|
||||||
description: Access challenge admin commands
|
description: Access challenge admin commands
|
||||||
default: op
|
default: op
|
||||||
|
acidisland.challenges:
|
||||||
|
description: Let the player use the /challenges command
|
||||||
|
default: true
|
||||||
|
acidisland.admin.challenges:
|
||||||
|
description: Access challenge admin commands
|
||||||
|
default: op
|
||||||
|
104
challenges.yml
104
challenges.yml
@ -188,18 +188,18 @@ challenges:
|
|||||||
dyemaker:
|
dyemaker:
|
||||||
friendlyname: 'Dye Maker'
|
friendlyname: 'Dye Maker'
|
||||||
description: 'Craft 32 cactus green dyes'
|
description: 'Craft 32 cactus green dyes'
|
||||||
icon: INK_SACK:2
|
icon: CACTUS_GREEN
|
||||||
level: 'Novice'
|
level: 'Novice'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'INK_SACK:2:32'
|
requiredItems: 'CACTUS_GREEN:32'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'SAPLING:0:2 SAPLING:1:2 SAPLING:2:2 SAPLING:3:2'
|
itemReward: 'OAK_SAPLING:2 BIRCH_SAPLING:2 JUNGLE_SAPLING:2 SPRUCE_SAPLING:2'
|
||||||
rewardText: '2 oak, 2 birch, 2 jungle and 2 spruce saplings'
|
rewardText: '2 oak, 2 birch, 2 jungle and 2 spruce saplings'
|
||||||
moneyReward: 10
|
moneyReward: 10
|
||||||
expReward: 30
|
expReward: 30
|
||||||
permissionReward: ''
|
permissionReward: ''
|
||||||
repeatable: true
|
repeatable: true
|
||||||
repeatItemReward: 'SAPLING:0:1 SAPLING:1:1 SAPLING:2:1 SAPLING:3:1 SAPLING:4:1 SAPLING:5:1'
|
repeatItemReward: 'ACACIA_SAPLING:1 DARK_OAK_SAPLING:1 OAK_SAPLING:1 BIRCH_SAPLING:1 JUNGLE_SAPLING:1 SPRUCE_SAPLING:1'
|
||||||
repeatRewardText: '1 of each kind of sapling'
|
repeatRewardText: '1 of each kind of sapling'
|
||||||
repeatMoneyReward: 5
|
repeatMoneyReward: 5
|
||||||
repeatExpReward: 10
|
repeatExpReward: 10
|
||||||
@ -247,11 +247,11 @@ challenges:
|
|||||||
maxtimes: 100
|
maxtimes: 100
|
||||||
seedbank:
|
seedbank:
|
||||||
friendlyname: 'Seedbank'
|
friendlyname: 'Seedbank'
|
||||||
description: 'Collect 64 melon seeds, 64 pumpkin seeds and 64 wheat seeds'
|
description: 'Collect 32 melon seeds, 32 pumpkin seeds, 32 beetroot seeds and 32 wheat seeds'
|
||||||
icon: PUMPKIN_SEEDS
|
icon: PUMPKIN_SEEDS
|
||||||
level: 'Novice'
|
level: 'Novice'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'MELON_SEEDS:64 PUMPKIN_SEEDS:64 SEEDS:64'
|
requiredItems: 'MELON_SEEDS:32 PUMPKIN_SEEDS:32 WHEAT_SEEDS:32 BEETROOT_SEEDS:32'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'DIRT:5 VINE:20'
|
itemReward: 'DIRT:5 VINE:20'
|
||||||
rewardText: '5 dirt blocks and 20 vines'
|
rewardText: '5 dirt blocks and 20 vines'
|
||||||
@ -268,18 +268,18 @@ challenges:
|
|||||||
stewmaker:
|
stewmaker:
|
||||||
friendlyname: 'Stew Maker'
|
friendlyname: 'Stew Maker'
|
||||||
description: 'Cook up 18 bowls of mushroom stew'
|
description: 'Cook up 18 bowls of mushroom stew'
|
||||||
icon: MUSHROOM_SOUP
|
icon: MUSHROOM_STEW
|
||||||
level: 'Novice'
|
level: 'Novice'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'MUSHROOM_SOUP:18'
|
requiredItems: 'MUSHROOM_STEW:18'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'MYCEL:2'
|
itemReward: 'MYCELIUM:2'
|
||||||
rewardText: '2 mycelium blocks'
|
rewardText: '2 mycelium blocks'
|
||||||
moneyReward: 15
|
moneyReward: 15
|
||||||
expReward: 30
|
expReward: 30
|
||||||
permissionReward: ''
|
permissionReward: ''
|
||||||
repeatable: true
|
repeatable: true
|
||||||
repeatItemReward: 'MYCEL:1'
|
repeatItemReward: 'MYCELIUM:1'
|
||||||
repeatRewardText: '1 mycelium block'
|
repeatRewardText: '1 mycelium block'
|
||||||
repeatMoneyReward: 5
|
repeatMoneyReward: 5
|
||||||
repeatExpReward: 10
|
repeatExpReward: 10
|
||||||
@ -288,7 +288,7 @@ challenges:
|
|||||||
builder:
|
builder:
|
||||||
friendlyname: 'Builder'
|
friendlyname: 'Builder'
|
||||||
description: 'Reach island level 10 (/[label] level).'
|
description: 'Reach island level 10 (/[label] level).'
|
||||||
icon: WOOD
|
icon: OAK_WOOD
|
||||||
level: 'Novice'
|
level: 'Novice'
|
||||||
type: level
|
type: level
|
||||||
requiredItems: 10
|
requiredItems: 10
|
||||||
@ -308,7 +308,7 @@ challenges:
|
|||||||
icon: BONE
|
icon: BONE
|
||||||
level: 'Competent'
|
level: 'Competent'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'ROTTEN_FLESH:64 STRING:32 SULPHUR:16 ARROW:32 BONE:32 SPIDER_EYE:5'
|
requiredItems: 'ROTTEN_FLESH:64 STRING:32 GUNPOWDER:16 ARROW:32 BONE:32 SPIDER_EYE:5'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'REDSTONE:16 IRON_ORE:5 FLINT:1 POTION:WATER_BREATHING:1 POTION:NIGHT_VISION:1'
|
itemReward: 'REDSTONE:16 IRON_ORE:5 FLINT:1 POTION:WATER_BREATHING:1 POTION:NIGHT_VISION:1'
|
||||||
rewardText: '16 redstone dust, 1 flint, 1 water breathing potion, 1 night vision potion and 5 iron(ore)'
|
rewardText: '16 redstone dust, 1 flint, 1 water breathing potion, 1 night vision potion and 5 iron(ore)'
|
||||||
@ -327,35 +327,35 @@ challenges:
|
|||||||
icon: WHEAT
|
icon: WHEAT
|
||||||
level: 'Competent'
|
level: 'Competent'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'WHEAT:64 SUGAR:64 MELON:64 CARROT_ITEM:64 POTATO_ITEM:64 PUMPKIN:64'
|
requiredItems: 'WHEAT:64 SUGAR:64 MELON:64 CARROTS:64 POTATOES:64 PUMPKIN:64'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'REDSTONE:16 INK_SACK:3:1 MONSTER_EGG:PIG:1 MONSTER_EGG:COW:1 MONSTER_EGG:CHICKEN:1'
|
itemReward: 'REDSTONE:16 COCOA_BEANS:1 PIG_SPAWN_EGG:1 COW_SPAWN_EGG:1 CHICKEN_SPAWN_EGG:1'
|
||||||
rewardText: '16 redstone dust, 1 cocoa bean, 1 spawn egg(chicken,cow,pig)'
|
rewardText: '16 redstone dust, 1 cocoa bean, 1 spawn egg (chicken,cow,pig)'
|
||||||
moneyReward: 75
|
moneyReward: 75
|
||||||
expReward: 75
|
expReward: 75
|
||||||
permissionReward: ''
|
permissionReward: ''
|
||||||
repeatable: true
|
repeatable: true
|
||||||
repeatItemReward: 'INK_SACK:3:1 MONSTER_EGG:PIG:1 MONSTER_EGG:COW:1 MONSTER_EGG:CHICKEN:1'
|
repeatItemReward: 'COCOA_BEANS:1 PIG_SPAWN_EGG:1 COW_SPAWN_EGG:1 CHICKEN_SPAWN_EGG:1'
|
||||||
repeatRewardText: '1 cocoa bean, 1 spawn egg(chicken,cow,pig)'
|
repeatRewardText: '1 cocoa bean, 1 spawn egg (chicken,cow,pig)'
|
||||||
repeatMoneyReward: 20
|
repeatMoneyReward: 20
|
||||||
repeatExpReward: 20
|
repeatExpReward: 20
|
||||||
# Max times limits how many times a challenge can be done. Comment out to make unlimited
|
# Max times limits how many times a challenge can be done. Comment out to make unlimited
|
||||||
maxtimes: 100
|
maxtimes: 100
|
||||||
angler:
|
angler:
|
||||||
friendlyname: 'Angler'
|
friendlyname: 'Angler'
|
||||||
description: 'Catch and cook 10 standard fish (no salmon)'
|
description: 'Catch and cook 10 salmon fish'
|
||||||
icon: COOKED_FISH
|
icon: COOKED_SALMON
|
||||||
level: 'Competent'
|
level: 'Competent'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'COOKED_FISH:10'
|
requiredItems: 'COOKED_SALMON:10'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'REDSTONE:16 IRON_ORE:5 INK_SACK:5'
|
itemReward: 'REDSTONE:16 IRON_ORE:5 INK_SAC:5'
|
||||||
rewardText: '16 redstone dust, 5 inksacs, 5 iron (ore)'
|
rewardText: '16 redstone dust, 5 inksacs, 5 iron (ore)'
|
||||||
moneyReward: 75
|
moneyReward: 75
|
||||||
expReward: 75
|
expReward: 75
|
||||||
permissionReward: ''
|
permissionReward: ''
|
||||||
repeatable: true
|
repeatable: true
|
||||||
repeatItemReward: 'REDSTONE:2 IRON_ORE:1 INK_SACK:1'
|
repeatItemReward: 'REDSTONE:2 IRON_ORE:1 INK_SAC:1'
|
||||||
repeatRewardText: '2 redstone dust, 1 inksac, 1 iron (ore)'
|
repeatRewardText: '2 redstone dust, 1 inksac, 1 iron (ore)'
|
||||||
repeatMoneyReward: 15
|
repeatMoneyReward: 15
|
||||||
repeatExpReward: 15
|
repeatExpReward: 15
|
||||||
@ -363,13 +363,13 @@ challenges:
|
|||||||
maxtimes: 100
|
maxtimes: 100
|
||||||
treecutter:
|
treecutter:
|
||||||
friendlyname: 'Treecutter'
|
friendlyname: 'Treecutter'
|
||||||
description: 'Create a tree farm and collect 16 oak, birch, jungle, and spruce logs'
|
description: 'Create a tree farm and collect 16 oak, birch, jungle, acacia, dark oak and spruce logs'
|
||||||
icon: LOG
|
icon: OAK_LOG
|
||||||
level: 'Competent'
|
level: 'Competent'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'LOG:0:16 LOG:1:16 LOG:2:16 LOG:3:16'
|
requiredItems: 'OAK_LOG:16 BIRCH_LOG:16 JUNGLE_LOG:16 SPRUCE_LOG:16 ACACIA_LOG:16 DARK_OAK_LOG:16'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'REDSTONE:16 IRON_ORE:5 MONSTER_EGG:WOLF:1'
|
itemReward: 'REDSTONE:16 IRON_ORE:5 WOLF_SPAWN_EGG:1'
|
||||||
rewardText: '16 redstone dust, 5 iron (ore), 1 wolf spawn egg'
|
rewardText: '16 redstone dust, 5 iron (ore), 1 wolf spawn egg'
|
||||||
moneyReward: 75
|
moneyReward: 75
|
||||||
expReward: 75
|
expReward: 75
|
||||||
@ -421,17 +421,17 @@ challenges:
|
|||||||
repeatExpReward: 0
|
repeatExpReward: 0
|
||||||
homestead:
|
homestead:
|
||||||
friendlyname: 'Homestead'
|
friendlyname: 'Homestead'
|
||||||
description: 'Build a house that contains at least 1 wooden door, bed, bookshelf, crafting table, furnace, glass-block window, and torch.'
|
description: 'Build a house that contains at least 1 oak door, white bed, bookshelf, crafting table, furnace, glass-block window, and wall torch.'
|
||||||
icon: BED
|
icon: WHITE_BED
|
||||||
level: 'Competent'
|
level: 'Competent'
|
||||||
type: island
|
type: island
|
||||||
requiredItems: 'BED_BLOCK:1 WORKBENCH:1 GLASS:1 WOODEN_DOOR:1 FURNACE:1 BOOKSHELF:1 TORCH:1'
|
requiredItems: 'WHITE_BED:1 CRAFTING_TABLE:1 GLASS:1 OAK_DOOR:1 FURNACE:1 BOOKSHELF:1 WALL_TORCH:1'
|
||||||
# Search radius - the number of blocks that will be searched around the player
|
# Search radius - the number of blocks that will be searched around the player
|
||||||
# Minimum 10, which searches from -10 to +10 blocks around the player in x,y,z
|
# Minimum 10, which searches from -10 to +10 blocks around the player in x,y,z
|
||||||
# Max is 50 because big searches cause lag
|
# Max is 50 because big searches cause lag
|
||||||
searchRadius: 10
|
searchRadius: 10
|
||||||
takeItems: false
|
takeItems: false
|
||||||
itemReward: 'JUKEBOX:1 RECORD_12:1 LAPIS_BLOCK:10'
|
itemReward: 'JUKEBOX:1 MUSIC_DISC_CHIRP:1 LAPIS_BLOCK:10'
|
||||||
rewardText: '1 jukebox, 1 music disk, 10 lapis lazuli blocks'
|
rewardText: '1 jukebox, 1 music disk, 10 lapis lazuli blocks'
|
||||||
moneyReward: 100
|
moneyReward: 100
|
||||||
expReward: 100
|
expReward: 100
|
||||||
@ -447,7 +447,7 @@ challenges:
|
|||||||
icon: NETHERRACK
|
icon: NETHERRACK
|
||||||
level: 'Expert'
|
level: 'Expert'
|
||||||
type: island
|
type: island
|
||||||
requiredItems: 'OBSIDIAN:10 PORTAL:1'
|
requiredItems: 'OBSIDIAN:10 NETHER_PORTAL:1'
|
||||||
takeItems: false
|
takeItems: false
|
||||||
itemReward: 'DIAMOND_SWORD:1'
|
itemReward: 'DIAMOND_SWORD:1'
|
||||||
rewardText: '1 diamond sword'
|
rewardText: '1 diamond sword'
|
||||||
@ -525,9 +525,9 @@ challenges:
|
|||||||
icon: MAP
|
icon: MAP
|
||||||
level: 'Expert'
|
level: 'Expert'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'NETHERRACK:64 SOUL_SAND:16 GHAST_TEAR:1 MAP:1 COMPASS:1 WATCH:1'
|
requiredItems: 'NETHERRACK:64 SOUL_SAND:16 GHAST_TEAR:1 MAP:1 COMPASS:1 CLOCK:1'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'POWERED_RAIL:32 RAILS:256 DIAMOND:1 MONSTER_EGG:OCELOT:1'
|
itemReward: 'POWERED_RAIL:32 RAIL:256 DIAMOND:1 OCELOT_SPAWN_EGG:1'
|
||||||
rewardText: '256 rails, 32 powered rails, 1 ocelot spawn egg, 1 diamond'
|
rewardText: '256 rails, 32 powered rails, 1 ocelot spawn egg, 1 diamond'
|
||||||
moneyReward: 100
|
moneyReward: 100
|
||||||
expReward: 100
|
expReward: 100
|
||||||
@ -560,18 +560,18 @@ challenges:
|
|||||||
shepherd:
|
shepherd:
|
||||||
friendlyname: 'Shepherd'
|
friendlyname: 'Shepherd'
|
||||||
description: 'Collect 5 of every color of wool'
|
description: 'Collect 5 of every color of wool'
|
||||||
icon: WOOL:2
|
icon: BLUE_WOOL
|
||||||
level: 'Advanced'
|
level: 'Advanced'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'WOOL:0:5 WOOL:1:5 WOOL:2:5 WOOL:3:5 WOOL:4:5 WOOL:5:5 WOOL:6:5 WOOL:7:5 WOOL:8:5 WOOL:9:5 WOOL:10:5 WOOL:11:5 WOOL:12:5 WOOL:13:5 WOOL:14:5 WOOL:15:5'
|
requiredItems: 'BLACK_WOOL:5 BLUE_WOOL:5 BROWN_WOOL:5 CYAN_WOOL:5 GRAY_WOOL:5 GREEN_WOOL:5 LIGHT_BLUE_WOOL:5 LIGHT_GRAY_WOOL:5 LIME_WOOL:5 MAGENTA_WOOL:5 ORANGE_WOOL:5 PINK_WOOL:5 PURPLE_WOOL:5 RED_WOOL:5 WHITE_WOOL:5 YELLOW_WOOL:5 '
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'DIAMOND:2 RECORD_7:1 RECORD_8:1 RECORD_6:1 MONSTER_EGG:SHEEP:1 EMERALD:5'
|
itemReward: 'DIAMOND:2 MUSIC_DISC_CAT:1 MUSIC_DISC_BLOCKS:1 MUSIC_DISC_STAL:1 SHEEP_SPAWN_EGG:1 EMERALD:5'
|
||||||
rewardText: '2 diamonds, 5 emeralds, 3 music disks, 1 sheep spawn egg'
|
rewardText: '2 diamonds, 5 emeralds, 3 music disks, 1 sheep spawn egg'
|
||||||
moneyReward: 200
|
moneyReward: 200
|
||||||
expReward: 200
|
expReward: 200
|
||||||
permissionReward: ''
|
permissionReward: ''
|
||||||
repeatable: true
|
repeatable: true
|
||||||
repeatItemReward: 'EMERALD:1 MONSTER_EGG:SHEEP:1'
|
repeatItemReward: 'EMERALD:1 SHEEP_SPAWN_EGG:1'
|
||||||
repeatRewardText: '1 emerald, 1 sheep spawn egg'
|
repeatRewardText: '1 emerald, 1 sheep spawn egg'
|
||||||
repeatMoneyReward: 20
|
repeatMoneyReward: 20
|
||||||
repeatExpReward: 20
|
repeatExpReward: 20
|
||||||
@ -580,13 +580,13 @@ challenges:
|
|||||||
alchemist:
|
alchemist:
|
||||||
friendlyname: 'Alchemist'
|
friendlyname: 'Alchemist'
|
||||||
description: 'Brew 1 potion of Fire Resistance, Slowness, Swiftness, Healing, Harming, Invisibility, Strength and Regeneration'
|
description: 'Brew 1 potion of Fire Resistance, Slowness, Swiftness, Healing, Harming, Invisibility, Strength and Regeneration'
|
||||||
icon: BREWING_STAND_ITEM
|
icon: BREWING_STAND
|
||||||
level: 'Advanced'
|
level: 'Advanced'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'POTION:FIRE_RESISTANCE::::1 POTION:SLOWNESS::::1 POTION:SPEED::::1 POTION:INSTANT_HEAL::::1 POTION:INSTANT_DAMAGE::::1 POTION:INVISIBILITY::::1 POTION:STRENGTH::::1 POTION:REGEN::::1'
|
requiredItems: 'POTION:FIRE_RESISTANCE::::1 POTION:SLOWNESS::::1 POTION:SPEED::::1 POTION:INSTANT_HEAL::::1 POTION:INSTANT_DAMAGE::::1 POTION:INVISIBILITY::::1 POTION:STRENGTH::::1 POTION:REGEN::::1'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'ENCHANTMENT_TABLE:1'
|
itemReward: 'ENCHANTING_TABLE:1'
|
||||||
rewardText: 'Enchantment Table'
|
rewardText: 'Enchanting Table'
|
||||||
moneyReward: 200
|
moneyReward: 200
|
||||||
expReward: 200
|
expReward: 200
|
||||||
permissionReward: ''
|
permissionReward: ''
|
||||||
@ -598,10 +598,10 @@ challenges:
|
|||||||
dj:
|
dj:
|
||||||
friendlyname: 'DJ'
|
friendlyname: 'DJ'
|
||||||
description: 'Craft a jukebox and collect all music discs'
|
description: 'Craft a jukebox and collect all music discs'
|
||||||
icon: RECORD_5
|
icon: MUSIC_DISC_CHIRP
|
||||||
level: 'Advanced'
|
level: 'Advanced'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'GOLD_RECORD:1 GREEN_RECORD:1 RECORD_3:1 RECORD_4:1 RECORD_5:1 RECORD_6:1 RECORD_7:1 RECORD_8:1 RECORD_9:1 RECORD_10:1 RECORD_11:1 RECORD_12:1 JUKEBOX:1'
|
requiredItems: 'MUSIC_DISC_11:1 MUSIC_DISC_13:1 MUSIC_DISC_BLOCKS:1 MUSIC_DISC_CAT:1 MUSIC_DISC_CHIRP:1 MUSIC_DISC_FAR:1 MUSIC_DISC_MALL:1 MUSIC_DISC_MELLOHI:1 MUSIC_DISC_STAL:1 MUSIC_DISC_STRAD:1 MUSIC_DISC_WAIT:1 MUSIC_DISC_WARD:1 JUKEBOX:1'
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'DIAMOND:3 EMERALD:10 GOLD_INGOT:5'
|
itemReward: 'DIAMOND:3 EMERALD:10 GOLD_INGOT:5'
|
||||||
rewardText: '3 diamonds, 10 emeralds and 5 gold ingots'
|
rewardText: '3 diamonds, 10 emeralds and 5 gold ingots'
|
||||||
@ -641,17 +641,15 @@ challenges:
|
|||||||
icon: GOLDEN_APPLE
|
icon: GOLDEN_APPLE
|
||||||
level: 'Advanced'
|
level: 'Advanced'
|
||||||
type: inventory
|
type: inventory
|
||||||
requiredItems: 'BAKED_POTATO:1 BREAD:1 CAKE:1 COOKED_CHICKEN:1 COOKED_FISH:1 GRILLED_PORK:1 COOKIE:1 GOLDEN_APPLE:0:1 GOLDEN_CARROT:1 MUSHROOM_SOUP:1 PUMPKIN_PIE:1 COOKED_BEEF:1'
|
requiredItems: 'BAKED_POTATO:1 BREAD:1 CAKE:1 COOKED_CHICKEN:1 COOKED_COD:1 COOKED_SALMON:1 COOKED_PORKCHOP:1 COOKED_RABBIT:1 COOKIE:1 GOLDEN_APPLE:0:1 GOLDEN_CARROT:1 MUSHROOM_STEW:1 PUMPKIN_PIE:1 COOKED_BEEF:1'
|
||||||
# If you are running 1.8 change to this:
|
|
||||||
# requiredItems: 'BAKED_POTATO:1 BREAD:1 CAKE:1 COOKED_CHICKEN:1 COOKED_FISH:1 GRILLED_PORK:1 COOKIE:1 GOLDEN_APPLE:0:1 GOLDEN_CARROT:1 MUSHROOM_SOUP:1 PUMPKIN_PIE:1 COOKED_BEEF:1 COOKED_RABBIT:1 RABBIT_STEW:1 COOKED_MUTTON:1'
|
|
||||||
takeItems: true
|
takeItems: true
|
||||||
itemReward: 'GOLD_BLOCK:2 GREEN_RECORD:1 RECORD_3:1 RECORD_5:1 MONSTER_EGG:MUSHROOM_COW:1 EMERALD:5'
|
itemReward: 'GOLD_BLOCK:2 MUSIC_DISC_MALL:1 MUSIC_DISC_WAIT:1 MUSIC_DISC_13:1 MOOSHROOM_SPAWN_EGG:1 EMERALD:5'
|
||||||
rewardText: '2 gold blocks, 3 music discs, 1 mooshroom spawn egg, and 5 emeralds'
|
rewardText: '2 gold blocks, 3 music discs, 1 mooshroom spawn egg, and 5 emeralds'
|
||||||
moneyReward: 200
|
moneyReward: 200
|
||||||
expReward: 200
|
expReward: 200
|
||||||
permissionReward: ''
|
permissionReward: ''
|
||||||
repeatable: true
|
repeatable: true
|
||||||
repeatItemReward: 'GOLD_INGOT:10 MONSTER_EGG:MUSHROOM_COW:1 EMERALD:1'
|
repeatItemReward: 'GOLD_INGOT:10 MOOSHROOM_SPAWN_EGG:1 EMERALD:1'
|
||||||
repeatRewardText: '10 gold ingots, 1 mooshroom spawn egg, 1 emerald'
|
repeatRewardText: '10 gold ingots, 1 mooshroom spawn egg, 1 emerald'
|
||||||
repeatMoneyReward: 20
|
repeatMoneyReward: 20
|
||||||
repeatExpReward: 20
|
repeatExpReward: 20
|
||||||
@ -665,7 +663,7 @@ challenges:
|
|||||||
type: island
|
type: island
|
||||||
requiredItems: 'BEACON:1'
|
requiredItems: 'BEACON:1'
|
||||||
takeItems: false
|
takeItems: false
|
||||||
itemReward: 'SMOOTH_BRICK:20 SMOOTH_BRICK:1:20 SMOOTH_BRICK:2:20 SMOOTH_BRICK:3:20'
|
itemReward: 'STONE_BRICKS:20 CHISELED_STONE_BRICKS:20 CRACKED_STONE_BRICKS:20 MOSSY_STONE_BRICKS:20'
|
||||||
rewardText: '20 blocks of every kind of stone brick'
|
rewardText: '20 blocks of every kind of stone brick'
|
||||||
moneyReward: 300
|
moneyReward: 300
|
||||||
expReward: 300
|
expReward: 300
|
||||||
@ -701,7 +699,7 @@ challenges:
|
|||||||
type: island
|
type: island
|
||||||
requiredItems: 'IRON_GOLEM:1'
|
requiredItems: 'IRON_GOLEM:1'
|
||||||
takeItems: false
|
takeItems: false
|
||||||
itemReward: 'NAME_TAG:1 ANVIL:1 CAULDRON_ITEM:1 IRON_BLOCK:2'
|
itemReward: 'NAME_TAG:1 ANVIL:1 CAULDRON:1 IRON_BLOCK:2'
|
||||||
rewardText: 'A name tag, an anvil, a cauldron and 2 iron blocks'
|
rewardText: 'A name tag, an anvil, a cauldron and 2 iron blocks'
|
||||||
moneyReward: 300
|
moneyReward: 300
|
||||||
expReward: 300
|
expReward: 300
|
||||||
@ -714,12 +712,12 @@ challenges:
|
|||||||
snowplay:
|
snowplay:
|
||||||
friendlyname: 'Snow Play!'
|
friendlyname: 'Snow Play!'
|
||||||
description: 'Build a snow golem'
|
description: 'Build a snow golem'
|
||||||
icon: SNOW_BALL
|
icon: SNOWBALL
|
||||||
level: 'Advanced'
|
level: 'Advanced'
|
||||||
type: island
|
type: island
|
||||||
requiredItems: 'SNOWMAN:1'
|
requiredItems: 'SNOWMAN:1'
|
||||||
takeItems: false
|
takeItems: false
|
||||||
itemReward: 'DIAMOND_SPADE:1'
|
itemReward: 'DIAMOND_SHOVEL:1'
|
||||||
rewardText: 'A diamond spade - get shoveling!'
|
rewardText: 'A diamond spade - get shoveling!'
|
||||||
moneyReward: 300
|
moneyReward: 300
|
||||||
expReward: 300
|
expReward: 300
|
||||||
@ -750,12 +748,12 @@ challenges:
|
|||||||
itsamonsterparty:
|
itsamonsterparty:
|
||||||
friendlyname: "It's a Monster Party"
|
friendlyname: "It's a Monster Party"
|
||||||
description: 'Have a party - all monsters invited! Get close to a Skeleton, Zombie, Spider, Creeper and Enderman all at the same time.'
|
description: 'Have a party - all monsters invited! Get close to a Skeleton, Zombie, Spider, Creeper and Enderman all at the same time.'
|
||||||
icon: SKULL_ITEM
|
icon: SKELETON_SKULL
|
||||||
level: 'Advanced'
|
level: 'Advanced'
|
||||||
type: island
|
type: island
|
||||||
requiredItems: 'SKELETON:1 ZOMBIE:1 SPIDER:1 CREEPER:1 ENDERMAN:1'
|
requiredItems: 'SKELETON:1 ZOMBIE:1 SPIDER:1 CREEPER:1 ENDERMAN:1'
|
||||||
takeItems: false
|
takeItems: false
|
||||||
itemReward: 'SKULL_ITEM:0:2 SKULL_ITEM:2:2 SKULL_ITEM:3:2'
|
itemReward: 'SKELETON_SKULL:1 ZOMBIE_HEAD:1 CREEPER_HEAD:1'
|
||||||
rewardText: 'Skulls!'
|
rewardText: 'Skulls!'
|
||||||
moneyReward: 200
|
moneyReward: 200
|
||||||
expReward: 400
|
expReward: 400
|
||||||
|
6
pom.xml
6
pom.xml
@ -44,12 +44,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
<version>1.13-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>us.tastybento</groupId>
|
<groupId>world.bentobox</groupId>
|
||||||
<artifactId>bskyblock</artifactId>
|
<artifactId>bentobox</artifactId>
|
||||||
<version>LATEST</version>
|
<version>LATEST</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -4,8 +4,8 @@ import org.bukkit.Bukkit;
|
|||||||
|
|
||||||
import bskyblock.addon.challenges.commands.ChallengesCommand;
|
import bskyblock.addon.challenges.commands.ChallengesCommand;
|
||||||
import bskyblock.addon.challenges.commands.admin.ChallengesAdminImportCommand;
|
import bskyblock.addon.challenges.commands.admin.ChallengesAdminImportCommand;
|
||||||
import us.tastybento.bskyblock.api.addons.Addon;
|
import world.bentobox.bentobox.api.addons.Addon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add-on to BSkyBlock that enables challenges
|
* Add-on to BSkyBlock that enables challenges
|
||||||
@ -21,7 +21,7 @@ public class ChallengesAddon extends Addon {
|
|||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
// Check if it is enabled - it might be loaded, but not enabled.
|
// Check if it is enabled - it might be loaded, but not enabled.
|
||||||
if (getBSkyBlock() == null || !getBSkyBlock().isEnabled()) {
|
if (getPlugin() == null || !getPlugin().isEnabled()) {
|
||||||
Bukkit.getLogger().severe("BSkyBlock is not available or disabled!");
|
Bukkit.getLogger().severe("BSkyBlock is not available or disabled!");
|
||||||
this.setEnabled(false);
|
this.setEnabled(false);
|
||||||
return;
|
return;
|
||||||
@ -34,19 +34,26 @@ public class ChallengesAddon extends Addon {
|
|||||||
|
|
||||||
// Register commands - run one tick later to allow all addons to load
|
// Register commands - run one tick later to allow all addons to load
|
||||||
// AcidIsland hook in
|
// AcidIsland hook in
|
||||||
getServer().getScheduler().runTask(getBSkyBlock(), () -> {
|
getServer().getScheduler().runTask(getPlugin(), () -> {
|
||||||
this.getBSkyBlock().getAddonsManager().getAddonByName("AcidIsland").ifPresent(a -> {
|
this.getPlugin().getAddonsManager().getAddonByName("AcidIsland").ifPresent(a -> {
|
||||||
CompositeCommand acidIslandCmd = getBSkyBlock().getCommandsManager().getCommand("ai");
|
CompositeCommand acidIslandCmd = getPlugin().getCommandsManager().getCommand("ai");
|
||||||
new ChallengesCommand(this, acidIslandCmd);
|
if (acidIslandCmd != null) {
|
||||||
CompositeCommand acidCmd = getBSkyBlock().getCommandsManager().getCommand("acid");
|
new ChallengesCommand(this, acidIslandCmd);
|
||||||
new ChallengesAdminImportCommand(this, acidCmd);
|
CompositeCommand acidCmd = getPlugin().getCommandsManager().getCommand("acid");
|
||||||
|
new ChallengesAdminImportCommand(this, acidCmd);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.getPlugin().getAddonsManager().getAddonByName("BSkyBlock").ifPresent(a -> {
|
||||||
|
// BSkyBlock hook in
|
||||||
|
CompositeCommand bsbIslandCmd = getPlugin().getCommandsManager().getCommand("island");
|
||||||
|
if (bsbIslandCmd != null) {
|
||||||
|
new ChallengesCommand(this, bsbIslandCmd);
|
||||||
|
CompositeCommand bsbAdminCmd = getPlugin().getCommandsManager().getCommand("bsbadmin");
|
||||||
|
new ChallengesAdminImportCommand(this, bsbAdminCmd);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
// BSkyBlock hook in
|
|
||||||
CompositeCommand bsbIslandCmd = getBSkyBlock().getCommandsManager().getCommand("island");
|
|
||||||
new ChallengesCommand(this, bsbIslandCmd);
|
|
||||||
CompositeCommand bsbAdminCmd = getBSkyBlock().getCommandsManager().getCommand("bsbadmin");
|
|
||||||
new ChallengesAdminImportCommand(this, bsbAdminCmd);
|
|
||||||
// Done
|
// Done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,10 +26,10 @@ import bskyblock.addon.challenges.database.object.Challenges;
|
|||||||
import bskyblock.addon.challenges.database.object.Challenges.ChallengeType;
|
import bskyblock.addon.challenges.database.object.Challenges.ChallengeType;
|
||||||
import bskyblock.addon.challenges.database.object.PlayerData;
|
import bskyblock.addon.challenges.database.object.PlayerData;
|
||||||
import bskyblock.addon.challenges.panel.ChallengesPanels;
|
import bskyblock.addon.challenges.panel.ChallengesPanels;
|
||||||
import us.tastybento.bskyblock.api.configuration.BSBConfig;
|
import world.bentobox.bentobox.api.configuration.BSBConfig;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import us.tastybento.bskyblock.database.BSBDatabase;
|
import world.bentobox.bentobox.database.BSBDatabase;
|
||||||
import us.tastybento.bskyblock.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
|
|
||||||
public class ChallengesManager {
|
public class ChallengesManager {
|
||||||
|
|
||||||
@ -53,7 +53,7 @@ public class ChallengesManager {
|
|||||||
challengeMap = new LinkedHashMap<>();
|
challengeMap = new LinkedHashMap<>();
|
||||||
// Cache of player data
|
// Cache of player data
|
||||||
playerData = new HashMap<>();
|
playerData = new HashMap<>();
|
||||||
load();
|
load();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -130,7 +130,7 @@ public class ChallengesManager {
|
|||||||
newChallenge.setRequiredItems(requiredItems);
|
newChallenge.setRequiredItems(requiredItems);
|
||||||
newChallenge.setTakeItems(true);
|
newChallenge.setTakeItems(true);
|
||||||
newChallenge.setUniqueId(inventory.getTitle());
|
newChallenge.setUniqueId(inventory.getTitle());
|
||||||
newChallenge.setIcon(new ItemStack(Material.EMPTY_MAP));
|
newChallenge.setIcon(new ItemStack(Material.MAP));
|
||||||
newChallenge.setLevel(FREE);
|
newChallenge.setLevel(FREE);
|
||||||
newChallenge.setDescription(createDescription(user, requiredItems));
|
newChallenge.setDescription(createDescription(user, requiredItems));
|
||||||
|
|
||||||
@ -197,7 +197,7 @@ public class ChallengesManager {
|
|||||||
* @param world - world to check
|
* @param world - world to check
|
||||||
* @return - challenge or null if it does not exist
|
* @return - challenge or null if it does not exist
|
||||||
*/
|
*/
|
||||||
public Challenges getChallenge(String name, World world) {
|
public Challenges getChallenge(String name, World world) {
|
||||||
String worldName = Util.getWorld(world).getName();
|
String worldName = Util.getWorld(world).getName();
|
||||||
for (Set<Challenges> ch : challengeMap.values()) {
|
for (Set<Challenges> ch : challengeMap.values()) {
|
||||||
Optional<Challenges> challenge = ch.stream().filter(c -> c.getUniqueId().equalsIgnoreCase(worldName + name)).findFirst();
|
Optional<Challenges> challenge = ch.stream().filter(c -> c.getUniqueId().equalsIgnoreCase(worldName + name)).findFirst();
|
||||||
@ -249,7 +249,7 @@ public class ChallengesManager {
|
|||||||
/**
|
/**
|
||||||
* Get the set of challenges for this level for this world
|
* Get the set of challenges for this level for this world
|
||||||
* @param level - the level required
|
* @param level - the level required
|
||||||
* @param world
|
* @param world
|
||||||
* @return the set of challenges for this level, or the first set of challenges if level is blank, or a blank list if there are no challenges
|
* @return the set of challenges for this level, or the first set of challenges if level is blank, or a blank list if there are no challenges
|
||||||
*/
|
*/
|
||||||
public Set<Challenges> getChallenges(String level, World world) {
|
public Set<Challenges> getChallenges(String level, World world) {
|
||||||
@ -257,7 +257,7 @@ public class ChallengesManager {
|
|||||||
Optional<ChallengeLevels> lv = challengeMap.keySet().stream().filter(l -> l.getUniqueId().equalsIgnoreCase(level)).findFirst();
|
Optional<ChallengeLevels> lv = challengeMap.keySet().stream().filter(l -> l.getUniqueId().equalsIgnoreCase(level)).findFirst();
|
||||||
// Get the challenges applicable to this world
|
// Get the challenges applicable to this world
|
||||||
return lv.isPresent() ? challengeMap.get(lv.get()).stream()
|
return lv.isPresent() ? challengeMap.get(lv.get()).stream()
|
||||||
.filter(c -> c.getWorld().equalsIgnoreCase(worldName) || c.getWorld().isEmpty()).collect(Collectors.toSet())
|
.filter(c -> c.getWorld().equalsIgnoreCase(worldName) || c.getWorld().isEmpty()).collect(Collectors.toSet())
|
||||||
: new HashSet<>();
|
: new HashSet<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -356,7 +356,7 @@ public class ChallengesManager {
|
|||||||
*/
|
*/
|
||||||
public void save(boolean async) {
|
public void save(boolean async) {
|
||||||
if (async) {
|
if (async) {
|
||||||
addon.getServer().getScheduler().runTaskAsynchronously(addon.getBSkyBlock(), this::save);
|
addon.getServer().getScheduler().runTaskAsynchronously(addon.getPlugin(), this::save);
|
||||||
} else {
|
} else {
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
@ -18,8 +18,8 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import bskyblock.addon.challenges.database.object.ChallengeLevels;
|
import bskyblock.addon.challenges.database.object.ChallengeLevels;
|
||||||
import bskyblock.addon.challenges.database.object.Challenges;
|
import bskyblock.addon.challenges.database.object.Challenges;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import us.tastybento.bskyblock.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Imports challenges
|
* Imports challenges
|
||||||
@ -42,7 +42,7 @@ public class FreshSqueezedChallenges {
|
|||||||
addon.saveResource("challenges.yml",false);
|
addon.saveResource("challenges.yml",false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Import challenges
|
* Import challenges
|
||||||
* @param user - user
|
* @param user - user
|
||||||
@ -101,8 +101,8 @@ public class FreshSqueezedChallenges {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Imports challenges
|
* Imports challenges
|
||||||
* @param overwrite
|
* @param overwrite
|
||||||
* @param args
|
* @param args
|
||||||
*/
|
*/
|
||||||
private void makeChallenges(User user, World world, boolean overwrite) {
|
private void makeChallenges(User user, World world, boolean overwrite) {
|
||||||
int size = 0;
|
int size = 0;
|
||||||
@ -114,7 +114,7 @@ public class FreshSqueezedChallenges {
|
|||||||
newChallenge.setDeployed(true);
|
newChallenge.setDeployed(true);
|
||||||
ConfigurationSection details = chals.getConfigurationSection(challenge);
|
ConfigurationSection details = chals.getConfigurationSection(challenge);
|
||||||
newChallenge.setFriendlyName(details.getString("friendlyname", challenge));
|
newChallenge.setFriendlyName(details.getString("friendlyname", challenge));
|
||||||
newChallenge.setWorld(Util.getWorld(world).getName());
|
newChallenge.setWorld(Util.getWorld(world).getName());
|
||||||
newChallenge.setDescription(addon.getChallengesManager().stringSplit(details.getString("description", "")));
|
newChallenge.setDescription(addon.getChallengesManager().stringSplit(details.getString("description", "")));
|
||||||
newChallenge.setIcon(new ParseItem(addon, details.getString("icon") + ":1").getItem());
|
newChallenge.setIcon(new ParseItem(addon, details.getString("icon") + ":1").getItem());
|
||||||
newChallenge.setLevel(details.getString("level", ChallengesManager.FREE));
|
newChallenge.setLevel(details.getString("level", ChallengesManager.FREE));
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
package bskyblock.addon.challenges;
|
package bskyblock.addon.challenges;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.PotionMeta;
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
import org.bukkit.inventory.meta.SpawnEggMeta;
|
|
||||||
import org.bukkit.potion.PotionData;
|
import org.bukkit.potion.PotionData;
|
||||||
import org.bukkit.potion.PotionType;
|
import org.bukkit.potion.PotionType;
|
||||||
|
|
||||||
@ -40,6 +37,7 @@ public class ParseItem {
|
|||||||
} else if (part.length == 6 && (part[0].contains("POTION") || part[0].equalsIgnoreCase("TIPPED_ARROW"))) {
|
} else if (part.length == 6 && (part[0].contains("POTION") || part[0].equalsIgnoreCase("TIPPED_ARROW"))) {
|
||||||
return potion(s, part);
|
return potion(s, part);
|
||||||
}
|
}
|
||||||
|
showError(s);
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -89,23 +87,16 @@ public class ParseItem {
|
|||||||
String[] twoer = {part[0], part[2]};
|
String[] twoer = {part[0], part[2]};
|
||||||
ItemStack result = two(s, twoer);
|
ItemStack result = two(s, twoer);
|
||||||
if (result == null) {
|
if (result == null) {
|
||||||
|
showError(s);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (StringUtils.isNumeric(part[1])) {
|
|
||||||
result.setDurability((short) Integer.parseInt(part[1]));
|
|
||||||
} else if (result.getType().equals(Material.MONSTER_EGG)) {
|
|
||||||
// Check if this is a string
|
|
||||||
EntityType entityType = EntityType.valueOf(part[1]);
|
|
||||||
SpawnEggMeta meta = ((SpawnEggMeta)result.getItemMeta());
|
|
||||||
meta.setSpawnedType(entityType);
|
|
||||||
result.setItemMeta(meta);
|
|
||||||
}
|
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void showError(String s) {
|
private void showError(String s) {
|
||||||
addon.getLogger().severe(() -> "Problem with " + s + " in challenges.yml!");
|
addon.getLogger().severe(() -> "Problem with " + s + " in config.yml!");
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack two(String s, String[] part) {
|
private ItemStack two(String s, String[] part) {
|
||||||
@ -113,10 +104,9 @@ public class ParseItem {
|
|||||||
try {
|
try {
|
||||||
reqAmount = Integer.parseInt(part[1]);
|
reqAmount = Integer.parseInt(part[1]);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
addon.getLogger().severe(() -> "Could not parse the quantity of the item " + s);
|
showError(s);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Material reqItem = Material.getMaterial(part[0].toUpperCase() + "_ITEM");
|
Material reqItem = Material.getMaterial(part[0].toUpperCase() + "_ITEM");
|
||||||
if (reqItem == null) {
|
if (reqItem == null) {
|
||||||
// Try the item
|
// Try the item
|
||||||
|
@ -4,35 +4,35 @@ import java.util.List;
|
|||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesAddon;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import bskyblock.addon.challenges.panel.ChallengesPanels;
|
import bskyblock.addon.challenges.panel.ChallengesPanels;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
public class ChallengesCommand extends CompositeCommand {
|
public class ChallengesCommand extends CompositeCommand {
|
||||||
public static final String CHALLENGE_COMMAND = "challenges";
|
public static final String CHALLENGE_COMMAND = "challenges";
|
||||||
private ChallengesAddon addon;
|
private ChallengesAddon addon;
|
||||||
|
|
||||||
public ChallengesCommand(ChallengesAddon addon, CompositeCommand cmd) {
|
public ChallengesCommand(ChallengesAddon addon, CompositeCommand cmd) {
|
||||||
super(cmd, CHALLENGE_COMMAND, "c", "challenge");
|
super(cmd, CHALLENGE_COMMAND);
|
||||||
this.addon = addon;
|
this.addon = addon;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// Open up the challenges GUI
|
// Open up the challenges GUI
|
||||||
if (user.isPlayer()) {
|
if (user.isPlayer()) {
|
||||||
new ChallengesPanels(addon, user, args.isEmpty() ? "" : args.get(0), getWorld(), getPermissionPrefix(), getTopLabel());
|
new ChallengesPanels(addon, user, args.isEmpty() ? "" : args.get(0), getWorld(), getPermissionPrefix(), getTopLabel());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.setOnlyPlayer(true);
|
this.setOnlyPlayer(true);
|
||||||
this.setPermission(getPermissionPrefix() + CHALLENGE_COMMAND);
|
this.setPermission(CHALLENGE_COMMAND);
|
||||||
this.setParameters(CHALLENGE_COMMAND + ".parameters");
|
this.setParameters(CHALLENGE_COMMAND + ".parameters");
|
||||||
this.setDescription(CHALLENGE_COMMAND + ".description");
|
this.setDescription(CHALLENGE_COMMAND + ".description");
|
||||||
this.setOnlyPlayer(true);
|
this.setOnlyPlayer(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,9 +5,9 @@ import java.util.List;
|
|||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesAddon;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import us.tastybento.bskyblock.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
|
|
||||||
public class ChallengesAdminImportCommand extends CompositeCommand {
|
public class ChallengesAdminImportCommand extends CompositeCommand {
|
||||||
|
|
||||||
@ -24,13 +24,13 @@ public class ChallengesAdminImportCommand extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
return addon.getImportManager().importChallenges(user, getWorld(), !args.isEmpty() && args.get(0).equalsIgnoreCase("overwrite"));
|
return addon.getImportManager().importChallenges(user, getWorld(), !args.isEmpty() && args.get(0).equalsIgnoreCase("overwrite"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.setPermission(getPermissionPrefix() + "challenges.admin");
|
this.setPermission("challenges.admin");
|
||||||
this.setParameters("challenges.admin.import.parameters");
|
this.setParameters("challenges.admin.import.parameters");
|
||||||
this.setDescription("challenges.admin.import.description");
|
this.setDescription("challenges.admin.import.description");
|
||||||
}
|
}
|
||||||
|
@ -4,9 +4,9 @@ import java.util.List;
|
|||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesAddon;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import bskyblock.addon.challenges.panel.CreateChallengeListener;
|
import bskyblock.addon.challenges.panel.CreateChallengeListener;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.panels.builders.PanelBuilder;
|
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
public class CreateChallenge extends CompositeCommand {
|
public class CreateChallenge extends CompositeCommand {
|
||||||
|
|
||||||
@ -27,14 +27,14 @@ public class CreateChallenge extends CompositeCommand {
|
|||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.setOnlyPlayer(true);
|
this.setOnlyPlayer(true);
|
||||||
this.setPermission(getPermissionPrefix() + "admin.challenges");
|
this.setPermission("admin.challenges");
|
||||||
this.setParameters("challaneges.admin.create.parameters");
|
this.setParameters("challaneges.admin.create.parameters");
|
||||||
this.setDescription("challenges.admin.create.description");
|
this.setDescription("challenges.admin.create.description");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
if (args.isEmpty()) {
|
if (args.isEmpty()) {
|
||||||
user.sendRawMessage("not enough args");
|
user.sendRawMessage("not enough args");
|
||||||
return false;
|
return false;
|
||||||
|
@ -17,9 +17,9 @@ import org.bukkit.event.player.PlayerInteractEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesAddon;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import us.tastybento.bskyblock.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Command to create a surrounding type challenge
|
* Command to create a surrounding type challenge
|
||||||
@ -39,19 +39,19 @@ public class CreateSurrounding extends CompositeCommand implements Listener {
|
|||||||
public CreateSurrounding(ChallengesAddon addon, CompositeCommand parent) {
|
public CreateSurrounding(ChallengesAddon addon, CompositeCommand parent) {
|
||||||
super(parent, "surrounding");
|
super(parent, "surrounding");
|
||||||
this.addon = addon;
|
this.addon = addon;
|
||||||
addon.getServer().getPluginManager().registerEvents(this, addon.getBSkyBlock());
|
addon.getServer().getPluginManager().registerEvents(this, addon.getPlugin());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
this.setOnlyPlayer(true);
|
this.setOnlyPlayer(true);
|
||||||
this.setPermission(getPermissionPrefix() + "admin.challenges");
|
this.setPermission("admin.challenges");
|
||||||
this.setParameters("challaneges.admin.create.surrounding.parameters");
|
this.setParameters("challaneges.admin.create.surrounding.parameters");
|
||||||
this.setDescription("challenges.admin.create.surrounding.description");
|
this.setDescription("challenges.admin.create.surrounding.description");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
if (args.isEmpty()) {
|
if (args.isEmpty()) {
|
||||||
user.sendMessage("challenges.admin.error.no-name");
|
user.sendMessage("challenges.admin.error.no-name");
|
||||||
return false;
|
return false;
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class MakeLevel extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public MakeLevel(BSkyBlock plugin, String label, String... string) {
|
public MakeLevel(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class MakeLevel extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class MakeLevel extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetDeployed extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetDeployed(BSkyBlock plugin, String label, String... string) {
|
public SetDeployed(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetDeployed extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetDeployed extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetDescription extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetDescription(BSkyBlock plugin, String label, String... string) {
|
public SetDescription(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetDescription extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetDescription extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetExp extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetExp(BSkyBlock plugin, String label, String... string) {
|
public SetExp(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetExp extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetExp extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetFriendlyName extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetFriendlyName(BSkyBlock plugin, String label, String... string) {
|
public SetFriendlyName(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetFriendlyName extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetFriendlyName extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
@ -9,8 +9,8 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesAddon;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import bskyblock.addon.challenges.database.object.Challenges;
|
import bskyblock.addon.challenges.database.object.Challenges;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -31,7 +31,7 @@ public class SetIcon extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -40,10 +40,10 @@ public class SetIcon extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
ItemStack icon = user.getInventory().getItemInMainHand();
|
ItemStack icon = user.getInventory().getItemInMainHand();
|
||||||
if (args.isEmpty() || icon == null) {
|
if (args.isEmpty() || icon == null) {
|
||||||
user.sendMessage("challenges.admin.seticon.description");
|
user.sendMessage("challenges.admin.seticon.description");
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetLevel extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetLevel(BSkyBlock plugin, String label, String... string) {
|
public SetLevel(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetLevel extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetLevel extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetMaxTimes extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetMaxTimes(BSkyBlock plugin, String label, String... string) {
|
public SetMaxTimes(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetMaxTimes extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetMaxTimes extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetPerm extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetPerm(BSkyBlock plugin, String label, String... string) {
|
public SetPerm(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetPerm extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetPerm extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetRepeatable extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetRepeatable(BSkyBlock plugin, String label, String... string) {
|
public SetRepeatable(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetRepeatable extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetRepeatable extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetReward extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetReward(BSkyBlock plugin, String label, String... string) {
|
public SetReward(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetReward extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetReward extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class SetType extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public SetType(BSkyBlock plugin, String label, String... string) {
|
public SetType(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class SetType extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class SetType extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ import org.bukkit.Material;
|
|||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesAddon;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enables the state of a Surrounding Challenge to be stored as it is built
|
* Enables the state of a Surrounding Challenge to be stored as it is built
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.commands.admin;
|
package bskyblock.addon.challenges.commands.admin;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.BSkyBlock;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.commands.CompositeCommand;
|
import world.bentobox.bentobox.api.commands.CompositeCommand;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tastybento
|
* @author tastybento
|
||||||
@ -20,7 +20,7 @@ public class TakeItems extends CompositeCommand {
|
|||||||
* @param label
|
* @param label
|
||||||
* @param string
|
* @param string
|
||||||
*/
|
*/
|
||||||
public TakeItems(BSkyBlock plugin, String label, String... string) {
|
public TakeItems(ChallengesAddon plugin, String label, String... string) {
|
||||||
super(plugin, label, string);
|
super(plugin, label, string);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
@ -45,7 +45,7 @@ public class TakeItems extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#setup()
|
* @see world.bentobox.bbox.api.commands.BSBCommand#setup()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setup() {
|
public void setup() {
|
||||||
@ -54,10 +54,10 @@ public class TakeItems extends CompositeCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.api.commands.BSBCommand#execute(us.tastybento.bskyblock.api.commands.User, java.util.List)
|
* @see world.bentobox.bbox.api.commands.BSBCommand#execute(world.bentobox.bbox.api.commands.User, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean execute(User user, List<String> args) {
|
public boolean execute(User user, String label, List<String> args) {
|
||||||
// TODO Auto-generated method stub
|
// TODO Auto-generated method stub
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -6,8 +6,8 @@ import java.util.List;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesManager;
|
import bskyblock.addon.challenges.ChallengesManager;
|
||||||
import us.tastybento.bskyblock.api.configuration.ConfigComment;
|
import world.bentobox.bentobox.api.configuration.ConfigComment;
|
||||||
import us.tastybento.bskyblock.database.objects.DataObject;
|
import world.bentobox.bentobox.database.objects.DataObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent a challenge level
|
* Represent a challenge level
|
||||||
|
@ -13,8 +13,8 @@ import org.bukkit.entity.EntityType;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesManager;
|
import bskyblock.addon.challenges.ChallengesManager;
|
||||||
import us.tastybento.bskyblock.api.configuration.ConfigComment;
|
import world.bentobox.bentobox.api.configuration.ConfigComment;
|
||||||
import us.tastybento.bskyblock.database.objects.DataObject;
|
import world.bentobox.bentobox.database.objects.DataObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data object for challenges
|
* Data object for challenges
|
||||||
@ -43,20 +43,20 @@ public class Challenges implements DataObject {
|
|||||||
*/
|
*/
|
||||||
ISLAND
|
ISLAND
|
||||||
}
|
}
|
||||||
|
|
||||||
// The order of the fields is the order shown in the YML files
|
// The order of the fields is the order shown in the YML files
|
||||||
@ConfigComment("Whether this challenge is deployed or not")
|
@ConfigComment("Whether this challenge is deployed or not")
|
||||||
private boolean deployed;
|
private boolean deployed;
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
@ConfigComment("Name of the icon and challenge. May include color codes. Single line.")
|
@ConfigComment("Name of the icon and challenge. May include color codes. Single line.")
|
||||||
private String friendlyName = "";
|
private String friendlyName = "";
|
||||||
@ConfigComment("Description of the challenge. Will become the lore on the icon. Can include & color codes. String List.")
|
@ConfigComment("Description of the challenge. Will become the lore on the icon. Can include & color codes. String List.")
|
||||||
private List<String> description = new ArrayList<>();
|
private List<String> description = new ArrayList<>();
|
||||||
@ConfigComment("The icon in the GUI for this challenge. ItemStack.")
|
@ConfigComment("The icon in the GUI for this challenge. ItemStack.")
|
||||||
private ItemStack icon = new ItemStack(Material.PAPER);
|
private ItemStack icon = new ItemStack(Material.PAPER);
|
||||||
@ConfigComment("Icon slot where this challenge should be placed. 0 to 49. A negative value means any slot")
|
@ConfigComment("Icon slot where this challenge should be placed. 0 to 49. A negative value means any slot")
|
||||||
private int slot = -1;
|
private int slot = -1;
|
||||||
|
|
||||||
// Definition
|
// Definition
|
||||||
@ConfigComment("Challenge level. Default is Free")
|
@ConfigComment("Challenge level. Default is Free")
|
||||||
@ -66,7 +66,7 @@ public class Challenges implements DataObject {
|
|||||||
@ConfigComment("World where this challenge operates. List only overworld. Nether and end are automatically covered.")
|
@ConfigComment("World where this challenge operates. List only overworld. Nether and end are automatically covered.")
|
||||||
private String world = "";
|
private String world = "";
|
||||||
@ConfigComment("List of environments where this challenge will occur: NETHER, NORMAL, THE_END. Leave blank for all.")
|
@ConfigComment("List of environments where this challenge will occur: NETHER, NORMAL, THE_END. Leave blank for all.")
|
||||||
private List<World.Environment> environment = new ArrayList<>();
|
private List<World.Environment> environment = new ArrayList<>();
|
||||||
@ConfigComment("The required permissions to see this challenge. String list.")
|
@ConfigComment("The required permissions to see this challenge. String list.")
|
||||||
private Set<String> reqPerms = new HashSet<>();
|
private Set<String> reqPerms = new HashSet<>();
|
||||||
@ConfigComment("The number of blocks around the player to search for items on an island")
|
@ConfigComment("The number of blocks around the player to search for items on an island")
|
||||||
@ -82,7 +82,7 @@ public class Challenges implements DataObject {
|
|||||||
@ConfigComment("This is a map of the blocks required in a SURROUNDING challenge. Material, Integer")
|
@ConfigComment("This is a map of the blocks required in a SURROUNDING challenge. Material, Integer")
|
||||||
private Map<Material, Integer> requiredBlocks = new EnumMap<>(Material.class);
|
private Map<Material, Integer> requiredBlocks = new EnumMap<>(Material.class);
|
||||||
@ConfigComment("The items that must be in the inventory to complete the challenge. ItemStack List.")
|
@ConfigComment("The items that must be in the inventory to complete the challenge. ItemStack List.")
|
||||||
private List<ItemStack> requiredItems = new ArrayList<>();
|
private List<ItemStack> requiredItems = new ArrayList<>();
|
||||||
@ConfigComment("Any entities that must be in the area for SURROUNDING type challenges. Map EntityType, Number")
|
@ConfigComment("Any entities that must be in the area for SURROUNDING type challenges. Map EntityType, Number")
|
||||||
private Map<EntityType, Integer> requiredEntities = new EnumMap<>(EntityType.class);
|
private Map<EntityType, Integer> requiredEntities = new EnumMap<>(EntityType.class);
|
||||||
@ConfigComment("Required experience")
|
@ConfigComment("Required experience")
|
||||||
@ -202,7 +202,7 @@ public class Challenges implements DataObject {
|
|||||||
* @return the icon
|
* @return the icon
|
||||||
*/
|
*/
|
||||||
public ItemStack getIcon() {
|
public ItemStack getIcon() {
|
||||||
return icon.clone();
|
return icon != null ? icon.clone() : new ItemStack(Material.MAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.database.object;
|
package bskyblock.addon.challenges.database.object;
|
||||||
|
|
||||||
@ -12,8 +12,8 @@ import org.bukkit.World;
|
|||||||
|
|
||||||
import com.google.gson.annotations.Expose;
|
import com.google.gson.annotations.Expose;
|
||||||
|
|
||||||
import us.tastybento.bskyblock.database.objects.DataObject;
|
import world.bentobox.bentobox.database.objects.DataObject;
|
||||||
import us.tastybento.bskyblock.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stores the player's challenge situation
|
* Stores the player's challenge situation
|
||||||
@ -36,7 +36,7 @@ public class PlayerData implements DataObject {
|
|||||||
|
|
||||||
// Required for bean instantiation
|
// Required for bean instantiation
|
||||||
public PlayerData() {}
|
public PlayerData() {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mark a challenge as having been completed. Will increment the number of times and timestamp
|
* Mark a challenge as having been completed. Will increment the number of times and timestamp
|
||||||
* @param challengeName - unique challenge name
|
* @param challengeName - unique challenge name
|
||||||
@ -47,7 +47,7 @@ public class PlayerData implements DataObject {
|
|||||||
challengeStatus.put(name, times);
|
challengeStatus.put(name, times);
|
||||||
challengesTimestamp.put(name, System.currentTimeMillis());
|
challengesTimestamp.put(name, System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a challenge has been done
|
* Check if a challenge has been done
|
||||||
* @param challengeName - unique challenge name
|
* @param challengeName - unique challenge name
|
||||||
@ -56,7 +56,7 @@ public class PlayerData implements DataObject {
|
|||||||
public boolean isChallengeDone(World world, String challengeName) {
|
public boolean isChallengeDone(World world, String challengeName) {
|
||||||
return getTimes(world, challengeName) > 0;
|
return getTimes(world, challengeName) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check how many times a challenge has been done
|
* Check how many times a challenge has been done
|
||||||
* @param challengeName - unique challenge name
|
* @param challengeName - unique challenge name
|
||||||
@ -65,7 +65,7 @@ public class PlayerData implements DataObject {
|
|||||||
public int getTimes(World world, String challengeName) {
|
public int getTimes(World world, String challengeName) {
|
||||||
return challengeStatus.getOrDefault(Util.getWorld(world).getName() + challengeName, 0);
|
return challengeStatus.getOrDefault(Util.getWorld(world).getName() + challengeName, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a player data entry
|
* Creates a player data entry
|
||||||
* @param uniqueId - the player's UUID in string format
|
* @param uniqueId - the player's UUID in string format
|
||||||
@ -75,7 +75,7 @@ public class PlayerData implements DataObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.database.objects.DataObject#getUniqueId()
|
* @see world.bentobox.bbox.database.objects.DataObject#getUniqueId()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String getUniqueId() {
|
public String getUniqueId() {
|
||||||
@ -83,7 +83,7 @@ public class PlayerData implements DataObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see us.tastybento.bskyblock.database.objects.DataObject#setUniqueId(java.lang.String)
|
* @see world.bentobox.bbox.database.objects.DataObject#setUniqueId(java.lang.String)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void setUniqueId(String uniqueId) {
|
public void setUniqueId(String uniqueId) {
|
||||||
|
@ -15,11 +15,11 @@ import bskyblock.addon.challenges.LevelStatus;
|
|||||||
import bskyblock.addon.challenges.commands.ChallengesCommand;
|
import bskyblock.addon.challenges.commands.ChallengesCommand;
|
||||||
import bskyblock.addon.challenges.database.object.Challenges;
|
import bskyblock.addon.challenges.database.object.Challenges;
|
||||||
import bskyblock.addon.challenges.database.object.Challenges.ChallengeType;
|
import bskyblock.addon.challenges.database.object.Challenges.ChallengeType;
|
||||||
import us.tastybento.bskyblock.api.panels.Panel;
|
import world.bentobox.bentobox.api.panels.Panel;
|
||||||
import us.tastybento.bskyblock.api.panels.PanelItem;
|
import world.bentobox.bentobox.api.panels.PanelItem;
|
||||||
import us.tastybento.bskyblock.api.panels.builders.PanelBuilder;
|
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
|
||||||
import us.tastybento.bskyblock.api.panels.builders.PanelItemBuilder;
|
import world.bentobox.bentobox.api.panels.builders.PanelItemBuilder;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
|
|
||||||
public class ChallengesPanels {
|
public class ChallengesPanels {
|
||||||
@ -38,14 +38,14 @@ public class ChallengesPanels {
|
|||||||
this.world = world;
|
this.world = world;
|
||||||
this.permPrefix = permPrefix;
|
this.permPrefix = permPrefix;
|
||||||
this.label = label;
|
this.label = label;
|
||||||
|
|
||||||
if (manager.getChallengeList().isEmpty()) {
|
if (manager.getChallengeList().isEmpty()) {
|
||||||
addon.getLogger().severe("There are no challenges set up!");
|
addon.getLogger().severe("There are no challenges set up!");
|
||||||
user.sendMessage("general.errors.general");
|
user.sendMessage("general.errors.general");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (level.isEmpty()) {
|
if (level.isEmpty()) {
|
||||||
level = manager.getChallengeList().keySet().iterator().next().getUniqueId();
|
level = manager.getChallengeList().keySet().iterator().next().getUniqueId();
|
||||||
}
|
}
|
||||||
this.level = level;
|
this.level = level;
|
||||||
// Check if level is valid
|
// Check if level is valid
|
||||||
@ -71,7 +71,7 @@ public class ChallengesPanels {
|
|||||||
createItem(panelBuilder, challenge);
|
createItem(panelBuilder, challenge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addFreeChallanges(PanelBuilder panelBuilder) {
|
private void addFreeChallanges(PanelBuilder panelBuilder) {
|
||||||
manager.getChallenges(ChallengesManager.FREE, world).forEach(challenge -> createItem(panelBuilder, challenge));
|
manager.getChallenges(ChallengesManager.FREE, world).forEach(challenge -> createItem(panelBuilder, challenge));
|
||||||
}
|
}
|
||||||
@ -122,7 +122,7 @@ public class ChallengesPanels {
|
|||||||
if (status.isUnlocked()) {
|
if (status.isUnlocked()) {
|
||||||
// Clicking on this icon will open up this level's challenges
|
// Clicking on this icon will open up this level's challenges
|
||||||
PanelItem item = new PanelItemBuilder()
|
PanelItem item = new PanelItemBuilder()
|
||||||
.icon(new ItemStack(Material.BOOK_AND_QUILL))
|
.icon(new ItemStack(Material.ENCHANTED_BOOK))
|
||||||
.name(name)
|
.name(name)
|
||||||
.description(manager.stringSplit(user.getTranslation("challenges.navigation","[level]",name)))
|
.description(manager.stringSplit(user.getTranslation("challenges.navigation","[level]",name)))
|
||||||
.clickHandler((p, u, c, s) -> {
|
.clickHandler((p, u, c, s) -> {
|
||||||
@ -147,10 +147,10 @@ public class ChallengesPanels {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the challenge description for the "item" in the inventory
|
* Creates the challenge description for the "item" in the inventory
|
||||||
*
|
*
|
||||||
* @param challenge
|
* @param challenge
|
||||||
* @param player
|
* @param player
|
||||||
* @return List of strings splitting challenge string into 25 chars long
|
* @return List of strings splitting challenge string into 25 chars long
|
||||||
*/
|
*/
|
||||||
private List<String> challengeDescription(Challenges challenge) {
|
private List<String> challengeDescription(Challenges challenge) {
|
||||||
List<String> result = new ArrayList<String>();
|
List<String> result = new ArrayList<String>();
|
||||||
@ -174,8 +174,8 @@ public class ChallengesPanels {
|
|||||||
result.addAll(splitTrans(user, "challenges.completed-times","[donetimes]", String.valueOf(doneTimes),"[maxtimes]", String.valueOf(maxTimes)));
|
result.addAll(splitTrans(user, "challenges.completed-times","[donetimes]", String.valueOf(doneTimes),"[maxtimes]", String.valueOf(maxTimes)));
|
||||||
} else {
|
} else {
|
||||||
result.addAll(splitTrans(user, "challenges.maxed-reached","[donetimes]", String.valueOf(doneTimes),"[maxtimes]", String.valueOf(maxTimes)));
|
result.addAll(splitTrans(user, "challenges.maxed-reached","[donetimes]", String.valueOf(doneTimes),"[maxtimes]", String.valueOf(maxTimes)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!complete || (complete && challenge.isRepeatable())) {
|
if (!complete || (complete && challenge.isRepeatable())) {
|
||||||
result.addAll(challenge.getDescription());
|
result.addAll(challenge.getDescription());
|
||||||
@ -218,7 +218,7 @@ public class ChallengesPanels {
|
|||||||
if (expReward > 0) {
|
if (expReward > 0) {
|
||||||
result.addAll(splitTrans(user,"challenges.exp-reward", "[reward]", String.valueOf(expReward)));
|
result.addAll(splitTrans(user,"challenges.exp-reward", "[reward]", String.valueOf(expReward)));
|
||||||
}
|
}
|
||||||
if (addon.getBSkyBlock().getSettings().isUseEconomy() && moneyReward > 0) {
|
if (addon.getPlugin().getSettings().isUseEconomy() && moneyReward > 0) {
|
||||||
result.addAll(splitTrans(user,"challenges.money-reward", "[reward]", String.valueOf(moneyReward)));
|
result.addAll(splitTrans(user,"challenges.money-reward", "[reward]", String.valueOf(moneyReward)));
|
||||||
}
|
}
|
||||||
// Final placeholder change for [label]
|
// Final placeholder change for [label]
|
||||||
|
@ -4,8 +4,8 @@ import org.bukkit.event.inventory.InventoryClickEvent;
|
|||||||
import org.bukkit.event.inventory.InventoryCloseEvent;
|
import org.bukkit.event.inventory.InventoryCloseEvent;
|
||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesAddon;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.panels.PanelListener;
|
import world.bentobox.bentobox.api.panels.PanelListener;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
public class CreateChallengeListener implements PanelListener {
|
public class CreateChallengeListener implements PanelListener {
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
package bskyblock.addon.challenges.panel;
|
package bskyblock.addon.challenges.panel;
|
||||||
|
|
||||||
import bskyblock.addon.challenges.ChallengesAddon;
|
import bskyblock.addon.challenges.ChallengesAddon;
|
||||||
import us.tastybento.bskyblock.api.panels.builders.PanelBuilder;
|
import world.bentobox.bentobox.api.panels.builders.PanelBuilder;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
|
|
||||||
public class CreateChallengePanel {
|
public class CreateChallengePanel {
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
package bskyblock.addon.challenges.panel;
|
package bskyblock.addon.challenges.panel;
|
||||||
|
|
||||||
@ -20,8 +20,8 @@ import bskyblock.addon.challenges.commands.ChallengesCommand;
|
|||||||
import bskyblock.addon.challenges.database.object.Challenges;
|
import bskyblock.addon.challenges.database.object.Challenges;
|
||||||
import bskyblock.addon.challenges.database.object.Challenges.ChallengeType;
|
import bskyblock.addon.challenges.database.object.Challenges.ChallengeType;
|
||||||
import bskyblock.addon.level.Level;
|
import bskyblock.addon.level.Level;
|
||||||
import us.tastybento.bskyblock.api.user.User;
|
import world.bentobox.bentobox.api.user.User;
|
||||||
import us.tastybento.bskyblock.util.Util;
|
import world.bentobox.bentobox.util.Util;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Run when a user tries to complete a challenge
|
* Run when a user tries to complete a challenge
|
||||||
@ -52,7 +52,7 @@ public class TryToComplete {
|
|||||||
this.user = user;
|
this.user = user;
|
||||||
this.manager = manager;
|
this.manager = manager;
|
||||||
this.challenge = challenge;
|
this.challenge = challenge;
|
||||||
|
|
||||||
// Check if can complete challenge
|
// Check if can complete challenge
|
||||||
ChallengeResult result = checkIfCanCompleteChallenge();
|
ChallengeResult result = checkIfCanCompleteChallenge();
|
||||||
if (!result.meetsRequirements) {
|
if (!result.meetsRequirements) {
|
||||||
@ -93,7 +93,7 @@ public class TryToComplete {
|
|||||||
* Checks if a challenge can be completed or not
|
* Checks if a challenge can be completed or not
|
||||||
*/
|
*/
|
||||||
private ChallengeResult checkIfCanCompleteChallenge() {
|
private ChallengeResult checkIfCanCompleteChallenge() {
|
||||||
// Check if user has the
|
// Check if user has the
|
||||||
if (!challenge.getLevel().equals(ChallengesManager.FREE) && !manager.isLevelUnlocked(user, challenge.getLevel(), world)) {
|
if (!challenge.getLevel().equals(ChallengesManager.FREE) && !manager.isLevelUnlocked(user, challenge.getLevel(), world)) {
|
||||||
user.sendMessage("challenges.errors.challenge-level-not-available");
|
user.sendMessage("challenges.errors.challenge-level-not-available");
|
||||||
return new ChallengeResult();
|
return new ChallengeResult();
|
||||||
@ -104,7 +104,7 @@ public class TryToComplete {
|
|||||||
return new ChallengeResult();
|
return new ChallengeResult();
|
||||||
}
|
}
|
||||||
// Check repeatability
|
// Check repeatability
|
||||||
if (manager.isChallengeComplete(user, challenge.getUniqueId(), world)
|
if (manager.isChallengeComplete(user, challenge.getUniqueId(), world)
|
||||||
&& (!challenge.isRepeatable() || challenge.getChallengeType().equals(ChallengeType.LEVEL)
|
&& (!challenge.isRepeatable() || challenge.getChallengeType().equals(ChallengeType.LEVEL)
|
||||||
|| challenge.getChallengeType().equals(ChallengeType.ISLAND))) {
|
|| challenge.getChallengeType().equals(ChallengeType.ISLAND))) {
|
||||||
user.sendMessage("challenges.not-repeatable");
|
user.sendMessage("challenges.not-repeatable");
|
||||||
@ -170,7 +170,7 @@ public class TryToComplete {
|
|||||||
for (int z = -searchRadius; z <= searchRadius; z++) {
|
for (int z = -searchRadius; z <= searchRadius; z++) {
|
||||||
Material mat = user.getWorld().getBlockAt(user.getLocation().add(new Vector(x,y,z))).getType();
|
Material mat = user.getWorld().getBlockAt(user.getLocation().add(new Vector(x,y,z))).getType();
|
||||||
// Remove one
|
// Remove one
|
||||||
blocks.computeIfPresent(mat, (b, amount) -> amount - 1);
|
blocks.computeIfPresent(mat, (b, amount) -> amount - 1);
|
||||||
// Remove any that have an amount of 0
|
// Remove any that have an amount of 0
|
||||||
blocks.entrySet().removeIf(en -> en.getValue() <= 0);
|
blocks.entrySet().removeIf(en -> en.getValue() <= 0);
|
||||||
}
|
}
|
||||||
@ -241,7 +241,7 @@ public class TryToComplete {
|
|||||||
cmd = cmd.substring(6,cmd.length()).replace("[player]", user.getName()).trim();
|
cmd = cmd.substring(6,cmd.length()).replace("[player]", user.getName()).trim();
|
||||||
try {
|
try {
|
||||||
if (!user.performCommand(cmd)) {
|
if (!user.performCommand(cmd)) {
|
||||||
showError(cmd);
|
showError(cmd);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
showError(cmd);
|
showError(cmd);
|
||||||
|
@ -13,7 +13,6 @@ import org.bukkit.Bukkit;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.World;
|
import org.bukkit.World;
|
||||||
import org.bukkit.entity.EntityType;
|
|
||||||
import org.bukkit.inventory.ItemFactory;
|
import org.bukkit.inventory.ItemFactory;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.PotionMeta;
|
import org.bukkit.inventory.meta.PotionMeta;
|
||||||
@ -66,9 +65,9 @@ public class ParseItemTest {
|
|||||||
assertNull(new ParseItem(addon, "anything:anything").getItem());
|
assertNull(new ParseItem(addon, "anything:anything").getItem());
|
||||||
// Bad material
|
// Bad material
|
||||||
assertNull(new ParseItem(addon, "nosuchmaterial:2").getItem());
|
assertNull(new ParseItem(addon, "nosuchmaterial:2").getItem());
|
||||||
|
|
||||||
// Material
|
// Material
|
||||||
for (Material mat : Material.values()) {
|
for (Material mat : Material.values()) {
|
||||||
ItemStack test = new ParseItem(addon, mat.name() + ":5").getItem();
|
ItemStack test = new ParseItem(addon, mat.name() + ":5").getItem();
|
||||||
if (test.getType().toString().endsWith("_ITEM") && !mat.toString().endsWith("_ITEM")) {
|
if (test.getType().toString().endsWith("_ITEM") && !mat.toString().endsWith("_ITEM")) {
|
||||||
assertEquals(mat.toString() + "_ITEM", test.getType().toString());
|
assertEquals(mat.toString() + "_ITEM", test.getType().toString());
|
||||||
@ -76,54 +75,35 @@ public class ParseItemTest {
|
|||||||
assertEquals(mat, test.getType());
|
assertEquals(mat, test.getType());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Nothing amount
|
// Nothing amount
|
||||||
ItemStack test = new ParseItem(addon, "STONE:").getItem();
|
ItemStack test = new ParseItem(addon, "STONE:").getItem();
|
||||||
assertNull(test);
|
assertNull(test);
|
||||||
|
|
||||||
|
|
||||||
// Test 3
|
// Test 3
|
||||||
// Bad material
|
// Bad material
|
||||||
assertNull(new ParseItem(addon, "nosuchmaterial:2:2").getItem());
|
assertNull(new ParseItem(addon, "nosuchmaterial:2:2").getItem());
|
||||||
|
|
||||||
// Bad amount
|
// Bad amount
|
||||||
assertNull(new ParseItem(addon, "STONE:1:sdfgsd").getItem());
|
assertNull(new ParseItem(addon, "STONE:1:sdfgsd").getItem());
|
||||||
|
|
||||||
// Missing amount = 1
|
// Missing amount = 1
|
||||||
test = new ParseItem(addon, "STONE:1:").getItem();
|
test = new ParseItem(addon, "STONE:1:").getItem();
|
||||||
assertNotNull(test); // This is okay, it's just a 2
|
assertNotNull(test); // This is okay, it's just a 2
|
||||||
|
|
||||||
// Material
|
|
||||||
for (Material mat : Material.values()) {
|
|
||||||
test = new ParseItem(addon, mat.name() + ":5:5").getItem();
|
|
||||||
if (test.getType().toString().endsWith("_ITEM") && !mat.toString().endsWith("_ITEM")) {
|
|
||||||
assertEquals(mat.toString() + "_ITEM", test.getType().toString());
|
|
||||||
assertEquals(5, test.getDurability());
|
|
||||||
} else {
|
|
||||||
assertEquals(mat, test.getType());
|
|
||||||
assertEquals(5, test.getDurability());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Test spawn eggs
|
|
||||||
for (EntityType ent : EntityType.values()) {
|
|
||||||
if (ent.isSpawnable()) {
|
|
||||||
test = new ParseItem(addon, "MONSTER_EGG:" + ent.name() + ":3").getItem();
|
|
||||||
assertEquals(Material.MONSTER_EGG, test.getType());
|
|
||||||
assertEquals(3, test.getAmount());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Test Potions
|
// Test Potions
|
||||||
PotionMeta itemMeta = mock(PotionMeta.class);
|
PotionMeta itemMeta = mock(PotionMeta.class);
|
||||||
when(itemFactory.getItemMeta(any())).thenReturn(itemMeta);
|
when(itemFactory.getItemMeta(any())).thenReturn(itemMeta);
|
||||||
when(Bukkit.getItemFactory()).thenReturn(itemFactory);
|
when(Bukkit.getItemFactory()).thenReturn(itemFactory);
|
||||||
|
|
||||||
// Bad material
|
// Bad material
|
||||||
assertNull(new ParseItem(addon, "nosuchmaterial:JUMP:2:NOTEXTENDED:NOSPLASH:2").getItem());
|
assertNull(new ParseItem(addon, "nosuchmaterial:JUMP:2:NOTEXTENDED:NOSPLASH:2").getItem());
|
||||||
// Bad amount
|
// Bad amount
|
||||||
assertNull(new ParseItem(addon, "POTION:JUMP:2:NOTEXTENDED:NOSPLASH:asfdas").getItem());
|
assertNull(new ParseItem(addon, "POTION:JUMP:2:NOTEXTENDED:NOSPLASH:asfdas").getItem());
|
||||||
test = new ParseItem(addon, "POTION:JUMP:2:NOTEXTENDED:NOSPLASH:").getItem();
|
test = new ParseItem(addon, "POTION:JUMP:2:NOTEXTENDED:NOSPLASH:").getItem();
|
||||||
assertNull(test);
|
assertNull(test);
|
||||||
|
|
||||||
test = new ParseItem(addon, "POTION:JUMP:2:NOTEXTENDED:NOSPLASH:1").getItem();
|
test = new ParseItem(addon, "POTION:JUMP:2:NOTEXTENDED:NOSPLASH:1").getItem();
|
||||||
assertEquals(Material.POTION, test.getType());
|
assertEquals(Material.POTION, test.getType());
|
||||||
test = new ParseItem(addon, "POTION:STRENGTH:1:EXTENDED:SPLASH:1").getItem();
|
test = new ParseItem(addon, "POTION:STRENGTH:1:EXTENDED:SPLASH:1").getItem();
|
||||||
|
Loading…
Reference in New Issue
Block a user