-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed the checks for duplicate enchantments when buying a new enchantment Added a system that limits the maximum amount of iterations that the enchantment handling will do Bows can now hold multiple Custom Enchantments at once Fixed permission nodes Vanilla Enchantments can now be enchanted using /ce ench The command /ce change now supports alternative colorcodes Fixed Obsidian Shield Fixed the unregistering of the Listener New Enchantments (Thanks to hetjoshi): Revulsion Self Destruct Aerial Charge
- Loading branch information
Taiterio
authored and
Taiterio
committed
Apr 12, 2015
1 parent
6bd3b0c
commit 54edd81
Showing
11 changed files
with
344 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.taiter.ce.Enchantments.Armor; | ||
|
||
/* | ||
* This file is part of Custom Enchantments | ||
* Copyright (C) Taiterio 2015 | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
|
||
import org.bukkit.entity.LivingEntity; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.entity.EntityDamageByEntityEvent; | ||
import org.bukkit.inventory.ItemStack; | ||
import org.bukkit.potion.PotionEffect; | ||
import org.bukkit.potion.PotionEffectType; | ||
|
||
import com.taiter.ce.Enchantments.CEnchantment; | ||
|
||
|
||
|
||
public class Revulsion extends CEnchantment { | ||
|
||
int duration; | ||
|
||
public Revulsion(String originalName, Application app, int enchantProbability, int occurrenceChance) { | ||
super(originalName, app, enchantProbability, occurrenceChance); | ||
configEntries.add("Duration: 20"); | ||
triggers.add(Trigger.DAMAGE_TAKEN); | ||
} | ||
|
||
@Override | ||
public void effect(Event e, ItemStack item, int level) { | ||
EntityDamageByEntityEvent event = (EntityDamageByEntityEvent) e; | ||
LivingEntity target = (LivingEntity) event.getDamager(); | ||
target.addPotionEffect( | ||
new PotionEffect( | ||
PotionEffectType.CONFUSION, | ||
duration * level, //This value is counted in ticks, 1/20 of a second | ||
0)); | ||
} | ||
|
||
@Override | ||
public void initConfigEntries() { | ||
duration = Integer.parseInt(getConfig().getString("Enchantments." + getOriginalName() + ".Duration")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package com.taiter.ce.Enchantments.Armor; | ||
|
||
/* | ||
* This file is part of Custom Enchantments | ||
* Copyright (C) Taiterio 2015 | ||
* | ||
* This program is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU Lesser General Public License as published by the | ||
* Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, but WITHOUT | ||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License | ||
* for more details. | ||
* | ||
* You should have received a copy of the GNU Lesser General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
|
||
|
||
import org.bukkit.entity.EntityType; | ||
import org.bukkit.entity.TNTPrimed; | ||
import org.bukkit.event.Event; | ||
import org.bukkit.event.entity.PlayerDeathEvent; | ||
import org.bukkit.inventory.ItemStack; | ||
import org.bukkit.metadata.FixedMetadataValue; | ||
import org.bukkit.util.Vector; | ||
|
||
import com.taiter.ce.Main; | ||
import com.taiter.ce.Tools; | ||
import com.taiter.ce.Enchantments.CEnchantment; | ||
|
||
|
||
|
||
public class SelfDestruct extends CEnchantment { | ||
|
||
int delay; | ||
|
||
public SelfDestruct(String originalName, Application app, int enchantProbability, int occurrenceChance) { | ||
super(originalName, app, enchantProbability, occurrenceChance); | ||
triggers.add(Trigger.DEATH); | ||
this.configEntries.add("ExplosionDelay: 40"); | ||
} | ||
|
||
@Override | ||
public void effect(Event e, ItemStack item, int level) { | ||
PlayerDeathEvent event = (PlayerDeathEvent) e; | ||
for(int i = level; i >= 0; i--) { | ||
TNTPrimed tnt = (TNTPrimed) event.getEntity().getWorld().spawnEntity(event.getEntity().getLocation(), EntityType.PRIMED_TNT); | ||
tnt.setFuseTicks(delay); | ||
tnt.setVelocity(new Vector(Tools.random.nextDouble()*1.5 - 1, Tools.random.nextDouble() * 1.5, Tools.random.nextDouble()*1.5 - 1)); | ||
if(!Main.createExplosions) | ||
tnt.setMetadata("ce.explosive", new FixedMetadataValue(getPlugin(), null)); | ||
} | ||
} | ||
|
||
@Override | ||
public void initConfigEntries() { | ||
delay = Integer.parseInt(getConfig().getString("Enchantments." + getOriginalName() + ".ExplosionDelay")); | ||
} | ||
} |
Oops, something went wrong.