mirror of
https://github.com/songoda/EpicEnchants.git
synced 2024-11-14 22:56:20 +01:00
Fixes
This commit is contained in:
parent
6d35c38feb
commit
282130f062
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicEnchants"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "1_B3"
|
||||
version: "1_B4"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -27,6 +27,9 @@ public enum TriggerType {
|
||||
|
||||
BLOCK_BREAK,
|
||||
EXPERIENCE_BLOCK_BREAK,
|
||||
|
||||
RIGHT_CLICK_BLOCK,
|
||||
LEFT_CLICK_BLOCK,
|
||||
REPEATING, //TODO: Figure out what this is.
|
||||
RIGHT_CLICK,
|
||||
LEFT_CLICK
|
||||
|
@ -57,11 +57,17 @@ public class PlayerListener implements Listener {
|
||||
|
||||
@EventHandler(priority = EventPriority.HIGHEST)
|
||||
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);
|
||||
} 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);
|
||||
}
|
||||
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)
|
||||
|
@ -27,6 +27,7 @@ public class LeveledModifier {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,6 @@ effects:
|
||||
# Chance that this will happen
|
||||
chance: "5 * {level}"
|
||||
# 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.
|
||||
who: OPPONENT
|
@ -18,7 +18,7 @@ item-whitelist:
|
||||
|
||||
# For a full list of effects, please visit: https://wiki.songoda.com/display/SON/EpicEnchants
|
||||
effects:
|
||||
MODIFY_OXYGEN:
|
||||
POTION:
|
||||
# The trigger that will fire this effect
|
||||
trigger: BLOCK_BREAK
|
||||
# Potion Effect that should be applied.
|
||||
|
@ -1,5 +1,5 @@
|
||||
# The enchant identifier must be unique.
|
||||
identifier: Featherweight
|
||||
identifier: FeatherWeight
|
||||
|
||||
# The max level for this enchant.
|
||||
max-level: 3
|
||||
|
@ -19,11 +19,11 @@ item-whitelist:
|
||||
effects:
|
||||
MODIFY_BLOCK:
|
||||
# The trigger that will fire this effect
|
||||
trigger: LEFT_CLICK
|
||||
trigger: LEFT_CLICK_BLOCK
|
||||
# Chance that this will happen
|
||||
chance: "10 * {level}"
|
||||
# Check if clicked block is obsidian
|
||||
condition: "{clicked_block} === 'OBSIDIAN'"
|
||||
condition: "{block_type} === 'OBSIDIAN'"
|
||||
# Set the block to air
|
||||
material: AIR
|
||||
|
Loading…
Reference in New Issue
Block a user