Added disable-in-worlds

This commit is contained in:
Auxilor 2020-12-06 10:44:39 +00:00
parent e6da1c58cd
commit dee8c2ce4d
305 changed files with 406 additions and 303 deletions

View File

@ -33,6 +33,7 @@ public class Alchemy extends EcoEnchant {
if(!EnchantmentUtils.passedChance(this, level))
return;
if(this.getDisabledWorlds().contains(entity.getWorld())) return;
PotionEffect effect = event.getNewEffect();

View File

@ -19,6 +19,7 @@ general-config:
- leggings
- boots
grindstoneable: true
disabled-in-worlds: []
conflicts: []
maximum-level: 6

View File

@ -1,3 +1,3 @@
name: Alchemy
main: com.willfp.ecoenchants.alchemy.AlchemyMain
version: 1.0.0
version: 1.0.1

View File

@ -20,6 +20,7 @@ general-config:
- axe
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts:
- aquamarine
- dehydration

View File

@ -20,6 +20,7 @@ general-config:
- axe
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts:
- altitude
- dehydration

View File

@ -20,6 +20,7 @@ general-config:
- axe
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts:
- altitude
- aquamarine

View File

@ -19,6 +19,7 @@ general-config:
- leggings
- boots
grindstoneable: true
disabled-in-worlds: []
conflicts:
- glacial
- heat_treated

View File

@ -19,6 +19,7 @@ general-config:
- leggings
- boots
grindstoneable: true
disabled-in-worlds: []
conflicts:
- elevation
- heat_treated

View File

@ -19,6 +19,7 @@ general-config:
- leggings
- boots
grindstoneable: true
disabled-in-worlds: []
conflicts:
- elevation
- glacial

View File

@ -20,6 +20,7 @@ general-config:
- axe
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts:
- altitide
- aquamarine

View File

@ -19,6 +19,7 @@ general-config:
- leggings
- boots
grindstoneable: true
disabled-in-worlds: []
conflicts:
- elevation
- glacial

View File

@ -20,6 +20,7 @@ general-config:
- axe
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts:
- altitude
- aquamarine

View File

@ -19,6 +19,7 @@ general-config:
- leggings
- boots
grindstoneable: true
disabled-in-worlds: []
conflicts:
- elevation
- glacial

View File

@ -1,3 +1,3 @@
name: Biomes
main: com.willfp.ecoenchants.biomes.BiomesMain
version: 1.0.0
version: 1.0.1

View File

@ -30,6 +30,7 @@ public abstract class EffectsEnchantment extends EcoEnchant {
}
int level = EnchantChecks.getArmorPoints(player, this);
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(level > 0) {
player.addPotionEffect(new PotionEffect(this.getPotionEffect(), 0x6fffffff, level - 1, false, false, true));
}

View File

@ -16,6 +16,7 @@ general-config:
targets:
- boots
grindstoneable: true
disabled-in-worlds: []
conflicts:
- spring
maximum-level: 3

View File

@ -16,6 +16,7 @@ general-config:
targets:
- helmet
grindstoneable: true
disabled-in-worlds: []
conflicts: []
maximum-level: 1

View File

@ -16,6 +16,7 @@ general-config:
targets:
- helmet
grindstoneable: true
disabled-in-worlds: []
conflicts: []
maximum-level: 2

View File

@ -16,6 +16,7 @@ general-config:
targets:
- boots
grindstoneable: true
disabled-in-worlds: []
conflicts:
- streamlining
maximum-level: 3

View File

@ -16,6 +16,7 @@ general-config:
targets:
- helmet
grindstoneable: true
disabled-in-worlds: []
conflicts: []
maximum-level: 1

View File

@ -1,3 +1,3 @@
name: Effects
main: com.willfp.ecoenchants.effects.EffectsMain
version: 1.0.1
version: 1.0.2

View File

@ -37,6 +37,7 @@ public class Endershot extends EcoEnchant {
event.setCancelled(true);
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))
return;

View File

@ -17,6 +17,7 @@ general-config:
- bow
- crossbow
grindstoneable: true
disabled-in-worlds: []
conflicts: []
maximum-level: 1

View File

@ -1,3 +1,3 @@
name: Endershot
main: com.willfp.ecoenchants.endershot.EndershotMain
version: 1.0.0
version: 1.0.1

View File

