This commit is contained in:
Brianna 2019-08-05 15:28:32 -04:00
parent 6d35c38feb
commit 282130f062
8 changed files with 21 additions and 11 deletions

View File

@ -4,7 +4,7 @@ stages:
variables: variables:
name: "EpicEnchants" name: "EpicEnchants"
path: "/builds/$CI_PROJECT_PATH" path: "/builds/$CI_PROJECT_PATH"
version: "1_B3" version: "1_B4"
build: build:
stage: build stage: build

View File

@ -27,6 +27,9 @@ public enum TriggerType {
BLOCK_BREAK, BLOCK_BREAK,
EXPERIENCE_BLOCK_BREAK, EXPERIENCE_BLOCK_BREAK,
RIGHT_CLICK_BLOCK,
LEFT_CLICK_BLOCK,
REPEATING, //TODO: Figure out what this is. REPEATING, //TODO: Figure out what this is.
RIGHT_CLICK, RIGHT_CLICK,
LEFT_CLICK LEFT_CLICK

View File

@ -57,11 +57,17 @@ public class PlayerListener implements Listener {
@EventHandler(priority = EventPriority.HIGHEST) @EventHandler(priority = EventPriority.HIGHEST)
public void onPlayerInteract(PlayerInteractEvent event) { public void onPlayerInteract(PlayerInteractEvent event) {
if (event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK) { if (event.getAction() == Action.RIGHT_CLICK_AIR) {
instance.getEnchantUtils().handlePlayer(event.getPlayer(), null, event, RIGHT_CLICK); instance.getEnchantUtils().handlePlayer(event.getPlayer(), null, event, RIGHT_CLICK);
} else if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.LEFT_CLICK_BLOCK) { } else if (event.getAction() == Action.LEFT_CLICK_AIR) {
instance.getEnchantUtils().handlePlayer(event.getPlayer(), null, event, LEFT_CLICK); instance.getEnchantUtils().handlePlayer(event.getPlayer(), null, event, LEFT_CLICK);
} }
if (event.getAction() == Action.RIGHT_CLICK_BLOCK) {
instance.getEnchantUtils().handlePlayer(event.getPlayer(), null, event, RIGHT_CLICK_BLOCK);
} else if (event.getAction() == Action.LEFT_CLICK_BLOCK) {
instance.getEnchantUtils().handlePlayer(event.getPlayer(), null, event, LEFT_CLICK_BLOCK);
}
} }
@EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST) @EventHandler(ignoreCancelled = true, priority = EventPriority.HIGHEST)

View File

@ -27,6 +27,7 @@ public class LeveledModifier {
String toTest = Placeholders.setPlaceholders(string, user, opponent, level); String toTest = Placeholders.setPlaceholders(string, user, opponent, level);
return (double) (int) GeneralUtils.parseJS(toTest, "LeveledModifier", def); Object value = GeneralUtils.parseJS(toTest, "LeveledModifier", def);
return value instanceof Double ? (double)value : (int)value;
} }
} }

View File

@ -7,7 +7,7 @@ max-level: 3
# The group of this enchant. Configure the groups in the groups.yml file. # The group of this enchant. Configure the groups in the groups.yml file.
group: SIMPLE group: SIMPLE
#Description # Description
description: description:
- "A chance to strike lightning" - "A chance to strike lightning"
- "at your opponents location." - "at your opponents location."
@ -22,6 +22,6 @@ effects:
# Chance that this will happen # Chance that this will happen
chance: "5 * {level}" chance: "5 * {level}"
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: ATTACK_PLAYER_MELEE trigger: ATTACK_PLAYER_RANGE
# What player should the effect be ran on: USER/OPPONENT. # What player should the effect be ran on: USER/OPPONENT.
who: OPPONENT who: OPPONENT

View File

@ -7,7 +7,7 @@ max-level: 1
# The group of this enchant. Configure the groups in the groups.yml file. # The group of this enchant. Configure the groups in the groups.yml file.
group: SIMPLE group: SIMPLE
#Description # Description
description: description:
- "A chance to refill your oxygen" - "A chance to refill your oxygen"
- "levels when breaking blocks." - "levels when breaking blocks."
@ -18,7 +18,7 @@ item-whitelist:
# For a full list of effects, please visit: https://wiki.songoda.com/display/SON/EpicEnchants # For a full list of effects, please visit: https://wiki.songoda.com/display/SON/EpicEnchants
effects: effects:
MODIFY_OXYGEN: POTION:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: BLOCK_BREAK trigger: BLOCK_BREAK
# Potion Effect that should be applied. # Potion Effect that should be applied.

View File

@ -1,5 +1,5 @@
# The enchant identifier must be unique. # The enchant identifier must be unique.
identifier: Featherweight identifier: FeatherWeight
# The max level for this enchant. # The max level for this enchant.
max-level: 3 max-level: 3

View File

@ -19,11 +19,11 @@ item-whitelist:
effects: effects:
MODIFY_BLOCK: MODIFY_BLOCK:
# The trigger that will fire this effect # The trigger that will fire this effect
trigger: LEFT_CLICK trigger: LEFT_CLICK_BLOCK
# Chance that this will happen # Chance that this will happen
chance: "10 * {level}" chance: "10 * {level}"
# Check if clicked block is obsidian # Check if clicked block is obsidian
condition: "{clicked_block} === 'OBSIDIAN'" condition: "{block_type} === 'OBSIDIAN'"
# Set the block to air # Set the block to air
material: AIR material: AIR