mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Added disable-in-worlds
This commit is contained in:
parent
e6da1c58cd
commit
dee8c2ce4d
@ -33,6 +33,7 @@ public class Alchemy extends EcoEnchant {
|
|||||||
|
|
||||||
if(!EnchantmentUtils.passedChance(this, level))
|
if(!EnchantmentUtils.passedChance(this, level))
|
||||||
return;
|
return;
|
||||||
|
if(this.getDisabledWorlds().contains(entity.getWorld())) return;
|
||||||
|
|
||||||
PotionEffect effect = event.getNewEffect();
|
PotionEffect effect = event.getNewEffect();
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ general-config:
|
|||||||
- leggings
|
- leggings
|
||||||
- boots
|
- boots
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
maximum-level: 6
|
maximum-level: 6
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: Alchemy
|
name: Alchemy
|
||||||
main: com.willfp.ecoenchants.alchemy.AlchemyMain
|
main: com.willfp.ecoenchants.alchemy.AlchemyMain
|
||||||
version: 1.0.0
|
version: 1.0.1
|
@ -20,6 +20,7 @@ general-config:
|
|||||||
- axe
|
- axe
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- aquamarine
|
- aquamarine
|
||||||
- dehydration
|
- dehydration
|
||||||
|
@ -20,6 +20,7 @@ general-config:
|
|||||||
- axe
|
- axe
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- altitude
|
- altitude
|
||||||
- dehydration
|
- dehydration
|
||||||
|
@ -20,6 +20,7 @@ general-config:
|
|||||||
- axe
|
- axe
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- altitude
|
- altitude
|
||||||
- aquamarine
|
- aquamarine
|
||||||
|
@ -19,6 +19,7 @@ general-config:
|
|||||||
- leggings
|
- leggings
|
||||||
- boots
|
- boots
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- glacial
|
- glacial
|
||||||
- heat_treated
|
- heat_treated
|
||||||
|
@ -19,6 +19,7 @@ general-config:
|
|||||||
- leggings
|
- leggings
|
||||||
- boots
|
- boots
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- elevation
|
- elevation
|
||||||
- heat_treated
|
- heat_treated
|
||||||
|
@ -19,6 +19,7 @@ general-config:
|
|||||||
- leggings
|
- leggings
|
||||||
- boots
|
- boots
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- elevation
|
- elevation
|
||||||
- glacial
|
- glacial
|
||||||
|
@ -20,6 +20,7 @@ general-config:
|
|||||||
- axe
|
- axe
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- altitide
|
- altitide
|
||||||
- aquamarine
|
- aquamarine
|
||||||
|
@ -19,6 +19,7 @@ general-config:
|
|||||||
- leggings
|
- leggings
|
||||||
- boots
|
- boots
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- elevation
|
- elevation
|
||||||
- glacial
|
- glacial
|
||||||
|
@ -20,6 +20,7 @@ general-config:
|
|||||||
- axe
|
- axe
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- altitude
|
- altitude
|
||||||
- aquamarine
|
- aquamarine
|
||||||
|
@ -19,6 +19,7 @@ general-config:
|
|||||||
- leggings
|
- leggings
|
||||||
- boots
|
- boots
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- elevation
|
- elevation
|
||||||
- glacial
|
- glacial
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: Biomes
|
name: Biomes
|
||||||
main: com.willfp.ecoenchants.biomes.BiomesMain
|
main: com.willfp.ecoenchants.biomes.BiomesMain
|
||||||
version: 1.0.0
|
version: 1.0.1
|
@ -30,6 +30,7 @@ public abstract class EffectsEnchantment extends EcoEnchant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int level = EnchantChecks.getArmorPoints(player, this);
|
int level = EnchantChecks.getArmorPoints(player, this);
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
if(level > 0) {
|
if(level > 0) {
|
||||||
player.addPotionEffect(new PotionEffect(this.getPotionEffect(), 0x6fffffff, level - 1, false, false, true));
|
player.addPotionEffect(new PotionEffect(this.getPotionEffect(), 0x6fffffff, level - 1, false, false, true));
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- boots
|
- boots
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- spring
|
- spring
|
||||||
maximum-level: 3
|
maximum-level: 3
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- helmet
|
- helmet
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
maximum-level: 1
|
maximum-level: 1
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- helmet
|
- helmet
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
maximum-level: 2
|
maximum-level: 2
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- boots
|
- boots
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- streamlining
|
- streamlining
|
||||||
maximum-level: 3
|
maximum-level: 3
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- helmet
|
- helmet
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
maximum-level: 1
|
maximum-level: 1
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: Effects
|
name: Effects
|
||||||
main: com.willfp.ecoenchants.effects.EffectsMain
|
main: com.willfp.ecoenchants.effects.EffectsMain
|
||||||
version: 1.0.1
|
version: 1.0.2
|
@ -37,6 +37,7 @@ public class Endershot extends EcoEnchant {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
if(!EnchantChecks.mainhand(player, this)) return;
|
if(!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if(!player.getInventory().contains(Material.ENDER_PEARL, 1) && !player.getGameMode().equals(GameMode.CREATIVE))
|
if(!player.getInventory().contains(Material.ENDER_PEARL, 1) && !player.getGameMode().equals(GameMode.CREATIVE))
|
||||||
return;
|
return;
|
||||||
|
@ -17,6 +17,7 @@ general-config:
|
|||||||
- bow
|
- bow
|
||||||
- crossbow
|
- crossbow
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
maximum-level: 1
|
maximum-level: 1
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: Endershot
|
name: Endershot
|
||||||
main: com.willfp.ecoenchants.endershot.EndershotMain
|
main: com.willfp.ecoenchants.endershot.EndershotMain
|
||||||
version: 1.0.0
|
version: 1.0.1
|
||||||
|
@ -17,6 +17,7 @@ general-config:
|
|||||||
- rod
|
- rod
|
||||||
- carrot_stick
|
- carrot_stick
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
maximum-level: 3
|
maximum-level: 3
|
||||||
|
|
||||||
|
@ -1,287 +1,3 @@
|
|||||||
name: Firewand
|
name: Firewand
|
||||||
main: com.willfp.ecoenchants.firewand.FirewandMain
|
main: com.willfp.ecoenchants.firewand.FirewandMain
|
||||||
version: 1.0.3
|
version: 1.0.4
|
||||||
|
|
||||||
# This is some junk so that polymart lets me upload it
|
|
||||||
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
||||||
### JUNK 9851390485762394875629834765928374659283476592384765986
|
|
@ -46,6 +46,7 @@ public class Precision extends EcoEnchant {
|
|||||||
|
|
||||||
ItemStack itemStack = TridentStack.getTridentStack(trident);
|
ItemStack itemStack = TridentStack.getTridentStack(trident);
|
||||||
if (!EnchantChecks.item(itemStack, this)) return;
|
if (!EnchantChecks.item(itemStack, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
maximum-level: 5
|
maximum-level: 5
|
||||||
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: Precision
|
name: Precision
|
||||||
main: com.willfp.ecoenchants.precision.PrecisionMain
|
main: com.willfp.ecoenchants.precision.PrecisionMain
|
||||||
version: 1.0.3
|
version: 1.0.4
|
@ -35,7 +35,8 @@ public class SprintArtifactsListener implements Listener {
|
|||||||
if(!matching.isPresent()) return;
|
if(!matching.isPresent()) return;
|
||||||
Artifact artifact = (Artifact) matching.get();
|
Artifact artifact = (Artifact) matching.get();
|
||||||
|
|
||||||
if (!EnchantChecks.chestplate(player, artifact)) return;
|
if (!EnchantChecks.boots(player, artifact)) return;
|
||||||
|
if(artifact.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
player.getWorld().spawnParticle(artifact.getParticle(), player.getLocation().add(0, 0.1, 0), 1, 0, 0, 0, 0, artifact.getDustOptions(), true);
|
player.getWorld().spawnParticle(artifact.getParticle(), player.getLocation().add(0, 0.1, 0), 1, 0, 0, 0, 0, artifact.getDustOptions(), true);
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: Sprint Artifacts
|
name: Sprint Artifacts
|
||||||
main: com.willfp.ecoenchants.sprintartifacts.SprintArtifactsMain
|
main: com.willfp.ecoenchants.sprintartifacts.SprintArtifactsMain
|
||||||
version: 1.0.0
|
version: 1.0.1
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- sniper
|
- sniper
|
||||||
maximum-level: 3
|
maximum-level: 3
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- sword
|
- sword
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- metallic
|
- metallic
|
||||||
maximum-level: 3
|
maximum-level: 3
|
||||||
|
@ -17,6 +17,7 @@ general-config:
|
|||||||
- bow
|
- bow
|
||||||
- crossbow
|
- crossbow
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- mortality
|
- mortality
|
||||||
maximum-level: 4
|
maximum-level: 4
|
||||||
|
@ -17,6 +17,7 @@ general-config:
|
|||||||
- bow
|
- bow
|
||||||
- crossbow
|
- crossbow
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- ghoul
|
- ghoul
|
||||||
maximum-level: 4
|
maximum-level: 4
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- crawler
|
- crawler
|
||||||
maximum-level: 3
|
maximum-level: 3
|
||||||
|
@ -16,6 +16,7 @@ general-config:
|
|||||||
targets:
|
targets:
|
||||||
- sword
|
- sword
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts:
|
conflicts:
|
||||||
- firestorm
|
- firestorm
|
||||||
maximum-level: 2
|
maximum-level: 2
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
name: Summoning
|
name: Summoning
|
||||||
main: com.willfp.ecoenchants.summoning.SummoningMain
|
main: com.willfp.ecoenchants.summoning.SummoningMain
|
||||||
version: 1.0.2
|
version: 1.0.3
|
@ -14,6 +14,7 @@ import org.apache.commons.lang.WordUtils;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.NamespacedKey;
|
import org.bukkit.NamespacedKey;
|
||||||
|
import org.bukkit.World;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.enchantments.EnchantmentTarget;
|
import org.bukkit.enchantments.EnchantmentTarget;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
@ -32,6 +33,7 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
@SuppressWarnings({"unchecked", "deprecation"})
|
@SuppressWarnings({"unchecked", "deprecation"})
|
||||||
public abstract class EcoEnchant extends Enchantment implements Listener, Registerable, Watcher {
|
public abstract class EcoEnchant extends Enchantment implements Listener, Registerable, Watcher {
|
||||||
@ -51,6 +53,7 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Regist
|
|||||||
private EnchantmentRarity rarity;
|
private EnchantmentRarity rarity;
|
||||||
private final Set<com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget> target = new HashSet<>();
|
private final Set<com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget> target = new HashSet<>();
|
||||||
private final Set<Material> targetMaterials = new HashSet<>();
|
private final Set<Material> targetMaterials = new HashSet<>();
|
||||||
|
private final Set<String> disabledWorldNames = new HashSet<>();
|
||||||
|
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
|
|
||||||
@ -115,6 +118,8 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Regist
|
|||||||
maxLvl = config.getInt(EcoEnchants.GENERAL_LOCATION + "maximum-level", 1);
|
maxLvl = config.getInt(EcoEnchants.GENERAL_LOCATION + "maximum-level", 1);
|
||||||
name = StringUtils.translate(config.getString("name"));
|
name = StringUtils.translate(config.getString("name"));
|
||||||
description = StringUtils.translate(config.getString("description"));
|
description = StringUtils.translate(config.getString("description"));
|
||||||
|
disabledWorldNames.clear();
|
||||||
|
disabledWorldNames.addAll(config.getStrings(EcoEnchants.GENERAL_LOCATION + "disabled-in-worlds"));
|
||||||
target.clear();
|
target.clear();
|
||||||
targetMaterials.clear();
|
targetMaterials.clear();
|
||||||
target.addAll(config.getTargets());
|
target.addAll(config.getTargets());
|
||||||
@ -294,6 +299,17 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Regist
|
|||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get worlds that the enchantment is disabled in
|
||||||
|
*
|
||||||
|
* @return A list of all disabled worlds
|
||||||
|
*/
|
||||||
|
public List<World> getDisabledWorlds() {
|
||||||
|
List<String> worldNames = Bukkit.getWorlds().stream().map(World::getName).map(String::toLowerCase).collect(Collectors.toList());
|
||||||
|
List<String> disabledExistingWorldNames = disabledWorldNames.stream().filter(s -> worldNames.contains(s.toLowerCase())).collect(Collectors.toList());
|
||||||
|
return Bukkit.getWorlds().stream().filter(world -> disabledExistingWorldNames.contains(world.getName().toLowerCase())).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get display name of enchantment.
|
* Get display name of enchantment.
|
||||||
* Not deprecated, unlike {@link Enchantment#getName()}
|
* Not deprecated, unlike {@link Enchantment#getName()}
|
||||||
|
@ -55,6 +55,7 @@ public class CallingCurse extends EcoEnchant implements EcoRunnable {
|
|||||||
public void run() {
|
public void run() {
|
||||||
players.forEach((player, level) -> {
|
players.forEach((player, level) -> {
|
||||||
double distance = EcoEnchants.CALLING_CURSE.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "distance");
|
double distance = EcoEnchants.CALLING_CURSE.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "distance");
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
for (Entity e : player.getWorld().getNearbyEntities(player.getLocation(), distance, distance, distance)) {
|
for (Entity e : player.getWorld().getNearbyEntities(player.getLocation(), distance, distance, distance)) {
|
||||||
if(!(e instanceof Monster)) continue;
|
if(!(e instanceof Monster)) continue;
|
||||||
|
@ -82,6 +82,7 @@ public class DecayCurse extends EcoEnchant implements EcoRunnable {
|
|||||||
for(ItemStack item : player.getInventory().getContents()) {
|
for(ItemStack item : player.getInventory().getContents()) {
|
||||||
int level = EnchantChecks.getItemLevel(item, this);
|
int level = EnchantChecks.getItemLevel(item, this);
|
||||||
if(level == 0) continue;
|
if(level == 0) continue;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if(!(item.getItemMeta() instanceof Repairable)) continue;
|
if(!(item.getItemMeta() instanceof Repairable)) continue;
|
||||||
|
|
||||||
|
@ -22,6 +22,8 @@ public class FragilityCurse extends EcoEnchant {
|
|||||||
|
|
||||||
if (!EnchantChecks.item(item, this)) return;
|
if (!EnchantChecks.item(item, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(event.getPlayer().getWorld())) return;
|
||||||
|
|
||||||
int min = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "minimum-extra-durability");
|
int min = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "minimum-extra-durability");
|
||||||
int max = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "maximum-extra-durability");
|
int max = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "maximum-extra-durability");
|
||||||
|
|
||||||
|
@ -24,6 +24,7 @@ public class HungerCurse extends EcoEnchant {
|
|||||||
|
|
||||||
if(!EnchantChecks.helmet(player, this)) return;
|
if(!EnchantChecks.helmet(player, this)) return;
|
||||||
if(event.getFoodLevel() > player.getFoodLevel()) return;
|
if(event.getFoodLevel() > player.getFoodLevel()) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int delta = player.getFoodLevel() - event.getFoodLevel();
|
int delta = player.getFoodLevel() - event.getFoodLevel();
|
||||||
delta *= this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "times-more-hunger");
|
delta *= this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "times-more-hunger");
|
||||||
|
@ -37,6 +37,8 @@ public class Beheading extends EcoEnchant {
|
|||||||
if(!EnchantmentUtils.passedChance(this, level))
|
if(!EnchantmentUtils.passedChance(this, level))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
ItemStack item;
|
ItemStack item;
|
||||||
|
|
||||||
if(victim instanceof Player) {
|
if(victim instanceof Player) {
|
||||||
|
@ -28,6 +28,8 @@ public class Dexterous extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
|
|
||||||
int level = EnchantChecks.getItemLevel(item, this);
|
int level = EnchantChecks.getItemLevel(item, this);
|
||||||
double bonus = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "add-speed-per-level");
|
double bonus = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "add-speed-per-level");
|
||||||
|
@ -18,6 +18,7 @@ public class Economical extends EcoEnchant {
|
|||||||
@EventHandler
|
@EventHandler
|
||||||
public void onElytraBoost(PlayerElytraBoostEvent event) {
|
public void onElytraBoost(PlayerElytraBoostEvent event) {
|
||||||
if(EnchantmentUtils.passedChance(this, EnchantChecks.getArmorPoints(event.getPlayer(), this)))
|
if(EnchantmentUtils.passedChance(this, EnchantChecks.getArmorPoints(event.getPlayer(), this)))
|
||||||
|
if(this.getDisabledWorlds().contains(event.getPlayer().getWorld())) return;
|
||||||
event.setShouldConsume(false);
|
event.setShouldConsume(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -45,6 +45,7 @@ public class Enderism extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!EnchantChecks.arrow(arrow, this)) return;
|
if (!EnchantChecks.arrow(arrow, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getArrowLevel(arrow, this);
|
int level = EnchantChecks.getArrowLevel(arrow, this);
|
||||||
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
||||||
|
@ -40,6 +40,7 @@ public class Farmhand extends EcoEnchant {
|
|||||||
ItemStack item = event.getItem();
|
ItemStack item = event.getItem();
|
||||||
|
|
||||||
if (!EnchantChecks.item(item, this)) return;
|
if (!EnchantChecks.item(item, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (!item.getType().toString().endsWith("_HOE"))
|
if (!item.getType().toString().endsWith("_HOE"))
|
||||||
return;
|
return;
|
||||||
|
@ -53,6 +53,7 @@ public class Forcefield extends EcoEnchant implements EcoRunnable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
players.forEach((player, level) -> {
|
players.forEach((player, level) -> {
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
double initialDistance = EcoEnchants.FORCEFIELD.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "initial-distance");
|
double initialDistance = EcoEnchants.FORCEFIELD.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "initial-distance");
|
||||||
double bonus = EcoEnchants.FORCEFIELD.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-level");
|
double bonus = EcoEnchants.FORCEFIELD.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-level");
|
||||||
double distance = initialDistance + (level * bonus);
|
double distance = initialDistance + (level * bonus);
|
||||||
|
@ -36,6 +36,7 @@ public class Frozen extends EcoEnchant {
|
|||||||
|
|
||||||
if (points == 0)
|
if (points == 0)
|
||||||
return;
|
return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
|
|
||||||
if(!EnchantmentUtils.passedChance(this, points))
|
if(!EnchantmentUtils.passedChance(this, points))
|
||||||
|
@ -35,6 +35,8 @@ public class Graceful extends EcoEnchant {
|
|||||||
if(!EnchantChecks.boots(player, this)) return;
|
if(!EnchantChecks.boots(player, this)) return;
|
||||||
int level = EnchantChecks.getBootsLevel(player, this);
|
int level = EnchantChecks.getBootsLevel(player, this);
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
|
|
||||||
if(!EnchantmentUtils.passedChance(this, level))
|
if(!EnchantmentUtils.passedChance(this, level))
|
||||||
return;
|
return;
|
||||||
|
@ -34,6 +34,8 @@ public class GreenThumb extends EcoEnchant {
|
|||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if(!AntigriefManager.canBreakBlock(player, event.getClickedBlock())) return;
|
if(!AntigriefManager.canBreakBlock(player, event.getClickedBlock())) return;
|
||||||
if(!AntigriefManager.canPlaceBlock(player, event.getClickedBlock())) return;
|
if(!AntigriefManager.canPlaceBlock(player, event.getClickedBlock())) return;
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ public class Grit extends EcoEnchant {
|
|||||||
|
|
||||||
if (totalGritPoints == 0)
|
if (totalGritPoints == 0)
|
||||||
return;
|
return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (!(attacker.getInventory().getItemInMainHand() instanceof Damageable))
|
if (!(attacker.getInventory().getItemInMainHand() instanceof Damageable))
|
||||||
return;
|
return;
|
||||||
|
@ -33,6 +33,7 @@ public class Incandescence extends EcoEnchant {
|
|||||||
|
|
||||||
if (totalIncandescencePoints == 0)
|
if (totalIncandescencePoints == 0)
|
||||||
return;
|
return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
Bukkit.getScheduler().runTaskLater(EcoEnchantsPlugin.getInstance(), () -> {
|
Bukkit.getScheduler().runTaskLater(EcoEnchantsPlugin.getInstance(), () -> {
|
||||||
victim.setFireTicks(totalIncandescencePoints * this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "ticks-per-point") + this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "initial-ticks"));
|
victim.setFireTicks(totalIncandescencePoints * this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "ticks-per-point") + this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "initial-ticks"));
|
||||||
|
@ -18,7 +18,15 @@ import org.bukkit.inventory.FurnaceRecipe;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.Recipe;
|
import org.bukkit.inventory.Recipe;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.Set;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
public class InfernalTouch extends EcoEnchant {
|
public class InfernalTouch extends EcoEnchant {
|
||||||
@ -67,6 +75,7 @@ public class InfernalTouch extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!AntigriefManager.canBreakBlock(player, block)) return;
|
if (!AntigriefManager.canBreakBlock(player, block)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
Collection<ItemStack> drops = new ArrayList<>();
|
Collection<ItemStack> drops = new ArrayList<>();
|
||||||
event.getItems().forEach((item -> {
|
event.getItems().forEach((item -> {
|
||||||
|
@ -27,6 +27,7 @@ public class Invigoration extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int totalInvigorationPoints = EnchantChecks.getArmorPoints(player, this, 0);
|
int totalInvigorationPoints = EnchantChecks.getArmorPoints(player, this, 0);
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (totalInvigorationPoints == 0)
|
if (totalInvigorationPoints == 0)
|
||||||
return;
|
return;
|
||||||
@ -46,6 +47,7 @@ public class Invigoration extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int totalInvigorationPoints = EnchantChecks.getArmorPoints(player, this, 0);
|
int totalInvigorationPoints = EnchantChecks.getArmorPoints(player, this, 0);
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (totalInvigorationPoints == 0)
|
if (totalInvigorationPoints == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -35,6 +35,8 @@ public class Launch extends EcoEnchant {
|
|||||||
|
|
||||||
if(!EnchantChecks.chestplate(player, this)) return;
|
if(!EnchantChecks.chestplate(player, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getChestplateLevel(player, this);
|
int level = EnchantChecks.getChestplateLevel(player, this);
|
||||||
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
|
||||||
double boost = 1 + (multiplier * level);
|
double boost = 1 + (multiplier * level);
|
||||||
|
@ -35,6 +35,7 @@ public class MagmaWalker extends EcoEnchant {
|
|||||||
if(event.getFrom().getBlock().equals(event.getTo().getBlock())) return;
|
if(event.getFrom().getBlock().equals(event.getTo().getBlock())) return;
|
||||||
|
|
||||||
if (!EnchantChecks.boots(player, this)) return;
|
if (!EnchantChecks.boots(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
Vector[] circle = VectorUtils.getCircle(this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "initial-radius")
|
Vector[] circle = VectorUtils.getCircle(this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "initial-radius")
|
||||||
+ (this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "per-level-radius") * EnchantChecks.getBootsLevel(player, this) - 1));
|
+ (this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "per-level-radius") * EnchantChecks.getBootsLevel(player, this) - 1));
|
||||||
|
@ -60,6 +60,7 @@ public class Magnetic extends EcoEnchant implements EcoRunnable {
|
|||||||
public void run() {
|
public void run() {
|
||||||
players.forEach((player, level) -> {
|
players.forEach((player, level) -> {
|
||||||
double distance = initialDistance + (level * bonus);
|
double distance = initialDistance + (level * bonus);
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
for (Entity e : player.getWorld().getNearbyEntities(player.getLocation(), distance, 2.0d, distance)) {
|
for (Entity e : player.getWorld().getNearbyEntities(player.getLocation(), distance, 2.0d, distance)) {
|
||||||
if(!(e instanceof Item || e instanceof ExperienceOrb)) continue;
|
if(!(e instanceof Item || e instanceof ExperienceOrb)) continue;
|
||||||
|
@ -30,6 +30,7 @@ public class Marksman extends EcoEnchant {
|
|||||||
Player player = (Player) event.getEntity().getShooter();
|
Player player = (Player) event.getEntity().getShooter();
|
||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (!(event.getEntity() instanceof Arrow)) return;
|
if (!(event.getEntity() instanceof Arrow)) return;
|
||||||
Arrow a = (Arrow) event.getEntity();
|
Arrow a = (Arrow) event.getEntity();
|
||||||
|
@ -30,6 +30,7 @@ public class Necrotic extends EcoEnchant {
|
|||||||
WitherSkeleton victim = (WitherSkeleton) event.getEntity();
|
WitherSkeleton victim = (WitherSkeleton) event.getEntity();
|
||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@ public class Parry extends EcoEnchant {
|
|||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
double damage = event.getDamage();
|
double damage = event.getDamage();
|
||||||
|
@ -36,6 +36,7 @@ public class Reel extends EcoEnchant {
|
|||||||
if(!AntigriefManager.canInjure(player, victim)) return;
|
if(!AntigriefManager.canInjure(player, victim)) return;
|
||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@ public class Rejuvenation extends EcoEnchant {
|
|||||||
Player player = (Player) event.getEntity();
|
Player player = (Player) event.getEntity();
|
||||||
|
|
||||||
int totalRejuvenationPoints = EnchantChecks.getArmorPoints(player, this, 0);
|
int totalRejuvenationPoints = EnchantChecks.getArmorPoints(player, this, 0);
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (totalRejuvenationPoints == 0)
|
if (totalRejuvenationPoints == 0)
|
||||||
return;
|
return;
|
||||||
|
@ -23,6 +23,7 @@ public class Sating extends EcoEnchant {
|
|||||||
Player player = (Player) event.getEntity();
|
Player player = (Player) event.getEntity();
|
||||||
|
|
||||||
if(!EnchantChecks.helmet(player, this)) return;
|
if(!EnchantChecks.helmet(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
if(event.getFoodLevel() > player.getFoodLevel()) return;
|
if(event.getFoodLevel() > player.getFoodLevel()) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getHelmetLevel(player, this);
|
int level = EnchantChecks.getHelmetLevel(player, this);
|
||||||
|
@ -39,6 +39,7 @@ public class Shockwave extends EcoEnchant {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!EnchantChecks.item(item, this)) return;
|
if (!EnchantChecks.item(item, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int ticks = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "particle-tick-delay");
|
int ticks = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "particle-tick-delay");
|
||||||
|
|
||||||
|
@ -34,6 +34,8 @@ public class ShotAssist extends EcoEnchant {
|
|||||||
|
|
||||||
int points = EnchantChecks.getArmorPoints(player, this, 0);
|
int points = EnchantChecks.getArmorPoints(player, this, 0);
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if(points == 0) return;
|
if(points == 0) return;
|
||||||
|
|
||||||
double damage = event.getDamage();
|
double damage = event.getDamage();
|
||||||
|
@ -32,6 +32,7 @@ public class Slicing extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (!EnchantChecks.chestplate(player, this)) return;
|
if (!EnchantChecks.chestplate(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
for (Entity entity : player.getNearbyEntities(1, 1, 1)) {
|
for (Entity entity : player.getNearbyEntities(1, 1, 1)) {
|
||||||
LivingEntity victim;
|
LivingEntity victim;
|
||||||
|
@ -5,8 +5,8 @@ import com.willfp.ecoenchants.enchantments.EcoEnchants;
|
|||||||
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
|
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
|
||||||
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
|
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
|
||||||
import com.willfp.ecoenchants.nms.TridentStack;
|
import com.willfp.ecoenchants.nms.TridentStack;
|
||||||
import com.willfp.ecoenchants.util.internal.DropQueue;
|
|
||||||
import com.willfp.ecoenchants.util.NumberUtils;
|
import com.willfp.ecoenchants.util.NumberUtils;
|
||||||
|
import com.willfp.ecoenchants.util.internal.DropQueue;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
@ -44,6 +44,7 @@ public class Spearfishing extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Player player = (Player) event.getEntity().getShooter();
|
Player player = (Player) event.getEntity().getShooter();
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
ItemStack item = TridentStack.getTridentStack(trident);
|
ItemStack item = TridentStack.getTridentStack(trident);
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ public class Spiked extends EcoEnchant {
|
|||||||
if(!AntigriefManager.canInjure(player, victim)) return;
|
if(!AntigriefManager.canInjure(player, victim)) return;
|
||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
|
@ -6,7 +6,11 @@ import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
|
|||||||
import com.willfp.ecoenchants.integrations.antigrief.AntigriefManager;
|
import com.willfp.ecoenchants.integrations.antigrief.AntigriefManager;
|
||||||
import com.willfp.ecoenchants.nms.TridentStack;
|
import com.willfp.ecoenchants.nms.TridentStack;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Trident;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
@ -39,6 +43,7 @@ public class Splash extends EcoEnchant {
|
|||||||
ItemStack item = TridentStack.getTridentStack(trident);
|
ItemStack item = TridentStack.getTridentStack(trident);
|
||||||
|
|
||||||
if (!EnchantChecks.item(item, this)) return;
|
if (!EnchantChecks.item(item, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getItemLevel(item, this);
|
int level = EnchantChecks.getItemLevel(item, this);
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@ public class Stamina extends EcoEnchant {
|
|||||||
if(!player.isSprinting()) return;
|
if(!player.isSprinting()) return;
|
||||||
|
|
||||||
if(!EnchantChecks.boots(player, this)) return;
|
if(!EnchantChecks.boots(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
if(event.getFoodLevel() > player.getFoodLevel()) return;
|
if(event.getFoodLevel() > player.getFoodLevel()) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getBootsLevel(player, this);
|
int level = EnchantChecks.getBootsLevel(player, this);
|
||||||
|
@ -11,7 +11,11 @@ import com.willfp.ecoenchants.util.internal.DropQueue;
|
|||||||
import org.bukkit.GameMode;
|
import org.bukkit.GameMode;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.Arrow;
|
||||||
|
import org.bukkit.entity.Item;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Trident;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
@ -37,6 +41,7 @@ public class Telekinesis extends EcoEnchant {
|
|||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (event.isCancelled()) return;
|
if (event.isCancelled()) return;
|
||||||
|
|
||||||
@ -63,6 +68,7 @@ public class Telekinesis extends EcoEnchant {
|
|||||||
Block block = event.getBlock();
|
Block block = event.getBlock();
|
||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR)
|
if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR)
|
||||||
return;
|
return;
|
||||||
@ -109,6 +115,7 @@ public class Telekinesis extends EcoEnchant {
|
|||||||
if(player == null || item == null) return;
|
if(player == null || item == null) return;
|
||||||
|
|
||||||
if (!EnchantChecks.item(item, this)) return;
|
if (!EnchantChecks.item(item, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int xp = event.getDroppedExp();
|
int xp = event.getDroppedExp();
|
||||||
Collection<ItemStack> drops = event.getDrops();
|
Collection<ItemStack> drops = event.getDrops();
|
||||||
|
@ -32,6 +32,7 @@ public class Thrive extends EcoEnchant {
|
|||||||
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getDefaultValue());
|
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getDefaultValue());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if(EcoEnchants.THRIVE.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
double thriveBonus = totalThrivePoints * EcoEnchants.THRIVE.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "health-per-point");
|
double thriveBonus = totalThrivePoints * EcoEnchants.THRIVE.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "health-per-point");
|
||||||
double prosperityBonus = totalProsperityPoints * EcoEnchants.PROSPERITY.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "health-per-point");
|
double prosperityBonus = totalProsperityPoints * EcoEnchants.PROSPERITY.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "health-per-point");
|
||||||
|
@ -23,6 +23,8 @@ public class Wisdom extends EcoEnchant {
|
|||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
event.getExpChangeEvent().setAmount((int) Math.ceil(event.getExpChangeEvent().getAmount() * (1 + (level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-point")))));
|
event.getExpChangeEvent().setAmount((int) Math.ceil(event.getExpChangeEvent().getAmount() * (1 + (level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-point")))));
|
||||||
|
@ -47,6 +47,8 @@ public class Aiming extends EcoEnchant {
|
|||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "distance-per-level");
|
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "distance-per-level");
|
||||||
|
|
||||||
double distance = level * multiplier;
|
double distance = level * multiplier;
|
||||||
|
@ -26,6 +26,8 @@ public class Frenzy extends EcoEnchant {
|
|||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
int duration = (int) (level * 20 * this.getConfig().getDouble((EcoEnchants.CONFIG_LOCATION + "seconds-per-level")));
|
int duration = (int) (level * 20 * this.getConfig().getDouble((EcoEnchants.CONFIG_LOCATION + "seconds-per-level")));
|
||||||
|
@ -34,6 +34,7 @@ public class Harpoon extends EcoEnchant {
|
|||||||
if(!AntigriefManager.canInjure(player, victim)) return;
|
if(!AntigriefManager.canInjure(player, victim)) return;
|
||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
|
@ -22,6 +22,8 @@ public class Indestructibility extends EcoEnchant {
|
|||||||
|
|
||||||
if (!EnchantChecks.item(item, this)) return;
|
if (!EnchantChecks.item(item, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(event.getPlayer().getWorld())) return;
|
||||||
|
|
||||||
double level = EnchantChecks.getItemLevel(item, this);
|
double level = EnchantChecks.getItemLevel(item, this);
|
||||||
double levelbonus = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "level-bonus");
|
double levelbonus = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "level-bonus");
|
||||||
|
|
||||||
|
@ -30,6 +30,8 @@ public class Instability extends EcoEnchant {
|
|||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if (!(event.getEntity() instanceof Arrow)) return;
|
if (!(event.getEntity() instanceof Arrow)) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
@ -23,6 +23,8 @@ public class Intellect extends EcoEnchant {
|
|||||||
|
|
||||||
if (!EnchantChecks.mainhand(player, this)) return;
|
if (!EnchantChecks.mainhand(player, this)) return;
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
|
||||||
event.getExpChangeEvent().setAmount((int) Math.ceil(event.getExpChangeEvent().getAmount() * (1 + (level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-point")))));
|
event.getExpChangeEvent().setAmount((int) Math.ceil(event.getExpChangeEvent().getAmount() * (1 + (level * this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-point")))));
|
||||||
|
@ -79,6 +79,7 @@ public class Repairing extends EcoEnchant implements EcoRunnable {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
players.forEach((player -> {
|
players.forEach((player -> {
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
for(ItemStack item : player.getInventory().getContents()) {
|
for(ItemStack item : player.getInventory().getContents()) {
|
||||||
int level = EnchantChecks.getItemLevel(item, this);
|
int level = EnchantChecks.getItemLevel(item, this);
|
||||||
if(level == 0) continue;
|
if(level == 0) continue;
|
||||||
|
@ -5,12 +5,17 @@ import com.willfp.ecoenchants.enchantments.EcoEnchant;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
public class Soulbound extends EcoEnchant {
|
public class Soulbound extends EcoEnchant {
|
||||||
public Soulbound() {
|
public Soulbound() {
|
||||||
super(
|
super(
|
||||||
@ -26,13 +31,15 @@ public class Soulbound extends EcoEnchant {
|
|||||||
return soulboundItemsMap.get(player);
|
return soulboundItemsMap.get(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onSoulboundDeath(PlayerDeathEvent event) {
|
public void onSoulboundDeath(PlayerDeathEvent event) {
|
||||||
if(event.getKeepInventory()) return;
|
if(event.getKeepInventory()) return;
|
||||||
|
|
||||||
Player player = event.getEntity();
|
Player player = event.getEntity();
|
||||||
List<ItemStack> soulboundItems = new ArrayList<>(); // Stored as list to preserve duplicates
|
List<ItemStack> soulboundItems = new ArrayList<>(); // Stored as list to preserve duplicates
|
||||||
|
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
Arrays.stream(player.getInventory().getContents()).filter(Objects::nonNull).forEach((itemStack -> {
|
Arrays.stream(player.getInventory().getContents()).filter(Objects::nonNull).forEach((itemStack -> {
|
||||||
if(itemStack.containsEnchantment(this)) soulboundItems.add(itemStack);
|
if(itemStack.containsEnchantment(this)) soulboundItems.add(itemStack);
|
||||||
|
|
||||||
@ -47,7 +54,7 @@ public class Soulbound extends EcoEnchant {
|
|||||||
soulboundItemsMap.put(player, soulboundItems);
|
soulboundItemsMap.put(player, soulboundItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onSoulboundRespawn(PlayerRespawnEvent event) {
|
public void onSoulboundRespawn(PlayerRespawnEvent event) {
|
||||||
if(!soulboundItemsMap.containsKey(event.getPlayer())) return;
|
if(!soulboundItemsMap.containsKey(event.getPlayer())) return;
|
||||||
|
|
||||||
|
@ -17,7 +17,12 @@ import org.bukkit.event.EventHandler;
|
|||||||
import org.bukkit.event.block.Action;
|
import org.bukkit.event.block.Action;
|
||||||
import org.bukkit.event.player.PlayerInteractEvent;
|
import org.bukkit.event.player.PlayerInteractEvent;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.Arrays;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper for Spell enchantments
|
* Wrapper for Spell enchantments
|
||||||
@ -68,6 +73,7 @@ public abstract class Spell extends EcoEnchant {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int level = EnchantChecks.getMainhandLevel(player, this);
|
int level = EnchantChecks.getMainhandLevel(player, this);
|
||||||
|
if(this.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
|
|
||||||
if(!cooldownTracker.containsKey(player.getUniqueId()))
|
if(!cooldownTracker.containsKey(player.getUniqueId()))
|
||||||
cooldownTracker.put(player.getUniqueId(), new SpellRunnable(this));
|
cooldownTracker.put(player.getUniqueId(), new SpellRunnable(this));
|
||||||
|
@ -10,12 +10,20 @@ import com.willfp.ecoenchants.nms.TridentStack;
|
|||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.entity.*;
|
import org.bukkit.entity.Arrow;
|
||||||
|
import org.bukkit.entity.EntityType;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.entity.Trident;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
import org.bukkit.event.block.BlockDamageEvent;
|
import org.bukkit.event.block.BlockDamageEvent;
|
||||||
import org.bukkit.event.entity.*;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
import org.bukkit.event.entity.EntityShootBowEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileHitEvent;
|
||||||
|
import org.bukkit.event.entity.ProjectileLaunchEvent;
|
||||||
import org.bukkit.event.player.PlayerMoveEvent;
|
import org.bukkit.event.player.PlayerMoveEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.potion.PotionEffectType;
|
import org.bukkit.potion.PotionEffectType;
|
||||||
@ -35,6 +43,8 @@ public class WatcherTriggers implements Listener {
|
|||||||
return;
|
return;
|
||||||
if (!(event.getEntity() instanceof LivingEntity))
|
if (!(event.getEntity() instanceof LivingEntity))
|
||||||
return;
|
return;
|
||||||
|
if(((Arrow) event.getDamager()).getShooter() == null)
|
||||||
|
return;
|
||||||
if(!(((Arrow) event.getDamager()).getShooter() instanceof LivingEntity))
|
if(!(((Arrow) event.getDamager()).getShooter() instanceof LivingEntity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -53,6 +63,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnArrow(arrow).forEach(((enchant, level) -> {
|
EnchantChecks.getEnchantsOnArrow(arrow).forEach(((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(attacker.getWorld())) return;
|
||||||
enchant.onArrowDamage(attacker, victim, arrow, level, event);
|
enchant.onArrowDamage(attacker, victim, arrow, level, event);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -67,6 +78,9 @@ public class WatcherTriggers implements Listener {
|
|||||||
if(!(((Trident) event.getDamager()).getShooter() instanceof LivingEntity))
|
if(!(((Trident) event.getDamager()).getShooter() instanceof LivingEntity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if(((Trident) event.getDamager()).getShooter() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!(event.getEntity() instanceof LivingEntity))
|
if (!(event.getEntity() instanceof LivingEntity))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -88,6 +102,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnItem(item).forEach(((enchant, level) -> {
|
EnchantChecks.getEnchantsOnItem(item).forEach(((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(attacker.getWorld())) return;
|
||||||
enchant.onTridentDamage(attacker, victim, trident, level, event);
|
enchant.onTridentDamage(attacker, victim, trident, level, event);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -112,6 +127,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnArmor(player).forEach((enchant, level) -> {
|
EnchantChecks.getEnchantsOnArmor(player).forEach((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
enchant.onJump(player, level, event);
|
enchant.onJump(player, level, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -149,6 +165,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnMainhand(attacker).forEach((enchant, level) -> {
|
EnchantChecks.getEnchantsOnMainhand(attacker).forEach((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(attacker.getWorld())) return;
|
||||||
enchant.onMeleeAttack(attacker, victim, level, event);
|
enchant.onMeleeAttack(attacker, victim, level, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -166,6 +183,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnMainhand(shooter).forEach((enchant, level) -> {
|
EnchantChecks.getEnchantsOnMainhand(shooter).forEach((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(shooter.getWorld())) return;
|
||||||
enchant.onBowShoot(shooter, arrow, level, event);
|
enchant.onBowShoot(shooter, arrow, level, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -185,6 +203,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnArmor(victim).forEach((enchant, level) -> {
|
EnchantChecks.getEnchantsOnArmor(victim).forEach((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(victim.getWorld())) return;
|
||||||
enchant.onFallDamage(victim, level, event);
|
enchant.onFallDamage(victim, level, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -198,11 +217,15 @@ public class WatcherTriggers implements Listener {
|
|||||||
|
|
||||||
if (!(event.getEntity() instanceof Arrow)) return;
|
if (!(event.getEntity() instanceof Arrow)) return;
|
||||||
|
|
||||||
|
if(event.getEntity().getShooter() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
Arrow arrow = (Arrow) event.getEntity();
|
Arrow arrow = (Arrow) event.getEntity();
|
||||||
LivingEntity shooter = (LivingEntity) event.getEntity().getShooter();
|
LivingEntity shooter = (LivingEntity) event.getEntity().getShooter();
|
||||||
|
|
||||||
EnchantChecks.getEnchantsOnArrow(arrow).forEach(((enchant, level) -> {
|
EnchantChecks.getEnchantsOnArrow(arrow).forEach(((enchant, level) -> {
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(shooter.getWorld())) return;
|
||||||
enchant.onArrowHit(shooter, level, event);
|
enchant.onArrowHit(shooter, level, event);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -213,6 +236,8 @@ public class WatcherTriggers implements Listener {
|
|||||||
return;
|
return;
|
||||||
if (!(event.getEntity().getShooter() instanceof LivingEntity))
|
if (!(event.getEntity().getShooter() instanceof LivingEntity))
|
||||||
return;
|
return;
|
||||||
|
if(event.getEntity().getShooter() == null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (!(event.getEntity() instanceof Trident)) return;
|
if (!(event.getEntity() instanceof Trident)) return;
|
||||||
|
|
||||||
@ -222,6 +247,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
|
|
||||||
EnchantChecks.getEnchantsOnItem(item).forEach(((enchant, level) -> {
|
EnchantChecks.getEnchantsOnItem(item).forEach(((enchant, level) -> {
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(shooter.getWorld())) return;
|
||||||
enchant.onTridentHit(shooter, level, event);
|
enchant.onTridentHit(shooter, level, event);
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
@ -241,6 +267,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnMainhand(player).forEach((enchant, level) -> {
|
EnchantChecks.getEnchantsOnMainhand(player).forEach((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
enchant.onBlockBreak(player, block, level, event);
|
enchant.onBlockBreak(player, block, level, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -257,6 +284,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnArmor(victim).forEach((enchant, level) -> {
|
EnchantChecks.getEnchantsOnArmor(victim).forEach((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(victim.getWorld())) return;
|
||||||
enchant.onDamageWearingArmor(victim, level, event);
|
enchant.onDamageWearingArmor(victim, level, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -271,6 +299,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EcoEnchants.getAll().forEach((enchant -> {
|
EcoEnchants.getAll().forEach((enchant -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
int level = EnchantChecks.getArmorPoints(player, enchant);
|
int level = EnchantChecks.getArmorPoints(player, enchant);
|
||||||
enchant.onArmorEquip(player, level, event);
|
enchant.onArmorEquip(player, level, event);
|
||||||
}));
|
}));
|
||||||
@ -290,6 +319,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnMainhand(player).forEach((enchant, level) -> {
|
EnchantChecks.getEnchantsOnMainhand(player).forEach((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(player.getWorld())) return;
|
||||||
enchant.onDamageBlock(player, block, level, event);
|
enchant.onDamageBlock(player, block, level, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -312,6 +342,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EnchantChecks.getEnchantsOnItem(item).forEach((enchant, level) -> {
|
EnchantChecks.getEnchantsOnItem(item).forEach((enchant, level) -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(shooter.getWorld())) return;
|
||||||
enchant.onTridentLaunch(shooter, trident, level, event);
|
enchant.onTridentLaunch(shooter, trident, level, event);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -338,6 +369,7 @@ public class WatcherTriggers implements Listener {
|
|||||||
EcoEnchants.getAll().forEach((enchant -> {
|
EcoEnchants.getAll().forEach((enchant -> {
|
||||||
if(event.isCancelled()) return;
|
if(event.isCancelled()) return;
|
||||||
if(!enchant.isEnabled()) return;
|
if(!enchant.isEnabled()) return;
|
||||||
|
if(enchant.getDisabledWorlds().contains(blocker.getWorld())) return;
|
||||||
int level;
|
int level;
|
||||||
if (!EnchantChecks.offhand(blocker, enchant) && !EnchantChecks.mainhand(blocker, enchant)) return;
|
if (!EnchantChecks.offhand(blocker, enchant) && !EnchantChecks.mainhand(blocker, enchant)) return;
|
||||||
if(EnchantChecks.offhand(blocker, enchant)) level = EnchantChecks.getOffhandLevel(blocker, enchant);
|
if(EnchantChecks.offhand(blocker, enchant)) level = EnchantChecks.getOffhandLevel(blocker, enchant);
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
@ -22,6 +22,7 @@ general-config:
|
|||||||
- crossbow
|
- crossbow
|
||||||
- trident
|
- trident
|
||||||
grindstoneable: true
|
grindstoneable: true
|
||||||
|
disabled-in-worlds: []
|
||||||
conflicts: []
|
conflicts: []
|
||||||
|
|
||||||
config:
|
config:
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user