@ -17,6 +17,7 @@ general-config:
- rod
- carrot_stick
grindstoneable: true
disabled-in-worlds: []
conflicts: []
maximum-level: 3

View File

@ -1,287 +1,3 @@
name: Firewand
main: com.willfp.ecoenchants.firewand.FirewandMain
version: 1.0.3
# 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
version: 1.0.4

View File

@ -46,6 +46,7 @@ public class Precision extends EcoEnchant {
ItemStack itemStack = TridentStack.getTridentStack(trident);
if (!EnchantChecks.item(itemStack, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getMainhandLevel(player, this);

View File

@ -16,6 +16,7 @@ general-config:
targets:
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
maximum-level: 5

View File

@ -1,3 +1,3 @@
name: Precision
main: com.willfp.ecoenchants.precision.PrecisionMain
version: 1.0.3
version: 1.0.4

View File

@ -35,7 +35,8 @@ public class SprintArtifactsListener implements Listener {
if(!matching.isPresent()) return;
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);
}

View File

@ -1,3 +1,3 @@
name: Sprint Artifacts
main: com.willfp.ecoenchants.sprintartifacts.SprintArtifactsMain
version: 1.0.0
version: 1.0.1

View File

@ -16,6 +16,7 @@ general-config:
targets:
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts:
- sniper
maximum-level: 3

View File

@ -16,6 +16,7 @@ general-config:
targets:
- sword
grindstoneable: true
disabled-in-worlds: []
conflicts:
- metallic
maximum-level: 3

View File

@ -17,6 +17,7 @@ general-config:
- bow
- crossbow
grindstoneable: true
disabled-in-worlds: []
conflicts:
- mortality
maximum-level: 4

View File

@ -17,6 +17,7 @@ general-config:
- bow
- crossbow
grindstoneable: true
disabled-in-worlds: []
conflicts:
- ghoul
maximum-level: 4

View File

@ -16,6 +16,7 @@ general-config:
targets:
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts:
- crawler
maximum-level: 3

View File

@ -16,6 +16,7 @@ general-config:
targets:
- sword
grindstoneable: true
disabled-in-worlds: []
conflicts:
- firestorm
maximum-level: 2

View File

@ -1,3 +1,3 @@
name: Summoning
main: com.willfp.ecoenchants.summoning.SummoningMain
version: 1.0.2
version: 1.0.3

View File

@ -14,6 +14,7 @@ import org.apache.commons.lang.WordUtils;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.World;
import org.bukkit.enchantments.Enchantment;
import org.bukkit.enchantments.EnchantmentTarget;
import org.bukkit.event.Listener;
@ -32,6 +33,7 @@ import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
@SuppressWarnings({"unchecked", "deprecation"})
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 final Set<com.willfp.ecoenchants.enchantments.meta.EnchantmentTarget> target = new HashSet<>();
private final Set<Material> targetMaterials = new HashSet<>();
private final Set<String> disabledWorldNames = new HashSet<>();
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);
name = StringUtils.translate(config.getString("name"));
description = StringUtils.translate(config.getString("description"));
disabledWorldNames.clear();
disabledWorldNames.addAll(config.getStrings(EcoEnchants.GENERAL_LOCATION + "disabled-in-worlds"));
target.clear();
targetMaterials.clear();
target.addAll(config.getTargets());
@ -294,6 +299,17 @@ public abstract class EcoEnchant extends Enchantment implements Listener, Regist
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.
* Not deprecated, unlike {@link Enchantment#getName()}

View File

@ -55,6 +55,7 @@ public class CallingCurse extends EcoEnchant implements EcoRunnable {
public void run() {
players.forEach((player, level) -> {
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)) {
if(!(e instanceof Monster)) continue;

View File

@ -82,6 +82,7 @@ public class DecayCurse extends EcoEnchant implements EcoRunnable {
for(ItemStack item : player.getInventory().getContents()) {
int level = EnchantChecks.getItemLevel(item, this);
if(level == 0) continue;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(!(item.getItemMeta() instanceof Repairable)) continue;

View File

@ -22,6 +22,8 @@ public class FragilityCurse extends EcoEnchant {
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 max = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "maximum-extra-durability");

View File

@ -24,6 +24,7 @@ public class HungerCurse extends EcoEnchant {
if(!EnchantChecks.helmet(player, this)) return;
if(event.getFoodLevel() > player.getFoodLevel()) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int delta = player.getFoodLevel() - event.getFoodLevel();
delta *= this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "times-more-hunger");

View File

@ -37,6 +37,8 @@ public class Beheading extends EcoEnchant {
if(!EnchantmentUtils.passedChance(this, level))
return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
ItemStack item;
if(victim instanceof Player) {

View File

@ -28,6 +28,8 @@ public class Dexterous extends EcoEnchant {
return;
}
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getItemLevel(item, this);
double bonus = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "add-speed-per-level");

View File

@ -18,6 +18,7 @@ public class Economical extends EcoEnchant {
@EventHandler
public void onElytraBoost(PlayerElytraBoostEvent event) {
if(EnchantmentUtils.passedChance(this, EnchantChecks.getArmorPoints(event.getPlayer(), this)))
if(this.getDisabledWorlds().contains(event.getPlayer().getWorld())) return;
event.setShouldConsume(false);
}
}

View File

@ -45,6 +45,7 @@ public class Enderism extends EcoEnchant {
return;
if (!EnchantChecks.arrow(arrow, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getArrowLevel(arrow, this);
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");

View File

@ -40,6 +40,7 @@ public class Farmhand extends EcoEnchant {
ItemStack item = event.getItem();
if (!EnchantChecks.item(item, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (!item.getType().toString().endsWith("_HOE"))
return;

View File

@ -53,6 +53,7 @@ public class Forcefield extends EcoEnchant implements EcoRunnable {
@Override
public void run() {
players.forEach((player, level) -> {
if(this.getDisabledWorlds().contains(player.getWorld())) return;
double initialDistance = EcoEnchants.FORCEFIELD.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "initial-distance");
double bonus = EcoEnchants.FORCEFIELD.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "bonus-per-level");
double distance = initialDistance + (level * bonus);

View File

@ -36,6 +36,7 @@ public class Frozen extends EcoEnchant {
if (points == 0)
return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(!EnchantmentUtils.passedChance(this, points))

View File

@ -35,6 +35,8 @@ public class Graceful extends EcoEnchant {
if(!EnchantChecks.boots(player, this)) return;
int level = EnchantChecks.getBootsLevel(player, this);
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(!EnchantmentUtils.passedChance(this, level))
return;

View File

@ -34,6 +34,8 @@ public class GreenThumb extends EcoEnchant {
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(!AntigriefManager.canBreakBlock(player, event.getClickedBlock())) return;
if(!AntigriefManager.canPlaceBlock(player, event.getClickedBlock())) return;

View File

@ -35,6 +35,7 @@ public class Grit extends EcoEnchant {
if (totalGritPoints == 0)
return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (!(attacker.getInventory().getItemInMainHand() instanceof Damageable))
return;

View File

@ -33,6 +33,7 @@ public class Incandescence extends EcoEnchant {
if (totalIncandescencePoints == 0)
return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
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"));

View File

@ -18,7 +18,15 @@ import org.bukkit.inventory.FurnaceRecipe;
import org.bukkit.inventory.ItemStack;
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;
public class InfernalTouch extends EcoEnchant {
@ -67,6 +75,7 @@ public class InfernalTouch extends EcoEnchant {
return;
if (!AntigriefManager.canBreakBlock(player, block)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
Collection<ItemStack> drops = new ArrayList<>();
event.getItems().forEach((item -> {

View File

@ -27,6 +27,7 @@ public class Invigoration extends EcoEnchant {
return;
int totalInvigorationPoints = EnchantChecks.getArmorPoints(player, this, 0);
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (totalInvigorationPoints == 0)
return;
@ -46,6 +47,7 @@ public class Invigoration extends EcoEnchant {
return;
int totalInvigorationPoints = EnchantChecks.getArmorPoints(player, this, 0);
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (totalInvigorationPoints == 0)
return;

View File

@ -35,6 +35,8 @@ public class Launch extends EcoEnchant {
if(!EnchantChecks.chestplate(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getChestplateLevel(player, this);
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
double boost = 1 + (multiplier * level);

View File

@ -35,6 +35,7 @@ public class MagmaWalker extends EcoEnchant {
if(event.getFrom().getBlock().equals(event.getTo().getBlock())) 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")
+ (this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "per-level-radius") * EnchantChecks.getBootsLevel(player, this) - 1));

View File

@ -60,6 +60,7 @@ public class Magnetic extends EcoEnchant implements EcoRunnable {
public void run() {
players.forEach((player, level) -> {
double distance = initialDistance + (level * bonus);
if(this.getDisabledWorlds().contains(player.getWorld())) return;
for (Entity e : player.getWorld().getNearbyEntities(player.getLocation(), distance, 2.0d, distance)) {
if(!(e instanceof Item || e instanceof ExperienceOrb)) continue;

View File

@ -30,6 +30,7 @@ public class Marksman extends EcoEnchant {
Player player = (Player) event.getEntity().getShooter();
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (!(event.getEntity() instanceof Arrow)) return;
Arrow a = (Arrow) event.getEntity();

View File

@ -30,6 +30,7 @@ public class Necrotic extends EcoEnchant {
WitherSkeleton victim = (WitherSkeleton) event.getEntity();
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getMainhandLevel(player, this);

View File

@ -27,6 +27,8 @@ public class Parry extends EcoEnchant {
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getMainhandLevel(player, this);
double damage = event.getDamage();

View File

@ -36,6 +36,7 @@ public class Reel extends EcoEnchant {
if(!AntigriefManager.canInjure(player, victim)) return;
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getMainhandLevel(player, this);

View File

@ -26,6 +26,7 @@ public class Rejuvenation extends EcoEnchant {
Player player = (Player) event.getEntity();
int totalRejuvenationPoints = EnchantChecks.getArmorPoints(player, this, 0);
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (totalRejuvenationPoints == 0)
return;

View File

@ -23,6 +23,7 @@ public class Sating extends EcoEnchant {
Player player = (Player) event.getEntity();
if(!EnchantChecks.helmet(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(event.getFoodLevel() > player.getFoodLevel()) return;
int level = EnchantChecks.getHelmetLevel(player, this);

View File

@ -39,6 +39,7 @@ public class Shockwave extends EcoEnchant {
}
if (!EnchantChecks.item(item, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int ticks = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "particle-tick-delay");

View File

@ -34,6 +34,8 @@ public class ShotAssist extends EcoEnchant {
int points = EnchantChecks.getArmorPoints(player, this, 0);
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(points == 0) return;
double damage = event.getDamage();

View File

@ -32,6 +32,7 @@ public class Slicing extends EcoEnchant {
return;
if (!EnchantChecks.chestplate(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
for (Entity entity : player.getNearbyEntities(1, 1, 1)) {
LivingEntity victim;

View File

@ -5,8 +5,8 @@ import com.willfp.ecoenchants.enchantments.EcoEnchants;
import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import com.willfp.ecoenchants.enchantments.util.EnchantmentUtils;
import com.willfp.ecoenchants.nms.TridentStack;
import com.willfp.ecoenchants.util.internal.DropQueue;
import com.willfp.ecoenchants.util.NumberUtils;
import com.willfp.ecoenchants.util.internal.DropQueue;
import org.bukkit.Material;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Player;
@ -44,6 +44,7 @@ public class Spearfishing extends EcoEnchant {
return;
Player player = (Player) event.getEntity().getShooter();
if(this.getDisabledWorlds().contains(player.getWorld())) return;
ItemStack item = TridentStack.getTridentStack(trident);

View File

@ -34,6 +34,7 @@ public class Spiked extends EcoEnchant {
if(!AntigriefManager.canInjure(player, victim)) return;
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getMainhandLevel(player, this);

View File

@ -6,7 +6,11 @@ import com.willfp.ecoenchants.enchantments.util.EnchantChecks;
import com.willfp.ecoenchants.integrations.antigrief.AntigriefManager;
import com.willfp.ecoenchants.nms.TridentStack;
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.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
@ -39,6 +43,7 @@ public class Splash extends EcoEnchant {
ItemStack item = TridentStack.getTridentStack(trident);
if (!EnchantChecks.item(item, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getItemLevel(item, this);

View File

@ -25,6 +25,7 @@ public class Stamina extends EcoEnchant {
if(!player.isSprinting()) return;
if(!EnchantChecks.boots(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(event.getFoodLevel() > player.getFoodLevel()) return;
int level = EnchantChecks.getBootsLevel(player, this);

View File

@ -11,7 +11,11 @@ import com.willfp.ecoenchants.util.internal.DropQueue;
import org.bukkit.GameMode;
import org.bukkit.Material;
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.EventPriority;
import org.bukkit.event.block.BlockBreakEvent;
@ -37,6 +41,7 @@ public class Telekinesis extends EcoEnchant {
Player player = event.getPlayer();
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (event.isCancelled()) return;
@ -63,6 +68,7 @@ public class Telekinesis extends EcoEnchant {
Block block = event.getBlock();
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (player.getGameMode() == GameMode.CREATIVE || player.getGameMode() == GameMode.SPECTATOR)
return;
@ -109,6 +115,7 @@ public class Telekinesis extends EcoEnchant {
if(player == null || item == null) return;
if (!EnchantChecks.item(item, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int xp = event.getDroppedExp();
Collection<ItemStack> drops = event.getDrops();

View File

@ -32,6 +32,7 @@ public class Thrive extends EcoEnchant {
player.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getDefaultValue());
return;
}
if(EcoEnchants.THRIVE.getDisabledWorlds().contains(player.getWorld())) return;
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");

View File

@ -23,6 +23,8 @@ public class Wisdom extends EcoEnchant {
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
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")))));

View File

@ -47,6 +47,8 @@ public class Aiming extends EcoEnchant {
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 distance = level * multiplier;

View File

@ -26,6 +26,8 @@ public class Frenzy extends EcoEnchant {
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getMainhandLevel(player, this);
int duration = (int) (level * 20 * this.getConfig().getDouble((EcoEnchants.CONFIG_LOCATION + "seconds-per-level")));

View File

@ -34,6 +34,7 @@ public class Harpoon extends EcoEnchant {
if(!AntigriefManager.canInjure(player, victim)) return;
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getMainhandLevel(player, this);

View File

@ -22,6 +22,8 @@ public class Indestructibility extends EcoEnchant {
if (!EnchantChecks.item(item, this)) return;
if(this.getDisabledWorlds().contains(event.getPlayer().getWorld())) return;
double level = EnchantChecks.getItemLevel(item, this);
double levelbonus = this.getConfig().getInt(EcoEnchants.CONFIG_LOCATION + "level-bonus");

View File

@ -30,6 +30,8 @@ public class Instability extends EcoEnchant {
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if (!(event.getEntity() instanceof Arrow)) return;
int level = EnchantChecks.getMainhandLevel(player, this);

View File

@ -23,6 +23,8 @@ public class Intellect extends EcoEnchant {
if (!EnchantChecks.mainhand(player, this)) return;
if(this.getDisabledWorlds().contains(player.getWorld())) return;
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")))));

View File

@ -79,6 +79,7 @@ public class Repairing extends EcoEnchant implements EcoRunnable {
@Override
public void run() {
players.forEach((player -> {
if(this.getDisabledWorlds().contains(player.getWorld())) return;
for(ItemStack item : player.getInventory().getContents()) {
int level = EnchantChecks.getItemLevel(item, this);
if(level == 0) continue;

View File

@ -5,12 +5,17 @@ import com.willfp.ecoenchants.enchantments.EcoEnchant;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.inventory.ItemStack;
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 Soulbound() {
super(
@ -26,13 +31,15 @@ public class Soulbound extends EcoEnchant {
return soulboundItemsMap.get(player);
}
@EventHandler
@EventHandler(priority = EventPriority.HIGHEST)
public void onSoulboundDeath(PlayerDeathEvent event) {
if(event.getKeepInventory()) return;
Player player = event.getEntity();
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 -> {
if(itemStack.containsEnchantment(this)) soulboundItems.add(itemStack);
@ -47,7 +54,7 @@ public class Soulbound extends EcoEnchant {
soulboundItemsMap.put(player, soulboundItems);
}
@EventHandler
@EventHandler(priority = EventPriority.HIGHEST)
public void onSoulboundRespawn(PlayerRespawnEvent event) {
if(!soulboundItemsMap.containsKey(event.getPlayer())) return;

View File

@ -17,7 +17,12 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.block.Action;
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
@ -68,6 +73,7 @@ public abstract class Spell extends EcoEnchant {
return;
int level = EnchantChecks.getMainhandLevel(player, this);
if(this.getDisabledWorlds().contains(player.getWorld())) return;
if(!cooldownTracker.containsKey(player.getUniqueId()))
cooldownTracker.put(player.getUniqueId(), new SpellRunnable(this));

View File

@ -10,12 +10,20 @@ import com.willfp.ecoenchants.nms.TridentStack;
import org.bukkit.Bukkit;
import org.bukkit.Material;
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.Listener;
import org.bukkit.event.block.BlockBreakEvent;
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.inventory.ItemStack;
import org.bukkit.potion.PotionEffectType;
@ -35,6 +43,8 @@ public class WatcherTriggers implements Listener {
return;
if (!(event.getEntity() instanceof LivingEntity))
return;
if(((Arrow) event.getDamager()).getShooter() == null)
return;
if(!(((Arrow) event.getDamager()).getShooter() instanceof LivingEntity))
return;
@ -53,6 +63,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnArrow(arrow).forEach(((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(attacker.getWorld())) return;
enchant.onArrowDamage(attacker, victim, arrow, level, event);
}));
}
@ -67,6 +78,9 @@ public class WatcherTriggers implements Listener {
if(!(((Trident) event.getDamager()).getShooter() instanceof LivingEntity))
return;
if(((Trident) event.getDamager()).getShooter() == null)
return;
if (!(event.getEntity() instanceof LivingEntity))
return;
@ -88,6 +102,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnItem(item).forEach(((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(attacker.getWorld())) return;
enchant.onTridentDamage(attacker, victim, trident, level, event);
}));
}
@ -112,6 +127,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnArmor(player).forEach((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(player.getWorld())) return;
enchant.onJump(player, level, event);
});
}
@ -149,6 +165,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnMainhand(attacker).forEach((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(attacker.getWorld())) return;
enchant.onMeleeAttack(attacker, victim, level, event);
});
}
@ -166,6 +183,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnMainhand(shooter).forEach((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(shooter.getWorld())) return;
enchant.onBowShoot(shooter, arrow, level, event);
});
}
@ -185,6 +203,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnArmor(victim).forEach((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(victim.getWorld())) return;
enchant.onFallDamage(victim, level, event);
});
}
@ -198,11 +217,15 @@ public class WatcherTriggers implements Listener {
if (!(event.getEntity() instanceof Arrow)) return;
if(event.getEntity().getShooter() == null)
return;
Arrow arrow = (Arrow) event.getEntity();
LivingEntity shooter = (LivingEntity) event.getEntity().getShooter();
EnchantChecks.getEnchantsOnArrow(arrow).forEach(((enchant, level) -> {
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(shooter.getWorld())) return;
enchant.onArrowHit(shooter, level, event);
}));
}
@ -213,6 +236,8 @@ public class WatcherTriggers implements Listener {
return;
if (!(event.getEntity().getShooter() instanceof LivingEntity))
return;
if(event.getEntity().getShooter() == null)
return;
if (!(event.getEntity() instanceof Trident)) return;
@ -222,6 +247,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnItem(item).forEach(((enchant, level) -> {
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(shooter.getWorld())) return;
enchant.onTridentHit(shooter, level, event);
}));
}
@ -241,6 +267,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnMainhand(player).forEach((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(player.getWorld())) return;
enchant.onBlockBreak(player, block, level, event);
});
}
@ -257,6 +284,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnArmor(victim).forEach((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(victim.getWorld())) return;
enchant.onDamageWearingArmor(victim, level, event);
});
}
@ -271,6 +299,7 @@ public class WatcherTriggers implements Listener {
EcoEnchants.getAll().forEach((enchant -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(player.getWorld())) return;
int level = EnchantChecks.getArmorPoints(player, enchant);
enchant.onArmorEquip(player, level, event);
}));
@ -290,6 +319,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnMainhand(player).forEach((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(player.getWorld())) return;
enchant.onDamageBlock(player, block, level, event);
});
}
@ -312,6 +342,7 @@ public class WatcherTriggers implements Listener {
EnchantChecks.getEnchantsOnItem(item).forEach((enchant, level) -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(shooter.getWorld())) return;
enchant.onTridentLaunch(shooter, trident, level, event);
});
}
@ -338,6 +369,7 @@ public class WatcherTriggers implements Listener {
EcoEnchants.getAll().forEach((enchant -> {
if(event.isCancelled()) return;
if(!enchant.isEnabled()) return;
if(enchant.getDisabledWorlds().contains(blocker.getWorld())) return;
int level;
if (!EnchantChecks.offhand(blocker, enchant) && !EnchantChecks.mainhand(blocker, enchant)) return;
if(EnchantChecks.offhand(blocker, enchant)) level = EnchantChecks.getOffhandLevel(blocker, enchant);

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

View File

@ -22,6 +22,7 @@ general-config:
- crossbow
- trident
grindstoneable: true
disabled-in-worlds: []
conflicts: []
config:

Some files were not shown because too many files have changed in this diff Show More